aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-03-22 18:31:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-03-22 18:31:46 +0000
commit945297e8e4ba57bd463a654c83b3e2aef04c9c2a (patch)
treeee1f53361d29c32f760a8aeed29bf7a966ea89cf
parent5d19b1bb0f5694f2ae47b3cc2ccfeb571764b439 (diff)
parent7f2442bc0587522c6a8de11372ff60b64bb06e28 (diff)
downloadlibpng-emu-35-1-release.tar.gz
Merge "Snap for 11612745 from 6cc454b6e9367825dfc9d3f230a6bb5337b1cb3b to emu-35-1-release" into emu-35-1-releaseemu-35-1-release
-rw-r--r--.appveyor.yml78
-rw-r--r--.gitignore78
-rw-r--r--.travis.yml35
-rw-r--r--ANNOUNCE53
-rw-r--r--AUTHORS52
-rw-r--r--Android.bp119
-rw-r--r--CHANGES156
-rw-r--r--CMakeLists.txt1099
-rw-r--r--INSTALL87
-rw-r--r--LICENSE179
-rw-r--r--METADATA22
-rw-r--r--Makefile.am10
-rw-r--r--Makefile.in427
-rw-r--r--OWNERS4
-rw-r--r--README356
-rw-r--r--README.android7
-rw-r--r--README.version3
-rw-r--r--TEST_MAPPING7
-rw-r--r--TODO49
-rw-r--r--TRADEMARK8
-rw-r--r--aclocal.m4226
-rw-r--r--arm/arm_init.c32
-rw-r--r--arm/filter_neon.S2
-rw-r--r--arm/filter_neon_intrinsics.c27
-rw-r--r--arm/palette_neon_intrinsics.c151
-rwxr-xr-xautogen.sh4
-rwxr-xr-xci/ci_verify_cmake.sh180
-rwxr-xr-xci/ci_verify_configure.sh128
-rwxr-xr-xci/ci_verify_makefiles.sh154
-rwxr-xr-xcompile17
-rwxr-xr-xconfig.guess1683
-rw-r--r--config.h.in34
-rwxr-xr-xconfig.sub2637
-rwxr-xr-xconfigure6150
-rw-r--r--configure.ac104
-rw-r--r--contrib/arm-neon/android-ndk.c2
-rw-r--r--contrib/arm-neon/linux-auxv.c2
-rw-r--r--contrib/arm-neon/linux.c2
-rw-r--r--contrib/conftest/pngcp.dfa4
-rw-r--r--contrib/examples/iccfrompng.c2
-rw-r--r--contrib/examples/pngpixel.c6
-rw-r--r--contrib/examples/pngtopng.c2
-rw-r--r--contrib/gregbook/readpng2.c2
-rw-r--r--contrib/intel/INSTALL158
-rw-r--r--contrib/intel/Makefile.am.patch17
-rw-r--r--contrib/intel/configure.ac.patch46
-rw-r--r--contrib/intel/filter_sse2_intrinsics.c379
-rw-r--r--contrib/intel/intel_init.c54
-rw-r--r--contrib/intel/intel_sse.patch190
-rwxr-xr-xcontrib/libtests/gentests.sh2
-rw-r--r--contrib/libtests/makepng.c107
-rw-r--r--contrib/libtests/pngimage.c94
-rw-r--r--contrib/libtests/pngstest.c69
-rw-r--r--contrib/libtests/pngunknown.c65
-rw-r--r--contrib/libtests/pngvalid.c563
-rw-r--r--contrib/libtests/readpng.c5
-rw-r--r--contrib/libtests/tarith.c110
-rw-r--r--contrib/libtests/timepng.c9
-rw-r--r--contrib/mips-msa/linux.c7
-rw-r--r--contrib/oss-fuzz/Dockerfile7
-rw-r--r--contrib/oss-fuzz/README.txt5
-rwxr-xr-xcontrib/oss-fuzz/build.sh12
-rw-r--r--contrib/oss-fuzz/libpng_read_fuzzer.cc46
-rw-r--r--contrib/oss-fuzz/newcc190
-rw-r--r--contrib/pngminus/CHANGES.txt13
-rw-r--r--contrib/pngminus/CMakeLists.txt24
-rw-r--r--contrib/pngminus/LICENSE.txt22
-rw-r--r--contrib/pngminus/Makefile62
-rw-r--r--contrib/pngminus/README.txt (renamed from contrib/pngminus/README)85
-rw-r--r--contrib/pngminus/makefile.std66
-rw-r--r--contrib/pngminus/makefile.tc338
-rwxr-xr-xcontrib/pngminus/png2pnm.bat4
-rw-r--r--contrib/pngminus/png2pnm.c165
-rwxr-xr-xcontrib/pngminus/png2pnm.sh4
-rwxr-xr-xcontrib/pngminus/pngminus.bat2
-rwxr-xr-xcontrib/pngminus/pngminus.sh2
-rwxr-xr-xcontrib/pngminus/pnm2png.bat4
-rw-r--r--contrib/pngminus/pnm2png.c258
-rwxr-xr-xcontrib/pngminus/pnm2png.sh4
-rw-r--r--contrib/pngsuite/README2
-rw-r--r--contrib/pngsuite/bad_interlace_conversions.txt9
-rw-r--r--contrib/pngsuite/ibasn0g08.pngbin0 -> 237 bytes
-rw-r--r--contrib/pngsuite/ibasn0g16.pngbin0 -> 274 bytes
-rw-r--r--contrib/pngsuite/ibasn2c08.pngbin0 -> 299 bytes
-rw-r--r--contrib/pngsuite/ibasn2c16.pngbin0 -> 558 bytes
-rw-r--r--contrib/pngsuite/ibasn3p08.pngbin0 -> 1492 bytes
-rw-r--r--contrib/pngsuite/ibasn4a08.pngbin0 -> 198 bytes
-rw-r--r--contrib/pngsuite/ibasn4a16.pngbin0 -> 2839 bytes
-rw-r--r--contrib/pngsuite/ibasn6a08.pngbin0 -> 339 bytes
-rw-r--r--contrib/pngsuite/ibasn6a16.pngbin0 -> 4164 bytes
-rw-r--r--contrib/pngsuite/iftbbn2c16.pngbin0 -> 2624 bytes
-rw-r--r--contrib/pngsuite/iftbbn3p08.pngbin0 -> 1507 bytes
-rw-r--r--contrib/pngsuite/iftbgn2c16.pngbin0 -> 2624 bytes
-rw-r--r--contrib/pngsuite/iftbgn3p08.pngbin0 -> 1507 bytes
-rw-r--r--contrib/pngsuite/iftbrn2c08.pngbin0 -> 1624 bytes
-rw-r--r--contrib/pngsuite/iftbwn0g16.pngbin0 -> 1448 bytes
-rw-r--r--contrib/pngsuite/iftbwn3p08.pngbin0 -> 1507 bytes
-rw-r--r--contrib/pngsuite/iftbyn3p08.pngbin0 -> 1507 bytes
-rw-r--r--contrib/pngsuite/iftp0n0g08.pngbin0 -> 847 bytes
-rw-r--r--contrib/pngsuite/iftp0n2c08.pngbin0 -> 2020 bytes
-rw-r--r--contrib/pngsuite/iftp0n3p08.pngbin0 -> 1495 bytes
-rw-r--r--contrib/pngsuite/iftp1n3p08.pngbin0 -> 1507 bytes
-rw-r--r--contrib/pngsuite/interlaced/README2
-rw-r--r--contrib/pngsuite/interlaced/ibasn0g01.pngbin0 -> 201 bytes
-rw-r--r--contrib/pngsuite/interlaced/ibasn0g02.pngbin0 -> 138 bytes
-rw-r--r--contrib/pngsuite/interlaced/ibasn0g04.pngbin0 -> 231 bytes
-rw-r--r--contrib/pngsuite/interlaced/ibasn3p01.pngbin0 -> 116 bytes
-rw-r--r--contrib/pngsuite/interlaced/ibasn3p02.pngbin0 -> 163 bytes
-rw-r--r--contrib/pngsuite/interlaced/ibasn3p04.pngbin0 -> 288 bytes
-rw-r--r--contrib/pngsuite/interlaced/iftbbn0g01.pngbin0 -> 214 bytes
-rw-r--r--contrib/pngsuite/interlaced/iftbbn0g02.pngbin0 -> 211 bytes
-rw-r--r--contrib/pngsuite/interlaced/iftbbn0g04.pngbin0 -> 489 bytes
-rw-r--r--contrib/powerpc-vsx/README2
-rw-r--r--contrib/powerpc-vsx/linux.c3
-rw-r--r--contrib/powerpc-vsx/linux_aux.c7
-rwxr-xr-xcontrib/testpngs/makepngs.sh6
-rw-r--r--contrib/tools/checksum-icc.c4
-rwxr-xr-xcontrib/tools/chkfmt.sh (renamed from contrib/tools/chkfmt)55
-rw-r--r--contrib/tools/cvtcolor.c6
-rw-r--r--contrib/tools/genpng.c5
-rwxr-xr-xcontrib/tools/intgamma.sh16
-rw-r--r--contrib/tools/makesRGB.c9
-rw-r--r--contrib/tools/png-fix-itxt.c6
-rw-r--r--contrib/tools/pngcp.c103
-rw-r--r--contrib/tools/pngfix.c33
-rwxr-xr-xcontrib/tools/reindent25
-rw-r--r--contrib/tools/sRGB.h6
-rw-r--r--contrib/visupng/PngFile.c11
-rw-r--r--contrib/visupng/PngFile.h4
-rw-r--r--contrib/visupng/VisualPng.c4
-rwxr-xr-xdepcomp10
-rw-r--r--example.c437
-rwxr-xr-xinstall-sh174
-rw-r--r--intel/filter_sse2_intrinsics.c51
-rw-r--r--intel/intel_init.c3
-rw-r--r--libpng-manual.txt161
-rw-r--r--libpng.3427
-rw-r--r--libpng.pc.in2
-rw-r--r--libpngpf.320
-rwxr-xr-xltmain.sh855
-rw-r--r--mips/filter_msa_intrinsics.c23
-rw-r--r--mips/mips_init.c3
-rwxr-xr-xmissing16
-rw-r--r--png.561
-rw-r--r--png.c91
-rw-r--r--png.h367
-rw-r--r--pngconf.h49
-rw-r--r--pngdebug.h6
-rw-r--r--pngerror.c12
-rw-r--r--pngget.c46
-rw-r--r--pnginfo.h18
-rw-r--r--pngmem.c6
-rw-r--r--pngpread.c52
-rw-r--r--pngpriv.h145
-rw-r--r--pngread.c55
-rw-r--r--pngrio.c16
-rw-r--r--pngrtran.c1684
-rw-r--r--pngrutil.c144
-rw-r--r--pngset.c91
-rw-r--r--pngstruct.h42
-rw-r--r--pngtest.c48
-rw-r--r--pngtrans.c28
-rw-r--r--pngwio.c14
-rw-r--r--pngwrite.c67
-rw-r--r--pngwtran.c19
-rw-r--r--pngwutil.c201
-rw-r--r--powerpc/filter_vsx_intrinsics.c19
-rw-r--r--powerpc/powerpc_init.c3
-rw-r--r--projects/owatcom/pngconfig.mak4
-rw-r--r--projects/visualc71/README.txt2
-rw-r--r--projects/vstudio/README.txt114
-rw-r--r--projects/vstudio/libpng/libpng.vcxproj240
-rw-r--r--projects/vstudio/pnglibconf/pnglibconf.vcxproj43
-rw-r--r--projects/vstudio/pngstest/pngstest.vcxproj217
-rw-r--r--projects/vstudio/pngtest/pngtest.vcxproj218
-rw-r--r--projects/vstudio/pngunknown/pngunknown.vcxproj217
-rw-r--r--projects/vstudio/pngvalid/pngvalid.vcxproj217
-rw-r--r--projects/vstudio/vstudio.sln101
-rw-r--r--projects/vstudio/zlib.props9
-rw-r--r--projects/vstudio/zlib/zlib.vcxproj167
-rw-r--r--scripts/README.txt61
-rwxr-xr-xscripts/checksym.awk1
-rw-r--r--scripts/def.c29
-rw-r--r--scripts/descrip.mms39
-rwxr-xr-xscripts/dfn.awk5
-rw-r--r--scripts/genchk.cmake.in3
-rw-r--r--scripts/genout.cmake.in8
-rw-r--r--scripts/gensrc.cmake.in2
-rw-r--r--scripts/intprefix.c1
-rw-r--r--scripts/libpng-config-head.in2
-rw-r--r--scripts/libpng.pc.in2
-rw-r--r--scripts/libtool.m4227
-rw-r--r--scripts/ltoptions.m44
-rw-r--r--scripts/ltsugar.m42
-rw-r--r--scripts/ltversion.m413
-rw-r--r--scripts/lt~obsolete.m44
-rw-r--r--scripts/makefile.32sunu174
-rw-r--r--scripts/makefile.64sunu174
-rw-r--r--scripts/makefile.aix67
-rw-r--r--scripts/makefile.amiga6
-rw-r--r--scripts/makefile.atari48
-rw-r--r--scripts/makefile.bc3220
-rw-r--r--scripts/makefile.beos168
-rw-r--r--scripts/makefile.bor170
-rw-r--r--scripts/makefile.cegcc116
-rw-r--r--scripts/makefile.clang91
-rw-r--r--scripts/makefile.darwin181
-rw-r--r--scripts/makefile.dec173
-rw-r--r--scripts/makefile.dj240
-rw-r--r--scripts/makefile.emcc83
-rw-r--r--scripts/makefile.freebsd52
-rw-r--r--scripts/makefile.gcc22
-rw-r--r--scripts/makefile.hp64174
-rw-r--r--scripts/makefile.hpgcc181
-rw-r--r--scripts/makefile.hpux174
-rw-r--r--scripts/makefile.ibmc18
-rw-r--r--scripts/makefile.intel61
-rw-r--r--scripts/makefile.knr116
-rw-r--r--scripts/makefile.linux200
-rw-r--r--scripts/makefile.linux-opt265
-rw-r--r--scripts/makefile.mips68
-rw-r--r--scripts/makefile.msys133
-rw-r--r--scripts/makefile.ne12bsd56
-rw-r--r--scripts/makefile.netbsd45
-rw-r--r--scripts/makefile.openbsd71
-rw-r--r--scripts/makefile.sco170
-rw-r--r--scripts/makefile.sggcc180
-rw-r--r--scripts/makefile.sgi184
-rw-r--r--scripts/makefile.so9173
-rw-r--r--scripts/makefile.solaris179
-rw-r--r--scripts/makefile.solaris-x86243
-rw-r--r--scripts/makefile.std108
-rw-r--r--scripts/makefile.sunos75
-rw-r--r--scripts/makefile.tc3100
-rw-r--r--scripts/makefile.vcwin-arm64 (renamed from scripts/makefile.msc)99
-rw-r--r--scripts/makefile.vcwin3235
-rwxr-xr-xscripts/options.awk13
-rw-r--r--scripts/pnglibconf.dfa19
-rw-r--r--scripts/pnglibconf.h.prebuilt11
-rwxr-xr-xscripts/pnglibconf.mak26
-rw-r--r--scripts/prefix.c1
-rw-r--r--scripts/smakefile.ppc6
-rw-r--r--scripts/sym.c1
-rw-r--r--scripts/symbols.c1
-rw-r--r--scripts/symbols.def1
-rw-r--r--scripts/vers.c1
-rwxr-xr-xtest-driver27
-rwxr-xr-xtests/pngtest2
-rwxr-xr-xtests/pngtest-all (renamed from tests/pngtest-badpngs)7
249 files changed, 14819 insertions, 14994 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 000000000..b850d02f0
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,78 @@
+version: 1.6.x-{build}
+
+branches:
+ except:
+ - /libpng[0-1][0-7]/
+
+image:
+ - Visual Studio 2022
+
+shallow_clone: true
+
+environment:
+ matrix:
+ - TOOLCHAIN: vstudio
+ AUTOMATION: cmake
+ ARCH: x86
+ - TOOLCHAIN: vstudio
+ AUTOMATION: cmake
+ ARCH: x64
+ - TOOLCHAIN: vstudio
+ AUTOMATION: cmake
+ ARCH: arm64
+ CI_NO_TEST: 1
+ - TOOLCHAIN: llvm
+ AUTOMATION: cmake
+ ARCH: x64
+ - TOOLCHAIN: msys2
+ AUTOMATION: cmake
+ ARCH: i686
+ - TOOLCHAIN: msys2
+ AUTOMATION: cmake
+ ARCH: x86_64
+ - TOOLCHAIN: msys2
+ AUTOMATION: configure
+ ARCH: i686
+ - TOOLCHAIN: msys2
+ AUTOMATION: configure
+ ARCH: x86_64
+ - TOOLCHAIN: msys2
+ AUTOMATION: makefiles
+ ARCH: i686
+ - TOOLCHAIN: msys2
+ AUTOMATION: makefiles
+ ARCH: x86_64
+
+install:
+ - 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
+ - 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
+ - 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
+ - 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
+
+before_build:
+ - 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022'
+ - 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
+ - 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
+ - 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
+ - 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
+ - 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja'
+ - 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
+ - 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang.exe'
+ - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" set CI_CMAKE_GENERATOR=Unix Makefiles'
+ - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set PATH=C:\msys64\mingw32\bin;%PATH%'
+ - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set PATH=C:\msys64\mingw64\bin;%PATH%'
+ - 'if "%TOOLCHAIN%"=="msys2" set CI_CC=%ARCH%-w64-mingw32-gcc.exe'
+ - 'set CI_CMAKE_BUILD_FLAGS=--parallel 2'
+ - 'set CI_CTEST_FLAGS=--parallel 2'
+ - 'set CI_MAKE_FLAGS=-j2'
+ - 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
+
+build_script:
+ - 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
+ - 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
+ - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
+ - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
+ - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'
+
+cache:
+ - C:\tools\vcpkg\installed
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..18696e723
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,78 @@
+# Prerequisites
+*.d
+
+# Precompiled headers
+*.gch
+*.pch
+
+# Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Linker output files
+*.exp
+*.ilk
+*.map
+
+# Compiled dynamic libraries
+*.dll
+*.dylib
+*.so
+*.so.*
+
+# Compiled static libraries
+*.a
+*.la
+*.lai
+*.lib
+
+# Compiled executables
+*.app/
+*.exe
+
+# Debug files
+*.dSYM/
+*.idb
+*.pdb
+*.su
+
+# Libpng configuration and build artifacts
+.deps/
+.dirstamp
+Makefile
+autom4te.cache/
+config.h
+config.h.in~
+config.log
+config.status
+configure~
+libpng-config
+libpng.pc
+libpng.vers
+libpng16-config
+libpng16.pc
+libtool
+pnglibconf.[ch]
+pnglibconf.dfn
+pnglibconf.out
+pnglibconf.pre
+pngprefix.h
+stamp-h1
+vers.out
+
+# Libpng test artifacts
+png-fix-itxt
+pngcp
+pngfix
+pngimage
+pngstest
+pngtest
+pngunknown
+pngvalid
+timepng
+pngout.png
+
+# Libpng CI artifacts
+out/
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..dfbefa790
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,35 @@
+branches:
+ except:
+ - /libpng[0-1][0-7]/
+
+language: c
+
+os:
+ - freebsd
+ - linux
+ - osx
+
+env:
+ - AUTOMATION=cmake CI_NO_TEST=1
+ - AUTOMATION=cmake CI_CMAKE_VARS="-DPNG_HARDWARE_OPTIMIZATIONS=ON" CI_SANITIZERS="address,undefined"
+ - AUTOMATION=cmake CI_CMAKE_VARS="-DPNG_HARDWARE_OPTIMIZATIONS=OFF" CI_SANITIZERS="address,undefined"
+ - AUTOMATION=configure CI_NO_TEST=1
+ - AUTOMATION=configure CI_CONFIGURE_FLAGS="--enable-hardware-optimizations"
+ - AUTOMATION=configure CI_CONFIGURE_FLAGS="--disable-hardware-optimizations"
+ - AUTOMATION=makefiles CI_NO_TEST=1
+ - AUTOMATION=makefiles CI_SANITIZERS="address,undefined"
+
+matrix:
+ include:
+ - os: osx
+ env: AUTOMATION=cmake CI_CMAKE_GENERATOR=Xcode
+
+before_script:
+ - 'if test "$TRAVIS_OS_NAME" = "linux"; then COMPILER="gcc"; else COMPILER="clang"; fi'
+ - 'export CI_MAKEFILES="scripts/makefile.std scripts/makefile.$COMPILER"'
+ - 'export CI_MAKE_FLAGS="-j2"'
+ - 'export CI_CMAKE_BUILD_FLAGS="--parallel 2"'
+ - 'export CI_CTEST_FLAGS="--parallel 2"'
+
+script:
+ - './ci/ci_verify_$AUTOMATION.sh'
diff --git a/ANNOUNCE b/ANNOUNCE
index 0f66c0d1d..404cbb0de 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,35 +1,42 @@
-Libpng 1.6.34 - September 29, 2017
+libpng 1.6.40 - June 21, 2023
+=============================
-This is a public release of libpng, intended for use in production codes.
+This is a public release of libpng, intended for use in production code.
-Files available for download:
-Source files with LF line endings (for Unix/Linux) and with a
-"configure" script
+Files available for download
+----------------------------
- libpng-1.6.34.tar.xz (LZMA-compressed, recommended)
- libpng-1.6.34.tar.gz
+Source files with LF line endings (for Unix/Linux):
-Source files with CRLF line endings (for Windows), without the
-"configure" script
+ * libpng-1.6.40.tar.xz (LZMA-compressed, recommended)
+ * libpng-1.6.40.tar.gz
- lpng1634.7z (LZMA-compressed, recommended)
- lpng1634.zip
+Source files with CRLF line endings (for Windows):
+
+ * lpng1640.7z (LZMA-compressed, recommended)
+ * lpng1640.zip
Other information:
- libpng-1.6.34-README.txt
- libpng-1.6.34-LICENSE.txt
- libpng-1.6.34-*.asc (armored detached GPG signatures)
+ * README.md
+ * LICENSE.md
+ * AUTHORS.md
+ * TRADEMARK.md
-Changes since the last public release (1.6.33):
- Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
- test failures.
-Send comments/corrections/commendations to png-mng-implement at lists.sf.net
-(subscription required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-implement
-to subscribe)
-or to glennrp at users.sourceforge.net
+Changes from version 1.6.39 to version 1.6.40
+---------------------------------------------
+
+ * Fixed the eXIf chunk multiplicity checks.
+ * Fixed a memory leak in pCAL processing.
+ * Corrected the validity report about tRNS inside png_get_valid().
+ * Fixed various build issues on *BSD, Mac and Windows.
+ * Updated the configurations and the scripts for continuous integration.
+ * Cleaned up the code, the build scripts, and the documentation.
-Glenn R-P
+
+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
+to subscribe.
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 000000000..60f41e5c6
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,52 @@
+PNG REFERENCE LIBRARY AUTHORS
+=============================
+
+This is the list of PNG Reference Library ("libpng") Contributing
+Authors, for copyright and licensing purposes.
+
+ * Andreas Dilger
+ * Cosmin Truta
+ * Dave Martindale
+ * Eric S. Raymond
+ * Gilles Vollant
+ * Glenn Randers-Pehrson
+ * Greg Roelofs
+ * Guy Eric Schalnat
+ * James Yu
+ * John Bowler
+ * Kevin Bracey
+ * Magnus Holmgren
+ * Mandar Sahastrabuddhe
+ * Mans Rullgard
+ * Matt Sarett
+ * Mike Klein
+ * Pascal Massimino
+ * Paul Schmidt
+ * Philippe Antoine
+ * Qiang Zhou
+ * Sam Bushell
+ * Samuel Williams
+ * Simon-Pierre Cadieux
+ * Tim Wegner
+ * Tom Lane
+ * Tom Tanner
+ * Vadim Barkov
+ * Willem van Schaik
+ * Zhijie Liang
+ * Arm Holdings
+ - Richard Townsend
+ * Google Inc.
+ - Dan Field
+ - Leon Scroggins III
+ - Matt Sarett
+ - Mike Klein
+ - Sami Boukortt
+ - Wan-Teh Chang
+
+The build projects, the build scripts, the test scripts, and other
+files in the "ci", "projects", "scripts" and "tests" directories, have
+other copyright owners, but are released under the libpng license.
+
+Some files in the "contrib" directory, and some tools-generated files
+that are distributed with libpng, have other copyright owners, and are
+released under other open source licenses.
diff --git a/Android.bp b/Android.bp
index 8daf08d37..d99c26845 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,25 +1,54 @@
// We need to build this for both the device (as a shared library)
// and the host (as a static library for tools to use).
+package {
+ default_applicable_licenses: ["external_libpng_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+//
+// large-scale-change filtered out the below license kinds as false-positives:
+// SPDX-license-identifier-GPL
+// SPDX-license-identifier-GPL-2.0
+// SPDX-license-identifier-LGPL
+// See: http://go/android-license-faq
+license {
+ name: "external_libpng_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-CC0-1.0",
+ "SPDX-license-identifier-MIT",
+ "SPDX-license-identifier-W3C",
+ "SPDX-license-identifier-Zlib",
+ "legacy_notice",
+ "legacy_unencumbered",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_defaults {
name: "libpng-defaults",
- srcs: [
- "png.c",
- "pngerror.c",
- "pngget.c",
- "pngmem.c",
- "pngpread.c",
- "pngread.c",
- "pngrio.c",
- "pngrtran.c",
- "pngrutil.c",
- "pngset.c",
- "pngtrans.c",
- "pngwio.c",
- "pngwrite.c",
- "pngwtran.c",
- "pngwutil.c",
+ exclude_srcs: [
+ "example.c",
+ "pngtest.c",
],
+ srcs: ["*.c"],
cflags: [
"-std=gnu89",
"-Wall",
@@ -28,32 +57,23 @@ cc_defaults {
],
arch: {
arm: {
- srcs: [
- "arm/arm_init.c",
- "arm/filter_neon.S",
- "arm/filter_neon_intrinsics.c",
- ],
+ srcs: ["arm/*"],
+ cflags: ["-O3"],
},
arm64: {
- srcs: [
- "arm/arm_init.c",
- "arm/filter_neon.S",
- "arm/filter_neon_intrinsics.c",
+ srcs: ["arm/*",],
+ cflags: ["-O3"],
+ exclude_srcs: [
+ "arm/filter_neon.S"
],
},
x86: {
- srcs: [
- "intel/intel_init.c",
- "intel/filter_sse2_intrinsics.c",
- ],
+ srcs: ["intel/*"],
// Disable optimizations because they crash on windows
// cflags: ["-DPNG_INTEL_SSE_OPT=1"],
},
x86_64: {
- srcs: [
- "intel/intel_init.c",
- "intel/filter_sse2_intrinsics.c",
- ],
+ srcs: ["intel/*"],
// Disable optimizations because they crash on windows
// cflags: ["-DPNG_INTEL_SSE_OPT=1"],
},
@@ -76,10 +96,10 @@ cc_defaults {
cc_library {
name: "libpng",
vendor_available: true,
+ product_available: true,
+ // TODO(b/153609531): remove when no longer needed.
+ native_bridge_supported: true,
recovery_available: true,
- vndk: {
- enabled: true,
- },
double_loadable: true,
host_supported: true,
defaults: ["libpng-defaults"],
@@ -99,7 +119,7 @@ cc_library_static {
cflags: ["-ftrapv"],
shared_libs: ["libz"],
- sdk_version: "14",
+ sdk_version: "minimum",
}
// For testing
@@ -116,3 +136,28 @@ cc_test {
"libz",
],
}
+
+cc_fuzz {
+ name: "libpng_read_fuzzer",
+ host_supported:true,
+
+ static_libs: [
+ "libpng",
+ "libz",
+ ],
+
+ srcs: [
+ "contrib/oss-fuzz/libpng_read_fuzzer.cc",
+ ],
+
+ dictionary: "contrib/oss-fuzz/png.dict",
+
+ corpus: ["contrib/testpngs/*.png"],
+
+ fuzz_config: {
+ cc: [
+ "scroggo@google.com",
+ ],
+ componentid: 87896,
+ },
+}
diff --git a/CHANGES b/CHANGES
index 4b8211891..2d8c585c0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,3 @@
-#if 0
CHANGES - changes for libpng
version 0.1 [March 29, 1995]
@@ -205,7 +204,7 @@ Version 0.97 [January, 1998]
Added simple sRGB support (Glenn R-P)
Easier conditional compiling, e.g.,
define PNG_READ/WRITE_NOT_FULLY_SUPPORTED;
- all configurable options can be selected from command-line instead
+ all configurable options can be selected from command line instead
of having to edit pngconf.h (Glenn R-P)
Fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P)
Added more conditions for png_do_background, to avoid changing
@@ -943,7 +942,7 @@ Version 1.0.8 [July 24, 2000]
Version 1.0.9beta1 [November 10, 2000]
Fixed typo in scripts/makefile.hpux
Updated makevms.com in scripts and contrib/* and contrib/* (Martin Zinser)
- Fixed seqence-point bug in contrib/pngminus/png2pnm (Martin Zinser)
+ Fixed sequence-point bug in contrib/pngminus/png2pnm (Martin Zinser)
Changed "cdrom.com" in documentation to "libpng.org"
Revised pnggccrd.c to get it all working, and updated makefile.gcmmx (Greg).
Changed type of "params" from voidp to png_voidp in png_read|write_png().
@@ -1454,7 +1453,7 @@ Version 1.2.6beta4 [July 28, 2004]
sequential read support.
Added some "#if PNG_WRITE_SUPPORTED" blocks.
Added #ifdef to remove some redundancy in png_malloc_default().
- Use png_malloc instead of png_zalloc to allocate the pallete.
+ Use png_malloc instead of png_zalloc to allocate the palette.
Version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004]
Fixed buffer overflow vulnerability (CVE-2004-0597) in png_handle_tRNS().
@@ -2296,7 +2295,7 @@ Version 1.4.0beta58 [May 14, 2009]
Clarified usage of sig_bit versus sig_bit_p in example.c (Vincent Torri)
Version 1.4.0beta59 [May 15, 2009]
- Reformated sources in libpng style (3-space intentation, comment format)
+ Reformatted sources in libpng style (3-space indentation, comment format)
Fixed typo in libpng docs (PNG_FILTER_AVE should be PNG_FILTER_AVG)
Added sections about the git repository and our coding style to the
documentation
@@ -2662,7 +2661,7 @@ Version 1.4.1beta06 [January 28, 2010]
Version 1.4.1beta07 [February 6, 2010]
Folded some long lines in the source files.
- Added defineable PNG_USER_CHUNK_CACHE_MAX, PNG_USER_CHUNK_MALLOC_MAX,
+ Added definable PNG_USER_CHUNK_CACHE_MAX, PNG_USER_CHUNK_MALLOC_MAX,
and a PNG_USER_LIMITS_SUPPORTED flag.
Eliminated use of png_ptr->irowbytes and reused the slot in png_ptr as
png_ptr->png_user_chunk_malloc_max.
@@ -3259,7 +3258,7 @@ Version 1.5.2beta01 [February 13, 2011]
Revised PNG_EXPORTA macro to not use an empty parameter, to accommodate the
old VisualC++ preprocessor.
Turned on interlace handling in png_read_png().
- Fixed gcc pendantic warnings.
+ Fixed gcc pedantic warnings.
Handle longjmp in Cygwin.
Fixed png_get_current_row_number() in the interlaced case.
Cleaned up ALPHA flags and transformations.
@@ -3359,7 +3358,7 @@ Version 1.5.3beta05 [May 6, 2011]
Pass "" instead of '\0' to png_default_error() in png_err(). This mistake
was introduced in libpng-1.2.20beta01. This fixes CVE-2011-2691.
Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte
- optimization configureable.
+ optimization configurable.
IDAT compression failed if preceded by a compressed text chunk (bug
introduced in libpng-1.5.3beta01-02). This was because the attempt to
reset the zlib stream in png_write_IDAT happened after the first IDAT
@@ -3643,7 +3642,7 @@ Version 1.5.6beta05 [October 12, 2011]
Fixed bug in png_write_chunk_header() debug print, introduced in 1.5.6beta01.
Version 1.5.6beta06 [October 17, 2011]
- Removed two redundant tests for unitialized row.
+ Removed two redundant tests for uninitialized row.
Fixed a relatively harmless memory overwrite in compressed text writing
with a 1 byte zlib buffer.
Add ability to call png_read_update_info multiple times to pngvalid.c.
@@ -3689,7 +3688,7 @@ Version 1.5.7beta01 [November 4, 2011]
crash. The pngmem.c implementation of png_malloc() included a cast
to png_size_t which would fail on large allocations on 16-bit systems.
Fix for the preprocessor of the Intel C compiler. The preprocessor
- splits adjacent @ signs with a space; this changes the concatentation
+ splits adjacent @ signs with a space; this changes the concatenation
token from @-@-@ to PNG_JOIN; that should work with all compiler
preprocessors.
Paeth filter speed improvements from work by Siarhei Siamashka. This
@@ -3735,7 +3734,7 @@ Version 1.5.7beta03 [November 17, 2011]
gray (on palette) itself.
Fixes for C++ compilation using g++ When libpng source is compiled
using g++. The compiler imposes C++ rules on the C source; thus it
- is desireable to make the source work with either C or C++ rules
+ is desirable to make the source work with either C or C++ rules
without throwing away useful error information. This change adds
png_voidcast to allow C semantic (void*) cases or the corresponding
C++ static_cast operation, as appropriate.
@@ -3887,7 +3886,7 @@ Version 1.6.0beta06 [January 24, 2012]
Version 1.6.0beta07 [January 28, 2012]
Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
compiler issues slightly different warnings from those issued by the
- current vesions of GCC. This eliminates those warnings by
+ current versions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites.
Updated configure.ac from autoupdate: added --enable-werror option.
Also some layout regularization and removal of introduced tab characters
@@ -3920,7 +3919,7 @@ Version 1.6.0beta08 [February 1, 2012]
version checking to configure.ac
Improved pngstest speed by not doing redundant tests and add const to
the background parameter of png_image_finish_read. The --background
- option is now done automagically only when required, so that commandline
+ option is now done automagically only when required, so that command-line
option no longer exists.
Cleaned up pngpriv.h to consistently declare all functions and data.
Also eliminated PNG_CONST_DATA, which is apparently not needed but we
@@ -4053,7 +4052,7 @@ Version 1.6.0beta16 [March 6, 2012]
(in fact this is harmless, but the PNG data produced may be sub-optimal).
Version 1.6.0beta17 [March 10, 2012]
- Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
+ Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
Reject all iCCP chunks after the first, even if the first one is invalid.
Deflate/inflate was reworked to move common zlib calls into single
functions [rw]util.c. A new shared keyword check routine was also added
@@ -4061,7 +4060,7 @@ Version 1.6.0beta17 [March 10, 2012]
possible to call png_inflate() incrementally. A warning is no longer
issued if the language tag or translated keyword in the iTXt chunk
has zero length.
- If benign errors are disabled use maximum window on ancilliary inflate.
+ If benign errors are disabled use maximum window on ancillary inflate.
This works round a bug introduced in 1.5.4 where compressed ancillary
chunks could end up with a too-small windowBits value in the deflate
header.
@@ -4176,7 +4175,7 @@ Version 1.6.0beta27 [August 11, 2012]
declared even though the functions are never actually defined. This
change provides a dummy definition so that the declarations work, yet any
implementation will fail to compile because of an incomplete type.
- Re-eliminated the use of strcpy() in pngtest.c. An unncessary use of
+ Re-eliminated the use of strcpy() in pngtest.c. An unnecessary use of
strcpy() was accidentally re-introduced in libpng16; this change replaces
it with strncpy().
Eliminated use of png_sizeof(); use sizeof() instead.
@@ -4309,7 +4308,7 @@ Version 1.6.0beta31 [November 1, 2012]
resulting in VS2010 having to update the files.
Removed non-working ICC profile support code that was mostly added to
libpng-1.6.0beta29 and beta30. There was too much code for too little
- gain; implementing full ICC color correction may be desireable but is left
+ gain; implementing full ICC color correction may be desirable but is left
up to applications.
Version 1.6.0beta32 [November 25, 2012]
@@ -4592,7 +4591,7 @@ Version 1.6.3beta07 [June 8, 2013]
the optimizations ('check' vs 'api') are exposed in the public header files
except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the
decision about whether or not to use the optimizations.
- Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage.
+ Protect symbol prefixing against CC/CPPFLAGS/CFLAGS usage.
Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test
on __ARM_NEON__ from configure time to compile time. This breaks symbol
prefixing because the definition of the special png_init_filter_functions
@@ -4963,7 +4962,7 @@ Version 1.6.13beta01 [July 4, 2014]
Changed "if defined(__ARM_NEON__)" to
"if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu).
Fixed clang no-warning builds: png_digit was defined but never used.
-
+
Version 1.6.13beta02 [July 21, 2014]
Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32
(bug report from Wolfgang S. Kechel). Bug was introduced in libpng-1.6.11.
@@ -5454,7 +5453,7 @@ Version 1.6.21beta01 [December 11, 2015]
Version 1.6.21beta02 [December 14, 2015]
Moved png_check_keyword() from pngwutil.c to pngset.c
Removed LE/BE dependencies in pngvalid, to 'fix' the current problem
- in the BigEndian tests by not testing it, making the BE code the same
+ in the BigEndian tests by not testing it, making the BE code the same
as the LE version.
Fixes to pngvalid for various reduced build configurations (eliminate unused
statics) and a fix for the case in rgb_to_gray when the digitize option
@@ -5518,7 +5517,7 @@ Version 1.6.22beta03 [March 9, 2016]
Added a common-law trademark notice and export control information
to the LICENSE file, png.h, and the man page.
Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that
- were accidentally removed from libpng-1.6.17.
+ were accidentally removed from libpng-1.6.17.
Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h
(Robert C. Seacord).
Removed dubious "#if INT_MAX" test from png.h that was added to
@@ -5635,7 +5634,7 @@ Version 1.6.24beta02 [June 23, 2016]
to All and adds a list of the warnings that need to be turned off. This is
semi-documentary; the intent is to tell libpng users which warnings have
been examined and judged non-fixable at present. The warning about
- structure padding is fixable, but it would be a signficant change (moving
+ structure padding is fixable, but it would be a significant change (moving
structure members around).
Version 1.6.24beta03 [July 4, 2016]
@@ -5781,7 +5780,7 @@ Version 1.6.28rc01 [January 3, 2017]
Added option to Cmake build allowing a custom location of zlib to be
specified in a scenario where libpng is being built as a subproject
alongside zlib by another project (Sam Serrels).
- Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
+ Changed png_ptr->options from a png_byte to png_uint_32, to accommodate
up to 16 options.
Version 1.6.28rc02 [January 4, 2017]
@@ -5928,11 +5927,11 @@ Version 1.6.32beta03 [August 2, 2017]
(Bug report from the OSS-fuzz project).
Version 1.6.32beta04 [August 2, 2017]
- Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
+ Replaced local eXIf_buf with info_ptr->eXIf_buf in png_handle_eXIf().
Update libpng.3 and libpng-manual.txt about eXIf functions.
Version 1.6.32beta05 [August 2, 2017]
- Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
+ Restored png_get_eXIf() and png_set_eXIf() to maintain API compatibility.
Version 1.6.32beta06 [August 2, 2017]
Removed png_get_eXIf_1() and png_set_eXIf_1().
@@ -5951,7 +5950,7 @@ Version 1.6.32beta09 [August 3, 2017]
Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
no longer using deprecated cmake LOCATION feature (Clifford Yapp).
Fixed five-byte error in the calculation of IDAT maximum possible size.
-
+
Version 1.6.32beta10 [August 5, 2017]
Moved chunk-length check into a png_check_chunk_length() private
function (Suggested by Max Stepin).
@@ -6038,14 +6037,99 @@ Version 1.6.33 [September 28, 2017]
Add end_info structure and png_read_end() to the libpng fuzzer.
Version 1.6.34 [September 29, 2017]
- Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
- test failures.
-
-Send comments/corrections/commendations to png-mng-implement at lists.sf.net
-(subscription required; visit
+ Removed contrib/pngsuite/i*.png; some of them caused test failures.
+
+Version 1.6.35beta01 [March 6, 2018]
+ Restored 21 of the contrib/pngsuite/i*.png, which do not cause test
+ failures. Placed the remainder in contrib/pngsuite/interlaced/i*.png.
+ Added calls to png_set_*() transforms commonly used by browsers to
+ the fuzzer.
+ Removed some unnecessary brackets in pngrtran.c
+ Fixed miscellaneous typos (Patch by github user "luzpaz").
+ Change "ASM C" to "C ASM" in CMakeLists.txt
+ Fixed incorrect handling of bKGD chunk in sub-8-bit files (Cosmin)
+ Added hardware optimization directories to zip and 7z distributions.
+ Fixed incorrect bitmask for options.
+ Fixed many spelling typos.
+
+Version 1.6.35beta02 [March 28, 2018]
+ Make png_get_iCCP consistent with man page (allow compression-type argument
+ to be NULL, bug report by Lenard Szolnoki).
+
+Version 1.6.35 [July 15, 2018]
+ Replaced the remaining uses of png_size_t with size_t (Cosmin)
+ Fixed the calculation of row_factor in png_check_chunk_length
+ (reported by Thuan Pham in SourceForge issue #278)
+ Added missing parentheses to a macro definition
+ (suggested by "irwir" in GitHub issue #216)
+
+Version 1.6.36 [December 1, 2018]
+ Optimized png_do_expand_palette for ARM processors.
+ Improved performance by around 10-22% on a recent ARM Chromebook.
+ (Contributed by Richard Townsend, ARM Holdings)
+ Fixed manipulation of machine-specific optimization options.
+ (Contributed by Vicki Pfau)
+ Used memcpy instead of manual pointer arithmetic on Intel SSE2.
+ (Contributed by Samuel Williams)
+ Fixed build errors with MSVC on ARM64.
+ (Contributed by Zhijie Liang)
+ Fixed detection of libm in CMakeLists.
+ (Contributed by Cameron Cawley)
+ Fixed incorrect creation of pkg-config file in CMakeLists.
+ (Contributed by Kyle Bentley)
+ Fixed the CMake build on Windows MSYS by avoiding symlinks.
+ Fixed a build warning on OpenBSD.
+ (Contributed by Theo Buehler)
+ Fixed various typos in comments.
+ (Contributed by "luz.paz")
+ Raised the minimum required CMake version from 3.0.2 to 3.1.
+ Removed yet more of the vestigial support for pre-ANSI C compilers.
+ Removed ancient makefiles for ancient systems that have been broken
+ across all previous libpng-1.6.x versions.
+ Removed the Y2K compliance statement and the export control
+ information.
+ Applied various code style and documentation fixes.
+
+Version 1.6.37 [April 14, 2019]
+ Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
+ Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
+ Fixed a memory leak in pngtest.c.
+ Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
+ contrib/pngminus; refactor.
+ Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
+ (Contributed by Willem van Schaik)
+ Fixed a typo in the libpng license v2.
+ (Contributed by Miguel Ojeda)
+ Added makefiles for AddressSanitizer-enabled builds.
+ Cleaned up various makefiles.
+
+Version 1.6.38 [September 14, 2022]
+ Added configurations and scripts for continuous integration.
+ Fixed various errors in the handling of tRNS, hIST and eXIf.
+ Implemented many stability improvements across all platforms.
+ Updated the internal documentation.
+
+Version 1.6.39 [November 20, 2022]
+ Changed the error handler of oversized chunks (i.e. larger than
+ PNG_USER_CHUNK_MALLOC_MAX) from png_chunk_error to png_benign_error.
+ Fixed a buffer overflow error in contrib/tools/pngfix.
+ Fixed a memory leak (CVE-2019-6129) in contrib/tools/pngcp.
+ Disabled the ARM Neon optimizations by default in the CMake file,
+ following the default behavior of the configure script.
+ Allowed configure.ac to work with the trunk version of autoconf.
+ Removed the support for "install" targets from the legacy makefiles;
+ removed the obsolete makefile.cegcc.
+ Cleaned up the code and updated the internal documentation.
+
+Version 1.6.40 [June 21, 2023]
+ Fixed the eXIf chunk multiplicity checks.
+ Fixed a memory leak in pCAL processing.
+ Corrected the validity report about tRNS inside png_get_valid().
+ Fixed various build issues on *BSD, Mac and Windows.
+ Updated the configurations and the scripts for continuous integration.
+ Cleaned up the code, the build scripts, and the documentation.
+
+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
-to subscribe)
-or to glennrp at users.sourceforge.net
-
-Glenn R-P
-#endif
+to subscribe.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48c6fa287..e355e4dfd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,108 +1,134 @@
# CMakeLists.txt
-# Copyright (C) 2007,2009-2017 Glenn Randers-Pehrson
+# Copyright (c) 2018-2023 Cosmin Truta
+# Copyright (c) 2007,2009-2018 Glenn Randers-Pehrson
# Written by Christian Ehrlicher, 2007
# Revised by Roger Lowman, 2009-2010
-# Revised by Clifford Yapp, 2011-2012
+# Revised by Clifford Yapp, 2011-2012,2017
+# Revised by Claudio Bley, 2013
# Revised by Roger Leigh, 2016
# Revised by Andreas Franek, 2016
+# Revised by Sam Serrels, 2017
+# Revised by Vadim Barkov, 2017
+# Revised by Vicky Pfau, 2018
+# Revised by Cameron Cawley, 2018,2021
+# Revised by Kyle Bentley, 2018
+# Revised by David Callu, 2020
+# Revised by Steve Robinson, 2020
+# Revised by Simon Hausmann, 2020
+# Revised by Alex Gaynor, 2020
+# Revised by Owen Rudge, 2020
+# Revised by Gleb Mazovetskiy, 2021
+# Revised by Christopher Sean Morrison, 2022
+# Revised by B. Scott Michel, 2022
+# Revised by Jeremy Maitin-Shepard, 2022
+# Revised by Martin Storsjo, 2022
+# Revised by Jon Creighton, 2023
+# Revised by Gunther Nikl, 2023
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-cmake_minimum_required(VERSION 3.0.2)
-cmake_policy(VERSION 3.0.2)
-
-# Set MacOSX @rpath usage globally.
-if (POLICY CMP0020)
- cmake_policy(SET CMP0020 NEW)
-endif(POLICY CMP0020)
-if (POLICY CMP0042)
- cmake_policy(SET CMP0042 NEW)
-endif(POLICY CMP0042)
-# Use new variable expansion policy.
-if (POLICY CMP0053)
- cmake_policy(SET CMP0053 NEW)
-endif(POLICY CMP0053)
-if (POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif(POLICY CMP0054)
-
-set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo")
-
-project(libpng ASM C)
-enable_testing()
+cmake_minimum_required(VERSION 3.1)
+cmake_policy(VERSION 3.1)
-set(PNGLIB_MAJOR 1)
-set(PNGLIB_MINOR 6)
-set(PNGLIB_RELEASE 34)
-set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
-set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
+project(libpng C ASM)
+enable_testing()
+include(CMakeParseArguments)
+include(CheckCSourceCompiles)
include(GNUInstallDirs)
-# needed packages
-
-#Allow users to specify location of Zlib,
-# Useful if zlib is being built alongside this as a sub-project
-option(PNG_BUILD_ZLIB "Custom zlib Location, else find_package is used" OFF)
-
-IF(NOT PNG_BUILD_ZLIB)
+set(PNGLIB_MAJOR 1)
+set(PNGLIB_MINOR 6)
+set(PNGLIB_REVISION 40)
+set(PNGLIB_SUBREVISION 0)
+#set(PNGLIB_SUBREVISION "git")
+set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
+set(PNGLIB_ABI_VERSION ${PNGLIB_MAJOR}${PNGLIB_MINOR})
+set(PNGLIB_SHARED_VERSION ${PNGLIB_ABI_VERSION}.${PNGLIB_REVISION}.${PNGLIB_SUBREVISION})
+
+# Allow the users to specify an application-specific API prefix for libpng
+# vendoring purposes. A standard libpng build should have no such prefix.
+set(PNG_PREFIX ""
+ CACHE STRING "Prefix to prepend to the API function names")
+
+# Allow the users to override the postfix appended to debug library file names.
+# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
+# not be cached, however, because doing so would affect all projects processed
+# after libpng, in unexpected and undesirable ways.
+set(PNG_DEBUG_POSTFIX "d"
+ CACHE STRING "Postfix to append to library file names under the Debug configuration")
+
+# Allow the users to import their own extra configuration settings.
+set(DFA_XTRA ""
+ CACHE FILEPATH "File containing extra configuration settings")
+
+# Allow the users to configure the following build options.
+option(PNG_SHARED "Build libpng as a shared lib" ON)
+option(PNG_STATIC "Build libpng as a static lib" ON)
+option(PNG_FRAMEWORK "Build libpng as a Mac OS X framework" OFF)
+option(PNG_EXECUTABLES "Build libpng executables" ON)
+option(PNG_TESTS "Build libpng tests" ON)
+option(PNG_DEBUG "Enable debug output" OFF)
+option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" ON)
+
+# Allow the users to specify a location of zlib.
+# Useful if zlib is being built alongside this as a sub-project.
+option(PNG_BUILD_ZLIB "Custom zlib location, else find_package is used" OFF)
+if(NOT PNG_BUILD_ZLIB)
find_package(ZLIB REQUIRED)
- include_directories(${ZLIB_INCLUDE_DIR})
-ENDIF(NOT PNG_BUILD_ZLIB)
-
-if(NOT WIN32)
- find_library(M_LIBRARY
- NAMES m
- PATHS /usr/lib /usr/local/lib
- )
+ include_directories(${ZLIB_INCLUDE_DIRS})
+endif()
+
+if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU AND NOT EMSCRIPTEN)
+ find_library(M_LIBRARY m)
if(NOT M_LIBRARY)
- message(STATUS "math lib 'libm' not found; floating point support disabled")
+ set(M_LIBRARY "")
endif()
else()
- # not needed on windows
+ # libm is not needed and/or not available.
set(M_LIBRARY "")
endif()
-# COMMAND LINE OPTIONS
-option(PNG_SHARED "Build shared lib" ON)
-option(PNG_STATIC "Build static lib" ON)
-option(PNG_TESTS "Build libpng tests" ON)
-
-# Many more configuration options could be added here
-option(PNG_FRAMEWORK "Build OS X framework" OFF)
-option(PNG_DEBUG "Build with debug output" OFF)
-option(PNGARG "Disable ANSI-C prototypes" OFF)
-
-option(PNG_HARDWARE_OPTIMIZATIONS "Enable Hardware Optimizations" ON)
-
-
-set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
-set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
+# CMake currently sets CMAKE_SYSTEM_PROCESSOR to one of x86_64 or arm64 on macOS,
+# based upon the OS architecture, not the target architecture. As such, we need
+# to check CMAKE_OSX_ARCHITECTURES to identify which hardware-specific flags to
+# enable. Note that this will fail if you attempt to build a universal binary in
+# a single CMake invocation.
+if (APPLE AND CMAKE_OSX_ARCHITECTURES)
+ set(TARGET_ARCH ${CMAKE_OSX_ARCHITECTURES})
+else()
+ set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+endif()
if(PNG_HARDWARE_OPTIMIZATIONS)
-# set definitions and sources for arm
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
- set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
- set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
- check: (default) use internal checking code;
- off: disable the optimizations;
- on: turn on unconditionally.")
- set_property(CACHE PNG_ARM_NEON PROPERTY STRINGS
- ${PNG_ARM_NEON_POSSIBLE_VALUES})
+
+# Set definitions and sources for ARM.
+if(TARGET_ARCH MATCHES "^arm" OR
+ TARGET_ARCH MATCHES "^aarch64")
+ if(TARGET_ARCH MATCHES "^arm64" OR
+ TARGET_ARCH MATCHES "^aarch64")
+ set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
+ set(PNG_ARM_NEON "on"
+ CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
+ else()
+ set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
+ set(PNG_ARM_NEON "off"
+ CACHE STRING "Enable ARM NEON optimizations: check|on|off; off is default")
+ endif()
+ set_property(CACHE PNG_ARM_NEON
+ PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
if(index EQUAL -1)
- message(FATAL_ERROR
- " PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
- elseif(NOT ${PNG_ARM_NEON} STREQUAL "no")
+ message(FATAL_ERROR "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
+ elseif(NOT ${PNG_ARM_NEON} STREQUAL "off")
set(libpng_arm_sources
- arm/arm_init.c
- arm/filter_neon.S
- arm/filter_neon_intrinsics.c)
-
+ arm/arm_init.c
+ arm/filter_neon.S
+ arm/filter_neon_intrinsics.c
+ arm/palette_neon_intrinsics.c)
if(${PNG_ARM_NEON} STREQUAL "on")
add_definitions(-DPNG_ARM_NEON_OPT=2)
elseif(${PNG_ARM_NEON} STREQUAL "check")
@@ -113,22 +139,21 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
endif()
endif()
-# set definitions and sources for powerpc
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*" )
+# Set definitions and sources for PowerPC.
+if(TARGET_ARCH MATCHES "^powerpc*" OR
+ TARGET_ARCH MATCHES "^ppc64*")
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
- set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations:
- off: disable the optimizations.")
- set_property(CACHE PNG_POWERPC_VSX PROPERTY STRINGS
- ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
+ set(PNG_POWERPC_VSX "on"
+ CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
+ set_property(CACHE PNG_POWERPC_VSX
+ PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
if(index EQUAL -1)
- message(FATAL_ERROR
- " PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
- elseif(NOT ${PNG_POWERPC_VSX} STREQUAL "no")
+ message(FATAL_ERROR "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
+ elseif(NOT ${PNG_POWERPC_VSX} STREQUAL "off")
set(libpng_powerpc_sources
- powerpc/powerpc_init.c
- powerpc/filter_vsx_intrinsics.c)
+ powerpc/powerpc_init.c
+ powerpc/filter_vsx_intrinsics.c)
if(${PNG_POWERPC_VSX} STREQUAL "on")
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
endif()
@@ -137,22 +162,21 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
endif()
endif()
-# set definitions and sources for intel
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*" )
+# Set definitions and sources for Intel.
+if(TARGET_ARCH MATCHES "^i?86" OR
+ TARGET_ARCH MATCHES "^x86_64*")
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
- set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
- off: disable the optimizations")
- set_property(CACHE PNG_INTEL_SSE PROPERTY STRINGS
- ${PNG_INTEL_SSE_POSSIBLE_VALUES})
+ set(PNG_INTEL_SSE "on"
+ CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
+ set_property(CACHE PNG_INTEL_SSE
+ PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
if(index EQUAL -1)
- message(FATAL_ERROR
- " PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
- elseif(NOT ${PNG_INTEL_SSE} STREQUAL "no")
+ message(FATAL_ERROR "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
+ elseif(NOT ${PNG_INTEL_SSE} STREQUAL "off")
set(libpng_intel_sources
- intel/intel_init.c
- intel/filter_sse2_intrinsics.c)
+ intel/intel_init.c
+ intel/filter_sse2_intrinsics.c)
if(${PNG_INTEL_SSE} STREQUAL "on")
add_definitions(-DPNG_INTEL_SSE_OPT=1)
endif()
@@ -161,22 +185,21 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
endif()
endif()
-# set definitions and sources for MIPS
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*" )
+# Set definitions and sources for MIPS.
+if(TARGET_ARCH MATCHES "mipsel*" OR
+ TARGET_ARCH MATCHES "mips64el*")
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
- set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations:
- off: disable the optimizations")
- set_property(CACHE PNG_MIPS_MSA PROPERTY STRINGS
- ${PNG_MIPS_MSA_POSSIBLE_VALUES})
+ set(PNG_MIPS_MSA "on"
+ CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
+ set_property(CACHE PNG_MIPS_MSA
+ PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index)
if(index EQUAL -1)
- message(FATAL_ERROR
- " PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
- elseif(NOT ${PNG_MIPS_MSA} STREQUAL "no")
+ message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
+ elseif(NOT ${PNG_MIPS_MSA} STREQUAL "off")
set(libpng_mips_sources
- mips/mips_init.c
- mips/filter_msa_intrinsics.c)
+ mips/mips_init.c
+ mips/filter_msa_intrinsics.c)
if(${PNG_MIPS_MSA} STREQUAL "on")
add_definitions(-DPNG_MIPS_MSA_OPT=2)
endif()
@@ -184,51 +207,78 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
add_definitions(-DPNG_MIPS_MSA_OPT=0)
endif()
endif()
-endif(PNG_HARDWARE_OPTIMIZATIONS)
-# SET LIBNAME
-set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
+else(PNG_HARDWARE_OPTIMIZATIONS)
-# to distinguish between debug and release lib
-set(CMAKE_DEBUG_POSTFIX "d")
+# Set definitions and sources for ARM.
+if(TARGET_ARCH MATCHES "^arm" OR
+ TARGET_ARCH MATCHES "^aarch64")
+ add_definitions(-DPNG_ARM_NEON_OPT=0)
+endif()
+
+# Set definitions and sources for PowerPC.
+if(TARGET_ARCH MATCHES "^powerpc*" OR
+ TARGET_ARCH MATCHES "^ppc64*")
+ add_definitions(-DPNG_POWERPC_VSX_OPT=0)
+endif()
+
+# Set definitions and sources for Intel.
+if(TARGET_ARCH MATCHES "^i?86" OR
+ TARGET_ARCH MATCHES "^x86_64*")
+ add_definitions(-DPNG_INTEL_SSE_OPT=0)
+endif()
+
+# Set definitions and sources for MIPS.
+if(TARGET_ARCH MATCHES "mipsel*" OR
+ TARGET_ARCH MATCHES "mips64el*")
+ add_definitions(-DPNG_MIPS_MSA_OPT=0)
+endif()
+
+endif(PNG_HARDWARE_OPTIMIZATIONS)
-include(CheckCSourceCompiles)
option(ld-version-script "Enable linker version script" ON)
-if(ld-version-script AND NOT APPLE)
+if(ld-version-script AND NOT ANDROID AND NOT APPLE)
# Check if LD supports linker scripts.
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
- global: sym;
- local: *;
-};
-
-VERS_2 {
- global: sym2;
- main;
-} VERS_1;
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "
+VERS_1 { global: sym1; local: *; };
+VERS_2 { global: sym2; main; } VERS_1;
")
- set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
- check_c_source_compiles("void sym(void) {}
+ set(_SAVED_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES "^SunOS")
+ # Avoid using CMAKE_SHARED_LIBRARY_C_FLAGS in version script checks on
+ # Solaris, because of an incompatibility with the Solaris link editor.
+ list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+ endif()
+ list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
+ check_c_source_compiles("
+void sym1(void) {}
void sym2(void) {}
-int main(void) {return 0;}
+int main(void) { return 0; }
" HAVE_LD_VERSION_SCRIPT)
if(NOT HAVE_LD_VERSION_SCRIPT)
- set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE} "-Wl,-M -Wl,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
- check_c_source_compiles("void sym(void) {}
+ set(CMAKE_REQUIRED_FLAGS ${_SAVED_CMAKE_REQUIRED_FLAGS})
+ if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES "^SunOS")
+ # Again, avoid using CMAKE_SHARED_LIBRARY_C_FLAGS in version script
+ # checks on Solaris.
+ list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+ endif()
+ list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,-M -Wl,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
+ check_c_source_compiles("
+void sym1(void) {}
void sym2(void) {}
-int main(void) {return 0;}
+int main(void) { return 0; }
" HAVE_SOLARIS_LD_VERSION_SCRIPT)
endif()
- set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
+ set(CMAKE_REQUIRED_FLAGS ${_SAVED_CMAKE_REQUIRED_FLAGS})
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()
# Find symbol prefix. Likely obsolete and unnecessary with recent
# toolchains (it's not done in many other projects).
-function(symbol_prefix)
+function(find_symbol_prefix)
set(SYMBOL_PREFIX)
- execute_process(COMMAND "${CMAKE_C_COMPILER}" "-E" "-"
+ execute_process(COMMAND "${CMAKE_C_COMPILER}" -E -
INPUT_FILE /dev/null
OUTPUT_VARIABLE OUT
RESULT_VARIABLE STATUS)
@@ -241,46 +291,59 @@ function(symbol_prefix)
foreach(line ${OUT})
string(REGEX MATCH "^PREFIX=" found_match "${line}")
if(found_match)
- STRING(REGEX REPLACE "^PREFIX=(.*\)" "\\1" prefix "${line}")
+ string(REGEX REPLACE "^PREFIX=(.*\)" "\\1" prefix "${line}")
string(REGEX MATCH "__USER_LABEL_PREFIX__" found_match "${prefix}")
if(found_match)
- STRING(REGEX REPLACE "(.*)__USER_LABEL_PREFIX__(.*)" "\\1\\2" prefix "${prefix}")
+ string(REGEX REPLACE "(.*)__USER_LABEL_PREFIX__(.*)" "\\1\\2" prefix "${prefix}")
endif()
set(SYMBOL_PREFIX "${prefix}")
endif()
endforeach()
- message(STATUS "Symbol prefix: ${SYMBOL_PREFIX}")
- set(SYMBOL_PREFIX "${SYMBOL_PREFIX}" PARENT_SCOPE)
+ message(STATUS "Symbol prefix: ${SYMBOL_PREFIX}")
+ set(SYMBOL_PREFIX "${SYMBOL_PREFIX}" PARENT_SCOPE)
endfunction()
if(UNIX)
- symbol_prefix()
+ find_symbol_prefix()
endif()
find_program(AWK NAMES gawk awk)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-if(NOT AWK OR ANDROID)
+if(NOT AWK OR ANDROID OR IOS)
# No awk available to generate sources; use pre-built pnglibconf.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
- add_custom_target(genfiles) # Dummy
+ add_custom_target(png_genfiles)
else()
- include(CMakeParseArguments)
- # Generate .chk from .out with awk
+ # Copy the awk scripts, converting their line endings to Unix (LF)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk
+ @ONLY
+ NEWLINE_STYLE LF)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk
+ @ONLY
+ NEWLINE_STYLE LF)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/dfn.awk
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/dfn.awk
+ @ONLY
+ NEWLINE_STYLE LF)
+
+ # Generate .chk from .out with awk:
# generate_chk(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
function(generate_chk)
set(options)
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- if (NOT _GC_INPUT)
- message(FATAL_ERROR "Invalid arguments. generate_out requires input.")
+ if(NOT _GC_INPUT)
+ message(FATAL_ERROR "generate_chk: Missing INPUT argument")
endif()
- if (NOT _GC_OUTPUT)
- message(FATAL_ERROR "Invalid arguments. generate_out requires output.")
+ if(NOT _GC_OUTPUT)
+ message(FATAL_ERROR "generate_chk: Missing OUTPUT argument")
endif()
add_custom_command(OUTPUT "${_GC_OUTPUT}"
@@ -299,11 +362,11 @@ else()
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- if (NOT _GO_INPUT)
- message(FATAL_ERROR "Invalid arguments. generate_out requires input.")
+ if(NOT _GO_INPUT)
+ message(FATAL_ERROR "generate_out: Missing INPUT argument")
endif()
- if (NOT _GO_OUTPUT)
- message(FATAL_ERROR "Invalid arguments. generate_out requires output.")
+ if(NOT _GO_OUTPUT)
+ message(FATAL_ERROR "generate_out: Missing OUTPUT argument")
endif()
add_custom_command(OUTPUT "${_GO_OUTPUT}"
@@ -322,8 +385,8 @@ else()
set(oneValueArgs OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- if (NOT _GSO_OUTPUT)
- message(FATAL_ERROR "Invalid arguments. generate_source requires output.")
+ if(NOT _GSO_OUTPUT)
+ message(FATAL_ERROR "generate_source: Missing OUTPUT argument")
endif()
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}"
@@ -335,25 +398,42 @@ else()
endfunction()
# Copy file
- function(generate_copy source destination)
- add_custom_command(OUTPUT "${destination}"
- COMMAND "${CMAKE_COMMAND}" -E remove "${destination}"
- COMMAND "${CMAKE_COMMAND}" -E copy "${source}"
- "${destination}"
- DEPENDS "${source}")
+ # generate_copy(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
+ function(generate_copy)
+ set(options)
+ set(oneValueArgs INPUT OUTPUT)
+ set(multiValueArgs DEPENDS)
+ cmake_parse_arguments(_GCO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ if(NOT _GCO_INPUT)
+ message(FATAL_ERROR "generate_copy: Missing INPUT argument")
+ endif()
+ if(NOT _GCO_OUTPUT)
+ message(FATAL_ERROR "generate_copy: Missing OUTPUT argument")
+ endif()
+
+ add_custom_command(OUTPUT "${_GCO_OUTPUT}"
+ COMMAND "${CMAKE_COMMAND}"
+ -E remove "${_GCO_OUTPUT}"
+ COMMAND "${CMAKE_COMMAND}"
+ -E copy "${_GCO_INPUT}" "${_GCO_OUTPUT}"
+ DEPENDS "${source}" ${_GCO_DEPENDS})
endfunction()
# Generate scripts/pnglibconf.h
generate_source(OUTPUT "scripts/pnglibconf.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
- "${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
+ add_custom_target(png_scripts_pnglibconf_c
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c")
# Generate pnglibconf.c
generate_source(OUTPUT "pnglibconf.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
- "${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
+ add_custom_target(pnglibconf_c
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c")
if(PNG_PREFIX)
set(PNGLIBCONF_H_EXTRA_DEPENDS
@@ -364,232 +444,251 @@ else()
endif()
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
+ DEPENDS pnglibconf_c)
+ add_custom_target(pnglibconf_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
# Generate pnglibconf.h
generate_source(OUTPUT "pnglibconf.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
${PNGLIBCONF_H_EXTRA_DEPENDS})
+ add_custom_target(pnglibconf_h
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
+ add_custom_target(png_scripts_intprefix_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/prefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out)
+ add_custom_target(png_scripts_prefix_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
# Generate pngprefix.h
generate_source(OUTPUT "pngprefix.h"
DEPENDS ${PNGPREFIX_H_EXTRA_DEPENDS})
+ add_custom_target(pngprefix_h
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
+ add_custom_target(png_scripts_sym_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
+ add_custom_target(png_scripts_symbols_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/vers.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
+ add_custom_target(png_scripts_vers_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
- DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk"
+ DEPENDS png_scripts_symbols_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def")
- add_custom_target(symbol-check DEPENDS
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
+ add_custom_target(png_scripts_symbols_chk
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
- generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
- "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
- generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
- "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
+ generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
+ DEPENDS png_scripts_sym_out)
+ generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
+ DEPENDS png_scripts_vers_out)
- add_custom_target(genvers DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
- add_custom_target(gensym DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
+ add_custom_target(png_genvers
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
+ add_custom_target(png_gensym
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
- add_custom_target("genprebuilt"
+ add_custom_target(png_genprebuilt
COMMAND "${CMAKE_COMMAND}"
"-DOUTPUT=scripts/pnglibconf.h.prebuilt"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
- # A single target handles generation of all generated files. If
- # they are dependend upon separately by multiple targets, this
- # confuses parallel make (it would require a separate top-level
- # target for each file to track the dependencies properly).
- add_custom_target(genfiles DEPENDS
- "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
- "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
- "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
-endif(NOT AWK OR ANDROID)
-
-# OUR SOURCES
+ # A single target handles generation of all generated files.
+ add_custom_target(png_genfiles
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym" png_gensym
+ "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers" png_genvers
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" pnglibconf_c
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
+ "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h" pngprefix_h
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out" png_scripts_intprefix_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c" png_scripts_pnglibconf_c
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out" png_scripts_prefix_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out" png_scripts_sym_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk" png_scripts_symbols_chk
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out" png_scripts_symbols_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out" png_scripts_vers_out)
+endif(NOT AWK OR ANDROID OR IOS)
+
+# List the source code files.
set(libpng_public_hdrs
- png.h
- pngconf.h
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
+ png.h
+ pngconf.h
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
)
set(libpng_private_hdrs
- pngpriv.h
- pngdebug.h
- pnginfo.h
- pngstruct.h
+ pngpriv.h
+ pngdebug.h
+ pnginfo.h
+ pngstruct.h
)
-if(AWK AND NOT ANDROID)
+if(AWK AND NOT ANDROID AND NOT IOS)
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
endif()
set(libpng_sources
- ${libpng_public_hdrs}
- ${libpng_private_hdrs}
- png.c
- pngerror.c
- pngget.c
- pngmem.c
- pngpread.c
- pngread.c
- pngrio.c
- pngrtran.c
- pngrutil.c
- pngset.c
- pngtrans.c
- pngwio.c
- pngwrite.c
- pngwtran.c
- pngwutil.c
- ${libpng_arm_sources}
- ${libpng_intel_sources}
- ${libpng_mips_sources}
- ${libpng_powerpc_sources}
+ ${libpng_public_hdrs}
+ ${libpng_private_hdrs}
+ png.c
+ pngerror.c
+ pngget.c
+ pngmem.c
+ pngpread.c
+ pngread.c
+ pngrio.c
+ pngrtran.c
+ pngrutil.c
+ pngset.c
+ pngtrans.c
+ pngwio.c
+ pngwrite.c
+ pngwtran.c
+ pngwutil.c
+ ${libpng_arm_sources}
+ ${libpng_intel_sources}
+ ${libpng_mips_sources}
+ ${libpng_powerpc_sources}
)
set(pngtest_sources
- pngtest.c
+ pngtest.c
)
set(pngvalid_sources
- contrib/libtests/pngvalid.c
+ contrib/libtests/pngvalid.c
)
set(pngstest_sources
- contrib/libtests/pngstest.c
+ contrib/libtests/pngstest.c
)
set(pngunknown_sources
- contrib/libtests/pngunknown.c
+ contrib/libtests/pngunknown.c
)
set(pngimage_sources
- contrib/libtests/pngimage.c
+ contrib/libtests/pngimage.c
)
set(pngfix_sources
- contrib/tools/pngfix.c
+ contrib/tools/pngfix.c
)
set(png_fix_itxt_sources
- contrib/tools/png-fix-itxt.c
+ contrib/tools/png-fix-itxt.c
)
-if(MSVC)
+if(MSVC OR (WIN32 AND (CMAKE_C_COMPILER_ID MATCHES ".*Clang")))
+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
-endif(MSVC)
+endif()
if(PNG_DEBUG)
add_definitions(-DPNG_DEBUG)
endif()
-# NOW BUILD OUR TARGET
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
-
-unset(PNG_LIB_TARGETS)
+# Now build our targets.
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS})
+
+# Initialize the list of libpng library targets.
+set(PNG_LIBRARY_TARGETS "")
+
+# Initialize the libpng library file names.
+if(UNIX
+ OR (WIN32 AND NOT "${CMAKE_SHARED_LIBRARY_PREFIX}" STREQUAL "")
+ OR (WIN32 AND NOT "${CMAKE_STATIC_LIBRARY_PREFIX}" STREQUAL ""))
+ # We are on a Unix or Unix-like toolchain like the GNU toolchain on Windows.
+ # Library file names are expected to have an implicit prefix such as "lib".
+ # Let CMake prepend and append its usual prefixes and suffixes by default.
+ set(PNG_SHARED_OUTPUT_NAME "png${PNGLIB_ABI_VERSION}")
+ set(PNG_STATIC_OUTPUT_NAME "png${PNGLIB_ABI_VERSION}")
+else()
+ # We are, most likely, on a Windows toolchain like MSVC, Clang on Windows,
+ # Borland/Embarcadero, etc. We need to specify the "libpng" name explicitly.
+ # We also need to use a custom suffix, in order to distinguish between the
+ # shared import library name and the static library name.
+ set(PNG_SHARED_OUTPUT_NAME "libpng${PNGLIB_ABI_VERSION}")
+ set(PNG_STATIC_OUTPUT_NAME "libpng${PNGLIB_ABI_VERSION}_static")
+endif()
if(PNG_SHARED)
- add_library(png SHARED ${libpng_sources})
- set(PNG_LIB_TARGETS png)
- set_target_properties(png PROPERTIES OUTPUT_NAME ${PNG_LIB_NAME})
- add_dependencies(png genfiles)
- if(MSVC)
- # msvc does not append 'lib' - do it here to have consistent name
- set_target_properties(png PROPERTIES PREFIX "lib")
- set_target_properties(png PROPERTIES IMPORT_PREFIX "lib")
- endif()
- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY})
-
+ add_library(png_shared SHARED ${libpng_sources})
+ add_dependencies(png_shared png_genfiles)
+ list(APPEND PNG_LIBRARY_TARGETS png_shared)
+ set_target_properties(png_shared PROPERTIES
+ OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
+ DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
+ VERSION "${PNGLIB_SHARED_VERSION}"
+ SOVERSION "${PNGLIB_ABI_VERSION}")
if(UNIX AND AWK)
if(HAVE_LD_VERSION_SCRIPT)
- set_target_properties(png PROPERTIES LINK_FLAGS
- "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
+ set_target_properties(png_shared PROPERTIES
+ LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
- set_target_properties(png PROPERTIES LINK_FLAGS
- "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
+ set_target_properties(png_shared PROPERTIES
+ LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
endif()
endif()
+ if(WIN32)
+ set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
+ endif()
+ target_link_libraries(png_shared ${ZLIB_LIBRARIES} ${M_LIBRARY})
endif()
if(PNG_STATIC)
- # does not work without changing name
- set(PNG_LIB_NAME_STATIC png_static)
add_library(png_static STATIC ${libpng_sources})
- add_dependencies(png_static genfiles)
- # MSVC doesn't use a different file extension for shared vs. static
- # libs. We are able to change OUTPUT_NAME to remove the _static
- # for all other platforms.
- if(NOT MSVC)
- set_target_properties(png_static PROPERTIES
- OUTPUT_NAME "${PNG_LIB_NAME}"
- CLEAN_DIRECT_OUTPUT 1)
- else()
- set_target_properties(png_static PROPERTIES
- OUTPUT_NAME "${PNG_LIB_NAME}_static"
- CLEAN_DIRECT_OUTPUT 1)
- endif()
- list(APPEND PNG_LIB_TARGETS png_static)
- if(MSVC)
- # msvc does not append 'lib' - do it here to have consistent name
- set_target_properties(png_static PROPERTIES PREFIX "lib")
- endif()
- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY})
+ add_dependencies(png_static png_genfiles)
+ list(APPEND PNG_LIBRARY_TARGETS png_static)
+ set_target_properties(png_static PROPERTIES
+ OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
+ DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY})
endif()
if(PNG_FRAMEWORK)
- set(PNG_LIB_NAME_FRAMEWORK png_framework)
add_library(png_framework SHARED ${libpng_sources})
- add_dependencies(png_framework genfiles)
- list(APPEND PNG_LIB_TARGETS png_framework)
+ add_dependencies(png_framework png_genfiles)
+ list(APPEND PNG_LIBRARY_TARGETS png_framework)
set_target_properties(png_framework PROPERTIES
- FRAMEWORK TRUE
- FRAMEWORK_VERSION ${PNGLIB_VERSION}
- MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PNGLIB_MAJOR}.${PNGLIB_MINOR}
- MACOSX_FRAMEWORK_BUNDLE_VERSION ${PNGLIB_VERSION}
- MACOSX_FRAMEWORK_IDENTIFIER org.libpng.libpng
- XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
- PUBLIC_HEADER "${libpng_public_hdrs}"
- OUTPUT_NAME png)
- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY})
+ FRAMEWORK TRUE
+ FRAMEWORK_VERSION "${PNGLIB_VERSION}"
+ MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
+ MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
+ MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
+ XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
+ PUBLIC_HEADER "${libpng_public_hdrs}"
+ OUTPUT_NAME "png")
+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY})
endif()
-if(NOT PNG_LIB_TARGETS)
- message(SEND_ERROR
- "No library variant selected to build. "
- "Please enable at least one of the following options: "
- " PNG_STATIC, PNG_SHARED, PNG_FRAMEWORK")
-endif()
-
-if(PNG_SHARED AND WIN32)
- set_target_properties(png PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
+if(NOT PNG_LIBRARY_TARGETS)
+ message(SEND_ERROR "No library variant selected to build. "
+ "Please enable at least one of the following options: "
+ "PNG_SHARED, PNG_STATIC, PNG_FRAMEWORK")
endif()
function(png_add_test)
@@ -597,32 +696,24 @@ function(png_add_test)
set(oneValueArgs NAME COMMAND)
set(multiValueArgs OPTIONS FILES)
cmake_parse_arguments(_PAT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-
- if (NOT _PAT_NAME)
- message(FATAL_ERROR "Invalid arguments. png_add_test requires name.")
+ if(NOT _PAT_NAME)
+ message(FATAL_ERROR "png_add_test: Missing NAME argument")
endif()
- if (NOT _PAT_COMMAND)
- message(FATAL_ERROR "Invalid arguments. png_add_test requires command.")
+ if(NOT _PAT_COMMAND)
+ message(FATAL_ERROR "png_add_test: Missing COMMAND argument")
endif()
set(TEST_OPTIONS "${_PAT_OPTIONS}")
set(TEST_FILES "${_PAT_FILES}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/test.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake" @ONLY)
- if(CMAKE_MAJOR_VERSION GREATER 2) # have generator expressions
- add_test(NAME "${_PAT_NAME}"
- COMMAND "${CMAKE_COMMAND}"
- "-DLIBPNG=$<TARGET_FILE:png>"
- "-DTEST_COMMAND=$<TARGET_FILE:${_PAT_COMMAND}>"
- -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake")
- else() # old 2.x add_test; limited and won't work well on Windows
- # Note LIBPNG is a dummy value as there are no generator expressions
- add_test("${_PAT_NAME}" "${CMAKE_COMMAND}"
- "-DLIBPNG=${CMAKE_CURRENT_BINARY_DIR}/libpng.so"
- "-DTEST_COMMAND=./${_PAT_COMMAND}"
- -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake")
- endif()
+ "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake"
+ @ONLY)
+ add_test(NAME "${_PAT_NAME}"
+ COMMAND "${CMAKE_COMMAND}"
+ "-DLIBPNG=$<TARGET_FILE:png_shared>"
+ "-DTEST_COMMAND=$<TARGET_FILE:${_PAT_COMMAND}>"
+ -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake")
endfunction()
if(PNG_TESTS AND PNG_SHARED)
@@ -636,44 +727,60 @@ if(PNG_TESTS AND PNG_SHARED)
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
add_executable(pngtest ${pngtest_sources})
- target_link_libraries(pngtest png)
+ target_link_libraries(pngtest png_shared)
- png_add_test(NAME pngtest COMMAND pngtest FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngtest
+ COMMAND pngtest
+ FILES "${PNGTEST_PNG}")
add_executable(pngvalid ${pngvalid_sources})
- target_link_libraries(pngvalid png)
+ target_link_libraries(pngvalid png_shared)
png_add_test(NAME pngvalid-gamma-16-to-8
- COMMAND pngvalid OPTIONS --gamma-16-to-8)
+ COMMAND pngvalid
+ OPTIONS --gamma-16-to-8)
png_add_test(NAME pngvalid-gamma-alpha-mode
- COMMAND pngvalid OPTIONS --gamma-alpha-mode)
+ COMMAND pngvalid
+ OPTIONS --gamma-alpha-mode)
png_add_test(NAME pngvalid-gamma-background
- COMMAND pngvalid OPTIONS --gamma-background)
+ COMMAND pngvalid
+ OPTIONS --gamma-background)
png_add_test(NAME pngvalid-gamma-expand16-alpha-mode
- COMMAND pngvalid OPTIONS --gamma-alpha-mode --expand16)
+ COMMAND pngvalid
+ OPTIONS --gamma-alpha-mode --expand16)
png_add_test(NAME pngvalid-gamma-expand16-background
- COMMAND pngvalid OPTIONS --gamma-background --expand16)
+ COMMAND pngvalid
+ OPTIONS --gamma-background --expand16)
png_add_test(NAME pngvalid-gamma-expand16-transform
- COMMAND pngvalid OPTIONS --gamma-transform --expand16)
+ COMMAND pngvalid
+ OPTIONS --gamma-transform --expand16)
png_add_test(NAME pngvalid-gamma-sbit
- COMMAND pngvalid OPTIONS --gamma-sbit)
+ COMMAND pngvalid
+ OPTIONS --gamma-sbit)
png_add_test(NAME pngvalid-gamma-threshold
- COMMAND pngvalid OPTIONS --gamma-threshold)
+ COMMAND pngvalid
+ OPTIONS --gamma-threshold)
png_add_test(NAME pngvalid-gamma-transform
- COMMAND pngvalid OPTIONS --gamma-transform)
+ COMMAND pngvalid
+ OPTIONS --gamma-transform)
png_add_test(NAME pngvalid-progressive-interlace-standard
- COMMAND pngvalid OPTIONS --standard --progressive-read --interlace)
+ COMMAND pngvalid
+ OPTIONS --standard --progressive-read --interlace)
png_add_test(NAME pngvalid-progressive-size
- COMMAND pngvalid OPTIONS --size --progressive-read)
+ COMMAND pngvalid
+ OPTIONS --size --progressive-read)
png_add_test(NAME pngvalid-progressive-standard
- COMMAND pngvalid OPTIONS --standard --progressive-read)
+ COMMAND pngvalid
+ OPTIONS --standard --progressive-read)
png_add_test(NAME pngvalid-standard
- COMMAND pngvalid OPTIONS --standard)
+ COMMAND pngvalid
+ OPTIONS --standard)
png_add_test(NAME pngvalid-transform
- COMMAND pngvalid OPTIONS --transform)
+ COMMAND pngvalid
+ OPTIONS --transform)
add_executable(pngstest ${pngstest_sources})
- target_link_libraries(pngstest png)
+ target_link_libraries(pngstest png_shared)
foreach(gamma_type 1.8 linear none sRGB)
foreach(alpha_type none alpha)
@@ -687,11 +794,11 @@ if(PNG_TESTS AND PNG_SHARED)
set(TEST_PNG_VALID TRUE)
if(TEST_PNG_ALPHA)
- if (NOT "${alpha_type}" STREQUAL "alpha")
+ if(NOT "${alpha_type}" STREQUAL "alpha")
set(TEST_PNG_VALID FALSE)
endif()
else()
- if ("${alpha_type}" STREQUAL "alpha")
+ if("${alpha_type}" STREQUAL "alpha")
set(TEST_PNG_VALID FALSE)
endif()
endif()
@@ -728,218 +835,226 @@ if(PNG_TESTS AND PNG_SHARED)
endforeach()
add_executable(pngunknown ${pngunknown_sources})
- target_link_libraries(pngunknown png)
-
- png_add_test(NAME pngunknown-discard COMMAND pngunknown OPTIONS --strict default=discard FILES "${PNGTEST_PNG}")
- png_add_test(NAME pngunknown-IDAT COMMAND pngunknown OPTIONS --strict default=discard IDAT=save FILES "${PNGTEST_PNG}")
- png_add_test(NAME pngunknown-if-safe COMMAND pngunknown OPTIONS --strict default=if-safe FILES "${PNGTEST_PNG}")
- png_add_test(NAME pngunknown-sAPI COMMAND pngunknown OPTIONS --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save FILES "${PNGTEST_PNG}")
- png_add_test(NAME pngunknown-save COMMAND pngunknown OPTIONS --strict default=save FILES "${PNGTEST_PNG}")
- png_add_test(NAME pngunknown-sTER COMMAND pngunknown OPTIONS --strict sTER=if-safe FILES "${PNGTEST_PNG}")
- png_add_test(NAME pngunknown-vpAg COMMAND pngunknown OPTIONS --strict vpAg=if-safe FILES "${PNGTEST_PNG}")
+ target_link_libraries(pngunknown png_shared)
+
+ png_add_test(NAME pngunknown-discard
+ COMMAND pngunknown
+ OPTIONS --strict default=discard
+ FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngunknown-IDAT
+ COMMAND pngunknown
+ OPTIONS --strict default=discard IDAT=save
+ FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngunknown-if-safe
+ COMMAND pngunknown
+ OPTIONS --strict default=if-safe
+ FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngunknown-sAPI
+ COMMAND pngunknown
+ OPTIONS --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
+ FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngunknown-save
+ COMMAND pngunknown
+ OPTIONS --strict default=save
+ FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngunknown-sTER
+ COMMAND pngunknown
+ OPTIONS --strict sTER=if-safe
+ FILES "${PNGTEST_PNG}")
+ png_add_test(NAME pngunknown-vpAg
+ COMMAND pngunknown
+ OPTIONS --strict vpAg=if-safe
+ FILES "${PNGTEST_PNG}")
add_executable(pngimage ${pngimage_sources})
- target_link_libraries(pngimage png)
-
- png_add_test(NAME pngimage-quick COMMAND pngimage OPTIONS --list-combos --log FILES ${PNGSUITE_PNGS})
- png_add_test(NAME pngimage-full COMMAND pngimage OPTIONS --exhaustive --list-combos --log FILES ${PNGSUITE_PNGS})
+ target_link_libraries(pngimage png_shared)
+
+ png_add_test(NAME pngimage-quick
+ COMMAND pngimage
+ OPTIONS --list-combos --log
+ FILES ${PNGSUITE_PNGS})
+ png_add_test(NAME pngimage-full
+ COMMAND pngimage
+ OPTIONS --exhaustive --list-combos --log
+ FILES ${PNGSUITE_PNGS})
endif()
-if(PNG_SHARED)
+if(PNG_SHARED AND PNG_EXECUTABLES)
add_executable(pngfix ${pngfix_sources})
- target_link_libraries(pngfix png)
+ target_link_libraries(pngfix png_shared)
set(PNG_BIN_TARGETS pngfix)
add_executable(png-fix-itxt ${png_fix_itxt_sources})
- target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY})
+ target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY})
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
endif()
-# Set a variable with CMake code which:
-# Creates a symlink from src to dest (if possible) or alternatively
-# copies if different.
-include(CMakeParseArguments)
-
-function(CREATE_SYMLINK DEST_FILE)
-
- cmake_parse_arguments(S "" "FILE;TARGET" "" ${ARGN})
-
- if(NOT S_TARGET AND NOT S_FILE)
- message(FATAL_ERROR "Specify either a TARGET or a FILE for CREATE_SYMLINK to link to.")
- endif(NOT S_TARGET AND NOT S_FILE)
-
- if(S_TARGET AND S_FILE)
- message(FATAL_ERROR "CREATE_SYMLINK called with both source file ${S_FILE} and build target ${S_TARGET} arguments - can only handle 1 type per call.")
- endif(S_TARGET AND S_FILE)
+# Create a symlink from src to dest (if possible), or, alternatively,
+# copy src to dest if different.
+function(create_symlink DEST_FILE)
+ cmake_parse_arguments(_SYM "" "FILE;TARGET" "" ${ARGN})
+ if(NOT _SYM_FILE AND NOT _SYM_TARGET)
+ message(FATAL_ERROR "create_symlink: Missing FILE or TARGET argument")
+ endif()
+ if(_SYM_FILE AND _SYM_TARGET)
+ message(FATAL_ERROR "create_symlink: "
+ "The arguments FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET}) "
+ "are mutually-exclusive")
+ endif()
- if(S_FILE)
+ if(_SYM_FILE)
# If we don't need to symlink something that's coming from a build target,
# we can go ahead and symlink/copy at configure time.
+ if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
+ execute_process(COMMAND "${CMAKE_COMMAND}"
+ -E copy_if_different
+ ${_SYM_FILE} ${DEST_FILE}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ else()
+ execute_process(COMMAND "${CMAKE_COMMAND}"
+ -E create_symlink
+ ${_SYM_FILE} ${DEST_FILE}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ endif()
+ endif()
- if(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
- execute_process(
- COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${S_FILE} ${DEST_FILE}
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
- )
- else(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
- execute_process(
- COMMAND ${CMAKE_COMMAND} -E create_symlink ${S_FILE} ${DEST_FILE}
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
- )
- endif(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
- endif(S_FILE)
-
- if(S_TARGET)
- # We need to use generator expressions, which can be a bit tricky, so for
- # simplicity make the symlink a POST_BUILD step and use the TARGET
+ if(_SYM_TARGET)
+ # We need to use generator expressions, which can be a bit tricky.
+ # For simplicity, make the symlink a POST_BUILD step, and use the TARGET
# signature of add_custom_command.
-
- if(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
- add_custom_command(TARGET ${S_TARGET} POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E copy_if_different $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE}
- )
- else(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
- add_custom_command(TARGET ${S_TARGET} POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E create_symlink $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE}
- )
- endif(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
-
- endif(S_TARGET)
-
+ if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
+ add_custom_command(TARGET ${_SYM_TARGET}
+ POST_BUILD
+ COMMAND "${CMAKE_COMMAND}"
+ -E copy_if_different
+ $<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>
+ $<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE})
+ else()
+ add_custom_command(TARGET ${_SYM_TARGET}
+ POST_BUILD
+ COMMAND "${CMAKE_COMMAND}"
+ -E create_symlink
+ $<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>
+ $<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE})
+ endif()
+ endif()
endfunction()
# Create source generation scripts.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genchk.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake @ONLY)
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake
+ @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genout.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake @ONLY)
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake
+ @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gensrc.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake @ONLY)
-
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake
+ @ONLY)
# libpng is a library so default to 'lib'
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR lib)
-endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+endif()
-# CREATE PKGCONFIG FILES
-# we use the same files like ./configure, so we have to set its vars
-# Only do this on Windows for Cygwin - the files don't make much sense outside
-# a UNIX look alike
+# Create pkgconfig files.
+# We use the same files like ./configure, so we have to set its vars.
+# Only do this on Windows for Cygwin - the files don't make much sense
+# outside of a UNIX look-alike.
if(NOT WIN32 OR CYGWIN OR MINGW)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
- set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
- set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+ set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
- CREATE_SYMLINK(libpng.pc FILE ${PNGLIB_NAME}.pc)
-
+ ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
+ @ONLY)
+ create_symlink(libpng.pc FILE libpng${PNGLIB_ABI_VERSION}.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
- CREATE_SYMLINK(libpng-config FILE ${PNGLIB_NAME}-config)
-endif(NOT WIN32 OR CYGWIN OR MINGW)
-
-# SET UP LINKS
-if(PNG_SHARED)
- set_target_properties(png PROPERTIES
-# VERSION 16.${PNGLIB_RELEASE}.1.6.34
- VERSION 16.${PNGLIB_RELEASE}.0
- SOVERSION 16
- CLEAN_DIRECT_OUTPUT 1)
-endif()
-
-# If CMake > 2.4.x, we set a variable used below to export
-# targets to an export file.
-# TODO: Use VERSION_GREATER after our cmake_minimum_required >= 2.6.2
-if(CMAKE_MAJOR_VERSION GREATER 1 AND CMAKE_MINOR_VERSION GREATER 4)
- set(PNG_EXPORT_RULE EXPORT libpng)
-elseif(CMAKE_MAJOR_VERSION GREATER 2) # future proof
- set(PNG_EXPORT_RULE EXPORT libpng)
+ ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
+ @ONLY)
+ create_symlink(libpng-config FILE libpng${PNGLIB_ABI_VERSION}-config)
endif()
-# INSTALL
-if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
- install(TARGETS ${PNG_LIB_TARGETS}
- ${PNG_EXPORT_RULE}
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
+# Install.
+if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
+ install(TARGETS ${PNG_LIBRARY_TARGETS}
+ EXPORT libpng
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(PNG_SHARED)
# Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
if(CYGWIN OR MINGW)
- CREATE_SYMLINK(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png)
- install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
- endif(CYGWIN OR MINGW)
+ create_symlink(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png_shared)
+ install(FILES $<TARGET_LINKER_FILE_DIR:png_shared>/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
if(NOT WIN32)
- CREATE_SYMLINK(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png)
- install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
- endif(NOT WIN32)
- endif(PNG_SHARED)
+ create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png_shared)
+ install(FILES $<TARGET_LINKER_FILE_DIR:png_shared>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+ endif()
if(PNG_STATIC)
if(NOT WIN32 OR CYGWIN OR MINGW)
- CREATE_SYMLINK( libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
- install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
- endif(NOT WIN32 OR CYGWIN OR MINGW)
- endif()
+ create_symlink(libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
+ install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+ endif()
endif()
-if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
- install(FILES ${libpng_public_hdrs} DESTINATION include)
- install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME})
+if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
+ install(FILES ${libpng_public_hdrs}
+ DESTINATION include)
+ install(FILES ${libpng_public_hdrs}
+ DESTINATION include/libpng${PNGLIB_ABI_VERSION})
endif()
-if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
+if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL)
if(NOT WIN32 OR CYGWIN OR MINGW)
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin)
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
DESTINATION bin)
- endif(NOT WIN32 OR CYGWIN OR MINGW)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
+ DESTINATION bin)
+ endif()
endif()
-if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL )
+if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL)
install(TARGETS ${PNG_BIN_TARGETS}
- RUNTIME DESTINATION bin)
+ RUNTIME DESTINATION bin)
endif()
-if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
- # Install man pages
- if(NOT PNG_MAN_DIR)
- set(PNG_MAN_DIR "share/man")
- endif()
- install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3)
- install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5)
- # Install pkg-config files
+if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
+ # Install the man pages.
+ install(FILES libpng.3 libpngpf.3
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
+ install(FILES png.5
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man5)
+ # Install the pkg-config files.
if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
- DESTINATION bin)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
- DESTINATION bin)
- endif(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
endif()
-# On versions of CMake that support it, create an export file CMake
-# users can include() to import our targets
-if(PNG_EXPORT_RULE AND NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL )
- install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake)
+# Create an export file that CMake users can include() to import our targets.
+if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL)
+ install(EXPORT libpng
+ DESTINATION lib/libpng
+ FILE libpng${PNGLIB_ABI_VERSION}.cmake)
endif()
-# what's with libpng-manual.txt and all the extra files?
-
-# UNINSTALL
-# do we need this?
-
-# DIST
-# do we need this?
-
-# to create msvc import lib for mingw compiled shared lib
+# TODO: Create MSVC import lib for MinGW-compiled shared lib.
# pexports libpng.dll > libpng.def
# lib /def:libpng.def /machine:x86
diff --git a/INSTALL b/INSTALL
index e8edb7240..042d72929 100644
--- a/INSTALL
+++ b/INSTALL
@@ -128,16 +128,18 @@ Your directory structure should look like this:
README
*.h, *.c => libpng source files
CMakeLists.txt => "cmake" script
+ ci
+ ci_*.sh
configuration files:
configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub,
- depcomp, install-sh, mkinstalldirs, test-pngtest.sh
+ depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
contrib
arm-neon, conftest, examples, gregbook, libtests, pngminim,
pngminus, pngsuite, tools, visupng
projects
- cbuilder5, owatcom, visualc71, vstudio, xcode
+ owatcom, visualc71, vstudio
scripts
makefile.*
*.def (module definition files)
@@ -145,7 +147,7 @@ Your directory structure should look like this:
pngtest.png
etc.
zlib
- README, *.h, *.c contrib, etc.
+ README, *.h, *.c, contrib, etc.
If the line endings in the files look funny, you may wish to get the other
distribution of libpng. It is available in both tar.gz (UNIX style line
@@ -153,28 +155,27 @@ endings) and zip (DOS style line endings) formats.
VI. Building with project files
-If you are building libpng with MSVC, you can enter the
-libpng projects\visualc71 or vstudio directory and follow the instructions
-in README.txt.
+If you are building libpng with Microsoft Visual Studio, you can enter
+the directory projects\visualc71 or projects\vstudio and follow the
+instructions in README.txt.
-Otherwise enter the zlib directory and follow the instructions in zlib/README,
-then come back here and run "configure" or choose the appropriate
-makefile.sys in the scripts directory.
+Otherwise, enter the zlib directory and follow the instructions in
+zlib/README, then come back here and run "configure" or choose the
+appropriate makefile in the scripts directory.
VII. Building with makefiles
Copy the file (or files) that you need from the
scripts directory into this directory, for example
-MSDOS example:
+UNIX example:
- copy scripts\makefile.msc makefile
- copy scripts\pnglibconf.h.prebuilt pnglibconf.h
+ cp scripts/makefile.std Makefile
+ make
-UNIX example:
+Windows example:
- cp scripts/makefile.std makefile
- cp scripts/pnglibconf.h.prebuilt pnglibconf.h
+ nmake -f scripts\makefile.vcwin32
Read the makefile to see if you need to change any source or
target directories to match your preferences.
@@ -191,36 +192,33 @@ test. For more confidence, you can run another test by typing
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
your output with the result shown in contrib/pngsuite/README.
-Most of the makefiles will allow you to run "make install" to
-put the library in its final resting place (if you want to
-do that, run "make install" in the zlib directory first if necessary).
-Some also allow you to run "make test-installed" after you have
-run "make install".
-
-VIII. Configuring libpng for 16-bit platforms
+Most of the makefiles used to allow you to run "make install" to put
+the library in its final resting place, but that feature is no longer
+supported. The only tested and supported manners to install libpng are
+the conventional build and install procedures driven by the configure
+script or by the CMake file.
-You will want to look into zconf.h to tell zlib (and thus libpng) that
-it cannot allocate more than 64K at a time. Even if you can, the memory
-won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K.
+VIII. Configuring for DOS and other 16-bit platforms
-IX. Configuring for DOS
+Officially, the support for 16-bit platforms has been removed.
For DOS users who only have access to the lower 640K, you will
have to limit zlib's memory usage via a png_set_compression_mem_level()
call. See zlib.h or zconf.h in the zlib library for more information.
-X. Configuring for Medium Model
+You may be or may not be in luck if you target the "large" memory model,
+but all the smaller models ("small", "compact" and "medium") are known
+to be unworkable. For DOS users who have access beyond the lower 640K,
+a "flat" 32-bit DOS model (such as DJGPP) is strongly recommended.
-Libpng's support for medium model has been tested on most of the popular
-compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets
-defined, and FAR gets defined to far in pngconf.h, and you should be
-all set. Everything in the library (except for zlib's structure) is
-expecting far data. You must use the typedefs with the p or pp on
-the end for pointers (or at least look at them and be careful). Make
-note that the rows of data are defined as png_bytepp, which is
-an "unsigned char far * far *".
+For DOS users who only have access to the lower 640K, you will have to
+limit zlib's memory usage via a png_set_compression_mem_level() call.
+You will also have to look into zconf.h to tell zlib (and thus libpng)
+that it cannot allocate more than 64K at a time. Even if you can, the
+memory won't be accessible. Therefore, you should limit zlib and libpng
+to 64K by defining MAXSEG_64K.
-XI. Prepending a prefix to exported symbols
+IX. Prepending a prefix to exported symbols
Starting with libpng-1.6.0, you can configure libpng (when using the
"configure" script) to prefix all exported symbols by means of the
@@ -231,7 +229,7 @@ identifier). This creates a set of macros in pnglibconf.h, so this is
transparent to applications; their function calls get transformed by
the macros to use the modified names.
-XII. Configuring for compiler xxx:
+X. Configuring for compiler xxx:
All includes for libpng are in pngconf.h. If you need to add, change
or delete an include, this is the place to do it.
@@ -243,7 +241,7 @@ As of libpng-1.5.0, pngpriv.h also includes three other private header
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
that previously appeared in the public headers.
-XIII. Removing unwanted object code
+XI. Removing unwanted object code
There are a bunch of #define's in pngconf.h that control what parts of
libpng are compiled. All the defines end in _SUPPORTED. If you are
@@ -282,9 +280,9 @@ library to fail if they call functions not available in your library.
The size of the library itself should not be an issue, because only
those sections that are actually used will be loaded into memory.
-XIV. Enabling or disabling hardware optimizations
+XII. Enabling or disabling hardware optimizations
-Certain hardware capabilites, such as the Intel SSE instructions,
+Certain hardware capabilities, such as the Intel SSE instructions,
are normally detected at run time. Enable them with configure options
such as one of
@@ -332,7 +330,7 @@ or disable them all at once with
cmake . -DPNG_HARDWARE_OPTIMIZATIONS=no
-XV. Changes to the build and configuration of libpng in libpng-1.5.x
+XIII. Changes to the build and configuration of libpng in libpng-1.5.x
Details of internal changes to the library code can be found in the CHANGES
file and in the GIT repository logs. These will be of no concern to the vast
@@ -423,7 +421,7 @@ $PREFIX/include directory). Do not edit pnglibconf.h after you have built
libpng, because than the settings would not accurately reflect the settings
that were used to build libpng.
-XVI. Setjmp/longjmp issues
+XIV. Setjmp/longjmp issues
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
is known to be not thread-safe on some platforms and we don't know of
@@ -441,7 +439,7 @@ This requires setjmp/longjmp, so you must either build the library
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
-XVII. Common linking failures
+XV. Common linking failures
If your application fails to find libpng or zlib entries while linking:
@@ -453,12 +451,13 @@ If your application fails to find libpng or zlib entries while linking:
If you are using the vstudio project, observe the WARNING in
project/vstudio/README.txt.
-XVIII. Other sources of information about libpng:
+XVI. Other sources of information about libpng:
Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5.
+Copyright (c) 2022 Cosmin Truta
Copyright (c) 1998-2002,2006-2016 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer
diff --git a/LICENSE b/LICENSE
index 4cda4fa0a..086d1c2fd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,53 +1,82 @@
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
+=========================================
-This copy of the libpng notices is provided for your convenience. In case of
-any discrepancy between this copy and the notices in the file png.h that is
-included in the libpng distribution, the latter shall prevail.
+PNG Reference Library License version 2
+---------------------------------------
-COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+ * Copyright (c) 1995-2023 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2023 Cosmin Truta.
+ * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
+ * Copyright (c) 1996-1997 Andreas Dilger.
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
-If you modify libpng you may insert additional notices immediately following
-this sentence.
+The software is supplied "as is", without warranty of any kind,
+express or implied, including, without limitation, the warranties
+of merchantability, fitness for a particular purpose, title, and
+non-infringement. In no event shall the Copyright owners, or
+anyone distributing the software, be liable for any damages or
+other liability, whether in contract, tort or otherwise, arising
+from, out of, or in connection with the software, or the use or
+other dealings in the software, even if advised of the possibility
+of such damage.
-This code is released under the libpng license.
+Permission is hereby granted to use, copy, modify, and distribute
+this software, or portions hereof, for any purpose, without fee,
+subject to the following restrictions:
-libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
-Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
+ 1. The origin of this software must not be misrepresented; you
+ must not claim that you wrote the original software. If you
+ use this software in a product, an acknowledgment in the product
+ documentation would be appreciated, but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+
+PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
+-----------------------------------------------------------------------
+
+libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
+Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors:
- Simon-Pierre Cadieux
- Eric S. Raymond
- Mans Rullgard
- Cosmin Truta
- Gilles Vollant
- James Yu
- Mandar Sahastrabuddhe
- Google Inc.
- Vadim Barkov
+ Simon-Pierre Cadieux
+ Eric S. Raymond
+ Mans Rullgard
+ Cosmin Truta
+ Gilles Vollant
+ James Yu
+ Mandar Sahastrabuddhe
+ Google Inc.
+ Vadim Barkov
and with the following additions to the disclaimer:
- There is no warranty against interference with your enjoyment of the
- library or against infringement. There is no warranty that our
- efforts or the library will fulfill any of your particular purposes
- or needs. This library is provided with all faults, and the entire
- risk of satisfactory quality, performance, accuracy, and effort is with
- the user.
+ There is no warranty against interference with your enjoyment of
+ the library or against infringement. There is no warranty that our
+ efforts or the library will fulfill any of your particular purposes
+ or needs. This library is provided with all faults, and the entire
+ risk of satisfactory quality, performance, accuracy, and effort is
+ with the user.
Some files in the "contrib" directory and some configure-generated
-files that are distributed with libpng have other copyright owners and
+files that are distributed with libpng have other copyright owners, and
are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and
-license as libpng-0.96, with the following individuals added to the list
-of Contributing Authors:
+license as libpng-0.96, with the following individuals added to the
+list of Contributing Authors:
- Tom Lane
- Glenn Randers-Pehrson
- Willem van Schaik
+ Tom Lane
+ Glenn Randers-Pehrson
+ Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
@@ -55,14 +84,14 @@ and are distributed according to the same disclaimer and license as
libpng-0.88, with the following individuals added to the list of
Contributing Authors:
- John Bowler
- Kevin Bracey
- Sam Bushell
- Magnus Holmgren
- Greg Roelofs
- Tom Tanner
+ John Bowler
+ Kevin Bracey
+ Sam Bushell
+ Magnus Holmgren
+ Greg Roelofs
+ Tom Tanner
-Some files in the "scripts" directory have other copyright owners
+Some files in the "scripts" directory have other copyright owners,
but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are
@@ -71,63 +100,35 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
- Andreas Dilger
- Dave Martindale
- Guy Eric Schalnat
- Paul Schmidt
- Tim Wegner
-
-The PNG Reference Library is supplied "AS IS". The Contributing Authors
-and Group 42, Inc. disclaim all warranties, expressed or implied,
-including, without limitation, the warranties of merchantability and of
-fitness for any purpose. The Contributing Authors and Group 42, Inc.
-assume no liability for direct, indirect, incidental, special, exemplary,
-or consequential damages, which may result from the use of the PNG
-Reference Library, even if advised of the possibility of such damage.
+ Andreas Dilger
+ Dave Martindale
+ Guy Eric Schalnat
+ Paul Schmidt
+ Tim Wegner
+
+The PNG Reference Library is supplied "AS IS". The Contributing
+Authors and Group 42, Inc. disclaim all warranties, expressed or
+implied, including, without limitation, the warranties of
+merchantability and of fitness for any purpose. The Contributing
+Authors and Group 42, Inc. assume no liability for direct, indirect,
+incidental, special, exemplary, or consequential damages, which may
+result from the use of the PNG Reference Library, even if advised of
+the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
- 1. The origin of this source code must not be misrepresented.
-
- 2. Altered versions must be plainly marked as such and must not
- be misrepresented as being the original source.
-
- 3. This Copyright notice may not be removed or altered from any
- source or altered source distribution.
-
-The Contributing Authors and Group 42, Inc. specifically permit, without
-fee, and encourage the use of this source code as a component to
-supporting the PNG file format in commercial products. If you use this
-source code in a product, acknowledgment is not required but would be
-appreciated.
-
-END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
-
-TRADEMARK:
-
-The name "libpng" has not been registered by the Copyright owner
-as a trademark in any jurisdiction. However, because libpng has
-been distributed and maintained world-wide, continually since 1995,
-the Copyright owner claims "common-law trademark protection" in any
-jurisdiction where common-law trademark is recognized.
-
-OSI CERTIFICATION:
-
-Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
-a certification mark of the Open Source Initiative. OSI has not addressed
-the additional disclaimers inserted at version 1.0.7.
+ 1. The origin of this source code must not be misrepresented.
-EXPORT CONTROL:
+ 2. Altered versions must be plainly marked as such and must not
+ be misrepresented as being the original source.
-The Copyright owner believes that the Export Control Classification
-Number (ECCN) for libpng is EAR99, which means not subject to export
-controls or International Traffic in Arms Regulations (ITAR) because
-it is open source, publicly available software, that does not contain
-any encryption software. See the EAR, paragraphs 734.3(b)(3) and
-734.7(b).
+ 3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
-Glenn Randers-Pehrson
-glennrp at users.sourceforge.net
-September 29, 2017
+The Contributing Authors and Group 42, Inc. specifically permit,
+without fee, and encourage the use of this source code as a component
+to supporting the PNG file format in commercial products. If you use
+this source code in a product, acknowledgment is not required but would
+be appreciated.
diff --git a/METADATA b/METADATA
new file mode 100644
index 000000000..9537dd332
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,22 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update libpng
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
+name: "libpng"
+description: "libpng is a PNG image codec."
+third_party {
+ url {
+ type: GIT
+ value: "https://github.com/glennrp/libpng.git"
+ }
+ version: "v1.6.40"
+ license_type: NOTICE
+ security {
+ tag: "NVD-CPE2.3:cpe:/a:libpng:libpng:1.6.37"
+ }
+ last_upgrade_date {
+ year: 2023
+ month: 6
+ day: 22
+ }
+}
diff --git a/Makefile.am b/Makefile.am
index 08db3e599..f21107e65 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am, the source file for Makefile.in (and hence Makefile), is
#
+# Copyright (c) 2018 Cosmin Truta
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
-# Last changed in libpng 1.6.25 [September 1, 2016]
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -59,8 +59,7 @@ pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
# Generally these are single line shell scripts to run a test with a particular
# set of parameters:
TESTS =\
- tests/pngtest\
- tests/pngtest-badpngs\
+ tests/pngtest-all\
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
tests/pngvalid-gamma-expand16-background\
@@ -95,7 +94,8 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
if PNG_ARM_NEON
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
- arm/filter_neon.S arm/filter_neon_intrinsics.c
+ arm/filter_neon.S arm/filter_neon_intrinsics.c \
+ arm/palette_neon_intrinsics.c
endif
if PNG_MIPS_MSA
@@ -147,7 +147,7 @@ pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
# from those directories being included. This only works if the configure is
# not done in the source directory!
EXTRA_DIST= \
- ANNOUNCE CHANGES INSTALL LICENSE README TODO \
+ ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
diff --git a/Makefile.in b/Makefile.in
index b25f3387b..6e7ba2839 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -16,8 +16,8 @@
# Makefile.am, the source file for Makefile.in (and hence Makefile), is
#
+# Copyright (c) 2018 Cosmin Truta
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
-# Last changed in libpng 1.6.25 [September 1, 2016]
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -106,7 +106,8 @@ check_PROGRAMS = pngtest$(EXEEXT) pngunknown$(EXEEXT) \
@HAVE_CLOCK_GETTIME_TRUE@am__append_1 = timepng
bin_PROGRAMS = pngfix$(EXEEXT) png-fix-itxt$(EXEEXT)
@PNG_ARM_NEON_TRUE@am__append_2 = arm/arm_init.c\
-@PNG_ARM_NEON_TRUE@ arm/filter_neon.S arm/filter_neon_intrinsics.c
+@PNG_ARM_NEON_TRUE@ arm/filter_neon.S arm/filter_neon_intrinsics.c \
+@PNG_ARM_NEON_TRUE@ arm/palette_neon_intrinsics.c
@PNG_MIPS_MSA_TRUE@am__append_3 = mips/mips_init.c\
@PNG_MIPS_MSA_TRUE@ mips/filter_msa_intrinsics.c
@@ -142,6 +143,12 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = libpng.pc libpng-config
CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \
+ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" \
+ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" \
+ "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"
+@HAVE_CLOCK_GETTIME_TRUE@am__EXEEXT_1 = timepng$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -169,10 +176,6 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
- "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" \
- "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" \
- "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD =
am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \
@@ -181,12 +184,14 @@ am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \
pngwtran.c pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h \
pngpriv.h pngstruct.h pngusr.dfa arm/arm_init.c \
arm/filter_neon.S arm/filter_neon_intrinsics.c \
- mips/mips_init.c mips/filter_msa_intrinsics.c \
- intel/intel_init.c intel/filter_sse2_intrinsics.c \
- powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c
+ arm/palette_neon_intrinsics.c mips/mips_init.c \
+ mips/filter_msa_intrinsics.c intel/intel_init.c \
+ intel/filter_sse2_intrinsics.c powerpc/powerpc_init.c \
+ powerpc/filter_vsx_intrinsics.c
am__dirstamp = $(am__leading_dot)dirstamp
@PNG_ARM_NEON_TRUE@am__objects_1 = arm/arm_init.lo arm/filter_neon.lo \
-@PNG_ARM_NEON_TRUE@ arm/filter_neon_intrinsics.lo
+@PNG_ARM_NEON_TRUE@ arm/filter_neon_intrinsics.lo \
+@PNG_ARM_NEON_TRUE@ arm/palette_neon_intrinsics.lo
@PNG_MIPS_MSA_TRUE@am__objects_2 = mips/mips_init.lo \
@PNG_MIPS_MSA_TRUE@ mips/filter_msa_intrinsics.lo
@PNG_INTEL_SSE_TRUE@am__objects_3 = intel/intel_init.lo \
@@ -211,8 +216,6 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK = $(LIBTOOL) $(AM_V_lt) \
$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS) $(LDFLAGS) -o \
$@
-@HAVE_CLOCK_GETTIME_TRUE@am__EXEEXT_1 = timepng$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS)
am_png_fix_itxt_OBJECTS = contrib/tools/png-fix-itxt.$(OBJEXT)
png_fix_itxt_OBJECTS = $(am_png_fix_itxt_OBJECTS)
png_fix_itxt_LDADD = $(LDADD)
@@ -255,11 +258,36 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/png.Plo ./$(DEPDIR)/pngerror.Plo \
+ ./$(DEPDIR)/pngget.Plo ./$(DEPDIR)/pngmem.Plo \
+ ./$(DEPDIR)/pngpread.Plo ./$(DEPDIR)/pngread.Plo \
+ ./$(DEPDIR)/pngrio.Plo ./$(DEPDIR)/pngrtran.Plo \
+ ./$(DEPDIR)/pngrutil.Plo ./$(DEPDIR)/pngset.Plo \
+ ./$(DEPDIR)/pngtest.Po ./$(DEPDIR)/pngtrans.Plo \
+ ./$(DEPDIR)/pngwio.Plo ./$(DEPDIR)/pngwrite.Plo \
+ ./$(DEPDIR)/pngwtran.Plo ./$(DEPDIR)/pngwutil.Plo \
+ arm/$(DEPDIR)/arm_init.Plo arm/$(DEPDIR)/filter_neon.Plo \
+ arm/$(DEPDIR)/filter_neon_intrinsics.Plo \
+ arm/$(DEPDIR)/palette_neon_intrinsics.Plo \
+ contrib/libtests/$(DEPDIR)/pngimage.Po \
+ contrib/libtests/$(DEPDIR)/pngstest.Po \
+ contrib/libtests/$(DEPDIR)/pngunknown.Po \
+ contrib/libtests/$(DEPDIR)/pngvalid.Po \
+ contrib/libtests/$(DEPDIR)/timepng.Po \
+ contrib/tools/$(DEPDIR)/png-fix-itxt.Po \
+ contrib/tools/$(DEPDIR)/pngcp.Po \
+ contrib/tools/$(DEPDIR)/pngfix.Po \
+ intel/$(DEPDIR)/filter_sse2_intrinsics.Plo \
+ intel/$(DEPDIR)/intel_init.Plo \
+ mips/$(DEPDIR)/filter_msa_intrinsics.Plo \
+ mips/$(DEPDIR)/mips_init.Plo \
+ powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo \
+ powerpc/$(DEPDIR)/powerpc_init.Plo
am__mv = mv -f
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CCASFLAGS) $(CCASFLAGS)
@@ -306,8 +334,8 @@ NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(pkgconfig_DATA)
HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+ config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@@ -324,9 +352,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope check recheck
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
@@ -483,6 +508,7 @@ am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
@@ -506,7 +532,7 @@ TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(srcdir)/libpng-config.in \
- $(srcdir)/libpng.pc.in INSTALL README TODO compile \
+ $(srcdir)/libpng.pc.in AUTHORS INSTALL README TODO compile \
config.guess config.sub depcomp install-sh ltmain.sh missing \
test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -522,6 +548,8 @@ am__post_remove_distdir = $(am__remove_distdir)
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
GZIP_ENV = --best
DIST_TARGETS = dist-xz dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -546,6 +574,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@@ -563,8 +593,10 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -608,7 +640,6 @@ PNGLIB_VERSION = @PNGLIB_VERSION@
# AM_CFLAGS)
PNG_COPTS = @PNG_COPTS@
PNG_PREFIX = @PNG_PREFIX@
-POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -667,6 +698,7 @@ pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -708,8 +740,7 @@ pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
# Generally these are single line shell scripts to run a test with a particular
# set of parameters:
TESTS = \
- tests/pngtest\
- tests/pngtest-badpngs\
+ tests/pngtest-all\
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
tests/pngvalid-gamma-expand16-background\
@@ -756,7 +787,7 @@ pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
# from those directories being included. This only works if the configure is
# not done in the source directory!
EXTRA_DIST = \
- ANNOUNCE CHANGES INSTALL LICENSE README TODO \
+ ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
@@ -814,8 +845,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -845,6 +876,64 @@ libpng.pc: $(top_builddir)/config.status $(srcdir)/libpng.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libpng-config: $(top_builddir)/config.status $(srcdir)/libpng-config.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@@ -890,6 +979,8 @@ arm/arm_init.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp)
arm/filter_neon.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp)
arm/filter_neon_intrinsics.lo: arm/$(am__dirstamp) \
arm/$(DEPDIR)/$(am__dirstamp)
+arm/palette_neon_intrinsics.lo: arm/$(am__dirstamp) \
+ arm/$(DEPDIR)/$(am__dirstamp)
mips/$(am__dirstamp):
@$(MKDIR_P) mips
@: > mips/$(am__dirstamp)
@@ -922,64 +1013,6 @@ powerpc/filter_vsx_intrinsics.lo: powerpc/$(am__dirstamp) \
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) $(EXTRA_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES)
$(AM_V_CCLD)$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK) -rpath $(libdir) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD) $(LIBS)
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
-clean-checkPROGRAMS:
- @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
contrib/tools/$(am__dirstamp):
@$(MKDIR_P) contrib/tools
@: > contrib/tools/$(am__dirstamp)
@@ -1097,39 +1130,46 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/png.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngget.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngmem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngpread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrio.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrtran.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrutil.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngset.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtrans.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwio.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwrite.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwtran.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwutil.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/arm_init.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/filter_neon.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/filter_neon_intrinsics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngimage.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngstest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngunknown.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngvalid.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/timepng.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/png-fix-itxt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/pngcp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/pngfix.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/filter_sse2_intrinsics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/intel_init.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/filter_msa_intrinsics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/mips_init.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@powerpc/$(DEPDIR)/powerpc_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/png.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngerror.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngget.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngmem.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngpread.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngread.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrio.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrtran.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrutil.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngset.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtest.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtrans.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwio.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwrite.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwtran.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwutil.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/arm_init.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/filter_neon.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/filter_neon_intrinsics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/palette_neon_intrinsics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngimage.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngstest.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngunknown.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngvalid.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/timepng.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/png-fix-itxt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/pngcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/pngfix.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/filter_sse2_intrinsics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/intel_init.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/filter_msa_intrinsics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/mips_init.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@powerpc/$(DEPDIR)/powerpc_init.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.S.o:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -1507,7 +1547,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
@@ -1520,7 +1560,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
fi; \
$$success || exit 1
-check-TESTS:
+check-TESTS: $(check_PROGRAMS)
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -1541,16 +1581,9 @@ recheck: all $(check_PROGRAMS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
-tests/pngtest.log: tests/pngtest
- @p='tests/pngtest'; \
- b='tests/pngtest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-tests/pngtest-badpngs.log: tests/pngtest-badpngs
- @p='tests/pngtest-badpngs'; \
- b='tests/pngtest-badpngs'; \
+tests/pngtest-all.log: tests/pngtest-all
+ @p='tests/pngtest-all'; \
+ b='tests/pngtest-all'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -1786,8 +1819,10 @@ tests/pngimage-full.log: tests/pngimage-full
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
-distdir: $(DISTFILES)
+distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1830,7 +1865,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -1844,6 +1879,10 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@@ -1855,7 +1894,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -1873,7 +1912,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -1883,9 +1922,11 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
@@ -1901,7 +1942,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -1957,17 +1998,20 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
$(HEADERS) config.h
install-binPROGRAMS: install-libLTLIBRARIES
+install-checkPROGRAMS: install-libLTLIBRARIES
+
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
+install-exec: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@@ -2024,7 +2068,40 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR) arm/$(DEPDIR) contrib/libtests/$(DEPDIR) contrib/tools/$(DEPDIR) intel/$(DEPDIR) mips/$(DEPDIR) powerpc/$(DEPDIR)
+ -rm -f ./$(DEPDIR)/png.Plo
+ -rm -f ./$(DEPDIR)/pngerror.Plo
+ -rm -f ./$(DEPDIR)/pngget.Plo
+ -rm -f ./$(DEPDIR)/pngmem.Plo
+ -rm -f ./$(DEPDIR)/pngpread.Plo
+ -rm -f ./$(DEPDIR)/pngread.Plo
+ -rm -f ./$(DEPDIR)/pngrio.Plo
+ -rm -f ./$(DEPDIR)/pngrtran.Plo
+ -rm -f ./$(DEPDIR)/pngrutil.Plo
+ -rm -f ./$(DEPDIR)/pngset.Plo
+ -rm -f ./$(DEPDIR)/pngtest.Po
+ -rm -f ./$(DEPDIR)/pngtrans.Plo
+ -rm -f ./$(DEPDIR)/pngwio.Plo
+ -rm -f ./$(DEPDIR)/pngwrite.Plo
+ -rm -f ./$(DEPDIR)/pngwtran.Plo
+ -rm -f ./$(DEPDIR)/pngwutil.Plo
+ -rm -f arm/$(DEPDIR)/arm_init.Plo
+ -rm -f arm/$(DEPDIR)/filter_neon.Plo
+ -rm -f arm/$(DEPDIR)/filter_neon_intrinsics.Plo
+ -rm -f arm/$(DEPDIR)/palette_neon_intrinsics.Plo
+ -rm -f contrib/libtests/$(DEPDIR)/pngimage.Po
+ -rm -f contrib/libtests/$(DEPDIR)/pngstest.Po
+ -rm -f contrib/libtests/$(DEPDIR)/pngunknown.Po
+ -rm -f contrib/libtests/$(DEPDIR)/pngvalid.Po
+ -rm -f contrib/libtests/$(DEPDIR)/timepng.Po
+ -rm -f contrib/tools/$(DEPDIR)/png-fix-itxt.Po
+ -rm -f contrib/tools/$(DEPDIR)/pngcp.Po
+ -rm -f contrib/tools/$(DEPDIR)/pngfix.Po
+ -rm -f intel/$(DEPDIR)/filter_sse2_intrinsics.Plo
+ -rm -f intel/$(DEPDIR)/intel_init.Plo
+ -rm -f mips/$(DEPDIR)/filter_msa_intrinsics.Plo
+ -rm -f mips/$(DEPDIR)/mips_init.Plo
+ -rm -f powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo
+ -rm -f powerpc/$(DEPDIR)/powerpc_init.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -2076,7 +2153,40 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR) arm/$(DEPDIR) contrib/libtests/$(DEPDIR) contrib/tools/$(DEPDIR) intel/$(DEPDIR) mips/$(DEPDIR) powerpc/$(DEPDIR)
+ -rm -f ./$(DEPDIR)/png.Plo
+ -rm -f ./$(DEPDIR)/pngerror.Plo
+ -rm -f ./$(DEPDIR)/pngget.Plo
+ -rm -f ./$(DEPDIR)/pngmem.Plo
+ -rm -f ./$(DEPDIR)/pngpread.Plo
+ -rm -f ./$(DEPDIR)/pngread.Plo
+ -rm -f ./$(DEPDIR)/pngrio.Plo
+ -rm -f ./$(DEPDIR)/pngrtran.Plo
+ -rm -f ./$(DEPDIR)/pngrutil.Plo
+ -rm -f ./$(DEPDIR)/pngset.Plo
+ -rm -f ./$(DEPDIR)/pngtest.Po
+ -rm -f ./$(DEPDIR)/pngtrans.Plo
+ -rm -f ./$(DEPDIR)/pngwio.Plo
+ -rm -f ./$(DEPDIR)/pngwrite.Plo
+ -rm -f ./$(DEPDIR)/pngwtran.Plo
+ -rm -f ./$(DEPDIR)/pngwutil.Plo
+ -rm -f arm/$(DEPDIR)/arm_init.Plo
+ -rm -f arm/$(DEPDIR)/filter_neon.Plo
+ -rm -f arm/$(DEPDIR)/filter_neon_intrinsics.Plo
+ -rm -f arm/$(DEPDIR)/palette_neon_intrinsics.Plo
+ -rm -f contrib/libtests/$(DEPDIR)/pngimage.Po
+ -rm -f contrib/libtests/$(DEPDIR)/pngstest.Po
+ -rm -f contrib/libtests/$(DEPDIR)/pngunknown.Po
+ -rm -f contrib/libtests/$(DEPDIR)/pngvalid.Po
+ -rm -f contrib/libtests/$(DEPDIR)/timepng.Po
+ -rm -f contrib/tools/$(DEPDIR)/png-fix-itxt.Po
+ -rm -f contrib/tools/$(DEPDIR)/pngcp.Po
+ -rm -f contrib/tools/$(DEPDIR)/pngfix.Po
+ -rm -f intel/$(DEPDIR)/filter_sse2_intrinsics.Plo
+ -rm -f intel/$(DEPDIR)/intel_init.Plo
+ -rm -f mips/$(DEPDIR)/filter_msa_intrinsics.Plo
+ -rm -f mips/$(DEPDIR)/mips_init.Plo
+ -rm -f powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo
+ -rm -f powerpc/$(DEPDIR)/powerpc_init.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -2102,22 +2212,23 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-man: uninstall-man3 uninstall-man5
.MAKE: all check check-am install install-am install-data-am \
- install-exec-am install-strip uninstall-am
-
-.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \
- check-am clean clean-binPROGRAMS clean-checkPROGRAMS \
- clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \
- cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
- dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
- dist-zip distcheck distclean distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-binSCRIPTS install-data \
- install-data-am install-data-hook install-dvi install-dvi-am \
- install-exec install-exec-am install-exec-hook install-html \
- install-html-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-man3 install-man5 \
+ install-exec install-exec-am install-strip uninstall-am
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
+ check-TESTS check-am clean clean-binPROGRAMS \
+ clean-checkPROGRAMS clean-cscope clean-generic \
+ clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \
+ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \
+ dist-lzip dist-shar dist-tarZ dist-xz dist-zip dist-zstd \
+ distcheck distclean distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-binPROGRAMS \
+ install-binSCRIPTS install-data install-data-am \
+ install-data-hook install-dvi install-dvi-am install-exec \
+ install-exec-am install-exec-hook install-html install-html-am \
+ install-info install-info-am install-libLTLIBRARIES \
+ install-man install-man3 install-man5 \
install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \
install-pkgconfigDATA install-pkgincludeHEADERS install-ps \
install-ps-am install-strip installcheck installcheck-am \
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 000000000..5366a9a7e
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,4 @@
+# Default code reviewers picked from top 3 or more developers.
+# Please update this list if you find better candidates.
+scroggo@google.com
+include platform/system/core:/janitors/OWNERS
diff --git a/README b/README
index 0da5a5ef8..dedd2c163 100644
--- a/README
+++ b/README
@@ -1,56 +1,88 @@
-README for libpng version 1.6.34 - September 29, 2017 (shared library 16.0)
-See the note about version numbers near the top of png.h
+README for libpng version 1.6.40
+================================
-See INSTALL for instructions on how to install libpng.
+See the note about version numbers near the top of `png.h`.
+See `INSTALL` for instructions on how to install libpng.
-Libpng comes in several distribution formats. Get libpng-*.tar.gz or
-libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
-or lpng*.7z or lpng*.zip if you want DOS-style line endings.
+Libpng comes in several distribution formats. Get `libpng-*.tar.gz`
+or `libpng-*.tar.xz` if you want UNIX-style line endings in the text
+files, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.
-Version 0.89 was the first official release of libpng. Don't let the
-fact that it's the first release fool you. The libpng library has been in
-extensive use and testing since mid-1995. By late 1997 it had
-finally gotten to the stage where there hadn't been significant
-changes to the API in some time, and people have a bad feeling about
-libraries with versions < 1.0. Version 1.0.0 was released in
-March 1998.
+For a detailed description on using libpng, read `libpng-manual.txt`.
+For examples of libpng in a program, see `example.c` and `pngtest.c`.
+For usage information and restrictions (what little they are) on libpng,
+see `png.h`. For a description on using zlib (the compression library
+used by libpng) and zlib's restrictions, see `zlib.h`.
-****
-Note that some of the changes to the png_info structure render this
+You should use zlib 1.0.4 or later to run this, but it _may_ work with
+versions as old as zlib 0.95. Even so, there are bugs in older zlib
+versions which can cause the output of invalid compression streams for
+some images.
+
+You should also note that zlib is a compression library that is useful
+for more things than just PNG files. You can use zlib as a drop-in
+replacement for `fread()` and `fwrite()`, if you are so inclined.
+
+zlib should be available at the same place that libpng is, or at
+https://zlib.net .
+
+You may also want a copy of the PNG specification. It is available
+as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
+these at http://www.libpng.org/pub/png/pngdocs.html .
+
+This code is currently being archived at https://libpng.sourceforge.io
+in the download area, and at http://libpng.download/src .
+
+This release, based in a large way on Glenn's, Guy's and Andreas'
+earlier work, was created and will be supported by myself and the PNG
+development group.
+
+Send comments, corrections and commendations to `png-mng-implement`
+at `lists.sourceforge.net`. (Subscription is required; visit
+https://lists.sourceforge.net/lists/listinfo/png-mng-implement
+to subscribe.)
+
+Send general questions about the PNG specification to `png-mng-misc`
+at `lists.sourceforge.net`. (Subscription is required; visit
+https://lists.sourceforge.net/lists/listinfo/png-mng-misc
+to subscribe.)
+
+Historical notes
+----------------
+
+The libpng library has been in extensive use and testing since mid-1995.
+Version 0.89, published a year later, was the first official release.
+By late 1997, it had finally gotten to the stage where there hadn't
+been significant changes to the API in some time, and people have a bad
+feeling about libraries with versions below 1.0. Version 1.0.0 was
+released in March 1998.
+
+Note that some of the changes to the `png_info` structure render this
version of the library binary incompatible with libpng-0.89 or
earlier versions if you are using a shared library. The type of the
-"filler" parameter for png_set_filler() has changed from png_byte to
-png_uint_32, which will affect shared-library applications that use
-this function.
+`filler` parameter for `png_set_filler()` has changed from `png_byte`
+to `png_uint_32`, which will affect shared-library applications that
+use this function.
-To avoid problems with changes to the internals of the png info_struct,
+To avoid problems with changes to the internals of the `info_struct`,
new APIs have been made available in 0.95 to avoid direct application
-access to info_ptr. These functions are the png_set_<chunk> and
-png_get_<chunk> functions. These functions should be used when
-accessing/storing the info_struct data, rather than manipulating it
+access to `info_ptr`. These functions are the `png_set_<chunk>` and
+`png_get_<chunk>` functions. These functions should be used when
+accessing/storing the `info_struct` data, rather than manipulating it
directly, to avoid such problems in the future.
It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
-be a transitional release, members of the png_struct and the
-info_struct can still be accessed, but the compiler will issue a
+be a transitional release, members of the `png_struct` and the
+`info_struct` can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
-reside in private pngstruct.h and pnginfo.h header files that are not
-accessible to applications. It is strongly suggested that new
-programs use the new APIs (as shown in example.c and pngtest.c), and
-older programs be converted to the new format, to facilitate upgrades
-in the future.
-****
-
-Additions since 0.90 include the ability to compile libpng as a
-Windows DLL, and new APIs for accessing data in the info struct.
-Experimental functions include the ability to set weighting and cost
-factors for row filter selection, direct reads of integers from buffers
-on big-endian processors that support misaligned data access, faster
-methods of doing alpha composition, and more accurate 16->8 bit color
-conversion.
+reside in private `pngstruct.h` and `pnginfo.h` header files that are
+not accessible to applications. It is strongly suggested that new
+programs use the new APIs (as shown in `example.c` and `pngtest.c`),
+and older programs be converted to the new format, to facilitate
+upgrades in the future.
The additions since 0.89 include the ability to read from a PNG stream
which has had some (or all) of the signature bytes read by the calling
@@ -60,163 +92,91 @@ the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk.
-The changes made to the library, and bugs fixed are based on discussions
-on the PNG-implement mailing list and not on material submitted
-privately to Guy, Andreas, or Glenn. They will forward any good
-suggestions to the list.
-
-For a detailed description on using libpng, read libpng-manual.txt. For
-examples of libpng in a program, see example.c and pngtest.c. For usage
-information and restrictions (what little they are) on libpng, see
-png.h. For a description on using zlib (the compression library used by
-libpng) and zlib's restrictions, see zlib.h
-
-I have included a general makefile, as well as several machine and
-compiler specific ones, but you may have to modify one for your own needs.
-
-You should use zlib 1.0.4 or later to run this, but it MAY work with
-versions as old as zlib 0.95. Even so, there are bugs in older zlib
-versions which can cause the output of invalid compression streams for
-some images. You will definitely need zlib 1.0.4 or later if you are
-taking advantage of the MS-DOS "far" structure allocation for the small
-and medium memory models. You should also note that zlib is a
-compression library that is useful for more things than just PNG files.
-You can use zlib as a drop-in replacement for fread() and fwrite() if
-you are so inclined.
-
-zlib should be available at the same place that libpng is, or at zlib.net.
-
-You may also want a copy of the PNG specification. It is available
-as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
-these at http://www.libpng.org/pub/png/pngdocs.html .
-
-This code is currently being archived at libpng.sourceforge.io in the
-[DOWNLOAD] area, and at http://libpng.download/src . If you
-can't find it in any of those places, e-mail me, and I'll help you find it.
-
-I am not a lawyer, but I believe that the Export Control Classification
-Number (ECCN) for libpng is EAR99, which means not subject to export
-controls or International Traffic in Arms Regulations (ITAR) because it
-is open source, publicly available software, that does not contain any
-encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
-
-If you have any code changes, requests, problems, etc., please e-mail
-them to me. Also, I'd appreciate any make files or project files,
-and any modifications you needed to make to get libpng to compile,
-along with a #define variable to tell what compiler/system you are on.
-If you needed to add transformations to libpng, or wish libpng would
-provide the image in a different way, drop me a note (and code, if
-possible), so I can consider supporting the transformation.
-Finally, if you get any warning messages when compiling libpng
-(note: not zlib), and they are easy to fix, I'd appreciate the
-fix. Please mention "libpng" somewhere in the subject line. Thanks.
-
-This release was created and will be supported by myself (of course
-based in a large way on Guy's and Andreas' earlier work), and the PNG
-development group.
-
-Send comments/corrections/commendations to png-mng-implement at
-lists.sourceforge.net (subscription required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-implement
-to subscribe) or to glennrp at users.sourceforge.net
-
-You can't reach Guy, the original libpng author, at the addresses
-given in previous versions of this document. He and Andreas will
-read mail addressed to the png-implement list, however.
-
-Please do not send general questions about PNG. Send them to
-png-mng-misc at lists.sf.net (subscription required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
-subscribe). If you have a question about something
-in the PNG specification that is related to using libpng, send it
-to me. Send me any questions that start with "I was using libpng,
-and ...". If in doubt, send questions to me. I'll bounce them
-to others, if necessary.
-
-Please do not send suggestions on how to change PNG. We have
-been discussing PNG for twenty years now, and it is official and
-finished. If you have suggestions for libpng, however, I'll
-gladly listen. Even if your suggestion is not used immediately,
-it may be used later.
-
-Files in this distribution:
-
- ANNOUNCE => Announcement of this version, with recent changes
- CHANGES => Description of changes between libpng versions
- KNOWNBUG => List of known bugs and deficiencies
- LICENSE => License to use and redistribute libpng
- README => This file
- TODO => Things not implemented in the current library
- Y2KINFO => Statement of Y2K compliance
- example.c => Example code for using libpng functions
- libpng.3 => manual page for libpng (includes libpng-manual.txt)
- libpng-manual.txt => Description of libpng and its functions
- libpngpf.3 => manual page for libpng's private functions
- png.5 => manual page for the PNG format
- png.c => Basic interface functions common to library
- png.h => Library function and interface declarations (public)
- pngpriv.h => Library function and interface declarations (private)
- pngconf.h => System specific library configuration (public)
- pngstruct.h => png_struct declaration (private)
- pnginfo.h => png_info struct declaration (private)
- pngdebug.h => debugging macros (private)
- pngerror.c => Error/warning message I/O functions
- pngget.c => Functions for retrieving info from struct
- pngmem.c => Memory handling functions
- pngbar.png => PNG logo, 88x31
- pngnow.png => PNG logo, 98x31
- pngpread.c => Progressive reading functions
- pngread.c => Read data/helper high-level functions
- pngrio.c => Lowest-level data read I/O functions
- pngrtran.c => Read data transformation functions
- pngrutil.c => Read data utility functions
- pngset.c => Functions for storing data into the info_struct
- pngtest.c => Library test program
- pngtest.png => Library test sample image
- pngtrans.c => Common data transformation functions
- pngwio.c => Lowest-level write I/O functions
- pngwrite.c => High-level write functions
- pngwtran.c => Write data transformations
- pngwutil.c => Write utility functions
- arm => Contains optimized code for the ARM platform
- powerpc => Contains optimized code for the PowerPC platform
- contrib => Contributions
- arm-neon => Optimized code for ARM-NEON platform
- powerpc-vsx => Optimized code for POWERPC-VSX platform
- examples => Example programs
- gregbook => source code for PNG reading and writing, from
- Greg Roelofs' "PNG: The Definitive Guide",
- O'Reilly, 1999
- libtests => Test programs
- mips-msa => Optimized code for MIPS-MSA platform
- pngminim => Minimal decoder, encoder, and progressive decoder
- programs demonstrating use of pngusr.dfa
- pngminus => Simple pnm2png and png2pnm programs
- pngsuite => Test images
- testpngs
- tools => Various tools
- visupng => Contains a MSVC workspace for VisualPng
- intel => Optimized code for INTEL-SSE2 platform
- mips => Optimized code for MIPS platform
- projects => Contains project files and workspaces for
- building a DLL
- owatcom => Contains a WATCOM project for building libpng
- visualc71 => Contains a Microsoft Visual C++ (MSVC)
- workspace for building libpng and zlib
- vstudio => Contains a Microsoft Visual C++ (MSVC)
- workspace for building libpng and zlib
- scripts => Directory containing scripts for building libpng:
- (see scripts/README.txt for the list of scripts)
-
-Good luck, and happy coding.
-
--Glenn Randers-Pehrson (current maintainer, since 1998)
- Internet: glennrp at users.sourceforge.net
-
--Andreas Eric Dilger (former maintainer, 1996-1997)
- Internet: adilger at enel.ucalgary.ca
- Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
-
--Guy Eric Schalnat (original author and former maintainer, 1995-1996)
- (formerly of Group 42, Inc)
- Internet: gschal at infinet.com
+The additions since 0.90 include the ability to compile libpng as a
+Windows DLL, and new APIs for accessing data in the `info_struct`.
+Experimental functions included the ability to set weighting and cost
+factors for row filter selection, direct reads of integers from buffers
+on big-endian processors that support misaligned data access, faster
+methods of doing alpha composition, and more accurate 16-to-8 bit color
+conversion. Some of these experimental functions, such as the weighted
+filter heuristics, have since been removed.
+
+Files included in this distribution
+-----------------------------------
+
+ ANNOUNCE => Announcement of this version, with recent changes
+ AUTHORS => List of contributing authors
+ CHANGES => Description of changes between libpng versions
+ INSTALL => Instructions to install libpng
+ LICENSE => License to use and redistribute libpng
+ README => This file
+ TODO => Things not implemented in the current library
+ TRADEMARK => Trademark information
+ example.c => Example code for using libpng functions
+ libpng.3 => Manual page for libpng (includes libpng-manual.txt)
+ libpng-manual.txt => Description of libpng and its functions
+ libpngpf.3 => Manual page for libpng's private functions (deprecated)
+ png.5 => Manual page for the PNG format
+ png.c => Basic interface functions common to library
+ png.h => Library function and interface declarations (public)
+ pngpriv.h => Library function and interface declarations (private)
+ pngconf.h => System specific library configuration (public)
+ pngstruct.h => png_struct declaration (private)
+ pnginfo.h => png_info struct declaration (private)
+ pngdebug.h => debugging macros (private)
+ pngerror.c => Error/warning message I/O functions
+ pngget.c => Functions for retrieving info from struct
+ pngmem.c => Memory handling functions
+ pngbar.png => PNG logo, 88x31
+ pngnow.png => PNG logo, 98x31
+ pngpread.c => Progressive reading functions
+ pngread.c => Read data/helper high-level functions
+ pngrio.c => Lowest-level data read I/O functions
+ pngrtran.c => Read data transformation functions
+ pngrutil.c => Read data utility functions
+ pngset.c => Functions for storing data into the info_struct
+ pngtest.c => Library test program
+ pngtest.png => Library test sample image
+ pngtrans.c => Common data transformation functions
+ pngwio.c => Lowest-level write I/O functions
+ 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
+ ci/ => Scripts for continuous integration
+ contrib/ => External contributions
+ arm-neon/ => Optimized code for the ARM-NEON platform
+ mips-msa/ => Optimized code for the MIPS-MSA platform
+ powerpc-vsx/ => Optimized code for the POWERPC-VSX platform
+ examples/ => Examples of libpng usage
+ gregbook/ => Source code for PNG reading and writing, from
+ "PNG: The Definitive Guide" by Greg Roelofs,
+ O'Reilly, 1999
+ libtests/ => Test programs
+ oss-fuzz/ => Files used by the OSS-Fuzz project for fuzz-testing
+ libpng
+ pngminim/ => Minimal decoder, encoder, and progressive decoder
+ programs demonstrating the use of pngusr.dfa
+ pngminus/ => Simple pnm2png and png2pnm programs
+ pngsuite/ => Test images
+ testpngs/ => Test images
+ tools/ => Various tools
+ visupng/ => VisualPng, a Windows viewer for PNG images
+ projects/ => Project files and workspaces for various IDEs
+ owatcom/ => OpenWatcom project
+ visualc71/ => Microsoft Visual C++ 7.1 workspace
+ vstudio/ => Microsoft Visual Studio workspace
+ scripts/ => Scripts and makefiles for building libpng
+ (see scripts/README.txt for the complete list)
+ tests/ => Test scripts
+
+Good luck, and happy coding!
+
+ * Cosmin Truta (current maintainer, since 2018)
+ * Glenn Randers-Pehrson (former maintainer, 1998-2018)
+ * Andreas Eric Dilger (former maintainer, 1996-1997)
+ * Guy Eric Schalnat (original author and former maintainer, 1995-1996)
+ (formerly of Group 42, Inc.)
diff --git a/README.android b/README.android
index 5f94dc96e..25d01e61b 100644
--- a/README.android
+++ b/README.android
@@ -1,12 +1,13 @@
-Any Android specific modifications to upstream libpng (1.6.34) should
-be listed here:
+Any Android specific modifications to upstream libpng (the version
+specified in METADATA) should be listed here:
(1) Android has added the following files.
pngusr.h
Android.bp
CleanSpec.mk
MODULE_LICENSE_BSD_LIKE
- README.version
+ METADATA
+ OWNERS
(2) pnglibconf.h
This is copied from scripts/pnglibconf.h.prebuilt.
diff --git a/README.version b/README.version
deleted file mode 100644
index ab95c6da5..000000000
--- a/README.version
+++ /dev/null
@@ -1,3 +0,0 @@
-URL: http://libpng.download/src/libpng16/libpng-1.6.34.tar.gz
-Version: 1.6.34
-BugComponent: 87896
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 000000000..10bd0ee90
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "presubmit": [
+ {
+ "name": "CtsGraphicsTestCases"
+ }
+ ]
+}
diff --git a/TODO b/TODO
index 36d6092a2..562dab069 100644
--- a/TODO
+++ b/TODO
@@ -1,30 +1,23 @@
-/*
TODO - list of things to do for libpng:
-Final bug fixes.
-Better C++ wrapper/full C++ implementation?
-Fix problem with C++ and EXTERN "C".
-cHRM transformation.
-Remove setjmp/longjmp usage in favor of returning error codes. As a start on
- this, minimize the use of png_error(), replacing them with
- png_warning(); return(0); or similar.
-Palette creation.
-Add "grayscale->palette" transformation and "palette->grayscale" detection.
-Improved dithering.
-Multi-lingual error and warning message support.
-Complete sRGB transformation (presently it simply uses gamma=0.45455).
-Man pages for function calls.
-Better documentation.
-Better filter selection
- (counting huffman bits/precompression? filter inertia? filter costs?).
-Histogram creation.
-Text conversion between different code pages (Latin-1 -> Mac and DOS).
-Avoid building gamma tables whenever possible.
-Use greater precision when changing to linear gamma for compositing against
- background and doing rgb-to-gray transformation.
-Investigate pre-incremented loop counters and other loop constructions.
-Add interpolated method of handling interlacing.
-Extend pngvalid.c to validate more of the libpng transformations.
-Refactor preprocessor conditionals to compile entire statements
-
-*/
+* Fix all defects (duh!)
+* Better C++ wrapper / full C++ implementation (?)
+* Fix the problems with C++ and 'extern "C"'.
+* cHRM transformation.
+* Palette creation.
+* "grayscale->palette" transformation and "palette->grayscale" detection.
+* Improved dithering.
+* Multi-lingual error and warning message support.
+* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
+* Man pages for function calls.
+* Better documentation.
+* Better filter selection
+ (e.g., counting huffman bits/precompression; filter inertia; filter costs).
+* Histogram creation.
+* Text conversion between different code pages (e.g., Latin-1 -> Mac).
+* Avoid building gamma tables whenever possible.
+* Greater precision in changing to linear gamma for compositing against
+ background, and in doing rgb-to-gray transformations.
+* Investigate pre-incremented loop counters and other loop constructions.
+* Interpolated method of handling interlacing.
+* More validations for libpng transformations.
diff --git a/TRADEMARK b/TRADEMARK
new file mode 100644
index 000000000..ac667187d
--- /dev/null
+++ b/TRADEMARK
@@ -0,0 +1,8 @@
+TRADEMARK
+=========
+
+The name "libpng" has not been registered by the Copyright owners
+as a trademark in any jurisdiction. However, because libpng has
+been distributed and maintained world-wide, continually since 1995,
+the Copyright owners claim "common-law trademark protection" in any
+jurisdiction where common-law trademark is recognized.
diff --git a/aclocal.m4 b/aclocal.m4
index 0ea1ad324..89201a2d9 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,13 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Figure out how to run the assembler. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -130,7 +130,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -161,7 +161,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -352,13 +352,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -366,49 +365,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE="gmake" (or whatever is
+ necessary). You can also try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -417,18 +410,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -456,6 +448,10 @@ m4_defn([AC_PROG_CC])
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
+m4_ifdef([_$0_ALREADY_INIT],
+ [m4_fatal([$0 expanded multiple times
+]m4_defn([_$0_ALREADY_INIT]))],
+ [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -492,7 +488,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
@@ -515,8 +511,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
@@ -544,6 +540,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
@@ -583,7 +593,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -625,7 +635,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -646,7 +656,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -668,7 +678,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -703,7 +713,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -711,49 +721,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# AM_MAKE_INCLUDE()
# -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -774,12 +777,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@@ -792,7 +790,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -821,7 +819,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -868,7 +866,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -887,7 +885,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -968,7 +966,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1028,7 +1026,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1056,7 +1054,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1075,7 +1073,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/arm/arm_init.c b/arm/arm_init.c
index 02df812e7..84d05556f 100644
--- a/arm/arm_init.c
+++ b/arm/arm_init.c
@@ -1,17 +1,16 @@
/* arm_init.c - NEON optimised filter functions
*
+ * Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.6.22 [May 26, 2016]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
-/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
- * called.
- */
+
+/* This module requires POSIX 1003.1 functions. */
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
@@ -32,21 +31,26 @@
* has partial support is contrib/arm-neon/linux.c - a generic Linux
* implementation which reads /proc/cpufino.
*/
+#include <signal.h> /* for sig_atomic_t */
+
#ifndef PNG_ARM_NEON_FILE
-# ifdef __linux__
-# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
+# if defined(__aarch64__) || defined(_M_ARM64)
+ /* ARM Neon is expected to be unconditionally available on ARM64. */
+# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
+# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
+ /* ARM Neon is expected to be available on the target CPU architecture. */
+# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
+# elif defined(__linux__)
+# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
+# else
+# error "No support for run-time ARM Neon checking; use compile-time options"
# endif
#endif
-#ifdef PNG_ARM_NEON_FILE
-
-#include <signal.h> /* for sig_atomic_t */
static int png_have_neon(png_structp png_ptr);
-#include PNG_ARM_NEON_FILE
-
-#else /* PNG_ARM_NEON_FILE */
-# error "PNG_ARM_NEON_FILE undefined: no support for run-time ARM NEON checks"
-#endif /* PNG_ARM_NEON_FILE */
+#ifdef PNG_ARM_NEON_FILE
+# include PNG_ARM_NEON_FILE
+#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
diff --git a/arm/filter_neon.S b/arm/filter_neon.S
index 000764cd2..2308aad13 100644
--- a/arm/filter_neon.S
+++ b/arm/filter_neon.S
@@ -1,9 +1,9 @@
/* filter_neon.S - NEON optimised filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2014,2017 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.6.31 [July 27, 2017]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
diff --git a/arm/filter_neon_intrinsics.c b/arm/filter_neon_intrinsics.c
index ea7e356bc..4466d48b2 100644
--- a/arm/filter_neon_intrinsics.c
+++ b/arm/filter_neon_intrinsics.c
@@ -1,12 +1,11 @@
/* filter_neon_intrinsics.c - NEON optimised filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Written by James Yu <james.yu at linaro.org>, October 2013.
* Based on filter_neon.S, written by Mans Rullgard, 2011.
*
- * Last changed in libpng 1.6.22 [May 26, 2016]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -19,7 +18,11 @@
/* This code requires -mfpu=neon on the command line: */
#if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-#include <arm_neon.h>
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+# include <arm64_neon.h>
+#else
+# include <arm_neon.h>
+#endif
/* libpng row pointers are not necessarily aligned to any particular boundary,
* however this code will only work with appropriate alignment. arm/arm_init.c
@@ -33,6 +36,11 @@
* 'type'. This is written this way just to hide the GCC strict aliasing
* warning; note that the code is safe because there never is an alias between
* the input and output pointers.
+ *
+ * When compiling with MSVC ARM64, the png_ldr macro can't be passed directly
+ * to vst4_lane_u32, because of an internal compiler error inside MSVC.
+ * To avoid this compiler bug, we use a temporary variable (vdest_val) to store
+ * the result of png_ldr.
*/
#define png_ldr(type,pointer)\
(temp_pointer = png_ptr(type,pointer), *temp_pointer)
@@ -125,12 +133,15 @@ png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row,
uint8x8x4_t *vrpt = png_ptr(uint8x8x4_t,&vtmp);
uint8x8x4_t vrp = *vrpt;
uint32x2x4_t *temp_pointer;
+ uint32x2x4_t vdest_val;
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
vdest.val[1] = vadd_u8(vdest.val[0], vrp.val[1]);
vdest.val[2] = vadd_u8(vdest.val[1], vrp.val[2]);
vdest.val[3] = vadd_u8(vdest.val[2], vrp.val[3]);
- vst4_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2x4_t,&vdest), 0);
+
+ vdest_val = png_ldr(uint32x2x4_t, &vdest);
+ vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
}
PNG_UNUSED(prev_row)
@@ -223,6 +234,7 @@ png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row,
uint8x8x4_t *vrpt, *vppt;
uint8x8x4_t vrp, vpp;
uint32x2x4_t *temp_pointer;
+ uint32x2x4_t vdest_val;
vtmp = vld4_u32(png_ptr(uint32_t,rp));
vrpt = png_ptr(uint8x8x4_t,&vtmp);
@@ -240,7 +252,8 @@ png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row,
vdest.val[3] = vhadd_u8(vdest.val[2], vpp.val[3]);
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
- vst4_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2x4_t,&vdest), 0);
+ vdest_val = png_ldr(uint32x2x4_t, &vdest);
+ vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
}
}
@@ -359,6 +372,7 @@ png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row,
uint8x8x4_t *vrpt, *vppt;
uint8x8x4_t vrp, vpp;
uint32x2x4_t *temp_pointer;
+ uint32x2x4_t vdest_val;
vtmp = vld4_u32(png_ptr(uint32_t,rp));
vrpt = png_ptr(uint8x8x4_t,&vtmp);
@@ -378,7 +392,8 @@ png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row,
vlast = vpp.val[3];
- vst4_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2x4_t,&vdest), 0);
+ vdest_val = png_ldr(uint32x2x4_t, &vdest);
+ vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
}
}
diff --git a/arm/palette_neon_intrinsics.c b/arm/palette_neon_intrinsics.c
new file mode 100644
index 000000000..92c7d6f9f
--- /dev/null
+++ b/arm/palette_neon_intrinsics.c
@@ -0,0 +1,151 @@
+
+/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
+ *
+ * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
+ * Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
+ *
+ * This code is released under the libpng license.
+ * For conditions of distribution and use, see the disclaimer
+ * and license in png.h
+ */
+
+#include "../pngpriv.h"
+
+#if PNG_ARM_NEON_IMPLEMENTATION == 1
+
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+# include <arm64_neon.h>
+#else
+# include <arm_neon.h>
+#endif
+
+/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
+void
+png_riffle_palette_neon(png_structrp png_ptr)
+{
+ png_const_colorp palette = png_ptr->palette;
+ png_bytep riffled_palette = png_ptr->riffled_palette;
+ png_const_bytep trans_alpha = png_ptr->trans_alpha;
+ int num_trans = png_ptr->num_trans;
+ int i;
+
+ /* Initially black, opaque. */
+ uint8x16x4_t w = {{
+ vdupq_n_u8(0x00),
+ vdupq_n_u8(0x00),
+ vdupq_n_u8(0x00),
+ vdupq_n_u8(0xff),
+ }};
+
+ png_debug(1, "in png_riffle_palette_neon");
+
+ /* First, riffle the RGB colours into an RGBA8 palette.
+ * The alpha component is set to opaque for now.
+ */
+ for (i = 0; i < 256; i += 16)
+ {
+ uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
+ w.val[0] = v.val[0];
+ w.val[1] = v.val[1];
+ w.val[2] = v.val[2];
+ vst4q_u8(riffled_palette + (i << 2), w);
+ }
+
+ /* Fix up the missing transparency values. */
+ for (i = 0; i < num_trans; i++)
+ riffled_palette[(i << 2) + 3] = trans_alpha[i];
+}
+
+/* Expands a palettized row into RGBA8. */
+int
+png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
+ png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
+{
+ png_uint_32 row_width = row_info->width;
+ const png_uint_32 *riffled_palette =
+ (const png_uint_32 *)png_ptr->riffled_palette;
+ const png_uint_32 pixels_per_chunk = 4;
+ png_uint_32 i;
+
+ png_debug(1, "in png_do_expand_palette_rgba8_neon");
+
+ PNG_UNUSED(row)
+ if (row_width < pixels_per_chunk)
+ return 0;
+
+ /* This function originally gets the last byte of the output row.
+ * The NEON part writes forward from a given position, so we have
+ * to seek this back by 4 pixels x 4 bytes.
+ */
+ *ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1);
+
+ for (i = 0; i < row_width; i += pixels_per_chunk)
+ {
+ uint32x4_t cur;
+ png_bytep sp = *ssp - i, dp = *ddp - (i << 2);
+ cur = vld1q_dup_u32 (riffled_palette + *(sp - 3));
+ cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1);
+ cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2);
+ cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3);
+ vst1q_u32((void *)dp, cur);
+ }
+ if (i != row_width)
+ {
+ /* Remove the amount that wasn't processed. */
+ i -= pixels_per_chunk;
+ }
+
+ /* Decrement output pointers. */
+ *ssp = *ssp - i;
+ *ddp = *ddp - (i << 2);
+ return i;
+}
+
+/* Expands a palettized row into RGB8. */
+int
+png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
+ png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
+{
+ png_uint_32 row_width = row_info->width;
+ png_const_bytep palette = (png_const_bytep)png_ptr->palette;
+ const png_uint_32 pixels_per_chunk = 8;
+ png_uint_32 i;
+
+ png_debug(1, "in png_do_expand_palette_rgb8_neon");
+
+ PNG_UNUSED(row)
+ if (row_width <= pixels_per_chunk)
+ return 0;
+
+ /* Seeking this back by 8 pixels x 3 bytes. */
+ *ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1);
+
+ for (i = 0; i < row_width; i += pixels_per_chunk)
+ {
+ uint8x8x3_t cur;
+ png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i);
+ cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7)));
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1);
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2);
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3);
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4);
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5);
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6);
+ cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7);
+ vst3_u8((void *)dp, cur);
+ }
+
+ if (i != row_width)
+ {
+ /* Remove the amount that wasn't processed. */
+ i -= pixels_per_chunk;
+ }
+
+ /* Decrement output pointers. */
+ *ssp = *ssp - i;
+ *ddp = *ddp - ((i << 1) + i);
+ return i;
+}
+
+#endif /* PNG_ARM_NEON_IMPLEMENTATION */
diff --git a/autogen.sh b/autogen.sh
index 91607171b..9c8830a6e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -77,7 +77,7 @@ libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
config.sub configure depcomp install-sh ltmain.sh missing\
test-driver"
#
-# Files generated by versions of configue >2.68 or automake >1.13 (i.e. later
+# Files generated by versions of autoconf >2.68 or automake >1.13 (i.e. later
# versions than those required by configure.ac):
libpng_autotools_extra="compile config.h.in~"
#
@@ -194,7 +194,7 @@ case "$mode" in
if test -d .git
then
exec >&2
- echo "ERROR: running autoreconf on an initialized sytem"
+ echo "ERROR: running autoreconf on an initialized system"
echo " This is not necessary; it is only necessary to remake the"
echo " autotools generated files if Makefile.am or configure.ac"
echo " change and make does the right thing with:"
diff --git a/ci/ci_verify_cmake.sh b/ci/ci_verify_cmake.sh
new file mode 100755
index 000000000..4e11addfb
--- /dev/null
+++ b/ci/ci_verify_cmake.sh
@@ -0,0 +1,180 @@
+#!/usr/bin/env bash
+set -e
+
+# ci_verify_cmake.sh
+# Continuously integrate libpng using CMake.
+#
+# Copyright (c) 2019-2023 Cosmin Truta.
+#
+# This software is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h.
+
+CI_SCRIPTNAME="$(basename "$0")"
+CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
+CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")"
+CI_BUILDDIR="$CI_SRCDIR/out/ci_verify_cmake.build"
+CI_INSTALLDIR="$CI_SRCDIR/out/ci_verify_cmake.install"
+
+# Keep the following relative paths in sync with the absolute paths.
+# We use them for the benefit of native Windows tools that might be
+# otherwise confused by the path encoding used by Bash-on-Windows.
+CI_SRCDIR_FROM_BUILDDIR="../.."
+CI_INSTALLDIR_FROM_BUILDDIR="../ci_verify_cmake.install"
+
+function ci_info {
+ printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*"
+}
+
+function ci_err {
+ printf >&2 "%s: error: %s\\n" "$CI_SCRIPTNAME" "$*"
+ exit 2
+}
+
+function ci_spawn {
+ printf >&2 "%s: executing:" "$CI_SCRIPTNAME"
+ printf >&2 " %q" "$@"
+ printf >&2 "\\n"
+ "$@"
+}
+
+function ci_init_cmake_build {
+ CI_SYSTEM_NAME="$(uname -s)"
+ CI_MACHINE_NAME="$(uname -m)"
+ 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
+ # environment variables, to avoid confusing MSBuild.
+ [[ $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_err "missing: \$CI_CMAKE_GENERATOR_PLATFORM"
+ fi
+}
+
+function ci_trace_cmake_build {
+ ci_info "## START OF CONFIGURATION ##"
+ ci_info "system name: $CI_SYSTEM_NAME"
+ ci_info "machine hardware name: $CI_MACHINE_NAME"
+ ci_info "source directory: $CI_SRCDIR"
+ ci_info "build directory: $CI_BUILDDIR"
+ ci_info "install directory: $CI_INSTALLDIR"
+ ci_info "environment option: \$CI_CMAKE: '$CI_CMAKE'"
+ ci_info "environment option: \$CI_CMAKE_GENERATOR: '$CI_CMAKE_GENERATOR'"
+ ci_info "environment option: \$CI_CMAKE_GENERATOR_PLATFORM: '$CI_CMAKE_GENERATOR_PLATFORM'"
+ ci_info "environment option: \$CI_CMAKE_BUILD_TYPE: '$CI_CMAKE_BUILD_TYPE'"
+ ci_info "environment option: \$CI_CMAKE_BUILD_FLAGS: '$CI_CMAKE_BUILD_FLAGS'"
+ ci_info "environment option: \$CI_CMAKE_TOOLCHAIN_FILE: '$CI_CMAKE_TOOLCHAIN_FILE'"
+ ci_info "environment option: \$CI_CMAKE_VARS: '$CI_CMAKE_VARS'"
+ ci_info "environment option: \$CI_CTEST: '$CI_CTEST'"
+ ci_info "environment option: \$CI_CTEST_FLAGS: '$CI_CTEST_FLAGS'"
+ ci_info "environment option: \$CI_CC: '$CI_CC'"
+ ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
+ 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_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_info "executable: \$CI_CC: $(command -V "$CI_CC")"
+ [[ $CI_AR ]] &&
+ ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
+ [[ $CI_RANLIB ]] &&
+ ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
+ ci_info "## END OF CONFIGURATION ##"
+}
+
+function ci_cleanup_old_cmake_build {
+ [[ ! -e $CI_BUILDDIR ]] ||
+ ci_spawn rm -fr "$CI_BUILDDIR"
+ [[ ! -e $CI_INSTALLDIR ]] ||
+ ci_spawn rm -fr "$CI_INSTALLDIR"
+}
+
+function ci_build_cmake {
+ 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")
+ [[ $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)
+ [[ $CI_NO_TEST ]] &&
+ ALL_CMAKE_VARS+=(-DPNG_TESTS=OFF)
+ 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_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
+ [[ $CI_CMAKE_GENERATOR_PLATFORM ]] &&
+ ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
+ # Build and install.
+ # Use $CI_SRCDIR_FROM_BUILDDIR and $CI_INSTALLDIR_FROM_BUILDDIR
+ # instead of $CI_SRCDIR and $CI_INSTALLDIR from this point onwards.
+ ci_spawn mkdir -p "$CI_BUILDDIR"
+ ci_spawn cd "$CI_BUILDDIR"
+ [[ $CI_SRCDIR -ef $CI_SRCDIR_FROM_BUILDDIR ]] ||
+ ci_err "assertion failed: testing: '$CI_SRCDIR' -ef '$CI_SRCDIR_FROM_BUILDDIR'"
+ ci_spawn mkdir -p "$CI_INSTALLDIR"
+ [[ $CI_INSTALLDIR -ef $CI_INSTALLDIR_FROM_BUILDDIR ]] ||
+ ci_err "assertion failed: testing: '$CI_INSTALLDIR' -ef '$CI_INSTALLDIR_FROM_BUILDDIR'"
+ ci_spawn "$CI_CMAKE" -DCMAKE_INSTALL_PREFIX="$CI_INSTALLDIR_FROM_BUILDDIR" \
+ "${ALL_CMAKE_VARS[@]}" \
+ "$CI_SRCDIR_FROM_BUILDDIR"
+ ci_spawn "$CI_CMAKE" --build . \
+ --config "$CI_CMAKE_BUILD_TYPE" \
+ "${ALL_CMAKE_BUILD_FLAGS[@]}"
+ [[ $CI_NO_TEST ]] ||
+ ci_spawn "$CI_CTEST" --build-config "$CI_CMAKE_BUILD_TYPE" \
+ "${ALL_CTEST_FLAGS[@]}"
+ [[ $CI_NO_INSTALL ]] ||
+ ci_spawn "$CI_CMAKE" --build . \
+ --config "$CI_CMAKE_BUILD_TYPE" \
+ --target install \
+ "${ALL_CMAKE_BUILD_FLAGS[@]}"
+ [[ $CI_NO_CLEAN ]] ||
+ ci_spawn "$CI_CMAKE" --build . \
+ --config "$CI_CMAKE_BUILD_TYPE" \
+ --target clean \
+ "${ALL_CMAKE_BUILD_FLAGS[@]}"
+ ci_info "## END OF BUILD ##"
+}
+
+function main {
+ [[ $# -eq 0 ]] || {
+ ci_info "note: this program accepts environment options only"
+ ci_err "unexpected command arguments: '$*'"
+ }
+ ci_init_cmake_build
+ ci_trace_cmake_build
+ ci_cleanup_old_cmake_build
+ ci_build_cmake
+}
+
+main "$@"
diff --git a/ci/ci_verify_configure.sh b/ci/ci_verify_configure.sh
new file mode 100755
index 000000000..a8e88787a
--- /dev/null
+++ b/ci/ci_verify_configure.sh
@@ -0,0 +1,128 @@
+#!/usr/bin/env bash
+set -e
+
+# ci_verify_configure.sh
+# Continuously integrate libpng using the configure script.
+#
+# Copyright (c) 2019-2023 Cosmin Truta.
+#
+# This software is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h.
+
+CI_SCRIPTNAME="$(basename "$0")"
+CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
+CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")"
+CI_BUILDDIR="$CI_SRCDIR/out/ci_verify_configure.build"
+CI_INSTALLDIR="$CI_SRCDIR/out/ci_verify_configure.install"
+
+function ci_info {
+ printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*"
+}
+
+function ci_err {
+ printf >&2 "%s: error: %s\\n" "$CI_SCRIPTNAME" "$*"
+ exit 2
+}
+
+function ci_spawn {
+ printf >&2 "%s: executing:" "$CI_SCRIPTNAME"
+ printf >&2 " %q" "$@"
+ printf >&2 "\\n"
+ "$@"
+}
+
+function ci_init_configure_build {
+ CI_SYSTEM_NAME="$(uname -s)"
+ CI_MACHINE_NAME="$(uname -m)"
+ CI_MAKE="${CI_MAKE:-make}"
+ # Set CI_CC to cc by default, if the cc command is available.
+ # The configure script defaults CC to gcc, which is not always a good idea.
+ [[ -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_err "unexpected: \$CI_CONFIGURE_VARS='$CI_CONFIGURE_VARS'"
+ [[ ! $CI_MAKE_VARS ]] || ci_err "unexpected: \$CI_MAKE_VARS='$CI_MAKE_VARS'"
+}
+
+function ci_trace_configure_build {
+ ci_info "## START OF CONFIGURATION ##"
+ ci_info "system name: $CI_SYSTEM_NAME"
+ ci_info "machine hardware name: $CI_MACHINE_NAME"
+ ci_info "source directory: $CI_SRCDIR"
+ ci_info "build directory: $CI_BUILDDIR"
+ ci_info "install directory: $CI_INSTALLDIR"
+ ci_info "environment option: \$CI_CONFIGURE_FLAGS: '$CI_CONFIGURE_FLAGS'"
+ ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
+ ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
+ ci_info "environment option: \$CI_CC: '$CI_CC'"
+ ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
+ ci_info "environment option: \$CI_CPP: '$CI_CPP'"
+ ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
+ ci_info "environment option: \$CI_AR: '$CI_AR'"
+ ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
+ 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_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_info "executable: \$CI_CC: $(command -V "$CI_CC")"
+ [[ $CI_CPP ]] &&
+ ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
+ [[ $CI_AR ]] &&
+ ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
+ [[ $CI_RANLIB ]] &&
+ ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
+ [[ $CI_LD ]] &&
+ ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
+ ci_info "## END OF CONFIGURATION ##"
+}
+
+function ci_cleanup_old_configure_build {
+ [[ ! -e $CI_BUILDDIR ]] ||
+ ci_spawn rm -fr "$CI_BUILDDIR"
+ [[ ! -e $CI_INSTALLDIR ]] ||
+ ci_spawn rm -fr "$CI_INSTALLDIR"
+}
+
+function ci_build_configure {
+ ci_info "## START OF BUILD ##"
+ # Export the configure build environment.
+ [[ $CI_CC ]] && ci_spawn export CC="$CI_CC"
+ [[ $CI_CC_FLAGS ]] && ci_spawn export CFLAGS="$CI_CC_FLAGS"
+ [[ $CI_CPP ]] && ci_spawn export CPP="$CI_CPP"
+ [[ $CI_CPP_FLAGS ]] && ci_spawn export CPPFLAGS="$CI_CPP_FLAGS"
+ [[ $CI_AR ]] && ci_spawn export AR="$CI_AR"
+ [[ $CI_RANLIB ]] && ci_spawn export RANLIB="$CI_RANLIB"
+ [[ $CI_LD ]] && ci_spawn export CPP="$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"
+ }
+ # Build and install.
+ ci_spawn mkdir -p "$CI_BUILDDIR"
+ ci_spawn cd "$CI_BUILDDIR"
+ ci_spawn "$CI_SRCDIR/configure" --prefix="$CI_INSTALLDIR" $CI_CONFIGURE_FLAGS
+ ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS
+ [[ $CI_NO_TEST ]] || ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS test
+ [[ $CI_NO_INSTALL ]] || ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS install
+ [[ $CI_NO_CLEAN ]] || ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS clean
+ [[ $CI_NO_CLEAN ]] || ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS distclean
+ ci_info "## END OF BUILD ##"
+}
+
+function main {
+ [[ $# -eq 0 ]] || {
+ ci_info "note: this program accepts environment options only"
+ ci_err "unexpected command arguments: '$*'"
+ }
+ ci_init_configure_build
+ ci_trace_configure_build
+ ci_cleanup_old_configure_build
+ ci_build_configure
+}
+
+main "$@"
diff --git a/ci/ci_verify_makefiles.sh b/ci/ci_verify_makefiles.sh
new file mode 100755
index 000000000..78e7469d7
--- /dev/null
+++ b/ci/ci_verify_makefiles.sh
@@ -0,0 +1,154 @@
+#!/usr/bin/env bash
+set -e
+
+# ci_verify_makefiles.sh
+# Continuously integrate libpng using the legacy makefiles.
+#
+# Copyright (c) 2019-2023 Cosmin Truta.
+#
+# This software is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h.
+
+CI_SCRIPTNAME="$(basename "$0")"
+CI_SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
+CI_SRCDIR="$(dirname "$CI_SCRIPTDIR")"
+
+function ci_info {
+ printf >&2 "%s: %s\\n" "$CI_SCRIPTNAME" "$*"
+}
+
+function ci_err {
+ printf >&2 "%s: error: %s\\n" "$CI_SCRIPTNAME" "$*"
+ exit 2
+}
+
+function ci_spawn {
+ printf >&2 "%s: executing:" "$CI_SCRIPTNAME"
+ printf >&2 " %q" "$@"
+ printf >&2 "\\n"
+ "$@"
+}
+
+function ci_init_makefiles_build {
+ CI_SYSTEM_NAME="$(uname -s)"
+ CI_MACHINE_NAME="$(uname -m)"
+ CI_MAKE="${CI_MAKE:-make}"
+ case "$CI_CC" in
+ ( *clang* )
+ CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.clang"}" ;;
+ ( *gcc* )
+ CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.gcc"}" ;;
+ ( * )
+ CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.std"}" ;;
+ esac
+}
+
+function ci_trace_makefiles_build {
+ ci_info "## START OF CONFIGURATION ##"
+ ci_info "system name: $CI_SYSTEM_NAME"
+ ci_info "machine hardware name: $CI_MACHINE_NAME"
+ ci_info "source directory: $CI_SRCDIR"
+ ci_info "environment option: \$CI_MAKEFILES: '$CI_MAKEFILES'"
+ ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
+ ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
+ ci_info "environment option: \$CI_MAKE_VARS: '$CI_MAKE_VARS'"
+ ci_info "environment option: \$CI_CC: '$CI_CC'"
+ ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
+ ci_info "environment option: \$CI_CPP: '$CI_CPP'"
+ ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
+ ci_info "environment option: \$CI_AR: '$CI_AR'"
+ ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
+ ci_info "environment option: \$CI_LD: '$CI_LD'"
+ 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_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_info "executable: \$CI_CC: $(command -V "$CI_CC")"
+ [[ $CI_CPP ]] &&
+ ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
+ [[ $CI_AR ]] &&
+ ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
+ [[ $CI_RANLIB ]] &&
+ ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
+ [[ $CI_LD ]] &&
+ ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
+ ci_info "## END OF CONFIGURATION ##"
+}
+
+function ci_cleanup_old_makefiles_build {
+ # Any old makefile-based build will most likely leave a mess
+ # of object files behind if interrupted, e.g., via Ctrl+C.
+ # There may be other files behind, depending on what makefile
+ # had been used. We cannot easily enumerate all of those.
+ # Fortunately, for a clean makefiles-based build, it should be
+ # sufficient to remove the old object files only.
+ [[ -z $(find "$CI_SRCDIR" -maxdepth 1 -name "*.o") ]] ||
+ ci_spawn rm -f "$CI_SRCDIR"/*.o
+ [[ -z $(find "$CI_SRCDIR" -maxdepth 1 -name "*.obj") ]] ||
+ ci_spawn rm -f "$CI_SRCDIR"/*.obj
+}
+
+function ci_build_makefiles {
+ 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 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!
+ cd "$CI_SRCDIR"
+ local MY_MAKEFILE
+ for MY_MAKEFILE in $CI_MAKEFILES
+ do
+ ci_info "using makefile: $MY_MAKEFILE"
+ ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
+ "${ALL_MAKE_FLAGS[@]}" \
+ "${ALL_MAKE_VARS[@]}"
+ [[ $CI_NO_TEST ]] ||
+ ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
+ "${ALL_MAKE_FLAGS[@]}" \
+ "${ALL_MAKE_VARS[@]}" \
+ test
+ [[ $CI_NO_CLEAN ]] ||
+ ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
+ "${ALL_MAKE_FLAGS[@]}" \
+ "${ALL_MAKE_VARS[@]}" \
+ clean
+ done
+ ci_info "## END OF BUILD ##"
+}
+
+function main {
+ [[ $# -eq 0 ]] || {
+ ci_info "note: this program accepts environment options only"
+ ci_err "unexpected command arguments: '$*'"
+ }
+ ci_init_makefiles_build
+ ci_trace_makefiles_build
+ ci_cleanup_old_makefiles_build
+ ci_build_makefiles
+}
+
+main "$@"
diff --git a/compile b/compile
index a85b723c7..df363c8fb 100755
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/config.guess b/config.guess
index 6c32c8645..e81d3ae7c 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2014-11-04'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2021-06-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@ timestamp='2014-11-04'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -27,11 +29,19 @@ timestamp='2014-11-04'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to <config-patches@gnu.org>.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
@@ -39,7 +49,7 @@ Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -50,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,7 +94,8 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
+# Just in case it came from the environment.
+GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
@@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039,SC3028
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD=$driver
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
+ LIBC=unknown
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
- #else
+ #elif defined(__GLIBC__)
LIBC=gnu
+ #else
+ #include <stdarg.h>
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$cc_set_libc"
+
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
+ fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -167,22 +202,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ echo unknown)`
+ case $UNAME_MACHINE_ARCH in
+ aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
+ *) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -197,45 +242,80 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
+ GUESS=$machine-${os}${release}${abi-}
+ ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+ ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+ ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+ ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+ ;;
+ *:MidnightBSD:*:*)
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+ ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+ ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+ ;;
+ *:OS108:*:*)
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+ ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+ ;;
+ *:Sortix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-sortix
+ ;;
+ *:Twizzler:*:*)
+ GUESS=$UNAME_MACHINE-unknown-twizzler
+ ;;
+ *:Redox:*:*)
+ GUESS=$UNAME_MACHINE-unknown-redox
+ ;;
+ mips:OSF1:*.*)
+ GUESS=mips-dec-osf1
+ ;;
alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -249,163 +329,158 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
+ case $ALPHA_CPU_TYPE in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
+ ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
+ GUESS=m68k-unknown-sysv4
+ ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-amigaos
+ ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-morphos
+ ;;
*:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
+ GUESS=i370-ibm-openedition
+ ;;
*:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
+ GUESS=s390-ibm-zvmoe
+ ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ GUESS=powerpc-ibm-os400
+ ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
+ ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ GUESS=arm-unknown-riscos
+ ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ GUESS=hppa1.1-hitachi-hiuxmpp
+ ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
+ case `(/bin/universe) 2>/dev/null` in
+ att) GUESS=pyramid-pyramid-sysv3 ;;
+ *) GUESS=pyramid-pyramid-bsd ;;
+ esac
+ ;;
NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
+ GUESS=pyramid-pyramid-svr4
+ ;;
DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
+ GUESS=sparc-icl-nx6
+ ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
+ sparc) GUESS=sparc-icl-nx7 ;;
+ esac
+ ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+ ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-hal-solaris2$SUN_REL
+ ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris2$SUN_REL
+ ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
+ ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
+ set_cc_for_build
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+ ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris3$SUN_REL
+ ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+ GUESS=sparc-sun-sunos$SUN_REL
+ ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
+ ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case `/bin/arch` in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
- exit ;;
+ ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
+ ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -415,44 +490,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-milan-mint$UNAME_RELEASE
+ ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-hades-mint$UNAME_RELEASE
+ ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
+ ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-machten$UNAME_RELEASE
+ ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
+ ;;
RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
+ GUESS=mips-dec-mach_bsd4.3
+ ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
+ ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
+ ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
+ ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -461,95 +536,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-mips-riscos$UNAME_RELEASE
+ ;;
Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
+ GUESS=powerpc-motorola-powermax
+ ;;
Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
+ GUESS=powerpc-harris-powerunix
+ ;;
m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
+ GUESS=m88k-harris-cxux7
+ ;;
m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
+ GUESS=m88k-motorola-sysv4
+ ;;
m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ GUESS=i586-dg-dgux$UNAME_RELEASE
fi
- exit ;;
+ ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
+ GUESS=m88k-dolphin-sysv3
+ ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
+ GUESS=m88k-tektronix-sysv3
+ ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
+ GUESS=m68k-tektronix-bsd
+ ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+ GUESS=mips-sgi-irix$IRIX_REL
+ ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
+ GUESS=i386-ibm-aix
+ ;;
ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
+ if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+ ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -560,77 +636,77 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
- echo "$SYSTEM_NAME"
+ GUESS=$SYSTEM_NAME
else
- echo rs6000-ibm-aix3.2.5
+ GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
+ GUESS=rs6000-ibm-aix3.2.4
else
- echo rs6000-ibm-aix3.2
+ GUESS=rs6000-ibm-aix3.2
fi
- exit ;;
+ ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/lslpp ] ; then
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ if test -x /usr/bin/lslpp ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+ ;;
*:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
+ GUESS=rs6000-ibm-aix
+ ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ GUESS=romp-ibm-bsd4.4
+ ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
+ ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
+ GUESS=rs6000-bull-bosx
+ ;;
DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
+ GUESS=m68k-bull-sysv3
+ ;;
9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
+ GUESS=m68k-hp-bsd
+ ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
+ GUESS=m68k-hp-bsd4.4
+ ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ case $UNAME_MACHINE in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
+ if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ case $sc_cpu_version in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ case $sc_kernel_bits in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if test "$HP_ARCH" = ""; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -663,13 +739,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if test "$HP_ARCH" = hppa2.0w
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -680,23 +756,23 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+ ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ GUESS=ia64-hp-hpux$HPUX_REV
+ ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -721,38 +797,38 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
+ GUESS=unknown-hitachi-hiuxwe2
+ ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ GUESS=hppa1.1-hp-bsd
+ ;;
9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
+ GUESS=hppa1.0-hp-bsd
+ ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-mpeix
+ ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ GUESS=hppa1.1-hp-osf
+ ;;
hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-osf
+ ;;
i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ if test -x /usr/sbin/sysversion ; then
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ GUESS=$UNAME_MACHINE-unknown-osf1
fi
- exit ;;
+ ;;
parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
+ GUESS=hppa1.1-hp-lites
+ ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
+ GUESS=c1-convex-bsd
+ ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
@@ -760,139 +836,145 @@ EOF
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
+ GUESS=c34-convex-bsd
+ ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
+ GUESS=c38-convex-bsd
+ ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
+ GUESS=c4-convex-bsd
+ ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=ymp-cray-unicos$CRAY_REL
+ ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=t90-cray-unicos$CRAY_REL
+ ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
+ ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=sv1-cray-unicos$CRAY_REL
+ ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=craynv-cray-unicosmp$CRAY_REL
+ ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+ ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+ ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+ ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
+ else
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
+ fi
+ ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ case $UNAME_PROCESSOR in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
- exit ;;
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+ ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-cygwin
+ ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw64
+ ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw32
+ ;;
*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-msys
+ ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-pw32
+ ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case $UNAME_MACHINE in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=i586-pc-interix$UNAME_RELEASE
+ ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
+ ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
+ ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-uwin
+ ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
+ GUESS=x86_64-pc-cygwin
+ ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
+ ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+ ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+ ;;
+ *:Minix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-minix
+ ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -902,172 +984,226 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
- exit ;;
+ ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
+ e2k:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+ ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ k1om:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+ eval "$cc_set_vars"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
- exit ;;
+ GUESS=or1k-unknown-linux-$LIBC
+ ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
+ GUESS=sparc-unknown-linux-$LIBC
+ ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
+ GUESS=hppa64-unknown-linux-$LIBC
+ ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
esac
- exit ;;
+ ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc64-unknown-linux-$LIBC
+ ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc-unknown-linux-$LIBC
+ ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc64le-unknown-linux-$LIBC
+ ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpcle-unknown-linux-$LIBC
+ ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+ ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+ ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ set_cc_for_build
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_X32 >/dev/null
+ then
+ LIBCABI=${LIBC}x32
+ fi
+ fi
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+ ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
+ GUESS=i386-sequent-sysv4
+ ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+ ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-os2-emx
+ ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-stop
+ ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-atheos
+ ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-syllable
+ ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
+ ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+ ;;
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
- exit ;;
+ ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
@@ -1075,12 +1211,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1090,43 +1226,43 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ GUESS=$UNAME_MACHINE-pc-sysv32
fi
- exit ;;
+ ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
+ GUESS=i586-pc-msdosdjgpp
+ ;;
Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
+ GUESS=i386-pc-mach3
+ ;;
paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
+ GUESS=i860-intel-osf1
+ ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
- exit ;;
+ ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
- echo m68010-convergent-sysv
- exit ;;
+ GUESS=m68010-convergent-sysv
+ ;;
mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
+ GUESS=m68k-convergent-sysv
+ ;;
M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
+ GUESS=m68k-diab-dnix
+ ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1134,9 +1270,9 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
@@ -1145,248 +1281,438 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+ ;;
mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
+ GUESS=m68k-atari-sysv4
+ ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+ ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+ ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+ ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dde-sysv$UNAME_RELEASE
+ ;;
RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ GUESS=$UNAME_MACHINE-sni-sysv4
else
- echo ns32k-sni-sysv
+ GUESS=ns32k-sni-sysv
fi
- exit ;;
+ ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ GUESS=i586-unisys-sysv4
+ ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
+ GUESS=hppa1.1-stratus-sysv4
+ ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
+ GUESS=i860-stratus-sysv4
+ ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
+ GUESS=$UNAME_MACHINE-stratus-vos
+ ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
+ GUESS=hppa1.1-stratus-vos
+ ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-aux$UNAME_RELEASE
+ ;;
news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
+ GUESS=mips-sony-newsos6
+ ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ if test -d /usr/nec; then
+ GUESS=mips-nec-sysv$UNAME_RELEASE
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
- exit ;;
+ ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
+ GUESS=powerpc-be-beos
+ ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
+ GUESS=powerpc-apple-beos
+ ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
+ GUESS=i586-pc-beos
+ ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
+ GUESS=i586-pc-haiku
+ ;;
x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
+ GUESS=x86_64-unknown-haiku
+ ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx4-nec-superux$UNAME_RELEASE
+ ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx5-nec-superux$UNAME_RELEASE
+ ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx6-nec-superux$UNAME_RELEASE
+ ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx7-nec-superux$UNAME_RELEASE
+ ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8-nec-superux$UNAME_RELEASE
+ ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
+ ;;
+ SX-ACE:SUPER-UX:*:*)
+ GUESS=sxace-nec-superux$UNAME_RELEASE
+ ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+ ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+ ;;
+ arm64:Darwin:*:*)
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
+ ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
+ UNAME_PROCESSOR=`uname -p`
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+ ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+ ;;
*:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-qnx
+ ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
+ ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
+ ;;
*:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
+ GUESS=mips-compaq-nonstopux
+ ;;
BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
+ GUESS=bs2000-siemens-sysv
+ ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+ ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
+ elif test "x${cputype-}" != x; then
+ UNAME_MACHINE=$cputype
fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-plan9
+ ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
+ GUESS=pdp10-unknown-tops10
+ ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
+ GUESS=pdp10-unknown-tenex
+ ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
+ GUESS=pdp10-dec-tops20
+ ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
+ GUESS=pdp10-xkl-tops20
+ ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
+ GUESS=pdp10-unknown-tops20
+ ;;
*:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
+ GUESS=pdp10-unknown-its
+ ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-sei-seiux$UNAME_RELEASE
+ ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+ ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
+ case $UNAME_MACHINE in
+ A*) GUESS=alpha-dec-vms ;;
+ I*) GUESS=ia64-dec-vms ;;
+ V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
+ GUESS=i386-pc-xenix
+ ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+ ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-rdos
+ ;;
+ *:AROS:*:*)
+ GUESS=$UNAME_MACHINE-unknown-aros
+ ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-esx
+ ;;
+ amd64:Isilon\ OneFS:*:*)
+ GUESS=x86_64-unknown-onefs
+ ;;
+ *:Unleashed:*:*)
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+ ;;
+esac
+
+# Do we have a guess based on uname results?
+if test "x$GUESS" != x; then
+ echo "$GUESS"
+ exit
+fi
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
+echo "$0: unable to guess system type" >&2
+
+case $UNAME_MACHINE:$UNAME_SYSTEM in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
esac
cat >&2 <<EOF
-$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+EOF
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
+# shellcheck disable=SC2003
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
+ cat >&2 <<EOF
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
@@ -1405,16 +1731,17 @@ hostinfo = `(hostinfo) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
+fi
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/config.h.in b/config.h.in
index a0ec9bc14..3309c9fd5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -15,18 +15,15 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -99,7 +96,9 @@
/* Enable POWERPC VSX optimizations */
#undef PNG_POWERPC_VSX_OPT
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
@@ -108,22 +107,17 @@
/* Version number of package */
#undef VERSION
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
- supported directly. */
+ supported only directly. */
#undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict or
- __restrict__, even though the corresponding Sun C compiler ends up with
- "#define restrict _Restrict" or "#define restrict __restrict__" in the
- previous line. Perhaps some future version of Sun C++ will work with
- restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
-#if defined __SUNPRO_CC && !defined __RESTRICT
+/* Work around a bug in older versions of Sun C++, which did not
+ #define __restrict__ or support _Restrict or __restrict__
+ even though the corresponding Sun C compiler ended up with
+ "#define restrict _Restrict" or "#define restrict __restrict__"
+ in the previous line. This workaround can be removed once
+ we assume Oracle Developer Studio 12.5 (2016) or later. */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
# define _Restrict
# define __restrict__
#endif
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/config.sub b/config.sub
index 7ffe37378..d74fb6dea 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2014-12-03'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2021-08-14'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@ timestamp='2014-12-03'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -33,7 +35,7 @@ timestamp='2014-12-03'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -50,15 +52,21 @@ timestamp='2014-12-03'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -68,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -90,12 +98,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -111,1228 +119,1181 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+saved_IFS=$IFS
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
+IFS=$saved_IFS
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+ *-*-*-*-*)
+ echo Invalid configuration \`"$1"\': more than four components >&2
+ exit 1
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
;;
- -psos*)
- os=-psos
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
- ms1)
- basic_machine=mt-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
-
- xscaleel)
- basic_machine=armel-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=we32k
+ vendor=att
;;
bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
+ cpu=m68k
+ vendor=motorola
;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
+ cpu=hppa1.0
+ vendor=hp
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=solaris2
;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
;;
*)
- os=-irix4
+ basic_os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
+ cpu=m68000
+ vendor=convergent
;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ basic_os=nextstep2
;;
*)
- os=-nextstep3
+ basic_os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
+ cpu=m68k
+ vendor=tti
;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
+ cpu=pn
+ vendor=gould
;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
+ cpu=romp
+ vendor=ibm
;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sequent)
- basic_machine=i386-sequent
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
;;
- sh5el)
- basic_machine=sh5le-unknown
+ none)
+ cpu=none
+ vendor=none
;;
- sh64)
- basic_machine=sh64-unknown
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
+ IFS=$saved_IFS
;;
- spur)
- basic_machine=spur-unknown
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ cpu=$basic_machine
+ vendor=pc
;;
- st2000)
- basic_machine=m68k-tandem
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ cpu=i386
+ vendor=pc
;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- sun2)
- basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ basic_os=${basic_os:-unicosmp}
;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
+ c90-unknown | c90-cray)
+ vendor=cray
+ basic_os=${Basic_os:-unicos}
;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
+ fx80-unknown)
+ vendor=alliant
;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
+ romp-unknown)
+ vendor=ibm
;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
+ mmix-unknown)
+ vendor=knuth
;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
+ rs6000-unknown)
+ vendor=ibm
;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
+ vax-unknown)
+ vendor=dec
;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
+ pdp11-unknown)
+ vendor=dec
;;
- sun4)
- basic_machine=sparc-sun
+ we32k-unknown)
+ vendor=att
;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
+ cydra-unknown)
+ vendor=cydrome
;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
+ i370-ibm*)
+ vendor=ibm
;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
+ orion-unknown)
+ vendor=highlevel
;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
- t90)
- basic_machine=t90-cray
- os=-unicos
+
+ # Here we normalize CPU types with a missing or matching vendor
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ basic_os=${basic_os:-bosx}
;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- tx39)
- basic_machine=mipstx39-unknown
+ blackfin-*)
+ cpu=bfin
+ basic_os=linux
;;
- tx39el)
- basic_machine=mipstx39el-unknown
+ c54x-*)
+ cpu=tic54x
;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
+ c55x-*)
+ cpu=tic55x
;;
- tower | tower-32)
- basic_machine=m68k-ncr
+ c6x-*)
+ cpu=tic6x
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
+ e500v[12]-*)
+ cpu=powerpc
+ basic_os=${basic_os}"spe"
;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
+ mips3*-*)
+ cpu=mips64
;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
+ ms1-*)
+ cpu=mt
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
+ m68knommu-*)
+ cpu=m68k
+ basic_os=linux
;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- vms)
- basic_machine=vax-dec
- os=-vms
+ openrisc-*)
+ cpu=or32
;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
+ parisc-*)
+ cpu=hppa
+ basic_os=linux
;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
+ pentium4-*)
+ cpu=i786
;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
+ pc98-*)
+ cpu=i386
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
+ ppc-* | ppcbe-*)
+ cpu=powerpc
;;
- xps | xps100)
- basic_machine=xps100-honeywell
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ppc64-*)
+ cpu=powerpc64
;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
+ sb1-*)
+ cpu=mipsisa64sb1
;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
+ sb1el-*)
+ cpu=mipsisa64sb1el
;;
- none)
- basic_machine=none-none
- os=-none
+ sh5e[lb]-*)
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ spur-*)
+ cpu=spur
;;
- op50n)
- basic_machine=hppa1.1-oki
+ strongarm-* | thumb-*)
+ cpu=arm
;;
- op60c)
- basic_machine=hppa1.1-oki
+ tx39-*)
+ cpu=mipstx39
;;
- romp)
- basic_machine=romp-ibm
+ tx39el-*)
+ cpu=mipstx39el
;;
- mmix)
- basic_machine=mmix-knuth
+ x64-*)
+ cpu=x86_64
;;
- rs6000)
- basic_machine=rs6000-ibm
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
- vax)
- basic_machine=vax-dec
+ arm64-*)
+ cpu=aarch64
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ basic_os=${basic_os:-elf}
;;
- pdp11)
- basic_machine=pdp11-dec
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
;;
- we32k)
- basic_machine=we32k-att
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ crx-*)
+ basic_os=${basic_os:-elf}
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
;;
- cydra)
- basic_machine=cydra-cydrome
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
;;
- orion)
- basic_machine=orion-highlevel
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
;;
- orion105)
- basic_machine=clipper-highlevel
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ tile*-*)
+ basic_os=${basic_os:-linux-gnu}
;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb | arc32 | arc64 \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | loongarch32 | loongarch64 | loongarchx32 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r3 | mipsisa32r3el \
+ | mipsisa32r5 | mipsisa32r5el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r3 | mipsisa64r3el \
+ | mipsisa64r5 | mipsisa64r5el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1340,200 +1301,215 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if test x$basic_os != x
then
+
+# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ os2-emx)
+ kernel=os2
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+ IFS=$saved_IFS
+ ;;
+ # Default OS when just kernel was specified
+ nto*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
+ ;;
+ linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
+ ;;
+ *)
+ kernel=
+ os=$basic_os
+ ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # solaris* is a basic system type, with this one exception.
+ auroraux)
+ os=auroraux
;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ bluegene*)
+ os=cnk
;;
- -solaris)
- os=-solaris2
+ solaris1 | solaris1.*)
+ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
;;
- -svr4*)
- os=-sysv4
+ solaris)
+ os=solaris2
;;
- -unixware*)
- os=-sysv4.2uw
+ unixware*)
+ os=sysv4.2uw
;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
+ # Some version numbers need modification
+ chorusos*)
+ os=chorusos
;;
- -nto-qnx*)
+ isc)
+ os=isc2.2
;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ sco6)
+ os=sco5v6
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ sco5)
+ os=sco3.2v5
;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ sco4)
+ os=sco3.2v4
;;
- -linux-dietlibc)
- os=-linux-dietlibc
+ sco3.2.[4-9]*)
+ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ sco*v* | scout)
+ # Don't match below
;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ sco*)
+ os=sco3.2v2
;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ psos*)
+ os=psos
;;
- -opened*)
- os=-openedition
+ qnx*)
+ os=qnx
;;
- -os400*)
- os=-os400
+ hiux*)
+ os=hiuxwe2
;;
- -wince*)
- os=-wince
+ lynx*178)
+ os=lynxos178
;;
- -osfrose*)
- os=-osfrose
+ lynx*5)
+ os=lynxos5
;;
- -osf*)
- os=-osf
+ lynxos*)
+ # don't get caught up in next wildcard
;;
- -utek*)
- os=-bsd
+ lynx*)
+ os=lynxos
;;
- -dynix*)
- os=-bsd
+ mac[0-9]*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
;;
- -acis*)
- os=-aos
+ opened*)
+ os=openedition
;;
- -atheos*)
- os=-atheos
+ os400*)
+ os=os400
;;
- -syllable*)
- os=-syllable
+ sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
- -386bsd)
- os=-bsd
+ sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
- -ctix* | -uts*)
- os=-sysv
+ wince*)
+ os=wince
;;
- -nova*)
- os=-rtmk-nova
+ utek*)
+ os=bsd
;;
- -ns2 )
- os=-nextstep2
+ dynix*)
+ os=bsd
;;
- -nsk*)
- os=-nsk
+ acis*)
+ os=aos
;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
+ atheos*)
+ os=atheos
;;
- -sinix*)
- os=-sysv4
+ syllable*)
+ os=syllable
;;
- -tpf*)
- os=-tpf
+ 386bsd)
+ os=bsd
;;
- -triton*)
- os=-sysv3
+ ctix* | uts*)
+ os=sysv
;;
- -oss*)
- os=-sysv3
+ nova*)
+ os=rtmk-nova
;;
- -svr4)
- os=-sysv4
+ ns2)
+ os=nextstep2
;;
- -svr3)
- os=-sysv3
+ # Preserve the version number of sinix5.
+ sinix5.*)
+ os=`echo "$os" | sed -e 's|sinix|sysv|'`
;;
- -sysvr4)
- os=-sysv4
+ sinix*)
+ os=sysv4
;;
- # This must come after -sysvr4.
- -sysv*)
+ tpf*)
+ os=tpf
;;
- -ose*)
- os=-ose
+ triton*)
+ os=sysv3
;;
- -es1800*)
- os=-ose
+ oss*)
+ os=sysv3
;;
- -xenix)
- os=-xenix
+ svr4*)
+ os=sysv4
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ svr3)
+ os=sysv3
;;
- -aros*)
- os=-aros
+ sysvr4)
+ os=sysv4
;;
- -zvmoe)
- os=-zvmoe
+ ose*)
+ os=ose
;;
- -dicos*)
- os=-dicos
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
;;
- -nacl*)
+ dicos*)
+ os=dicos
;;
- -none)
+ pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $cpu in
+ arm*)
+ os=eabi
+ ;;
+ *)
+ os=elf
+ ;;
+ esac
;;
*)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1546,261 +1522,362 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=elf
;;
spu-*)
- os=-elf
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=-aout
+ os=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=coff
;;
c8051-*)
- os=-elf
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=elf
;;
tic54x-*)
- os=-coff
+ os=coff
;;
tic55x-*)
- os=-coff
+ os=coff
;;
tic6x-*)
- os=-coff
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
;;
mep-*)
- os=-elf
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
- *-be)
- os=-beos
+ pru-*)
+ os=elf
;;
- *-haiku)
- os=-haiku
+ *-be)
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ musl* | newlib* | relibc* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ none)
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
+ | linux-musl* | linux-relibc* | linux-uclibc* )
+ ;;
+ uclinux-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ ;;
+ nto-qnx*)
+ ;;
+ os2-emx)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- -sunos*)
+ *-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- -beos*)
+ *-beos*)
vendor=be
;;
- -hpux*)
+ *-hpux*)
vendor=hp
;;
- -mpeix*)
+ *-mpeix*)
vendor=hp
;;
- -hiux*)
+ *-hiux*)
vendor=hitachi
;;
- -unos*)
+ *-unos*)
vendor=crds
;;
- -dgux*)
+ *-dgux*)
vendor=dg
;;
- -luna*)
+ *-luna*)
vendor=omron
;;
- -genix*)
+ *-genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- -os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- -ptx*)
+ *-ptx*)
vendor=sequent
;;
- -tpf*)
+ *-tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- -aux*)
+ *-aux*)
vendor=apple
;;
- -hms*)
+ *-hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ *-vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/configure b/configure
index 603fd9e0e..e0b285f76 100755
--- a/configure
+++ b/configure
@@ -1,11 +1,12 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libpng 1.6.34.
+# Generated by GNU Autoconf 2.71 for libpng 1.6.40.
#
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
#
#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -16,14 +17,16 @@
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -33,46 +36,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -96,8 +92,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -109,30 +109,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
@@ -154,20 +134,22 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ as_bourne_compatible="as_nop=:
+if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
-else
+else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
@@ -187,12 +169,15 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
-else
+else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
+blah=\$(echo \$(echo blah))
+test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
@@ -207,30 +192,38 @@ test \$(( 1 + 1 )) = 2 || exit 1
PATH=/empty FPATH=/empty; export PATH FPATH
test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
|| test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
+ if (eval "$as_required") 2>/dev/null
+then :
as_have_required=yes
-else
+else $as_nop
as_have_required=no
fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
-else
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
+ as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
+then :
break 2
fi
fi
@@ -238,14 +231,21 @@ fi
esac
as_found=false
done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi
+fi
- if test "x$CONFIG_SHELL" != x; then :
+ if test "x$CONFIG_SHELL" != x
+then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
@@ -263,18 +263,19 @@ esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ if test x$as_have_required = xno
+then :
+ printf "%s\n" "$0: This script requires a shell more modern than all"
+ printf "%s\n" "$0: the shells that I found on your system."
+ if test ${ZSH_VERSION+y} ; then
+ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
+ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and
$0: png-mng-implement@lists.sourceforge.net about your
$0: system, including any error possibly output before this
$0: message. Then install a modern shell, or manually run
@@ -302,6 +303,7 @@ as_fn_unset ()
}
as_unset=as_fn_unset
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -319,6 +321,14 @@ as_fn_exit ()
as_fn_set_status $1
exit $1
} # as_fn_exit
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
@@ -333,7 +343,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -381,12 +391,13 @@ as_fn_executable_p ()
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -398,18 +409,27 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+ return $?
+}
+as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
@@ -421,9 +441,9 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
@@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
exit
}
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -521,6 +545,13 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -590,51 +621,48 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libpng'
PACKAGE_TARNAME='libpng'
-PACKAGE_VERSION='1.6.34'
-PACKAGE_STRING='libpng 1.6.34'
+PACKAGE_VERSION='1.6.40'
+PACKAGE_STRING='libpng 1.6.40'
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
PACKAGE_URL=''
ac_unique_file="pngget.c"
# Factoring default headers for most tests.
ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
+#include <stddef.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
+#ifdef HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
# include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
+ac_header_c_list=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
+LIBOBJS
PNG_POWERPC_VSX_FALSE
PNG_POWERPC_VSX_TRUE
PNG_INTEL_SSE_FALSE
@@ -665,8 +693,6 @@ HAVE_SOLARIS_LD_FALSE
HAVE_SOLARIS_LD_TRUE
HAVE_CLOCK_GETTIME_FALSE
HAVE_CLOCK_GETTIME_TRUE
-LIBOBJS
-POW_LIB
PNG_COPTS
DFNCPP
LT_SYS_LIBRARY_PATH
@@ -679,6 +705,7 @@ MANIFEST_TOOL
RANLIB
ac_ct_AR
AR
+FILECMD
NM
ac_ct_DUMPBIN
DUMPBIN
@@ -713,7 +740,6 @@ am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
-am__quote
am__include
DEPDIR
OBJEXT
@@ -730,6 +756,9 @@ AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
+CSCOPE
+ETAGS
+CTAGS
am__untar
am__tar
AMTAR
@@ -772,6 +801,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -790,7 +820,8 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@@ -870,6 +901,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -899,8 +931,6 @@ do
*) ac_optarg=yes ;;
esac
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
@@ -941,9 +971,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -967,9 +997,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -1122,6 +1152,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1171,9 +1210,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1187,9 +1226,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1233,9 +1272,9 @@ Try \`$0 --help' for more information"
*)
# FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
@@ -1251,7 +1290,7 @@ if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1259,7 +1298,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1315,7 +1354,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1372,7 +1411,7 @@ if test "$ac_init_help" = "long"; then
# 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 1.6.34 to adapt to many kinds of systems.
+\`configure' configures libpng 1.6.40 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1412,6 +1451,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1442,7 +1482,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libpng 1.6.34:";;
+ short | recursive ) echo "Configuration of libpng 1.6.40:";;
esac
cat <<\_ACEOF
@@ -1575,9 +1615,9 @@ if test "$ac_init_help" = "recursive"; then
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1605,7 +1645,8 @@ esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
+ # Check for configure.gnu first; this name is used for a wrapper for
+ # Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
@@ -1613,7 +1654,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1622,10 +1663,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libpng configure 1.6.34
-generated by GNU Autoconf 2.69
+libpng configure 1.6.40
+generated by GNU Autoconf 2.71
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1642,14 +1683,14 @@ fi
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1657,14 +1698,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1686,7 +1728,7 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1694,14 +1736,15 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1717,14 +1760,14 @@ fi
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
+ rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1732,17 +1775,18 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
@@ -1764,83 +1808,44 @@ fi
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$3=yes"
-else
+else $as_nop
eval "$3=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
@@ -1848,16 +1853,9 @@ else
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+ which can conflict with char $2 (); below. */
+#include <limits.h>
#undef $2
/* Override any GCC internal prototype to avoid an error.
@@ -1875,89 +1873,56 @@ choke me
#endif
int
-main ()
+main (void)
{
return $2 ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
eval "$3=yes"
-else
+else $as_nop
eval "$3=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
+ac_configure_args_raw=
+for ac_arg
+do
+ case $ac_arg in
+ *\'*)
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+case $ac_configure_args_raw in
+ *$as_nl*)
+ ac_safe_unquote= ;;
+ *)
+ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
+ ac_unsafe_a="$ac_unsafe_z#~"
+ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
-} # ac_fn_c_check_type
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libpng $as_me 1.6.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+It was created by libpng $as_me 1.6.40, which was
+generated by GNU Autoconf 2.71. Invocation command line was
- $ $0 $@
+ $ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
@@ -1990,8 +1955,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
@@ -2026,7 +1995,7 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
@@ -2061,11 +2030,13 @@ done
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
+ # Sanitize IFS.
+ IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
- $as_echo "## ---------------- ##
+ printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
@@ -2076,8 +2047,8 @@ trap 'exit_status=$?
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -2101,7 +2072,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- $as_echo "## ----------------- ##
+ printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
@@ -2109,14 +2080,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
@@ -2124,15 +2095,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
@@ -2140,8 +2111,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
echo
fi
test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
+ printf "%s\n" "$as_me: caught signal $ac_signal"
+ printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -2155,63 +2126,48 @@ ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
-$as_echo "/* confdefs.h */" > confdefs.h
+printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
+printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
+printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
+printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
+ ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
+ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+
+for ac_site_file in $ac_site_files
do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ case $ac_site_file in #(
+ */*) :
+ ;; #(
+ *) :
+ ac_site_file=./$ac_site_file ;;
+esac
+ if test -f "$ac_site_file" && test -r "$ac_site_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -2221,19 +2177,434 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
+# Test code for whether the C compiler supports C89 (global declarations)
+ac_c_conftest_c89_globals='
+/* Does the compiler advertise C89 conformance?
+ Do not test the value of __STDC__, because some compilers set it to 0
+ while being otherwise adequately conformant. */
+#if !defined __STDC__
+# error "Compiler does not advertise C89 conformance"
+#endif
+
+#include <stddef.h>
+#include <stdarg.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
+struct buf { int x; };
+struct buf * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not \xHH hex character constants.
+ These do not provoke an error unfortunately, instead are silently treated
+ as an "x". The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously \x00 != x always comes out true, for an
+ array size at least. It is necessary to write \x00 == 0 to get something
+ that is true only with -std. */
+int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) '\''x'\''
+int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
+ int, int);'
+
+# Test code for whether the C compiler supports C89 (body of main).
+ac_c_conftest_c89_main='
+ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
+'
+
+# Test code for whether the C compiler supports C99 (global declarations)
+ac_c_conftest_c99_globals='
+// Does the compiler advertise C99 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
+# error "Compiler does not advertise C99 conformance"
+#endif
+
+#include <stdbool.h>
+extern int puts (const char *);
+extern int printf (const char *, ...);
+extern int dprintf (int, const char *, ...);
+extern void *malloc (size_t);
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+// dprintf is used instead of fprintf to avoid needing to declare
+// FILE and stderr.
+#define debug(...) dprintf (2, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ #error "your preprocessor is broken"
+#endif
+#if BIG_OK
+#else
+ #error "your preprocessor is broken"
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case '\''s'\'': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case '\''d'\'': // int
+ number = va_arg (args_copy, int);
+ break;
+ case '\''f'\'': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+'
+
+# Test code for whether the C compiler supports C99 (body of main).
+ac_c_conftest_c99_main='
+ // Check bool.
+ _Bool success = false;
+ success |= (argc != 0);
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[0] = argv[0][0];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
+ || dynamic_array[ni.number - 1] != 543);
+'
+
+# Test code for whether the C compiler supports C11 (global declarations)
+ac_c_conftest_c11_globals='
+// Does the compiler advertise C11 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
+# error "Compiler does not advertise C11 conformance"
+#endif
+
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+'
+
+# Test code for whether the C compiler supports C11 (body of main).
+ac_c_conftest_c11_main='
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+ v1.i = 2;
+ v1.w.k = 5;
+ ok |= v1.i != 5;
+'
+
+# Test code for whether the C compiler supports C11 (complete).
+ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+${ac_c_conftest_c11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ ${ac_c_conftest_c11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C99 (complete).
+ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C89 (complete).
+ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ return ok;
+}
+"
+
+as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
+as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
+as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
+as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
+as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
+as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
+as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
+as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
+as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
+
+# Auxiliary files required by this configure script.
+ac_aux_files="ltmain.sh config.guess config.sub compile missing install-sh"
+
+# Locations in which to look for auxiliary files.
+ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.."
+
+# Search for a directory containing all of the required auxiliary files,
+# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
+# If we don't find one directory that contains all the files we need,
+# we report the set of missing files from the *first* directory in
+# $ac_aux_dir_candidates and give up.
+ac_missing_aux_files=""
+ac_first_candidate=:
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in $ac_aux_dir_candidates
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ as_found=:
+
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
+ ac_aux_dir_found=yes
+ ac_install_sh=
+ for ac_aux in $ac_aux_files
+ do
+ # As a special case, if "install-sh" is required, that requirement
+ # can be satisfied by any of "install-sh", "install.sh", or "shtool",
+ # and $ac_install_sh is set appropriately for whichever one is found.
+ if test x"$ac_aux" = x"install-sh"
+ then
+ if test -f "${as_dir}install-sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
+ ac_install_sh="${as_dir}install-sh -c"
+ elif test -f "${as_dir}install.sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
+ ac_install_sh="${as_dir}install.sh -c"
+ elif test -f "${as_dir}shtool"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
+ ac_install_sh="${as_dir}shtool install -c"
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} install-sh"
+ else
+ break
+ fi
+ fi
+ else
+ if test -f "${as_dir}${ac_aux}"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
+ else
+ break
+ fi
+ fi
+ fi
+ done
+ if test "$ac_aux_dir_found" = yes; then
+ ac_aux_dir="$as_dir"
+ break
+ fi
+ ac_first_candidate=false
+
+ as_found=false
+done
+IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+ as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
+fi
+
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+if test -f "${ac_aux_dir}config.guess"; then
+ ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
+fi
+if test -f "${ac_aux_dir}config.sub"; then
+ ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
+fi
+if test -f "$ac_aux_dir/configure"; then
+ ac_configure="$SHELL ${ac_aux_dir}configure"
+fi
+
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -2244,12 +2615,12 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
@@ -2258,24 +2629,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -2285,11 +2656,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
+ and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2310,38 +2682,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# dist-xz requires automake 1.11 or later
# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
# 1.13 is required for parallel tests
-am__api_version='1.15'
+am__api_version='1.16'
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-# Find a good install program. We prefer a C program (faster),
+ # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
@@ -2355,20 +2700,25 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${ac_cv_path_install+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+ ./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
@@ -2378,13 +2728,13 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
@@ -2392,12 +2742,12 @@ case $as_dir/ in #((
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
@@ -2413,7 +2763,7 @@ IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
- if test "${ac_cv_path_install+set}" = set; then
+ if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2423,8 +2773,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2434,8 +2784,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -2489,8 +2839,8 @@ else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
@@ -2509,26 +2859,23 @@ test "$program_suffix" != NONE &&
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+
+ if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
@@ -2548,11 +2895,12 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
@@ -2560,11 +2908,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2575,11 +2927,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -2588,11 +2940,12 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
@@ -2600,11 +2953,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2615,11 +2972,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -2627,8 +2984,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -2640,25 +2997,31 @@ fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
+printf %s "checking for a race-free mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${ac_cv_path_mkdir+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
+ as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir ('*'coreutils) '* | \
+ 'BusyBox '* | \
'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
esac
done
@@ -2669,7 +3032,7 @@ IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
+ if test ${ac_cv_path_mkdir+y}; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2679,18 +3042,19 @@ fi
MKDIR_P="$ac_install_sh -d"
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
@@ -2698,11 +3062,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2713,24 +3081,25 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -n "$AWK" && break
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@@ -2746,12 +3115,12 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2765,7 +3134,8 @@ fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
enableval=$enable_silent_rules;
fi
@@ -2775,12 +3145,13 @@ case $enable_silent_rules in # (((
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
@@ -2792,8 +3163,8 @@ else
am_cv_make_support_nested_variables=no
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -2825,17 +3196,13 @@ fi
# Define the identity of the package.
PACKAGE='libpng'
- VERSION='1.6.34'
+ VERSION='1.6.40'
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
# Some tools Automake needs.
@@ -2855,8 +3222,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
@@ -2875,6 +3242,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+
+
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
@@ -2907,7 +3288,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -2922,17 +3303,18 @@ fi
# configure. This is necessary because libpng distributions cannot rely on the
# time stamps of the autotools generated files being correct
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
+if test ${enable_maintainer_mode+y}
+then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
+else $as_nop
USE_MAINTAINER_MODE=no
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+printf "%s\n" "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
@@ -2946,10 +3328,10 @@ fi
-PNGLIB_VERSION=1.6.34
+PNGLIB_VERSION=1.6.40
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
-PNGLIB_RELEASE=34
+PNGLIB_RELEASE=40
@@ -2963,6 +3345,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2971,11 +3362,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -2983,11 +3375,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -2998,11 +3394,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3011,11 +3407,12 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
@@ -3023,11 +3420,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3038,11 +3439,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -3050,8 +3451,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -3064,11 +3465,12 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3076,11 +3478,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3091,11 +3497,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3104,11 +3510,12 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3117,15 +3524,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3141,18 +3552,18 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3163,11 +3574,12 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
@@ -3175,11 +3587,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3190,11 +3606,11 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3207,11 +3623,12 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
@@ -3219,11 +3636,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3234,11 +3655,11 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3250,34 +3671,138 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
+else
+ CC="$ac_cv_prog_CC"
fi
fi
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v -V -qversion -version; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -3287,7 +3812,7 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
@@ -3295,7 +3820,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3307,9 +3832,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+printf %s "checking whether the C compiler works... " >&6; }
+ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
@@ -3330,11 +3855,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
@@ -3351,7 +3877,7 @@ do
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
@@ -3367,44 +3893,46 @@ do
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
-else
+else $as_nop
ac_file=''
fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+printf %s "checking for C compiler default output file name... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+printf "%s\n" "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+printf %s "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3418,15 +3946,15 @@ for ac_file in conftest.exe conftest conftest.*; do
* ) break;;
esac
done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+printf "%s\n" "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
@@ -3435,7 +3963,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
-main ()
+main (void)
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
@@ -3447,8 +3975,8 @@ _ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+printf %s "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
@@ -3456,10 +3984,10 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
@@ -3467,39 +3995,40 @@ $as_echo "$ac_try_echo"; } >&5
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+printf "%s\n" "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+printf %s "checking for suffix of object files... " >&6; }
+if test ${ac_cv_objext+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3513,11 +4042,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
@@ -3526,31 +4056,32 @@ $as_echo "$ac_try_echo"; } >&5
break;;
esac
done
-else
- $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+printf "%s\n" "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -3560,29 +4091,33 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
+else $as_nop
ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
-ac_test_CFLAGS=${CFLAGS+set}
+ac_test_CFLAGS=${CFLAGS+y}
ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
@@ -3591,57 +4126,60 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
-else
+else $as_nop
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
+else $as_nop
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -3656,94 +4194,144 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+ CC="$CC $ac_cv_prog_cc_c11"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+ ac_prog_cc_stdc=c11
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c99" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+ CC="$CC $ac_cv_prog_cc_c99"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+ ac_prog_cc_stdc=c99
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c89_program
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
+ if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_c89=$ac_arg
fi
-rm -f core conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
-
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+ if test "x$ac_cv_prog_cc_c89" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+ CC="$CC $ac_cv_prog_cc_c89"
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+ ac_prog_cc_stdc=c89
+fi
fi
ac_ext=c
@@ -3752,21 +4340,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_ext=c
+
+ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3794,8 +4384,8 @@ _ACEOF
rm -f core conftest*
unset am_i
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
@@ -3814,48 +4404,49 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+printf "%s\n" "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
+if test ${enable_dependency_tracking+y}
+then :
enableval=$enable_dependency_tracking;
fi
@@ -3876,11 +4467,12 @@ fi
depcc="$CC" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
@@ -3987,8 +4579,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -4011,11 +4603,12 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
depcc="$CCAS" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CCAS_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
@@ -4120,8 +4713,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; }
CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
if
@@ -4135,26 +4728,29 @@ else
fi
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+
+ # Make sure we can run config.sub.
+$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+printf %s "checking build system type... " >&6; }
+if test ${ac_cv_build+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+ ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+printf "%s\n" "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
@@ -4173,21 +4769,22 @@ IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+printf %s "checking host system type... " >&6; }
+if test ${ac_cv_host+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+ ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+printf "%s\n" "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
@@ -4206,11 +4803,12 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+printf %s "checking for a sed that does not truncate output... " >&6; }
+if test ${ac_cv_path_SED+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
@@ -4224,10 +4822,15 @@ else
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in sed gsed
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
@@ -4236,13 +4839,13 @@ case `"$ac_path_SED" --version 2>&1` in
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
+ printf "%s\n" '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4270,8 +4873,8 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+printf "%s\n" "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
@@ -4288,11 +4891,12 @@ Xsed="$SED -e 1s/^X//"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+printf %s "checking for grep that handles long lines and -e... " >&6; }
+if test ${ac_cv_path_GREP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
@@ -4300,10 +4904,15 @@ else
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in grep ggrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
@@ -4312,13 +4921,13 @@ case `"$ac_path_GREP" --version 2>&1` in
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
+ printf "%s\n" 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4346,16 +4955,17 @@ else
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+printf "%s\n" "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ 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}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
@@ -4366,10 +4976,15 @@ else
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in egrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
@@ -4378,13 +4993,13 @@ case `"$ac_path_EGREP" --version 2>&1` in
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
+ printf "%s\n" 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4413,16 +5028,17 @@ fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+printf "%s\n" "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+printf %s "checking for fgrep... " >&6; }
+if test ${ac_cv_path_FGREP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
then ac_cv_path_FGREP="$GREP -F"
else
@@ -4433,10 +5049,15 @@ else
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in fgrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
@@ -4445,13 +5066,13 @@ case `"$ac_path_FGREP" --version 2>&1` in
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
+ printf "%s\n" 'FGREP' >> "conftest.nl"
"$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -4480,8 +5101,8 @@ fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+printf "%s\n" "$ac_cv_path_FGREP" >&6; }
FGREP="$ac_cv_path_FGREP"
@@ -4507,8 +5128,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+printf %s "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
@@ -4534,12 +5155,12 @@ func_echo_all ()
}
case $ECHO in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
+ printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+printf "%s\n" "printf" >&6; } ;;
+ print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+printf "%s\n" "print -r" >&6; } ;;
+ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+printf "%s\n" "cat" >&6; } ;;
esac
@@ -4558,17 +5179,18 @@ esac
# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
+if test ${with_gnu_ld+y}
+then :
withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
+else $as_nop
with_gnu_ld=no
fi
ac_prog=ld
if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+printf %s "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return, which upsets mingw
@@ -4597,15 +5219,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
;;
esac
elif test yes = "$with_gnu_ld"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+printf %s "checking for GNU ld... " >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+printf %s "checking for non-GNU ld... " >&6; }
fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test ${lt_cv_path_LD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -z "$LD"; then
lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
@@ -4634,18 +5257,19 @@ fi
LD=$lt_cv_path_LD
if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+printf "%s\n" "$LD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+printf %s "checking if the linker ($LD) is GNU ld... " >&6; }
+if test ${lt_cv_prog_gnu_ld+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
@@ -4656,8 +5280,8 @@ case `$LD -v 2>&1 </dev/null` in
;;
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -4673,40 +5297,36 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+printf %s "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ if test ${ac_cv_prog_CPP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ # Double quotes because $CC needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
-else
+else $as_nop
# Broken: fails on valid input.
continue
fi
@@ -4718,10 +5338,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
# Broken: success on invalid input.
continue
-else
+else $as_nop
# Passes both tests.
ac_preproc_ok=:
break
@@ -4731,7 +5352,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
break
fi
@@ -4743,29 +5365,24 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+printf "%s\n" "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
-else
+else $as_nop
# Broken: fails on valid input.
continue
fi
@@ -4777,10 +5394,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
# Broken: success on invalid input.
continue
-else
+else $as_nop
# Passes both tests.
ac_preproc_ok=:
break
@@ -4790,11 +5408,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -4809,11 +5428,12 @@ for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
@@ -4821,11 +5441,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -4836,11 +5460,11 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4848,24 +5472,25 @@ fi
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+printf %s "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+printf "%s\n" "no, using $LN_S" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@@ -4881,26 +5506,27 @@ esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
case `pwd` in
*\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
-macro_version='2.4.6'
-macro_revision='2.4.6'
+macro_version='2.4.7'
+macro_revision='2.4.7'
+
@@ -4933,11 +5559,12 @@ delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test ${lt_cv_path_NM+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM=$NM
@@ -4962,13 +5589,13 @@ else
mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
- case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@@ -4987,8 +5614,8 @@ else
: ${lt_cv_path_NM=no}
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+printf "%s\n" "$lt_cv_path_NM" >&6; }
if test no != "$lt_cv_path_NM"; then
NM=$lt_cv_path_NM
else
@@ -5001,11 +5628,12 @@ else
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DUMPBIN+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DUMPBIN"; then
ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
else
@@ -5013,11 +5641,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5028,11 +5660,11 @@ fi
fi
DUMPBIN=$ac_cv_prog_DUMPBIN
if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+printf "%s\n" "$DUMPBIN" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5045,11 +5677,12 @@ if test -z "$DUMPBIN"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DUMPBIN+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DUMPBIN"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
else
@@ -5057,11 +5690,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5072,11 +5709,11 @@ fi
fi
ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+printf "%s\n" "$ac_ct_DUMPBIN" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5088,15 +5725,15 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DUMPBIN=$ac_ct_DUMPBIN
fi
fi
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@@ -5117,11 +5754,12 @@ test -z "$NM" && NM=nm
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+printf %s "checking the name lister ($NM) interface... " >&6; }
+if test ${lt_cv_nm_interface+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
@@ -5137,15 +5775,16 @@ else
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+printf "%s\n" "$lt_cv_nm_interface" >&6; }
# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+printf %s "checking the maximum length of command line arguments... " >&6; }
+if test ${lt_cv_sys_max_cmd_len+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
i=0
teststring=ABCD
@@ -5187,7 +5826,7 @@ else
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5230,7 +5869,7 @@ else
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@@ -5272,11 +5911,11 @@ else
fi
if test -n "$lt_cv_sys_max_cmd_len"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
+printf "%s\n" "none" >&6; }
fi
max_cmd_len=$lt_cv_sys_max_cmd_len
@@ -5320,11 +5959,12 @@ esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+printf %s "checking how to convert $build file names to $host format... " >&6; }
+if test ${lt_cv_to_host_file_cmd+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
case $host in
*-*-mingw* )
case $build in
@@ -5360,18 +6000,19 @@ esac
fi
to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+printf %s "checking how to convert $build file names to toolchain format... " >&6; }
+if test ${lt_cv_to_tool_file_cmd+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
@@ -5387,22 +6028,23 @@ esac
fi
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+printf %s "checking for $LD option to reload object files... " >&6; }
+if test ${lt_cv_ld_reload_flag+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ld_reload_flag='-r'
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+printf "%s\n" "$lt_cv_ld_reload_flag" >&6; }
reload_flag=$lt_cv_ld_reload_flag
case $reload_flag in
"" | " "*) ;;
@@ -5433,13 +6075,122 @@ esac
if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args.
+set dummy ${ac_tool_prefix}file; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_FILECMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$FILECMD"; then
+ ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_FILECMD="${ac_tool_prefix}file"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+FILECMD=$ac_cv_prog_FILECMD
+if test -n "$FILECMD"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5
+printf "%s\n" "$FILECMD" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_FILECMD"; then
+ ac_ct_FILECMD=$FILECMD
+ # Extract the first word of "file", so it can be a program name with args.
+set dummy file; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_FILECMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$ac_ct_FILECMD"; then
+ ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_FILECMD="file"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD
+if test -n "$ac_ct_FILECMD"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5
+printf "%s\n" "$ac_ct_FILECMD" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_FILECMD" = x; then
+ FILECMD=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ FILECMD=$ac_ct_FILECMD
+ fi
+else
+ FILECMD="$ac_cv_prog_FILECMD"
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
else
@@ -5447,11 +6198,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5462,11 +6217,11 @@ fi
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+printf "%s\n" "$OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5475,11 +6230,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
ac_ct_OBJDUMP=$OBJDUMP
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
else
@@ -5487,11 +6243,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5502,11 +6262,11 @@ fi
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+printf "%s\n" "$ac_ct_OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OBJDUMP" = x; then
@@ -5514,8 +6274,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OBJDUMP=$ac_ct_OBJDUMP
@@ -5531,11 +6291,12 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+printf %s "checking how to recognize dependent libraries... " >&6; }
+if test ${lt_cv_deplibs_check_method+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
@@ -5561,7 +6322,7 @@ beos*)
bsdi[45]*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -5595,14 +6356,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -5616,7 +6377,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
@@ -5663,7 +6424,7 @@ netbsd*)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@@ -5731,8 +6492,8 @@ os2*)
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+printf "%s\n" "$lt_cv_deplibs_check_method" >&6; }
file_magic_glob=
want_nocaseglob=no
@@ -5776,11 +6537,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
@@ -5788,11 +6550,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5803,11 +6569,11 @@ fi
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+printf "%s\n" "$DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5816,11 +6582,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then
ac_ct_DLLTOOL=$DLLTOOL
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DLLTOOL"; then
ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
else
@@ -5828,11 +6595,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5843,11 +6614,11 @@ fi
fi
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+printf "%s\n" "$ac_ct_DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_DLLTOOL" = x; then
@@ -5855,8 +6626,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DLLTOOL=$ac_ct_DLLTOOL
@@ -5873,11 +6644,12 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+printf %s "checking how to associate runtime and link libraries... " >&6; }
+if test ${lt_cv_sharedlib_from_linklib_cmd+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
@@ -5900,8 +6672,8 @@ cygwin* | mingw* | pw32* | cegcc*)
esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
@@ -5917,11 +6689,12 @@ if test -n "$ac_tool_prefix"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
@@ -5929,11 +6702,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5944,11 +6721,11 @@ fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5961,11 +6738,12 @@ if test -z "$AR"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AR+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_AR"; then
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
else
@@ -5973,11 +6751,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5988,11 +6770,11 @@ fi
fi
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+printf "%s\n" "$ac_ct_AR" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -6004,8 +6786,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
@@ -6013,42 +6795,60 @@ esac
fi
: ${AR=ar}
-: ${AR_FLAGS=cru}
+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
+# higher priority because thats what people were doing historically (setting
+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
+# variable obsoleted/removed.
+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
+lt_ar_flags=$AR_FLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+
+
+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
+
+
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+printf %s "checking for archiver @FILE support... " >&6; }
+if test ${lt_cv_ar_at_file+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ar_at_file=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
echo conftest.$ac_objext > conftest.lst
lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test 0 -eq "$ac_status"; then
# Ensure the archiver fails upon bogus file names.
@@ -6056,7 +6856,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test 0 -ne "$ac_status"; then
lt_cv_ar_at_file=@
@@ -6065,11 +6865,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
rm -f conftest.* libconftest.a
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+printf "%s\n" "$lt_cv_ar_at_file" >&6; }
if test no = "$lt_cv_ar_at_file"; then
archiver_list_spec=
@@ -6086,11 +6886,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
@@ -6098,11 +6899,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6113,11 +6918,11 @@ fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -6126,11 +6931,12 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
@@ -6138,11 +6944,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6153,11 +6963,11 @@ fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -6165,8 +6975,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -6185,11 +6995,12 @@ test -z "$STRIP" && STRIP=:
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
@@ -6197,11 +7008,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6212,11 +7027,11 @@ fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -6225,11 +7040,12 @@ if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
@@ -6237,11 +7053,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6252,11 +7072,11 @@ fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
@@ -6264,8 +7084,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
@@ -6354,11 +7174,12 @@ compiler=$CC
# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+printf %s "checking command to parse $NM output from $compiler object... " >&6; }
+if test ${lt_cv_sys_global_symbol_pipe+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
@@ -6413,7 +7234,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@@ -6431,20 +7252,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@@ -6468,7 +7289,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
+ # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
@@ -6486,9 +7307,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -6510,14 +7331,14 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
(eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
@@ -6586,7 +7407,7 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest$ac_exeext; then
pipe_works=yes
fi
@@ -6621,11 +7442,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+printf "%s\n" "failed" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+printf "%s\n" "ok" >&6; }
fi
# Response file support.
@@ -6671,13 +7492,14 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+printf %s "checking for sysroot... " >&6; }
# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
+if test ${with_sysroot+y}
+then :
withval=$with_sysroot;
-else
+else $as_nop
with_sysroot=no
fi
@@ -6690,29 +7512,30 @@ case $with_sysroot in #(
fi
;; #(
/*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
-$as_echo "$with_sysroot" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+printf "%s\n" "$with_sysroot" >&6; }
as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+printf "%s\n" "${lt_sysroot:-no}" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
-$as_echo_n "checking for a working dd... " >&6; }
-if ${ac_cv_path_lt_DD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+printf %s "checking for a working dd... " >&6; }
+if test ${ac_cv_path_lt_DD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
: ${lt_DD:=$DD}
@@ -6723,10 +7546,15 @@ if test -z "$lt_DD"; then
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in dd; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in dd
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_lt_DD" || continue
if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
cmp -s conftest.i conftest.out \
@@ -6746,15 +7574,16 @@ fi
rm -f conftest.i conftest2.i conftest.out
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
-$as_echo "$ac_cv_path_lt_DD" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+printf "%s\n" "$ac_cv_path_lt_DD" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
-$as_echo_n "checking how to truncate binary pipes... " >&6; }
-if ${lt_cv_truncate_bin+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+printf %s "checking how to truncate binary pipes... " >&6; }
+if test ${lt_cv_truncate_bin+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
lt_cv_truncate_bin=
@@ -6765,8 +7594,8 @@ fi
rm -f conftest.i conftest2.i conftest.out
test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
-$as_echo "$lt_cv_truncate_bin" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+printf "%s\n" "$lt_cv_truncate_bin" >&6; }
@@ -6789,7 +7618,8 @@ func_cc_basename ()
}
# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
+if test ${enable_libtool_lock+y}
+then :
enableval=$enable_libtool_lock;
fi
@@ -6805,9 +7635,9 @@ ia64-*-hpux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@@ -6825,10 +7655,10 @@ ia64-*-hpux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@@ -6840,7 +7670,7 @@ ia64-*-hpux*)
;;
esac
else
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -6863,10 +7693,10 @@ mips64*-*linux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@@ -6874,7 +7704,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@@ -6882,7 +7712,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@@ -6904,16 +7734,16 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@@ -6967,11 +7797,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+printf %s "checking whether the C compiler needs -belf... " >&6; }
+if test ${lt_cv_cc_needs_belf+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6982,19 +7813,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_cv_cc_needs_belf=yes
-else
+else $as_nop
lt_cv_cc_needs_belf=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7003,8 +7835,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+printf "%s\n" "$lt_cv_cc_needs_belf" >&6; }
if test yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS=$SAVE_CFLAGS
@@ -7017,9 +7849,9 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@@ -7054,11 +7886,12 @@ need_locks=$enable_libtool_lock
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_MANIFEST_TOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$MANIFEST_TOOL"; then
ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
else
@@ -7066,11 +7899,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7081,11 +7918,11 @@ fi
fi
MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+printf "%s\n" "$MANIFEST_TOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7094,11 +7931,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
# Extract the first word of "mt", so it can be a program name with args.
set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_MANIFEST_TOOL"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
else
@@ -7106,11 +7944,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7121,11 +7963,11 @@ fi
fi
ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_MANIFEST_TOOL" = x; then
@@ -7133,8 +7975,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
@@ -7144,11 +7986,12 @@ else
fi
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if test ${lt_cv_path_mainfest_tool+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_path_mainfest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
@@ -7158,8 +8001,8 @@ else
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; }
if test yes != "$lt_cv_path_mainfest_tool"; then
MANIFEST_TOOL=:
fi
@@ -7174,11 +8017,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DSYMUTIL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DSYMUTIL"; then
ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
else
@@ -7186,11 +8030,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7201,11 +8049,11 @@ fi
fi
DSYMUTIL=$ac_cv_prog_DSYMUTIL
if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+printf "%s\n" "$DSYMUTIL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7214,11 +8062,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then
ac_ct_DSYMUTIL=$DSYMUTIL
# Extract the first word of "dsymutil", so it can be a program name with args.
set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DSYMUTIL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DSYMUTIL"; then
ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
else
@@ -7226,11 +8075,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7241,11 +8094,11 @@ fi
fi
ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+printf "%s\n" "$ac_ct_DSYMUTIL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_DSYMUTIL" = x; then
@@ -7253,8 +8106,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DSYMUTIL=$ac_ct_DSYMUTIL
@@ -7266,11 +8119,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_NMEDIT+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$NMEDIT"; then
ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
else
@@ -7278,11 +8132,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7293,11 +8151,11 @@ fi
fi
NMEDIT=$ac_cv_prog_NMEDIT
if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+printf "%s\n" "$NMEDIT" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7306,11 +8164,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then
ac_ct_NMEDIT=$NMEDIT
# Extract the first word of "nmedit", so it can be a program name with args.
set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_NMEDIT+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_NMEDIT"; then
ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
else
@@ -7318,11 +8177,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7333,11 +8196,11 @@ fi
fi
ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+printf "%s\n" "$ac_ct_NMEDIT" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_NMEDIT" = x; then
@@ -7345,8 +8208,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
NMEDIT=$ac_ct_NMEDIT
@@ -7358,11 +8221,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_LIPO+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$LIPO"; then
ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
else
@@ -7370,11 +8234,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7385,11 +8253,11 @@ fi
fi
LIPO=$ac_cv_prog_LIPO
if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+printf "%s\n" "$LIPO" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7398,11 +8266,12 @@ if test -z "$ac_cv_prog_LIPO"; then
ac_ct_LIPO=$LIPO
# Extract the first word of "lipo", so it can be a program name with args.
set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_LIPO+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_LIPO"; then
ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
else
@@ -7410,11 +8279,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7425,11 +8298,11 @@ fi
fi
ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+printf "%s\n" "$ac_ct_LIPO" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_LIPO" = x; then
@@ -7437,8 +8310,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
LIPO=$ac_ct_LIPO
@@ -7450,11 +8323,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OTOOL"; then
ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
else
@@ -7462,11 +8336,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7477,11 +8355,11 @@ fi
fi
OTOOL=$ac_cv_prog_OTOOL
if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+printf "%s\n" "$OTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7490,11 +8368,12 @@ if test -z "$ac_cv_prog_OTOOL"; then
ac_ct_OTOOL=$OTOOL
# Extract the first word of "otool", so it can be a program name with args.
set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OTOOL"; then
ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
else
@@ -7502,11 +8381,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7517,11 +8400,11 @@ fi
fi
ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+printf "%s\n" "$ac_ct_OTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OTOOL" = x; then
@@ -7529,8 +8412,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL=$ac_ct_OTOOL
@@ -7542,11 +8425,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OTOOL64+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OTOOL64"; then
ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
else
@@ -7554,11 +8438,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7569,11 +8457,11 @@ fi
fi
OTOOL64=$ac_cv_prog_OTOOL64
if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+printf "%s\n" "$OTOOL64" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -7582,11 +8470,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then
ac_ct_OTOOL64=$OTOOL64
# Extract the first word of "otool64", so it can be a program name with args.
set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OTOOL64+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OTOOL64"; then
ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
else
@@ -7594,11 +8483,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -7609,11 +8502,11 @@ fi
fi
ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+printf "%s\n" "$ac_ct_OTOOL64" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OTOOL64" = x; then
@@ -7621,8 +8514,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL64=$ac_ct_OTOOL64
@@ -7657,11 +8550,12 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+printf %s "checking for -single_module linker flag... " >&6; }
+if test ${lt_cv_apple_cc_single_mod+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_apple_cc_single_mod=no
if test -z "$LT_MULTI_MODULE"; then
# By default we will add the -single_module flag. You can override
@@ -7690,14 +8584,15 @@ else
rm -f conftest.*
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+printf %s "checking for -exported_symbols_list linker flag... " >&6; }
+if test ${lt_cv_ld_exported_symbols_list+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
@@ -7706,39 +8601,41 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_cv_ld_exported_symbols_list=yes
-else
+else $as_nop
lt_cv_ld_exported_symbols_list=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+printf %s "checking for -force_load linker flag... " >&6; }
+if test ${lt_cv_ld_force_load+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5
+ $AR $AR_FLAGS libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
@@ -7758,24 +8655,19 @@ _LT_EOF
rm -rf conftest.dSYM
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+printf "%s\n" "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[012][,.]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ darwin*)
+ case $MACOSX_DEPLOYMENT_TARGET,$host in
+ 10.[012],*|,*powerpc*-darwin[5-8]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
@@ -7830,149 +8722,43 @@ func_munge_path_list ()
esac
}
+ac_header= ac_cache=
+for ac_item in $ac_header_c_list
+do
+ if test $ac_cache; then
+ ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
+ if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
+ printf "%s\n" "#define $ac_item 1" >> confdefs.h
+ fi
+ ac_header= ac_cache=
+ elif test $ac_header; then
+ ac_cache=$ac_item
+ else
+ ac_header=$ac_item
+ fi
+done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-fi
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-fi
+if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
+then :
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
+if test "x$ac_cv_header_dlfcn_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h
fi
-done
-
@@ -7985,11 +8771,12 @@ case $host in
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AS+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$AS"; then
ac_cv_prog_AS="$AS" # Let the user override the test.
else
@@ -7997,11 +8784,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8012,11 +8803,11 @@ fi
fi
AS=$ac_cv_prog_AS
if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+printf "%s\n" "$AS" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8025,11 +8816,12 @@ if test -z "$ac_cv_prog_AS"; then
ac_ct_AS=$AS
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AS+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_AS"; then
ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
else
@@ -8037,11 +8829,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8052,11 +8848,11 @@ fi
fi
ac_ct_AS=$ac_cv_prog_ac_ct_AS
if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+printf "%s\n" "$ac_ct_AS" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_AS" = x; then
@@ -8064,8 +8860,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AS=$ac_ct_AS
@@ -8077,11 +8873,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
@@ -8089,11 +8886,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8104,11 +8905,11 @@ fi
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+printf "%s\n" "$DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8117,11 +8918,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then
ac_ct_DLLTOOL=$DLLTOOL
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_DLLTOOL+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_DLLTOOL"; then
ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
else
@@ -8129,11 +8931,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8144,11 +8950,11 @@ fi
fi
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+printf "%s\n" "$ac_ct_DLLTOOL" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_DLLTOOL" = x; then
@@ -8156,8 +8962,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DLLTOOL=$ac_ct_DLLTOOL
@@ -8169,11 +8975,12 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
else
@@ -8181,11 +8988,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8196,11 +9007,11 @@ fi
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+printf "%s\n" "$OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8209,11 +9020,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
ac_ct_OBJDUMP=$OBJDUMP
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_OBJDUMP+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
else
@@ -8221,11 +9033,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8236,11 +9052,11 @@ fi
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+printf "%s\n" "$ac_ct_OBJDUMP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_OBJDUMP" = x; then
@@ -8248,8 +9064,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OBJDUMP=$ac_ct_OBJDUMP
@@ -8286,7 +9102,8 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
+if test ${enable_shared+y}
+then :
enableval=$enable_shared; p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
@@ -8304,7 +9121,7 @@ if test "${enable_shared+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
enable_shared=yes
fi
@@ -8317,7 +9134,8 @@ fi
# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
+if test ${enable_static+y}
+then :
enableval=$enable_static; p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
@@ -8335,7 +9153,7 @@ if test "${enable_static+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
enable_static=yes
fi
@@ -8349,7 +9167,8 @@ fi
# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
+if test ${with_pic+y}
+then :
withval=$with_pic; lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
@@ -8366,7 +9185,7 @@ if test "${with_pic+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
pic_mode=default
fi
@@ -8378,7 +9197,8 @@ fi
# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
+if test ${enable_fast_install+y}
+then :
enableval=$enable_fast_install; p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
@@ -8396,7 +9216,7 @@ if test "${enable_fast_install+set}" = set; then :
IFS=$lt_save_ifs
;;
esac
-else
+else $as_nop
enable_fast_install=yes
fi
@@ -8410,11 +9230,12 @@ fi
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[5-9]*,yes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
-$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+printf %s "checking which variant of shared library versioning to provide... " >&6; }
# Check whether --with-aix-soname was given.
-if test "${with_aix_soname+set}" = set; then :
+if test ${with_aix_soname+y}
+then :
withval=$with_aix_soname; case $withval in
aix|svr4|both)
;;
@@ -8423,18 +9244,19 @@ if test "${with_aix_soname+set}" = set; then :
;;
esac
lt_cv_with_aix_soname=$with_aix_soname
-else
- if ${lt_cv_with_aix_soname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ if test ${lt_cv_with_aix_soname+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_with_aix_soname=aix
fi
with_aix_soname=$lt_cv_with_aix_soname
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
-$as_echo "$with_aix_soname" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+printf "%s\n" "$with_aix_soname" >&6; }
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
@@ -8516,11 +9338,12 @@ if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+printf %s "checking for objdir... " >&6; }
+if test ${lt_cv_objdir+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
@@ -8531,17 +9354,15 @@ else
fi
rmdir .libs 2>/dev/null
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+printf "%s\n" "$lt_cv_objdir" >&6; }
objdir=$lt_cv_objdir
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
+printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h
@@ -8562,8 +9383,8 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -8587,11 +9408,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+printf %s "checking for ${ac_tool_prefix}file... " >&6; }
+if test ${lt_cv_path_MAGIC_CMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
@@ -8640,11 +9462,11 @@ fi
MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+printf "%s\n" "$MAGIC_CMD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8653,11 +9475,12 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+printf %s "checking for file... " >&6; }
+if test ${lt_cv_path_MAGIC_CMD+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
@@ -8706,11 +9529,11 @@ fi
MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+printf "%s\n" "$MAGIC_CMD" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -8795,11 +9618,12 @@ if test yes = "$GCC"; then
lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test ${lt_cv_prog_compiler_rtti_exceptions+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
@@ -8830,8 +9654,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -9072,7 +9896,7 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
@@ -9188,26 +10012,28 @@ case $host_os in
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+printf %s "checking for $compiler option to produce PIC... " >&6; }
+if test ${lt_cv_prog_compiler_pic+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; }
lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test ${lt_cv_prog_compiler_pic_works+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
@@ -9238,8 +10064,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; }
if test yes = "$lt_cv_prog_compiler_pic_works"; then
case $lt_prog_compiler_pic in
@@ -9267,11 +10093,12 @@ fi
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test ${lt_cv_prog_compiler_static_works+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_static_works=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
@@ -9295,8 +10122,8 @@ else
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; }
if test yes = "$lt_cv_prog_compiler_static_works"; then
:
@@ -9310,11 +10137,12 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test ${lt_cv_prog_compiler_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
@@ -9357,19 +10185,20 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test ${lt_cv_prog_compiler_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
@@ -9412,8 +10241,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; }
@@ -9421,19 +10250,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
hard_links=nottested
if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
# do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+printf %s "checking if we can lock with hard links... " >&6; }
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+printf "%s\n" "$hard_links" >&6; }
if test no = "$hard_links"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
@@ -9445,8 +10274,8 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
runpath_var=
allow_undefined_flag=
@@ -9490,15 +10319,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
+ # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@@ -9550,7 +10379,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+ case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9662,6 +10491,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
+ file_list_spec='@'
;;
interix[3-9]*)
@@ -9676,7 +10506,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@@ -9719,7 +10549,7 @@ _LT_EOF
compiler_needs_object=yes
;;
esac
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
@@ -9731,7 +10561,7 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
@@ -9747,7 +10577,7 @@ _LT_EOF
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@@ -9879,7 +10709,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -10001,21 +10831,23 @@ _LT_EOF
if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_aix_libpath_+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -10030,7 +10862,7 @@ if ac_fn_c_try_link "$LINENO"; then :
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=/usr/lib:/lib
@@ -10054,21 +10886,23 @@ fi
if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_aix_libpath_+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
@@ -10083,7 +10917,7 @@ if ac_fn_c_try_link "$LINENO"; then :
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=/usr/lib:/lib
@@ -10146,12 +10980,12 @@ fi
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
- cl*)
- # Native MSVC
+ cl* | icl*)
+ # Native MSVC or ICC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
@@ -10192,7 +11026,7 @@ fi
fi'
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
@@ -10233,8 +11067,8 @@ fi
output_verbose_link_cmd=func_echo_all
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
else
ld_shlibs=no
@@ -10268,7 +11102,7 @@ fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -10334,11 +11168,12 @@ fi
# Older versions of the 11.00 compiler do not understand -b yet
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+printf %s "checking if $CC understands -b... " >&6; }
+if test ${lt_cv_prog_compiler__b+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_prog_compiler__b=no
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -b"
@@ -10362,8 +11197,8 @@ else
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+printf "%s\n" "$lt_cv_prog_compiler__b" >&6; }
if test yes = "$lt_cv_prog_compiler__b"; then
archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
@@ -10403,28 +11238,30 @@ fi
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
# This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if test ${lt_cv_irix_exported_symbol+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int foo (void) { return 0; }
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
lt_cv_irix_exported_symbol=yes
-else
+else $as_nop
lt_cv_irix_exported_symbol=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
if test yes = "$lt_cv_irix_exported_symbol"; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
@@ -10516,6 +11353,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
+ file_list_spec='@'
;;
osf3*)
@@ -10704,8 +11542,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+printf "%s\n" "$ld_shlibs" >&6; }
test no = "$ld_shlibs" && can_build_shared=no
with_gnu_ld=$with_gnu_ld
@@ -10741,18 +11579,19 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+printf %s "checking whether -lc should be explicitly linked in... " >&6; }
+if test ${lt_cv_archive_cmds_need_lc+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 2>conftest.err; then
soname=conftest
lib=conftest
@@ -10770,7 +11609,7 @@ else
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
(eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then
lt_cv_archive_cmds_need_lc=no
@@ -10784,8 +11623,8 @@ else
$RM conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; }
archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
;;
esac
@@ -10944,8 +11783,8 @@ esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+printf %s "checking dynamic linker characteristics... " >&6; }
if test yes = "$GCC"; then
case $host_os in
@@ -11207,7 +12046,7 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
@@ -11217,14 +12056,14 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
- *,cl*)
- # Native MSVC
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@@ -11243,7 +12082,7 @@ cygwin* | mingw* | pw32* | cegcc*)
done
IFS=$lt_save_ifs
# Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@@ -11280,7 +12119,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@@ -11313,7 +12152,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@@ -11506,9 +12345,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ if test ${lt_cv_shlibpath_overrides_runpath+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
@@ -11518,19 +12358,21 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+if ac_fn_c_try_link "$LINENO"
+then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null
+then :
lt_cv_shlibpath_overrides_runpath=yes
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
@@ -11762,8 +12604,8 @@ uts4*)
dynamic_linker=no
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+printf "%s\n" "$dynamic_linker" >&6; }
test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
@@ -11884,8 +12726,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+printf %s "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
test -n "$runpath_var" ||
@@ -11909,8 +12751,8 @@ else
# directories.
hardcode_action=unsupported
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+printf "%s\n" "$hardcode_action" >&6; }
if test relink = "$hardcode_action" ||
test yes = "$inherit_rpath"; then
@@ -11954,11 +12796,12 @@ else
darwin*)
# if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+printf %s "checking for dlopen in -ldl... " >&6; }
+if test ${ac_cv_lib_dl_dlopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11967,32 +12810,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char dlopen ();
int
-main ()
+main (void)
{
return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dl_dlopen=yes
-else
+else $as_nop
ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
+else $as_nop
lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
@@ -12012,14 +12854,16 @@ fi
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
+if test "x$ac_cv_func_shl_load" = xyes
+then :
lt_cv_dlopen=shl_load
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+printf %s "checking for shl_load in -ldld... " >&6; }
+if test ${ac_cv_lib_dld_shl_load+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12028,41 +12872,42 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char shl_load ();
int
-main ()
+main (void)
{
return shl_load ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dld_shl_load=yes
-else
+else $as_nop
ac_cv_lib_dld_shl_load=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes
+then :
lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
-else
+else $as_nop
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
+if test "x$ac_cv_func_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+printf %s "checking for dlopen in -ldl... " >&6; }
+if test ${ac_cv_lib_dl_dlopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12071,37 +12916,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char dlopen ();
int
-main ()
+main (void)
{
return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dl_dlopen=yes
-else
+else $as_nop
ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+printf %s "checking for dlopen in -lsvld... " >&6; }
+if test ${ac_cv_lib_svld_dlopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12110,37 +12955,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char dlopen ();
int
-main ()
+main (void)
{
return dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_svld_dlopen=yes
-else
+else $as_nop
ac_cv_lib_svld_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes
+then :
lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+printf %s "checking for dld_link in -ldld... " >&6; }
+if test ${ac_cv_lib_dld_dld_link+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12149,30 +12994,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char dld_link ();
int
-main ()
+main (void)
{
return dld_link ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_dld_dld_link=yes
-else
+else $as_nop
ac_cv_lib_dld_dld_link=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes
+then :
lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
fi
@@ -12211,11 +13055,12 @@ fi
save_LIBS=$LIBS
LIBS="$lt_cv_dlopen_libs $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+printf %s "checking whether a program can dlopen itself... " >&6; }
+if test ${lt_cv_dlopen_self+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self=cross
else
@@ -12294,7 +13139,7 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
@@ -12312,16 +13157,17 @@ rm -fr conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+printf "%s\n" "$lt_cv_dlopen_self" >&6; }
if test yes = "$lt_cv_dlopen_self"; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+printf %s "checking whether a statically linked program can dlopen itself... " >&6; }
+if test ${lt_cv_dlopen_self_static+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self_static=cross
else
@@ -12400,7 +13246,7 @@ _LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
@@ -12418,8 +13264,8 @@ rm -fr conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+printf "%s\n" "$lt_cv_dlopen_self_static" >&6; }
fi
CPPFLAGS=$save_CPPFLAGS
@@ -12457,32 +13303,43 @@ fi
striplib=
old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+printf %s "checking whether stripping libraries is possible... " >&6; }
+if test -z "$STRIP"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+else
+ if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ else
+ case $host_os in
+ darwin*)
+ # FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ ;;
+ freebsd*)
+ if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ fi
+ ;;
+ *)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ ;;
+ esac
+ fi
fi
@@ -12497,13 +13354,13 @@ fi
# Report what library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+printf %s "checking if libtool supports shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+printf "%s\n" "$can_build_shared" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+printf %s "checking whether to build shared libraries... " >&6; }
test no = "$can_build_shared" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
@@ -12527,15 +13384,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
fi
;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+printf "%s\n" "$enable_shared" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+printf %s "checking whether to build static libraries... " >&6; }
# Make sure either enable_shared or enable_static is yes.
test yes = "$enable_shared" || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+printf "%s\n" "$enable_static" >&6; }
@@ -12575,17 +13432,17 @@ CC=$lt_save_CC
# Some awks crash when confronted with pnglibconf.dfa, do a test run now
# to make sure this doesn't happen
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that AWK works" >&5
-$as_echo_n "checking that AWK works... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that AWK works" >&5
+printf %s "checking that AWK works... " >&6; }
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
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+printf "%s\n" "ok" >&6; }
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 1 "failed
See \`config.log' for more details" "$LINENO" 5; }
fi
@@ -12595,18 +13452,19 @@ fi
DFNCPP="$CPP"
-# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
-# checks the compiler with a program that generates a warning), add the
-# following option to deal with this
+# -Werror cannot be passed to GCC in CFLAGS because configure will fail
+# (it checks the compiler with a program that generates a warning).
+# Add the following option to deal with this:
# Check whether --enable-werror was given.
-if test "${enable_werror+set}" = set; then :
+if test ${enable_werror+y}
+then :
enableval=$enable_werror; test "$enable_werror" = "yes" && enable_werror="-Werror"
if test "$enable_werror" != "no"; then
sav_CFLAGS="$CFLAGS"
CFLAGS="$enable_werror $CFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler allows $enable_werror" >&5
-$as_echo_n "checking if the compiler allows $enable_werror... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler allows $enable_werror" >&5
+printf %s "checking if the compiler allows $enable_werror... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12614,26 +13472,27 @@ $as_echo_n "checking if the compiler allows $enable_werror... " >&6; }
return argv[argc-1][0];
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if ac_fn_c_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
PNG_COPTS="$PNG_COPTS $enable_werror"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS="$sav_CFLAGS"
fi
fi
-# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89
-# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1
-# This is incompatible with the new default mode, so we test for that and force the
-# "-std=c89" compiler option:
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to force back C standard to C89" >&5
-$as_echo_n "checking if we need to force back C standard to C89... " >&6; }
+# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89.
+# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
+# _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
+# we test for that and force the "-std=c89" compiler option:
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we need to force back C standard to C89" >&5
+printf %s "checking if we need to force back C standard to C89... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12641,247 +13500,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#include <stdio.h>
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-else
+if ac_fn_c_try_compile "$LINENO"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+else $as_nop
if test "x$GCC" != "xyes"; then
as_fn_error $? "Forcing back to C89 is required but the flags are only known for GCC" "$LINENO" 5
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
CFLAGS="$CFLAGS -std=c89"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# Checks for header files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
- typedef int charset[2];
- const charset cs = { 0, 0 };
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
-else
- ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+# Checks for structures and compiler characteristics.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if test ${ac_cv_struct_tm+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <time.h>
int
-main ()
+main (void)
{
struct tm tm;
int *p = &tm.tm_sec;
@@ -12890,209 +13545,89 @@ struct tm tm;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_struct_tm=time.h
-else
+else $as_nop
ac_cv_struct_tm=sys/time.h
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+printf "%s\n" "$ac_cv_struct_tm" >&6; }
if test $ac_cv_struct_tm = sys/time.h; then
-$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
-$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if ${ac_cv_c_restrict+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+printf %s "checking for C/C++ restrict keyword... " >&6; }
+if test ${ac_cv_c_restrict+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_cv_c_restrict=no
- # The order here caters to the fact that C++ does not require restrict.
- for ac_kw in __restrict __restrict__ _Restrict restrict; do
+ # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+ # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+ # Put 'restrict' last, because C++ lacks it.
+ for ac_kw in __restrict__ __restrict _Restrict restrict; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-typedef int * int_ptr;
- int foo (int_ptr $ac_kw ip) {
- return ip[0];
- }
+typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+
int
-main ()
+main (void)
{
int s[1];
- int * $ac_kw t = s;
- t[0] = 0;
- return foo(t)
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_restrict=$ac_kw
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
test "$ac_cv_c_restrict" != no && break
done
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
-$as_echo "$ac_cv_c_restrict" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+printf "%s\n" "$ac_cv_c_restrict" >&6; }
case $ac_cv_c_restrict in
restrict) ;;
- no) $as_echo "#define restrict /**/" >>confdefs.h
+ no) printf "%s\n" "#define restrict /**/" >>confdefs.h
;;
- *) cat >>confdefs.h <<_ACEOF
-#define restrict $ac_cv_c_restrict
-_ACEOF
+ *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h
;;
esac
# Checks for library functions.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
-$as_echo_n "checking for working strtod... " >&6; }
-if ${ac_cv_func_strtod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_strtod=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-$ac_includes_default
-#ifndef strtod
-double strtod ();
-#endif
-int
-main()
-{
- {
- /* Some versions of Linux strtod mis-parse strings with leading '+'. */
- char *string = " +69";
- char *term;
- double value;
- value = strtod (string, &term);
- if (value != 69 || term != (string + 4))
- return 1;
- }
-
- {
- /* Under Solaris 2.4, strtod returns the wrong value for the
- terminating character under some conditions. */
- char *string = "NaN";
- char *term;
- strtod (string, &term);
- if (term != string && *(term - 1) == 0)
- return 1;
- }
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_strtod=yes
-else
- ac_cv_func_strtod=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
-$as_echo "$ac_cv_func_strtod" >&6; }
-if test $ac_cv_func_strtod = no; then
- case " $LIBOBJS " in
- *" strtod.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
- ;;
-esac
-
-ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes; then :
-
-fi
-
-if test $ac_cv_func_pow = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
-$as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pow ();
-int
-main ()
-{
-return pow ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_pow=yes
-else
- ac_cv_lib_m_pow=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
-$as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
- POW_LIB=-lm
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
-$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
-fi
-fi
-
-fi
-
-for ac_func in memset
-do :
- ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset"
-if test "x$ac_cv_func_memset" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMSET 1
-_ACEOF
-
-else
- as_fn_error $? "memset not found in libc" "$LINENO" 5
-fi
-done
-
-for ac_func in pow
+ for ac_func in pow
do :
ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_POW 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
-$as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+if test "x$ac_cv_func_pow" = xyes
+then :
+ printf "%s\n" "#define HAVE_POW 1" >>confdefs.h
+
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
+printf %s "checking for pow in -lm... " >&6; }
+if test ${ac_cv_lib_m_pow+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13101,52 +13636,50 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char pow ();
int
-main ()
+main (void)
{
return pow ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_m_pow=yes
-else
+else $as_nop
ac_cv_lib_m_pow=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
-$as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
+printf "%s\n" "$ac_cv_lib_m_pow" >&6; }
+if test "x$ac_cv_lib_m_pow" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h
LIBS="-lm $LIBS"
-else
+else $as_nop
as_fn_error $? "cannot find pow" "$LINENO" 5
fi
fi
-done
+done
-# Some later POSIX 1003.1 functions are required for test programs, failure here
-# is soft (the corresponding test program is not built).
+# Some later POSIX 1003.1 functions are required for test programs, failure
+# here is soft (the corresponding test program is not built).
ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
-if test "x$ac_cv_func_clock_gettime" = xyes; then :
+if test "x$ac_cv_func_clock_gettime" = xyes
+then :
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not building timepng" >&5
-$as_echo "$as_me: WARNING: not building timepng" >&2;}
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: not building timepng" >&5
+printf "%s\n" "$as_me: WARNING: not building timepng" >&2;}
fi
if test "$ac_cv_func_clock_gettime" = "yes"; then
@@ -13160,17 +13693,19 @@ fi
# Check whether --with-zlib-prefix was given.
-if test "${with_zlib_prefix+set}" = set; then :
+if test ${with_zlib_prefix+y}
+then :
withval=$with_zlib_prefix; ZPREFIX=${withval}
-else
+else $as_nop
ZPREFIX='z_'
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5
-$as_echo_n "checking for zlibVersion in -lz... " >&6; }
-if ${ac_cv_lib_z_zlibVersion+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5
+printf %s "checking for zlibVersion in -lz... " >&6; }
+if test ${ac_cv_lib_z_zlibVersion+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13179,43 +13714,41 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char zlibVersion ();
int
-main ()
+main (void)
{
return zlibVersion ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_z_zlibVersion=yes
-else
+else $as_nop
ac_cv_lib_z_zlibVersion=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5
-$as_echo "$ac_cv_lib_z_zlibVersion" >&6; }
-if test "x$ac_cv_lib_z_zlibVersion" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5
+printf "%s\n" "$ac_cv_lib_z_zlibVersion" >&6; }
+if test "x$ac_cv_lib_z_zlibVersion" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h
LIBS="-lz $LIBS"
-else
- as_ac_Lib=`$as_echo "ac_cv_lib_z_${ZPREFIX}zlibVersion" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ZPREFIX}zlibVersion in -lz" >&5
-$as_echo_n "checking for ${ZPREFIX}zlibVersion in -lz... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+else $as_nop
+ as_ac_Lib=`printf "%s\n" "ac_cv_lib_z_${ZPREFIX}zlibVersion" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ZPREFIX}zlibVersion in -lz" >&5
+printf %s "checking for ${ZPREFIX}zlibVersion in -lz... " >&6; }
+if eval test \${$as_ac_Lib+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13224,38 +13757,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char ${ZPREFIX}zlibVersion ();
int
-main ()
+main (void)
{
return ${ZPREFIX}zlibVersion ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
eval "$as_ac_Lib=yes"
-else
+else $as_nop
eval "$as_ac_Lib=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
eval ac_res=\$$as_ac_Lib
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"
+then :
+ printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h
LIBS="-lz $LIBS"
-else
+else $as_nop
as_fn_error $? "zlib not installed" "$LINENO" 5
fi
@@ -13265,11 +13795,12 @@ fi
# The following is for pngvalid, to ensure it catches FP errors even on
# platforms that don't enable FP exceptions, the function appears in the math
# library (typically), it's not an error if it is not found.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for feenableexcept in -lm" >&5
-$as_echo_n "checking for feenableexcept in -lm... " >&6; }
-if ${ac_cv_lib_m_feenableexcept+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for feenableexcept in -lm" >&5
+printf %s "checking for feenableexcept in -lm... " >&6; }
+if test ${ac_cv_lib_m_feenableexcept+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13278,61 +13809,54 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
char feenableexcept ();
int
-main ()
+main (void)
{
return feenableexcept ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_m_feenableexcept=yes
-else
+else $as_nop
ac_cv_lib_m_feenableexcept=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_feenableexcept" >&5
-$as_echo "$ac_cv_lib_m_feenableexcept" >&6; }
-if test "x$ac_cv_lib_m_feenableexcept" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_feenableexcept" >&5
+printf "%s\n" "$ac_cv_lib_m_feenableexcept" >&6; }
+if test "x$ac_cv_lib_m_feenableexcept" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h
LIBS="-lm $LIBS"
fi
-for ac_func in feenableexcept
-do :
- ac_fn_c_check_func "$LINENO" "feenableexcept" "ac_cv_func_feenableexcept"
-if test "x$ac_cv_func_feenableexcept" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_FEENABLEEXCEPT 1
-_ACEOF
+ac_fn_c_check_func "$LINENO" "feenableexcept" "ac_cv_func_feenableexcept"
+if test "x$ac_cv_func_feenableexcept" = xyes
+then :
+ printf "%s\n" "#define HAVE_FEENABLEEXCEPT 1" >>confdefs.h
fi
-done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if using Solaris linker" >&5
-$as_echo_n "checking if using Solaris linker... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if using Solaris linker" >&5
+printf %s "checking if using Solaris linker... " >&6; }
SLD=`$LD --version 2>&1 | grep Solaris`
if test "$SLD"; then
have_solaris_ld=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
have_solaris_ld=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "$have_solaris_ld" = "yes"; then
HAVE_SOLARIS_LD_TRUE=
@@ -13343,16 +13867,16 @@ else
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5
-$as_echo_n "checking if libraries can be versioned... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5
+printf %s "checking if libraries can be versioned... " >&6; }
# Special case for PE/COFF platforms: ld reports
# support for version-script, but doesn't actually
# DO anything with it.
case $host in
*cygwin* | *mingw32* | *interix* )
have_ld_version_script=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
;;
* )
@@ -13364,14 +13888,14 @@ fi
if test "$GLD"; then
have_ld_version_script=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
have_ld_version_script=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** You have not enabled versioned symbols." >&5
-$as_echo "$as_me: WARNING: *** You have not enabled versioned symbols." >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** You have not enabled versioned symbols." >&5
+printf "%s\n" "$as_me: WARNING: *** You have not enabled versioned symbols." >&2;}
fi
;;
esac
@@ -13386,15 +13910,15 @@ fi
if test "$have_ld_version_script" = "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symbol prefix" >&5
-$as_echo_n "checking for symbol prefix... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for symbol prefix" >&5
+printf %s "checking for symbol prefix... " >&6; }
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__::"`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYMBOL_PREFIX" >&5
-$as_echo "$SYMBOL_PREFIX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SYMBOL_PREFIX" >&5
+printf "%s\n" "$SYMBOL_PREFIX" >&6; }
fi
# Substitutions for .in files
@@ -13407,29 +13931,31 @@ fi
# Allow the pkg-config directory to be set
# Check whether --with-pkgconfigdir was given.
-if test "${with_pkgconfigdir+set}" = set; then :
+if test ${with_pkgconfigdir+y}
+then :
withval=$with_pkgconfigdir; pkgconfigdir=${withval}
-else
+else $as_nop
pkgconfigdir='${libdir}/pkgconfig'
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: pkgconfig directory is ${pkgconfigdir}" >&5
-$as_echo "$as_me: pkgconfig directory is ${pkgconfigdir}" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkgconfig directory is ${pkgconfigdir}" >&5
+printf "%s\n" "$as_me: pkgconfig directory is ${pkgconfigdir}" >&6;}
# Make the *-config binary config scripts optional
# Check whether --with-binconfigs was given.
-if test "${with_binconfigs+set}" = set; then :
+if test ${with_binconfigs+y}
+then :
withval=$with_binconfigs; if test "${withval}" = no; then
binconfigs=
- { $as_echo "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5
-$as_echo "$as_me: libpng-config scripts will not be built" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5
+printf "%s\n" "$as_me: libpng-config scripts will not be built" >&6;}
else
binconfigs='${binconfigs}'
fi
-else
+else $as_nop
binconfigs='${binconfigs}'
fi
@@ -13439,7 +13965,8 @@ fi
# at the start of the build to rename exported library functions
# Check whether --with-libpng-prefix was given.
-if test "${with_libpng_prefix+set}" = set; then :
+if test ${with_libpng_prefix+y}
+then :
withval=$with_libpng_prefix; if test "${withval:-no}" != "no"; then
PNG_PREFIX=${withval}
@@ -13459,7 +13986,8 @@ fi
# always installed, when the following options are turned on corresponding
# unversioned links are also created (normally as symbolic links):
# Check whether --enable-unversioned-links was given.
-if test "${enable_unversioned_links+set}" = set; then :
+if test ${enable_unversioned_links+y}
+then :
enableval=$enable_unversioned_links;
fi
@@ -13476,7 +14004,8 @@ fi
# Check whether --enable-unversioned-libpng-pc was given.
-if test "${enable_unversioned_libpng_pc+set}" = set; then :
+if test ${enable_unversioned_libpng_pc+y}
+then :
enableval=$enable_unversioned_libpng_pc;
fi
@@ -13490,7 +14019,8 @@ fi
# Check whether --enable-unversioned-libpng-config was given.
-if test "${enable_unversioned_libpng_config+set}" = set; then :
+if test ${enable_unversioned_libpng_config+y}
+then :
enableval=$enable_unversioned_libpng_config;
fi
@@ -13503,32 +14033,33 @@ else
fi
-# HOST SPECIFIC OPTIONS
+# HOST-SPECIFIC OPTIONS
# =====================
#
# DEFAULT
# =======
#
# Check whether --enable-hardware-optimizations was given.
-if test "${enable_hardware_optimizations+set}" = set; then :
+if test ${enable_hardware_optimizations+y}
+then :
enableval=$enable_hardware_optimizations; case "$enableval" in
no|off)
# disable hardware optimization on all systems:
enable_arm_neon=no
-$as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_ARM_NEON_OPT 0" >>confdefs.h
enable_mips_msa=no
-$as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h
enable_powerpc_vsx=no
-$as_echo "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h
enable_intel_sse=no
-$as_echo "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h
;;
*)
@@ -13537,25 +14068,25 @@ $as_echo "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h
arm*|aarch64*)
enable_arm_neon=yes
-$as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_ARM_NEON_OPT 2" >>confdefs.h
;;
mipsel*|mips64el*)
enable_mips_msa=yes
-$as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h
;;
i?86|x86_64)
enable_intel_sse=yes
-$as_echo "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h
+printf "%s\n" "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h
;;
powerpc*|ppc64*)
enable_powerpc_vsx=yes
-$as_echo "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h
+printf "%s\n" "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h
;;
esac
@@ -13570,31 +14101,32 @@ fi
# ARM NEON (SIMD) support.
# Check whether --enable-arm-neon was given.
-if test "${enable_arm_neon+set}" = set; then :
+if test ${enable_arm_neon+y}
+then :
enableval=$enable_arm_neon; case "$enableval" in
no|off)
# disable the default enabling on __ARM_NEON__ systems:
-$as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_ARM_NEON_OPT 0" >>confdefs.h
# Prevent inclusion of the assembler files below:
- enable_arm_neon=no;;
+ enable_arm_neon=no ;;
check)
-$as_echo "#define PNG_ARM_NEON_CHECK_SUPPORTED /**/" >>confdefs.h
+printf "%s\n" "#define PNG_ARM_NEON_CHECK_SUPPORTED /**/" >>confdefs.h
;;
api)
-$as_echo "#define PNG_ARM_NEON_API_SUPPORTED /**/" >>confdefs.h
+printf "%s\n" "#define PNG_ARM_NEON_API_SUPPORTED /**/" >>confdefs.h
;;
yes|on)
-$as_echo "#define PNG_ARM_NEON_OPT 2" >>confdefs.h
+printf "%s\n" "#define PNG_ARM_NEON_OPT 2" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-arm-neon: please specify 'check' or 'api', if
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-arm-neon: please specify 'check' or 'api', if
you want the optimizations unconditionally pass -mfpu=neon
to the compiler." >&5
-$as_echo "$as_me: WARNING: --enable-arm-neon: please specify 'check' or 'api', if
+printf "%s\n" "$as_me: WARNING: --enable-arm-neon: please specify 'check' or 'api', if
you want the optimizations unconditionally pass -mfpu=neon
to the compiler." >&2;};;
*)
@@ -13603,14 +14135,14 @@ $as_echo "$as_me: WARNING: --enable-arm-neon: please specify 'check' or 'api', i
fi
-# Add ARM specific files to all builds where the 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*')
+# 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*')
if test "$enable_arm_neon" != 'no' &&
case "$host_cpu" in
- arm*|aarch64*) :;;
- *) test "$enable_arm_neon" != '';;
+ arm*|aarch64*) : ;;
+ *) test "$enable_arm_neon" != '' ;;
esac; then
PNG_ARM_NEON_TRUE=
PNG_ARM_NEON_FALSE='#'
@@ -13621,36 +14153,37 @@ fi
# MIPS
-# ===
+# ====
#
# MIPS MSA (SIMD) support.
# Check whether --enable-mips-msa was given.
-if test "${enable_mips_msa+set}" = set; then :
+if test ${enable_mips_msa+y}
+then :
enableval=$enable_mips_msa; case "$enableval" in
no|off)
# disable the default enabling on __mips_msa systems:
-$as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h
# Prevent inclusion of the assembler files below:
- enable_mips_msa=no;;
+ enable_mips_msa=no ;;
check)
-$as_echo "#define PNG_MIPS_MSA_CHECK_SUPPORTED /**/" >>confdefs.h
+printf "%s\n" "#define PNG_MIPS_MSA_CHECK_SUPPORTED /**/" >>confdefs.h
;;
api)
-$as_echo "#define PNG_MIPS_MSA_API_SUPPORTED /**/" >>confdefs.h
+printf "%s\n" "#define PNG_MIPS_MSA_API_SUPPORTED /**/" >>confdefs.h
;;
yes|on)
-$as_echo "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h
+printf "%s\n" "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-mips-msa: please specify 'check' or 'api', if
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-mips-msa: please specify 'check' or 'api', if
you want the optimizations unconditionally pass '-mmsa -mfp64'
to the compiler." >&5
-$as_echo "$as_me: WARNING: --enable-mips-msa: please specify 'check' or 'api', if
+printf "%s\n" "$as_me: WARNING: --enable-mips-msa: please specify 'check' or 'api', if
you want the optimizations unconditionally pass '-mmsa -mfp64'
to the compiler." >&2;};;
*)
@@ -13659,13 +14192,13 @@ $as_echo "$as_me: WARNING: --enable-mips-msa: please specify 'check' or 'api', i
fi
-# 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*')
+# 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*')
if test "$enable_mips_msa" != 'no' &&
case "$host_cpu" in
- mipsel*|mips64el*) :;;
+ mipsel*|mips64el*) : ;;
esac; then
PNG_MIPS_MSA_TRUE=
PNG_MIPS_MSA_FALSE='#'
@@ -13681,18 +14214,19 @@ fi
# INTEL SSE (SIMD) support.
# Check whether --enable-intel-sse was given.
-if test "${enable_intel_sse+set}" = set; then :
+if test ${enable_intel_sse+y}
+then :
enableval=$enable_intel_sse; case "$enableval" in
no|off)
# disable the default enabling:
-$as_echo "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h
# Prevent inclusion of the assembler files below:
- enable_intel_sse=no;;
+ enable_intel_sse=no ;;
yes|on)
-$as_echo "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h
+printf "%s\n" "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h
;;
*)
as_fn_error $? "--enable-intel-sse=${enable_intel_sse}: invalid value" "$LINENO" 5
@@ -13700,13 +14234,13 @@ $as_echo "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h
fi
-# Add Intel specific files to all builds where the 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*')
+# 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*')
if test "$enable_intel_sse" != 'no' &&
case "$host_cpu" in
- i?86|x86_64) :;;
- *) test "$enable_intel_sse" != '';;
+ i?86|x86_64) : ;;
+ *) test "$enable_intel_sse" != '' ;;
esac; then
PNG_INTEL_SSE_TRUE=
PNG_INTEL_SSE_FALSE='#'
@@ -13717,55 +14251,56 @@ fi
# PowerPC
-# ===
+# =======
#
# PowerPC VSX (SIMD) support.
# Check whether --enable-powerpc-vsx was given.
-if test "${enable_powerpc_vsx+set}" = set; then :
+if test ${enable_powerpc_vsx+y}
+then :
enableval=$enable_powerpc_vsx; case "$enableval" in
no|off)
# disable the default enabling on __ppc64__ systems:
-$as_echo "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h
+printf "%s\n" "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h
- # Prevent inclusion of the platform specific files below:
- enable_powerpc_vsx=no;;
+ # Prevent inclusion of the platform-specific files below:
+ enable_powerpc_vsx=no ;;
check)
-$as_echo "#define PNG_POWERPC_VSX_CHECK_SUPPORTED /**/" >>confdefs.h
+printf "%s\n" "#define PNG_POWERPC_VSX_CHECK_SUPPORTED /**/" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file
for the list of supported OSes." >&5
-$as_echo "$as_me: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file
+printf "%s\n" "$as_me: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file
for the list of supported OSes." >&2;};;
api)
-$as_echo "#define PNG_POWERPC_VSX_API_SUPPORTED /**/" >>confdefs.h
+printf "%s\n" "#define PNG_POWERPC_VSX_API_SUPPORTED /**/" >>confdefs.h
;;
yes|on)
-$as_echo "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h
+printf "%s\n" "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx: please specify 'check' or 'api', if
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx: please specify 'check' or 'api', if
you want the optimizations unconditionally pass '-maltivec -mvsx'
- or '-mcpu=power8'to the compiler." >&5
-$as_echo "$as_me: WARNING: --enable-powerpc-vsx: please specify 'check' or 'api', if
+ or '-mcpu=power8' to the compiler." >&5
+printf "%s\n" "$as_me: WARNING: --enable-powerpc-vsx: please specify 'check' or 'api', if
you want the optimizations unconditionally pass '-maltivec -mvsx'
- or '-mcpu=power8'to the compiler." >&2;};;
+ or '-mcpu=power8' to the compiler." >&2;};;
*)
as_fn_error $? "--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value" "$LINENO" 5
esac
fi
-# Add PowerPC specific files to all builds where the 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*')
if test "$enable_powerpc_vsx" != 'no' &&
case "$host_cpu" in
- powerpc*|ppc64*) :;;
+ powerpc*|ppc64*) : ;;
esac; then
PNG_POWERPC_VSX_TRUE=
PNG_POWERPC_VSX_FALSE='#'
@@ -13775,9 +14310,8 @@ else
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Extra options for compiler: $PNG_COPTS" >&5
-$as_echo "$as_me: Extra options for compiler: $PNG_COPTS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Extra options for compiler: $PNG_COPTS" >&5
+printf "%s\n" "$as_me: Extra options for compiler: $PNG_COPTS" >&6;}
# Config files, substituting as above
ac_config_files="$ac_config_files Makefile libpng.pc:libpng.pc.in"
@@ -13812,8 +14346,8 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -13843,15 +14377,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
/^ac_cv_env_/b end
t clear
:clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
@@ -13865,8 +14399,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;}
fi
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -13883,7 +14417,7 @@ U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -13894,14 +14428,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -13975,8 +14509,8 @@ fi
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
@@ -13999,14 +14533,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
+else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
@@ -14016,46 +14552,46 @@ esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -14064,13 +14600,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -14079,8 +14608,12 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
@@ -14092,30 +14625,10 @@ if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
@@ -14128,13 +14641,14 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -14161,18 +14675,20 @@ as_fn_unset ()
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
+
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
+else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
@@ -14184,12 +14700,13 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
+else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
@@ -14220,7 +14737,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -14242,6 +14759,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -14255,6 +14776,12 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -14296,7 +14823,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -14305,7 +14832,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -14367,8 +14894,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libpng $as_me 1.6.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+This file was extended by libpng $as_me 1.6.40, which was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -14430,14 +14957,16 @@ $config_commands
Report bugs to <png-mng-implement@lists.sourceforge.net>."
_ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-libpng config.status 1.6.34
-configured by $0, generated by GNU Autoconf 2.69,
+libpng config.status 1.6.40
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -14477,15 +15006,15 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
+ printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
+ printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
@@ -14493,7 +15022,7 @@ do
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
@@ -14502,7 +15031,7 @@ do
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
+ printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
@@ -14530,7 +15059,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
@@ -14544,7 +15073,7 @@ exec 5>>config.log
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- $as_echo "$ac_log"
+ printf "%s\n" "$ac_log"
} >&5
_ACEOF
@@ -14552,7 +15081,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -14599,12 +15128,14 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q
lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
@@ -14728,13 +15259,13 @@ LN_S \
lt_SP2NL \
lt_NL2SP \
reload_flag \
+FILECMD \
deplibs_check_method \
file_magic_cmd \
file_magic_glob \
want_nocaseglob \
sharedlib_from_linklib_cmd \
AR \
-AR_FLAGS \
archiver_list_spec \
STRIP \
RANLIB \
@@ -14864,9 +15395,9 @@ done
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
+ test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers
+ test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
@@ -15202,7 +15733,7 @@ do
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
@@ -15210,17 +15741,17 @@ do
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
+ ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
@@ -15237,7 +15768,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
+printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -15261,9 +15792,9 @@ $as_echo X"$ac_file" |
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -15325,8 +15856,8 @@ ac_sed_dataroot='
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
@@ -15370,9 +15901,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
@@ -15388,20 +15919,20 @@ which seems to be undefined. Please make sure it is defined" >&2;}
#
if test x"$ac_file" != x-; then
{
- $as_echo "/* $configure_input */" \
+ printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
- $as_echo "/* $configure_input */" \
+ printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
@@ -15421,7 +15952,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$_am_arg" : 'X\(//\)[^/]' \| \
X"$_am_arg" : 'X\(//\)$' \| \
X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
+printf "%s\n" X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -15441,8 +15972,8 @@ $as_echo X"$_am_arg" |
s/.*/./; q'`/stamp-h$_am_stamp_count
;;
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
;;
esac
@@ -15452,29 +15983,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -15492,53 +16029,50 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
- /^X\(\/\/\)$/{
+ /^X\/\(\/\/\)$/{
s//\1/
q
}
- /^X\(\/\).*/{
+ /^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE=\"gmake\" (or whatever is
+ necessary). You can also try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
}
;;
"libtool":C)
@@ -15685,6 +16219,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd
# convert \$build files to toolchain format.
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+# A file(cmd) program that detects file types.
+FILECMD=$lt_FILECMD
+
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -15703,8 +16240,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
# The archiver.
AR=$lt_AR
+# Flags to create an archive (by configure).
+lt_ar_flags=$lt_ar_flags
+
# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
+AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"}
# How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec
@@ -16072,6 +16612,7 @@ _LT_EOF
esac
+
ltmain=$ac_aux_dir/ltmain.sh
@@ -16079,7 +16620,7 @@ ltmain=$ac_aux_dir/ltmain.sh
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
+ $SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
@@ -16122,7 +16663,8 @@ if test "$no_create" != yes; then
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
diff --git a/configure.ac b/configure.ac
index e3cfafd6e..43c682e9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# configure.ac
+# Copyright (c) 2018-2022 Cosmin Truta
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
-# Last changed in libpng 1.6.25 [September 1, 2016]
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -25,7 +25,7 @@ AC_PREREQ([2.68])
dnl Version number stuff here:
-AC_INIT([libpng],[1.6.34],[png-mng-implement@lists.sourceforge.net])
+AC_INIT([libpng],[1.6.40],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts])
# libpng does not follow GNU file name conventions (hence 'foreign')
@@ -46,10 +46,10 @@ dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake
-PNGLIB_VERSION=1.6.34
+PNGLIB_VERSION=1.6.40
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
-PNGLIB_RELEASE=34
+PNGLIB_RELEASE=40
dnl End of version number stuff
@@ -89,9 +89,9 @@ fi
DFNCPP="$CPP"
AC_SUBST(DFNCPP)
-# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
-# checks the compiler with a program that generates a warning), add the
-# following option to deal with this
+# -Werror cannot be passed to GCC in CFLAGS because configure will fail
+# (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]
[cause configure itself to fail])
@@ -114,10 +114,10 @@ AC_ARG_ENABLE(werror,
CFLAGS="$sav_CFLAGS"
fi],)
-# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89
-# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1
-# This is incompatible with the new default mode, so we test for that and force the
-# "-std=c89" compiler option:
+# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89.
+# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
+# _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
+# we test for that and force the "-std=c89" compiler option:
AC_MSG_CHECKING([if we need to force back C standard to C89])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
@@ -133,23 +133,17 @@ AC_COMPILE_IFELSE(
CFLAGS="$CFLAGS -std=c89"
])
-# Checks for header files.
-AC_HEADER_STDC
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
+# Checks for structures and compiler characteristics.
AC_STRUCT_TM
AC_C_RESTRICT
# Checks for library functions.
-AC_FUNC_STRTOD
-AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc))
-AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
+AC_CHECK_FUNCS([pow], ,
+ [AC_CHECK_LIB([m], [pow], , [AC_MSG_ERROR([cannot find pow])])])
-# Some later POSIX 1003.1 functions are required for test programs, failure here
-# is soft (the corresponding test program is not built).
-AC_CHECK_FUNC([clock_gettime],,[AC_MSG_WARN([not building timepng])])
+# Some later POSIX 1003.1 functions are required for test programs, failure
+# here is soft (the corresponding test program is not built).
+AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
AC_ARG_WITH(zlib-prefix,
@@ -157,8 +151,9 @@ AC_ARG_WITH(zlib-prefix,
[prefix that may have been used in installed zlib]),
[ZPREFIX=${withval}],
[ZPREFIX='z_'])
-AC_CHECK_LIB(z, zlibVersion, ,
- AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))
+AC_CHECK_LIB([z], [zlibVersion], ,
+ [AC_CHECK_LIB([z], [${ZPREFIX}zlibVersion], ,
+ [AC_MSG_ERROR([zlib not installed])])])
# The following is for pngvalid, to ensure it catches FP errors even on
# platforms that don't enable FP exceptions, the function appears in the math
@@ -297,7 +292,7 @@ AC_ARG_ENABLE([unversioned-libpng-config],
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
[test "$enable_unversioned_libpng_config" != "no"])
-# HOST SPECIFIC OPTIONS
+# HOST-SPECIFIC OPTIONS
# =====================
#
# DEFAULT
@@ -327,12 +322,12 @@ AC_ARG_ENABLE([hardware-optimizations],
case "$host_cpu" in
arm*|aarch64*)
enable_arm_neon=yes
- AC_DEFINE([PNG_ARM_NEON_OPT], [0],
+ AC_DEFINE([PNG_ARM_NEON_OPT], [2],
[Enable ARM_NEON optimizations])
;;
mipsel*|mips64el*)
enable_mips_msa=yes
- AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
+ AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
[Enable MIPS_MSA optimizations])
;;
i?86|x86_64)
@@ -367,7 +362,7 @@ AC_ARG_ENABLE([arm-neon],
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
[Disable ARM Neon optimizations])
# Prevent inclusion of the assembler files below:
- enable_arm_neon=no;;
+ enable_arm_neon=no ;;
check)
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
[Check for ARM Neon support at run-time]);;
@@ -384,19 +379,19 @@ AC_ARG_ENABLE([arm-neon],
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
esac])
-# Add ARM specific files to all builds where the 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*')
+# 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*')
AM_CONDITIONAL([PNG_ARM_NEON],
[test "$enable_arm_neon" != 'no' &&
case "$host_cpu" in
- arm*|aarch64*) :;;
- *) test "$enable_arm_neon" != '';;
+ arm*|aarch64*) : ;;
+ *) test "$enable_arm_neon" != '' ;;
esac])
# MIPS
-# ===
+# ====
#
# MIPS MSA (SIMD) support.
@@ -413,7 +408,7 @@ AC_ARG_ENABLE([mips-msa],
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
[Disable MIPS MSA optimizations])
# Prevent inclusion of the assembler files below:
- enable_mips_msa=no;;
+ enable_mips_msa=no ;;
check)
AC_DEFINE([PNG_MIPS_MSA_CHECK_SUPPORTED], [],
[Check for MIPS MSA support at run-time]);;
@@ -430,14 +425,14 @@ AC_ARG_ENABLE([mips-msa],
AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value])
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*')
+# 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*')
AM_CONDITIONAL([PNG_MIPS_MSA],
[test "$enable_mips_msa" != 'no' &&
case "$host_cpu" in
- mipsel*|mips64el*) :;;
+ mipsel*|mips64el*) : ;;
esac])
# INTEL
@@ -457,7 +452,7 @@ AC_ARG_ENABLE([intel-sse],
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
[Disable Intel SSE optimizations])
# Prevent inclusion of the assembler files below:
- enable_intel_sse=no;;
+ enable_intel_sse=no ;;
yes|on)
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
[Enable Intel SSE optimizations]);;
@@ -465,18 +460,18 @@ AC_ARG_ENABLE([intel-sse],
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
esac])
-# Add Intel specific files to all builds where the 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*')
+# 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*')
AM_CONDITIONAL([PNG_INTEL_SSE],
[test "$enable_intel_sse" != 'no' &&
case "$host_cpu" in
- i?86|x86_64) :;;
- *) test "$enable_intel_sse" != '';;
+ i?86|x86_64) : ;;
+ *) test "$enable_intel_sse" != '' ;;
esac])
# PowerPC
-# ===
+# =======
#
# PowerPC VSX (SIMD) support.
@@ -492,8 +487,8 @@ AS_HELP_STRING([[[--enable-powerpc-vsx]]],
# disable the default enabling on __ppc64__ systems:
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
[Disable POWERPC VSX optimizations])
- # Prevent inclusion of the platform specific files below:
- enable_powerpc_vsx=no;;
+ # Prevent inclusion of the platform-specific files below:
+ enable_powerpc_vsx=no ;;
check)
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
[Check for POWERPC VSX support at run-time])
@@ -507,22 +502,21 @@ AS_HELP_STRING([[[--enable-powerpc-vsx]]],
[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.]);;
+ [or '-mcpu=power8' to the compiler.]);;
*)
AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value])
esac])
-# Add PowerPC specific files to all builds where the 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' &&
case "$host_cpu" in
- powerpc*|ppc64*) :;;
+ powerpc*|ppc64*) : ;;
esac])
-
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
# Config files, substituting as above
diff --git a/contrib/arm-neon/android-ndk.c b/contrib/arm-neon/android-ndk.c
index fb3a4898d..c72c468a7 100644
--- a/contrib/arm-neon/android-ndk.c
+++ b/contrib/arm-neon/android-ndk.c
@@ -2,7 +2,6 @@
*
* Copyright (c) 2014 Glenn Randers-Pehrson
* Written by John Bowler, 2014.
- * Last changed in libpng 1.6.10 [March 6, 2014]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -24,6 +23,7 @@
* has been compiled only, not linked: no version of the library has been found,
* only the header files exist in the NDK.
*/
+
#include <cpu-features.h>
static int
diff --git a/contrib/arm-neon/linux-auxv.c b/contrib/arm-neon/linux-auxv.c
index 4d26bd3b3..c5d7f5127 100644
--- a/contrib/arm-neon/linux-auxv.c
+++ b/contrib/arm-neon/linux-auxv.c
@@ -2,7 +2,6 @@
*
* Copyright (c) 2014 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.6.10 [March 6, 2014]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -22,6 +21,7 @@
* This generic __linux__ implementation requires reading /proc/self/auxv and
* looking at each element for one that records NEON capabilities.
*/
+
#include <unistd.h> /* for POSIX 1003.1 */
#include <errno.h> /* for EINTR */
diff --git a/contrib/arm-neon/linux.c b/contrib/arm-neon/linux.c
index a9bc360dd..b5429d0c3 100644
--- a/contrib/arm-neon/linux.c
+++ b/contrib/arm-neon/linux.c
@@ -1,6 +1,5 @@
/* contrib/arm-neon/linux.c
*
- * Last changed in libpng 1.6.31 [July 27, 2017]
* Copyright (c) 2014, 2017 Glenn Randers-Pehrson
* Written by John Bowler, 2014, 2017.
*
@@ -19,6 +18,7 @@
* This code is strict ANSI-C and is probably moderately portable; it does
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
*/
+
#include <stdio.h>
static int
diff --git a/contrib/conftest/pngcp.dfa b/contrib/conftest/pngcp.dfa
index 15a856e2f..31c411d5f 100644
--- a/contrib/conftest/pngcp.dfa
+++ b/contrib/conftest/pngcp.dfa
@@ -33,7 +33,7 @@ option WRITE_16BIT on
option WRITE_FILTER on
# pngcp needs this to preserve unknown chunks, switching all these on means that
-# pngcp can work without explicit known chunk reading suppport
+# pngcp can work without explicit known chunk reading support
option UNKNOWN_CHUNKS on
option SET_UNKNOWN_CHUNKS on
option HANDLE_AS_UNKNOWN on
@@ -52,6 +52,6 @@ option TEXT on
option USER_LIMITS on
option SET_USER_LIMITS on
-# these are are just required for specific customizations
+# these are just required for specific customizations
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
option WRITE_CUSTOMIZE_COMPRESSION on
diff --git a/contrib/examples/iccfrompng.c b/contrib/examples/iccfrompng.c
index 603037e70..00056abfd 100644
--- a/contrib/examples/iccfrompng.c
+++ b/contrib/examples/iccfrompng.c
@@ -10,7 +10,7 @@
* without processing the image. Notice that some header information may occur
* after the image data. Textual data and comments are an example; the approach
* in this file won't work reliably for such data because it only looks for the
- * information in the section of the file that preceeds the image data.
+ * information in the section of the file that precedes the image data.
*
* Compile and link against libpng and zlib, plus anything else required on the
* system you use.
diff --git a/contrib/examples/pngpixel.c b/contrib/examples/pngpixel.c
index f762379ed..9185d518f 100644
--- a/contrib/examples/pngpixel.c
+++ b/contrib/examples/pngpixel.c
@@ -42,7 +42,7 @@ component(png_const_bytep row, png_uint_32 x, unsigned int c,
png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels);
png_uint_32 bit_offset_lo = bit_depth * ((x & 0x3f) * channels + c);
- row = (png_const_bytep)(((PNG_CONST png_byte (*)[8])row) + bit_offset_hi);
+ row = (png_const_bytep)(((const png_byte (*)[8])row) + bit_offset_hi);
row += bit_offset_lo >> 3;
bit_offset_lo &= 0x07;
@@ -73,7 +73,7 @@ static void
print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
png_uint_32 x)
{
- PNG_CONST unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
+ unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
switch (png_get_color_type(png_ptr, info_ptr))
{
@@ -87,7 +87,7 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
*/
case PNG_COLOR_TYPE_PALETTE:
{
- PNG_CONST int index = component(row, x, 0, bit_depth, 1);
+ int index = component(row, x, 0, bit_depth, 1);
png_colorp palette = NULL;
int num_palette = 0;
diff --git a/contrib/examples/pngtopng.c b/contrib/examples/pngtopng.c
index 904b97238..1d55496ac 100644
--- a/contrib/examples/pngtopng.c
+++ b/contrib/examples/pngtopng.c
@@ -5,8 +5,6 @@
* related or neighboring rights to this work. This work is published from:
* United States.
*
- * Last changed in libpng 1.6.29 [March 16, 2017]
- *
* Read a PNG and write it out in a fixed format, using the 'simplified API'
* that was introduced in libpng-1.6.0.
*
diff --git a/contrib/gregbook/readpng2.c b/contrib/gregbook/readpng2.c
index 5d13e1530..610b3cd87 100644
--- a/contrib/gregbook/readpng2.c
+++ b/contrib/gregbook/readpng2.c
@@ -146,7 +146,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
/* These byte strings were copied from png.h. If a future version
* of readpng2.c recognizes more chunks, add them to this list.
*/
- static PNG_CONST png_byte chunks_to_process[] = {
+ static const png_byte chunks_to_process[] = {
98, 75, 71, 68, '\0', /* bKGD */
103, 65, 77, 65, '\0', /* gAMA */
115, 82, 71, 66, '\0', /* sRGB */
diff --git a/contrib/intel/INSTALL b/contrib/intel/INSTALL
deleted file mode 100644
index cd5cdd94e..000000000
--- a/contrib/intel/INSTALL
+++ /dev/null
@@ -1,158 +0,0 @@
-Enabling SSE support
-
-Copyright (c) 2016 Google, Inc.
-Written by Mike Klein, Matt Sarett
-
-This INSTALL file written by Glenn Randers-Pehrson, 2016.
-
-If you have moved intel_init.c and filter_sse2_intrinsics.c to a different
-directory, be sure to update the '#include "../../pngpriv.h"' line in both
-files if necessary to point to the correct relative location of pngpriv.h
-with respect to the new location of those files.
-
-To enable SSE support in libpng, follow the instructions in I, II, or III,
-below:
-
-I. Using patched "configure" scripts:
-
-First, apply intel_sse.patch in your build directory.
-
- patch -i contrib/intel/intel_sse.patch -p1
-
-Then, if you are not building in a new GIT clone, e.g., in a tar
-distribution, remove any existing pre-built configure scripts:
-
- ./configure --enable-maintainer-mode
- make maintainer-clean
- ./autogen.sh --maintainer --clean
-
-Finally, configure libpng with -DPNG_INTEL_SSE in CPPFLAGS:
-
- ./autogen.sh --maintainer
- CPPFLAGS="-DPNG_INTEL_SSE" ./configure [options]
- make CPPFLAGS="-DPNG_INTEL_SSE" [options]
- make
-
-II. Using a custom makefile:
-
-If you are using a custom makefile makefile, you will have to update it
-manually to include contrib/intel/*.o in the dependencies, and to define
-PNG_INTEL_SSE.
-
-III. Using manually updated "configure" scripts:
-
-If you prefer, manually edit pngpriv.h, configure.ac, and Makefile.am,
-following the instructions below, then follow the instructions in
-section II of INSTALL in the main libpng directory, then configure libpng
-with -DPNG_INTEL_SSE in CPPFLAGS.
-
-1. Add the following code to configure.ac under HOST SPECIFIC OPTIONS
-directly beneath the section for ARM:
-
------------------cut----------------
-# INTEL
-# =====
-#
-# INTEL SSE (SIMD) support.
-
-AC_ARG_ENABLE([intel-sse],
- AS_HELP_STRING([[[--enable-intel-sse]]],
- [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.]),
- [case "$enableval" in
- no|off)
- # disable the default enabling:
- AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
- [Disable Intel SSE optimizations])
- # Prevent inclusion of the assembler files below:
- enable_intel_sse=no;;
- yes|on)
- AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
- [Enable Intel SSE optimizations]);;
- *)
- AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
- esac])
-
-# Add Intel specific files to all builds where the 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*')
-AM_CONDITIONAL([PNG_INTEL_SSE],
- [test "$enable_intel_sse" != 'no' &&
- case "$host_cpu" in
- i?86|x86_64) :;;
- *) test "$enable_intel_sse" != '';;
- esac])
------------------cut----------------
-
-2. Add the following code to Makefile.am under HOST SPECIFIC OPTIONS
-directly beneath the "if PNG_ARM_NEON ... endif" statement:
-
------------------cut----------------
-if PNG_INTEL_SSE
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\
- contrib/intel/filter_sse2_intrinsics.c
-endif
------------------cut----------------
-
-3. Add the following lines to pngpriv.h, following the PNG_ARM_NEON_OPT
-code:
-
------------------cut----------------
-#ifndef PNG_INTEL_SSE_OPT
-# ifdef PNG_INTEL_SSE
- /* Only check for SSE if the build configuration has been modified to
- * enable SSE optimizations. This means that these optimizations will
- * be off by default. See contrib/intel for more details.
- */
-# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
- defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
- (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
-# define PNG_INTEL_SSE_OPT 1
-# endif
-# endif
-#endif
-
-#if PNG_INTEL_SSE_OPT > 0
-# ifndef PNG_INTEL_SSE_IMPLEMENTATION
-# if defined(__SSE4_1__) || defined(__AVX__)
- /* We are not actually using AVX, but checking for AVX is the best
- way we can detect SSE4.1 and SSSE3 on MSVC.
- */
-# define PNG_INTEL_SSE_IMPLEMENTATION 3
-# elif defined(__SSSE3__)
-# define PNG_INTEL_SSE_IMPLEMENTATION 2
-# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
- (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
-# define PNG_INTEL_SSE_IMPLEMENTATION 1
-# else
-# define PNG_INTEL_SSE_IMPLEMENTATION 0
-# endif
-# endif
-
-# if PNG_INTEL_SSE_IMPLEMENTATION > 0
-# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
-# endif
-#endif
-
------------------cut----------------
-
-4. Add the following lines to pngpriv.h, following the prototype for
-png_read_filter_row_paeth4_neon:
-
------------------cut----------------
-PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-
------------------cut----------------
diff --git a/contrib/intel/Makefile.am.patch b/contrib/intel/Makefile.am.patch
deleted file mode 100644
index 3921f274d..000000000
--- a/contrib/intel/Makefile.am.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#
-# Copyright (c) 2016 Google, Inc.
-#
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-#
-
-# In order to compile Intel SSE optimizations for libpng, please add
-# the following code to Makefile.am directly beneath the
-# "if PNG_ARM_NEON ... endif" statement.
-
-if PNG_INTEL_SSE
-libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\
- contrib/intel/filter_sse2_intrinsics.c
-endif
diff --git a/contrib/intel/configure.ac.patch b/contrib/intel/configure.ac.patch
deleted file mode 100644
index fec654953..000000000
--- a/contrib/intel/configure.ac.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (c) 2016 Google, Inc.
-#
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-#
-
-# In order to compile Intel SSE optimizations for libpng, please add
-# the following code to configure.ac under HOST SPECIFIC OPTIONS
-# directly beneath the section for ARM.
-
-# INTEL
-# ===
-#
-# INTEL SSE (SIMD) support.
-
-AC_ARG_ENABLE([intel-sse],
- AS_HELP_STRING([[[--enable-intel-sse]]],
- [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.]),
- [case "$enableval" in
- no|off)
- # disable the default enabling:
- AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
- [Disable Intel SSE optimizations])
- # Prevent inclusion of the assembler files below:
- enable_intel_sse=no;;
- yes|on)
- AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
- [Enable Intel SSE optimizations]);;
- *)
- AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
- esac])
-
-# Add Intel specific files to all builds where the 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*')
-AM_CONDITIONAL([PNG_INTEL_SSE],
- [test "$enable_intel_sse" != 'no' &&
- case "$host_cpu" in
- i?86|x86_64) :;;
- *) test "$enable_intel_sse" != '';;
- esac])
diff --git a/contrib/intel/filter_sse2_intrinsics.c b/contrib/intel/filter_sse2_intrinsics.c
deleted file mode 100644
index b02840c55..000000000
--- a/contrib/intel/filter_sse2_intrinsics.c
+++ /dev/null
@@ -1,379 +0,0 @@
-
-/* filter_sse2_intrinsics.c - SSE2 optimized filter functions
- *
- * Copyright (c) 2016 Google, Inc.
- * Written by Mike Klein and Matt Sarett
- * Derived from arm/filter_neon_intrinsics.c, which was
- * Copyright (c) 2014,2016 Glenn Randers-Pehrson
- *
- * Last changed in libpng 1.6.24 [August 4, 2016]
- *
- * This code is released under the libpng license.
- * For conditions of distribution and use, see the disclaimer
- * and license in png.h
- */
-
-#include "../../pngpriv.h"
-
-#ifdef PNG_READ_SUPPORTED
-
-#if PNG_INTEL_SSE_IMPLEMENTATION > 0
-
-#include <immintrin.h>
-
-/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
- * They're positioned like this:
- * prev: c b
- * row: a d
- * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
- * whichever of a, b, or c is closest to p=a+b-c.
- */
-
-static __m128i load4(const void* p) {
- return _mm_cvtsi32_si128(*(const int*)p);
-}
-
-static void store4(void* p, __m128i v) {
- *(int*)p = _mm_cvtsi128_si32(v);
-}
-
-static __m128i load3(const void* p) {
- /* We'll load 2 bytes, then 1 byte,
- * then mask them together, and finally load into SSE.
- */
- const png_uint_16* p01 = p;
- const png_byte* p2 = (const png_byte*)(p01+1);
-
- png_uint_32 v012 = (png_uint_32)(*p01)
- | (png_uint_32)(*p2) << 16;
- return load4(&v012);
-}
-
-static void store3(void* p, __m128i v) {
- /* We'll pull from SSE as a 32-bit int, then write
- * its bottom two bytes, then its third byte.
- */
- png_uint_32 v012;
- store4(&v012, v);
-
- png_uint_16* p01 = p;
- png_byte* p2 = (png_byte*)(p01+1);
- *p01 = v012;
- *p2 = v012 >> 16;
-}
-
-void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
- png_const_bytep prev)
-{
- /* The Sub filter predicts each pixel as the previous pixel, a.
- * There is no pixel to the left of the first pixel. It's encoded directly.
- * That works with our main loop if we just say that left pixel was zero.
- */
- png_debug(1, "in png_read_filter_row_sub3_sse2");
- __m128i a, d = _mm_setzero_si128();
-
- int rb = row_info->rowbytes;
- while (rb >= 4) {
- a = d; d = load4(row);
- d = _mm_add_epi8(d, a);
- store3(row, d);
-
- row += 3;
- rb -= 3;
- }
- if (rb > 0) {
- a = d; d = load3(row);
- d = _mm_add_epi8(d, a);
- store3(row, d);
-
- row += 3;
- rb -= 3;
- }
-}
-
-void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
- png_const_bytep prev)
-{
- /* The Sub filter predicts each pixel as the previous pixel, a.
- * There is no pixel to the left of the first pixel. It's encoded directly.
- * That works with our main loop if we just say that left pixel was zero.
- */
- png_debug(1, "in png_read_filter_row_sub4_sse2");
- __m128i a, d = _mm_setzero_si128();
-
- int rb = row_info->rowbytes;
- while (rb > 0) {
- a = d; d = load4(row);
- d = _mm_add_epi8(d, a);
- store4(row, d);
-
- row += 4;
- rb -= 4;
- }
-}
-
-void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
- png_const_bytep prev)
-{
- /* The Avg filter predicts each pixel as the (truncated) average of a and b.
- * There's no pixel to the left of the first pixel. Luckily, it's
- * predicted to be half of the pixel above it. So again, this works
- * perfectly with our loop if we make sure a starts at zero.
- */
- png_debug(1, "in png_read_filter_row_avg3_sse2");
- const __m128i zero = _mm_setzero_si128();
- __m128i b;
- __m128i a, d = zero;
-
- int rb = row_info->rowbytes;
- while (rb >= 4) {
- b = load4(prev);
- a = d; d = load4(row );
-
- /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
- __m128i avg = _mm_avg_epu8(a,b);
- /* ...but we can fix it up by subtracting off 1 if it rounded up. */
- avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
- _mm_set1_epi8(1)));
- d = _mm_add_epi8(d, avg);
- store3(row, d);
-
- prev += 3;
- row += 3;
- rb -= 3;
- }
- if (rb > 0) {
- b = load3(prev);
- a = d; d = load3(row );
-
- /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
- __m128i avg = _mm_avg_epu8(a,b);
- /* ...but we can fix it up by subtracting off 1 if it rounded up. */
- avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
- _mm_set1_epi8(1)));
-
- d = _mm_add_epi8(d, avg);
- store3(row, d);
-
- prev += 3;
- row += 3;
- rb -= 3;
- }
-}
-
-void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row,
- png_const_bytep prev)
-{
- /* The Avg filter predicts each pixel as the (truncated) average of a and b.
- * There's no pixel to the left of the first pixel. Luckily, it's
- * predicted to be half of the pixel above it. So again, this works
- * perfectly with our loop if we make sure a starts at zero.
- */
- png_debug(1, "in png_read_filter_row_avg4_sse2");
- const __m128i zero = _mm_setzero_si128();
- __m128i b;
- __m128i a, d = zero;
-
- int rb = row_info->rowbytes;
- while (rb > 0) {
- b = load4(prev);
- a = d; d = load4(row );
-
- /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
- __m128i avg = _mm_avg_epu8(a,b);
- /* ...but we can fix it up by subtracting off 1 if it rounded up. */
- avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
- _mm_set1_epi8(1)));
-
- d = _mm_add_epi8(d, avg);
- store4(row, d);
-
- prev += 4;
- row += 4;
- rb -= 4;
- }
-}
-
-/* Returns |x| for 16-bit lanes. */
-static __m128i abs_i16(__m128i x) {
-#if PNG_INTEL_SSE_IMPLEMENTATION >= 2
- return _mm_abs_epi16(x);
-#else
- /* Read this all as, return x<0 ? -x : x.
- * To negate two's complement, you flip all the bits then add 1.
- */
- __m128i is_negative = _mm_cmplt_epi16(x, _mm_setzero_si128());
-
- /* Flip negative lanes. */
- x = _mm_xor_si128(x, is_negative);
-
- /* +1 to negative lanes, else +0. */
- x = _mm_sub_epi16(x, is_negative);
- return x;
-#endif
-}
-
-/* Bytewise c ? t : e. */
-static __m128i if_then_else(__m128i c, __m128i t, __m128i e) {
-#if PNG_INTEL_SSE_IMPLEMENTATION >= 3
- return _mm_blendv_epi8(e,t,c);
-#else
- return _mm_or_si128(_mm_and_si128(c, t), _mm_andnot_si128(c, e));
-#endif
-}
-
-void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
- png_const_bytep prev)
-{
- /* Paeth tries to predict pixel d using the pixel to the left of it, a,
- * and two pixels from the previous row, b and c:
- * prev: c b
- * row: a d
- * The Paeth function predicts d to be whichever of a, b, or c is nearest to
- * p=a+b-c.
- *
- * The first pixel has no left context, and so uses an Up filter, p = b.
- * This works naturally with our main loop's p = a+b-c if we force a and c
- * to zero.
- * Here we zero b and d, which become c and a respectively at the start of
- * the loop.
- */
- png_debug(1, "in png_read_filter_row_paeth3_sse2");
- const __m128i zero = _mm_setzero_si128();
- __m128i c, b = zero,
- a, d = zero;
-
- int rb = row_info->rowbytes;
- while (rb >= 4) {
- /* It's easiest to do this math (particularly, deal with pc) with 16-bit
- * intermediates.
- */
- c = b; b = _mm_unpacklo_epi8(load4(prev), zero);
- a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
-
- /* (p-a) == (a+b-c - a) == (b-c) */
- __m128i pa = _mm_sub_epi16(b,c);
-
- /* (p-b) == (a+b-c - b) == (a-c) */
- __m128i pb = _mm_sub_epi16(a,c);
-
- /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
- __m128i pc = _mm_add_epi16(pa,pb);
-
- pa = abs_i16(pa); /* |p-a| */
- pb = abs_i16(pb); /* |p-b| */
- pc = abs_i16(pc); /* |p-c| */
-
- __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
-
- /* Paeth breaks ties favoring a over b over c. */
- __m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
- if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
- c));
-
- /* Note `_epi8`: we need addition to wrap modulo 255. */
- d = _mm_add_epi8(d, nearest);
- store3(row, _mm_packus_epi16(d,d));
-
- prev += 3;
- row += 3;
- rb -= 3;
- }
- if (rb > 0) {
- /* It's easiest to do this math (particularly, deal with pc) with 16-bit
- * intermediates.
- */
- c = b; b = _mm_unpacklo_epi8(load3(prev), zero);
- a = d; d = _mm_unpacklo_epi8(load3(row ), zero);
-
- /* (p-a) == (a+b-c - a) == (b-c) */
- __m128i pa = _mm_sub_epi16(b,c);
-
- /* (p-b) == (a+b-c - b) == (a-c) */
- __m128i pb = _mm_sub_epi16(a,c);
-
- /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
- __m128i pc = _mm_add_epi16(pa,pb);
-
- pa = abs_i16(pa); /* |p-a| */
- pb = abs_i16(pb); /* |p-b| */
- pc = abs_i16(pc); /* |p-c| */
-
- __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
-
- /* Paeth breaks ties favoring a over b over c. */
- __m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
- if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
- c));
-
- /* Note `_epi8`: we need addition to wrap modulo 255. */
- d = _mm_add_epi8(d, nearest);
- store3(row, _mm_packus_epi16(d,d));
-
- prev += 3;
- row += 3;
- rb -= 3;
- }
-}
-
-void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row,
- png_const_bytep prev)
-{
- /* Paeth tries to predict pixel d using the pixel to the left of it, a,
- * and two pixels from the previous row, b and c:
- * prev: c b
- * row: a d
- * The Paeth function predicts d to be whichever of a, b, or c is nearest to
- * p=a+b-c.
- *
- * The first pixel has no left context, and so uses an Up filter, p = b.
- * This works naturally with our main loop's p = a+b-c if we force a and c
- * to zero.
- * Here we zero b and d, which become c and a respectively at the start of
- * the loop.
- */
- png_debug(1, "in png_read_filter_row_paeth4_sse2");
- const __m128i zero = _mm_setzero_si128();
- __m128i c, b = zero,
- a, d = zero;
-
- int rb = row_info->rowbytes;
- while (rb > 0) {
- /* It's easiest to do this math (particularly, deal with pc) with 16-bit
- * intermediates.
- */
- c = b; b = _mm_unpacklo_epi8(load4(prev), zero);
- a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
-
- /* (p-a) == (a+b-c - a) == (b-c) */
- __m128i pa = _mm_sub_epi16(b,c);
-
- /* (p-b) == (a+b-c - b) == (a-c) */
- __m128i pb = _mm_sub_epi16(a,c);
-
- /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
- __m128i pc = _mm_add_epi16(pa,pb);
-
- pa = abs_i16(pa); /* |p-a| */
- pb = abs_i16(pb); /* |p-b| */
- pc = abs_i16(pc); /* |p-c| */
-
- __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
-
- /* Paeth breaks ties favoring a over b over c. */
- __m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
- if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
- c));
-
- /* Note `_epi8`: we need addition to wrap modulo 255. */
- d = _mm_add_epi8(d, nearest);
- store4(row, _mm_packus_epi16(d,d));
-
- prev += 4;
- row += 4;
- rb -= 4;
- }
-}
-
-#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */
-#endif /* READ */
diff --git a/contrib/intel/intel_init.c b/contrib/intel/intel_init.c
deleted file mode 100644
index 328e90e9a..000000000
--- a/contrib/intel/intel_init.c
+++ /dev/null
@@ -1,54 +0,0 @@
-
-/* intel_init.c - SSE2 optimized filter functions
- *
- * Copyright (c) 2016 Google, Inc.
- * Written by Mike Klein and Matt Sarett
- * Derived from arm/arm_init.c, which was
- * Copyright (c) 2014,2016 Glenn Randers-Pehrson
- *
- * Last changed in libpng 1.6.22 [May 26, 2016]
- *
- * This code is released under the libpng license.
- * For conditions of distribution and use, see the disclaimer
- * and license in png.h
- */
-
-#include "../../pngpriv.h"
-
-#ifdef PNG_READ_SUPPORTED
-#if PNG_INTEL_SSE_IMPLEMENTATION > 0
-
-void
-png_init_filter_functions_sse2(png_structp pp, unsigned int bpp)
-{
- /* The techniques used to implement each of these filters in SSE operate on
- * one pixel at a time.
- * So they generally speed up 3bpp images about 3x, 4bpp images about 4x.
- * They can scale up to 6 and 8 bpp images and down to 2 bpp images,
- * but they'd not likely have any benefit for 1bpp images.
- * Most of these can be implemented using only MMX and 64-bit registers,
- * but they end up a bit slower than using the equally-ubiquitous SSE2.
- */
- png_debug(1, "in png_init_filter_functions_sse2");
- if (bpp == 3)
- {
- pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_sse2;
- pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_sse2;
- pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
- png_read_filter_row_paeth3_sse2;
- }
- else if (bpp == 4)
- {
- pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_sse2;
- pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_sse2;
- pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
- png_read_filter_row_paeth4_sse2;
- }
-
- /* No need optimize PNG_FILTER_VALUE_UP. The compiler should
- * autovectorize.
- */
-}
-
-#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */
-#endif /* PNG_READ_SUPPORTED */
diff --git a/contrib/intel/intel_sse.patch b/contrib/intel/intel_sse.patch
deleted file mode 100644
index a852538ed..000000000
--- a/contrib/intel/intel_sse.patch
+++ /dev/null
@@ -1,190 +0,0 @@
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac 2016-08-29 11:46:27.000000000 -0400
-+++ b/configure.ac 2016-08-29 16:57:03.866355018 -0400
-@@ -386,16 +386,51 @@ AC_ARG_ENABLE([mips-msa],
- # future host CPU does not match 'mips*')
-
- AM_CONDITIONAL([PNG_MIPS_MSA],
- [test "$enable_mips_msa" != 'no' &&
- case "$host_cpu" in
- mipsel*|mips64el*) :;;
- esac])
-
-+# INTEL
-+# =====
-+#
-+# INTEL SSE (SIMD) support.
-+
-+AC_ARG_ENABLE([intel-sse],
-+ AS_HELP_STRING([[[--enable-intel-sse]]],
-+ [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.]),
-+ [case "$enableval" in
-+ no|off)
-+ # disable the default enabling:
-+ AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
-+ [Disable Intel SSE optimizations])
-+ # Prevent inclusion of the assembler files below:
-+ enable_intel_sse=no;;
-+ yes|on)
-+ AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
-+ [Enable Intel SSE optimizations]);;
-+ *)
-+ AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
-+ esac])
-+
-+# Add Intel specific files to all builds where the 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*')
-+AM_CONDITIONAL([PNG_INTEL_SSE],
-+ [test "$enable_intel_sse" != 'no' &&
-+ case "$host_cpu" in
-+ i?86|x86_64) :;;
-+ *) test "$enable_intel_sse" != '';;
-+ esac])
-+
- AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
-
- # Config files, substituting as above
- AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
- AC_CONFIG_FILES([libpng-config:libpng-config.in],
- [chmod +x libpng-config])
-
- AC_OUTPUT
-diff --git a/Makefile.am b/Makefile.am
---- a/Makefile.am 2016-08-29 11:46:27.000000000 -0400
-+++ b/Makefile.am 2016-08-29 16:57:45.955528215 -0400
-@@ -97,16 +97,21 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SO
- arm/filter_neon.S arm/filter_neon_intrinsics.c
- endif
-
- if PNG_MIPS_MSA
- libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c\
- mips/filter_msa_intrinsics.c
- endif
-
-+if PNG_INTEL_SSE
-+libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\
-+ contrib/intel/filter_sse2_intrinsics.c
-+endif
-+
- nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
-
- libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
- -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
-
- if HAVE_LD_VERSION_SCRIPT
- # Versioned symbols and restricted exports
- if HAVE_SOLARIS_LD
-diff --git a/pngpriv.h b/pngpriv.h
---- debug16/pngpriv.h 2016-08-30 10:46:36.000000000 -0400
-+++ libpng16/pngpriv.h 2016-08-30 11:57:25.672280202 -0400
-@@ -185,16 +185,52 @@
- #ifndef PNG_MIPS_MSA_OPT
- # if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
- # define PNG_MIPS_MSA_OPT 2
- # else
- # define PNG_MIPS_MSA_OPT 0
- # endif
- #endif
-
-+#ifndef PNG_INTEL_SSE_OPT
-+# ifdef PNG_INTEL_SSE
-+ /* Only check for SSE if the build configuration has been modified to
-+ * enable SSE optimizations. This means that these optimizations will
-+ * be off by default. See contrib/intel for more details.
-+ */
-+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
-+ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
-+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
-+# define PNG_INTEL_SSE_OPT 1
-+# endif
-+# endif
-+#endif
-+
-+#if PNG_INTEL_SSE_OPT > 0
-+# ifndef PNG_INTEL_SSE_IMPLEMENTATION
-+# if defined(__SSE4_1__) || defined(__AVX__)
-+ /* We are not actually using AVX, but checking for AVX is the best
-+ way we can detect SSE4.1 and SSSE3 on MSVC.
-+ */
-+# define PNG_INTEL_SSE_IMPLEMENTATION 3
-+# elif defined(__SSSE3__)
-+# define PNG_INTEL_SSE_IMPLEMENTATION 2
-+# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
-+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
-+# define PNG_INTEL_SSE_IMPLEMENTATION 1
-+# else
-+# define PNG_INTEL_SSE_IMPLEMENTATION 0
-+# endif
-+# endif
-+
-+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
-+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
-+# endif
-+#endif
-+
- #if PNG_MIPS_MSA_OPT > 0
- # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
- # ifndef PNG_MIPS_MSA_IMPLEMENTATION
- # if defined(__mips_msa)
- # if defined(__clang__)
- # elif defined(__GNUC__)
- # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
- # define PNG_MIPS_MSA_IMPLEMENTATION 2
-@@ -1232,16 +1268,31 @@ PNG_INTERNAL_FUNCTION(void,png_read_filt
- PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_msa,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
- PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_msa,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
- PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
- row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
- #endif
-
-+#if PNG_INTEL_SSE_IMPLEMENTATION > 0
-+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
-+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
-+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
-+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
-+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
-+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
-+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
-+#endif
-+
- /* Choose the best filter to use and filter the row data */
- PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
- png_row_infop row_info),PNG_EMPTY);
-
- #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
- PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr,
- png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY);
- /* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer
-@@ -1967,16 +2018,21 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_O
- PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
- (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
- #endif
-
- #if PNG_MIPS_MSA_OPT > 0
- PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
- (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
- #endif
-+
-+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
-+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
-+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
-+# endif
- #endif
-
- PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
- png_const_charp key, png_bytep new_key), PNG_EMPTY);
-
- /* Maintainer: Put new private prototypes here ^ */
-
- #include "pngdebug.h"
diff --git a/contrib/libtests/gentests.sh b/contrib/libtests/gentests.sh
index f0f8d2395..eba7ce50c 100755
--- a/contrib/libtests/gentests.sh
+++ b/contrib/libtests/gentests.sh
@@ -2,8 +2,6 @@
#
# Copyright (c) 2013 John Cunningham Bowler
#
-# Last changed in libpng 1.6.0 [February 14, 2013]
-#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
diff --git a/contrib/libtests/makepng.c b/contrib/libtests/makepng.c
index 9dff04846..a866fc1d1 100644
--- a/contrib/libtests/makepng.c
+++ b/contrib/libtests/makepng.c
@@ -3,8 +3,6 @@
/* Copyright: */
#define COPYRIGHT "\251 2013,2015 John Cunningham Bowler"
/*
- * Last changed in libpng 1.6.20 [November 24, 2015]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -299,25 +297,28 @@ generate_palette(png_colorp palette, png_bytep trans, int bit_depth,
unsigned int x, y;
volatile unsigned int ip = 0;
- for (x=0; x<size; ++x) for (y=0; y<size; ++y)
+ for (x=0; x<size; ++x)
{
- ip = x + (size * y);
-
- /* size is at most 16, so the scaled value below fits in 16 bits
- */
-# define interp(pos, c1, c2) ((pos * c1) + ((size-pos) * c2))
-# define xyinterp(x, y, c1, c2, c3, c4) (((size * size / 2) +\
- (interp(x, c1, c2) * y + (size-y) * interp(x, c3, c4))) /\
- (size*size))
-
- set_color(palette+ip, trans+ip,
- /* color: green, red,blue,white */
- xyinterp(x, y, 0, 255, 0, 255),
- xyinterp(x, y, 255, 0, 0, 255),
- xyinterp(x, y, 0, 0, 255, 255),
- /* alpha: 0, 102, 204, 255) */
- xyinterp(x, y, 0, 102, 204, 255),
- gamma_table);
+ for (y=0; y<size; ++y)
+ {
+ ip = x + (size * y);
+
+ /* size is at most 16, so the scaled value below fits in 16 bits
+ */
+# define interp(pos, c1, c2) ((pos * c1) + ((size-pos) * c2))
+# define xyinterp(x, y, c1, c2, c3, c4) (((size * size / 2) +\
+ (interp(x, c1, c2) * y + (size-y) * interp(x, c3, c4))) /\
+ (size*size))
+
+ set_color(palette+ip, trans+ip,
+ /* color: green, red,blue,white */
+ xyinterp(x, y, 0, 255, 0, 255),
+ xyinterp(x, y, 255, 0, 0, 255),
+ xyinterp(x, y, 0, 0, 255, 255),
+ /* alpha: 0, 102, 204, 255) */
+ xyinterp(x, y, 0, 102, 204, 255),
+ gamma_table);
+ }
}
return ip+1;
@@ -396,7 +397,7 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
image_size_of_type(color_type, bit_depth, colors, small)-1;
png_uint_32 depth_max = (1U << bit_depth)-1; /* up to 65536 */
- if (colors[0] == 0) if (small)
+ if (colors[0] == 0 && small)
{
unsigned int pixel_depth = pixel_depth_of_type(color_type, bit_depth);
@@ -495,7 +496,7 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 32:
case 48:
case 64:
- /* The rows are filled by an alogorithm similar to the above, in the
+ /* The rows are filled by an algorithm similar to the above, in the
* first row pixel bytes are all equal, increasing from 0 by 1 for
* each pixel. In the second row the bytes within a pixel are
* incremented 1,3,5,7,... from the previous row byte. Using an odd
@@ -661,7 +662,7 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
{
case 1:
{
- const png_uint_32 luma = colors[1];
+ png_uint_32 luma = colors[1];
png_uint_32 x;
for (x=0; x<=size_max; ++x)
@@ -672,8 +673,8 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 2:
{
- const png_uint_32 luma = colors[1];
- const png_uint_32 alpha = colors[2];
+ png_uint_32 luma = colors[1];
+ png_uint_32 alpha = colors[2];
png_uint_32 x;
for (x=0; x<size_max; ++x)
@@ -688,9 +689,9 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 3:
{
- const png_uint_32 red = colors[1];
- const png_uint_32 green = colors[2];
- const png_uint_32 blue = colors[3];
+ png_uint_32 red = colors[1];
+ png_uint_32 green = colors[2];
+ png_uint_32 blue = colors[3];
png_uint_32 x;
for (x=0; x<=size_max; ++x)
@@ -707,10 +708,10 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 4:
{
- const png_uint_32 red = colors[1];
- const png_uint_32 green = colors[2];
- const png_uint_32 blue = colors[3];
- const png_uint_32 alpha = colors[4];
+ png_uint_32 red = colors[1];
+ png_uint_32 green = colors[2];
+ png_uint_32 blue = colors[3];
+ png_uint_32 alpha = colors[4];
png_uint_32 x;
for (x=0; x<=size_max; ++x)
@@ -812,7 +813,7 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
png_error(png_ptr, "OOM allocating info structure");
{
- const unsigned int size =
+ unsigned int size =
image_size_of_type(color_type, bit_depth, colors, small);
unsigned int ysize;
png_fixed_point real_gamma = 45455; /* For sRGB */
@@ -824,7 +825,7 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
*/
if (small)
{
- const unsigned int pixel_depth =
+ unsigned int pixel_depth =
pixel_depth_of_type(color_type, bit_depth);
if (pixel_depth <= 8U)
@@ -858,10 +859,13 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
{
unsigned int i;
- if (real_gamma == 45455) for (i=0; i<256; ++i)
+ if (real_gamma == 45455)
{
- gamma_table[i] = (png_byte)i;
- conv = 1.;
+ for (i=0; i<256; ++i)
+ {
+ gamma_table[i] = (png_byte)i;
+ conv = 1.;
+ }
}
else
@@ -950,7 +954,7 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
int passes = 1;
# endif /* !WRITE_INTERLACING */
int pass;
- png_size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+ size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
row = malloc(rowbytes);
@@ -1094,7 +1098,7 @@ load_file(png_const_charp name, png_bytepp result)
return 0;
}
-static png_size_t
+static size_t
load_fake(png_charp param, png_bytepp profile)
{
char *endptr = NULL;
@@ -1164,7 +1168,7 @@ insert_iCCP(png_structp png_ptr, png_infop info_ptr, int nparams,
{
case '<':
{
- png_size_t filelen = load_file(params[1]+1, &profile);
+ size_t filelen = load_file(params[1]+1, &profile);
if (filelen > 0xfffffffc) /* Maximum profile length */
{
fprintf(stderr, "%s: file too long (%lu) for an ICC profile\n",
@@ -1179,7 +1183,7 @@ insert_iCCP(png_structp png_ptr, png_infop info_ptr, int nparams,
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
{
- png_size_t fake_len = load_fake(params[1], &profile);
+ size_t fake_len = load_fake(params[1], &profile);
if (fake_len > 0) /* else a simple parameter */
{
@@ -1274,7 +1278,7 @@ set_text(png_structp png_ptr, png_infop info_ptr, png_textp text,
case '5': case '6': case '7': case '8': case '9':
{
png_bytep data = NULL;
- png_size_t fake_len = load_fake(param, &data);
+ size_t fake_len = load_fake(param, &data);
if (fake_len > 0) /* else a simple parameter */
{
@@ -1378,10 +1382,10 @@ static void
insert_sBIT(png_structp png_ptr, png_infop info_ptr, int nparams,
png_charpp params)
{
- const int ct = png_get_color_type(png_ptr, info_ptr);
- const int c = (ct & PNG_COLOR_MASK_COLOR ? 3 : 1) +
+ int ct = png_get_color_type(png_ptr, info_ptr);
+ int c = (ct & PNG_COLOR_MASK_COLOR ? 3 : 1) +
(ct & PNG_COLOR_MASK_ALPHA ? 1 : 0);
- const unsigned int maxval =
+ unsigned int maxval =
ct & PNG_COLOR_MASK_PALETTE ? 8U : png_get_bit_depth(png_ptr, info_ptr);
png_color_8 sBIT;
@@ -1430,10 +1434,13 @@ find_parameters(png_const_charp what, png_charp param, png_charp *list,
for (i=0; *param && i<nparams; ++i)
{
list[i] = param;
- while (*++param) if (*param == '\n' || *param == ':')
+ while (*++param)
{
- *param++ = 0; /* Terminate last parameter */
- break; /* And start a new one. */
+ if (*param == '\n' || *param == ':')
+ {
+ *param++ = 0; /* Terminate last parameter */
+ break; /* And start a new one. */
+ }
}
}
@@ -1856,7 +1863,7 @@ main(int argc, char **argv)
/* Check the colors */
{
- const unsigned int lim = (color_type == PNG_COLOR_TYPE_PALETTE ? 255U :
+ unsigned int lim = (color_type == PNG_COLOR_TYPE_PALETTE ? 255U :
(1U<<bit_depth)-1);
unsigned int i;
@@ -1869,7 +1876,7 @@ main(int argc, char **argv)
}
}
- /* small and colors are incomparible (will probably crash if both are used at
+ /* small and colors are incompatible (will probably crash if both are used at
* the same time!)
*/
if (small && colors[0] != 0)
diff --git a/contrib/libtests/pngimage.c b/contrib/libtests/pngimage.c
index 9ae402cc4..be176b2bc 100644
--- a/contrib/libtests/pngimage.c
+++ b/contrib/libtests/pngimage.c
@@ -1,9 +1,9 @@
+
/* pngimage.c
*
+ * Copyright (c) 2021 Cosmin Truta
* Copyright (c) 2015,2016 John Cunningham Bowler
*
- * Last changed in libpng 1.6.24 [August 4, 2016]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -12,6 +12,7 @@
* using png_read_png and then write with png_write_png. Test all possible
* transforms.
*/
+
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -317,11 +318,10 @@ transform_name(int t)
t &= -t; /* first set bit */
- for (i=0; i<TTABLE_SIZE; ++i) if (transform_info[i].name != NULL)
- {
- if ((transform_info[i].transform & t) != 0)
- return transform_info[i].name;
- }
+ for (i=0; i<TTABLE_SIZE; ++i)
+ if (transform_info[i].name != NULL)
+ if ((transform_info[i].transform & t) != 0)
+ return transform_info[i].name;
return "invalid transform";
}
@@ -338,13 +338,16 @@ validate_T(void)
{
unsigned int i;
- for (i=0; i<TTABLE_SIZE; ++i) if (transform_info[i].name != NULL)
+ for (i=0; i<TTABLE_SIZE; ++i)
{
- if (transform_info[i].when & TRANSFORM_R)
- read_transforms |= transform_info[i].transform;
+ if (transform_info[i].name != NULL)
+ {
+ if (transform_info[i].when & TRANSFORM_R)
+ read_transforms |= transform_info[i].transform;
- if (transform_info[i].when & TRANSFORM_W)
- write_transforms |= transform_info[i].transform;
+ if (transform_info[i].when & TRANSFORM_W)
+ write_transforms |= transform_info[i].transform;
+ }
}
/* Reversible transforms are those which are supported on both read and
@@ -551,7 +554,7 @@ struct display
png_structp original_pp; /* used on the original read */
png_infop original_ip; /* set by the original read */
- png_size_t original_rowbytes; /* of the original rows: */
+ size_t original_rowbytes; /* of the original rows: */
png_bytepp original_rows; /* from the original read */
/* Original chunks valid */
@@ -807,7 +810,7 @@ display_cache_file(struct display *dp, const char *filename)
static void
buffer_read(struct display *dp, struct buffer *bp, png_bytep data,
- png_size_t size)
+ size_t size)
{
struct buffer_list *last = bp->current;
size_t read_count = bp->read_count;
@@ -855,7 +858,7 @@ buffer_read(struct display *dp, struct buffer *bp, png_bytep data,
}
static void PNGCBAPI
-read_function(png_structp pp, png_bytep data, png_size_t size)
+read_function(png_structp pp, png_bytep data, size_t size)
{
buffer_read(get_dp(pp), get_buffer(pp), data, size);
}
@@ -927,7 +930,7 @@ update_display(struct display *dp)
png_structp pp;
png_infop ip;
- /* Now perform the initial read with a 0 tranform. */
+ /* Now perform the initial read with a 0 transform. */
read_png(dp, &dp->original_file, "original read", 0/*no transform*/);
/* Move the result to the 'original' fields */
@@ -962,21 +965,24 @@ update_display(struct display *dp)
int bd = dp->bit_depth;
unsigned int i;
- for (i=0; i<TTABLE_SIZE; ++i) if (transform_info[i].name != NULL)
+ for (i=0; i<TTABLE_SIZE; ++i)
{
- int transform = transform_info[i].transform;
-
- if ((transform_info[i].valid_chunks == 0 ||
- (transform_info[i].valid_chunks & chunks) != 0) &&
- (transform_info[i].color_mask_required & ct) ==
- transform_info[i].color_mask_required &&
- (transform_info[i].color_mask_absent & ct) == 0 &&
- (transform_info[i].bit_depths & bd) != 0 &&
- (transform_info[i].when & TRANSFORM_R) != 0)
- active |= transform;
-
- else if ((transform_info[i].when & TRANSFORM_R) != 0)
- inactive |= transform;
+ if (transform_info[i].name != NULL)
+ {
+ int transform = transform_info[i].transform;
+
+ if ((transform_info[i].valid_chunks == 0 ||
+ (transform_info[i].valid_chunks & chunks) != 0) &&
+ (transform_info[i].color_mask_required & ct) ==
+ transform_info[i].color_mask_required &&
+ (transform_info[i].color_mask_absent & ct) == 0 &&
+ (transform_info[i].bit_depths & bd) != 0 &&
+ (transform_info[i].when & TRANSFORM_R) != 0)
+ active |= transform;
+
+ else if ((transform_info[i].when & TRANSFORM_R) != 0)
+ inactive |= transform;
+ }
}
/* Some transforms appear multiple times in the table; the 'active' status
@@ -1000,8 +1006,9 @@ compare_read(struct display *dp, int applied_transforms)
int interlace_method, compression_method, filter_method;
const char *e = NULL;
- png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth,
- &color_type, &interlace_method, &compression_method, &filter_method);
+ if (!png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth,
+ &color_type, &interlace_method, &compression_method, &filter_method))
+ display_log(dp, LIBPNG_BUG, "png_get_IHDR failed");
# define C(item) if (item != dp->item) \
display_log(dp, APP_WARNING, "IHDR " #item "(%lu) changed to %lu",\
@@ -1081,8 +1088,9 @@ compare_read(struct display *dp, int applied_transforms)
size_t x;
/* Find the first error */
- for (x=0; x<rowbytes-1; ++x) if (row[x] != orig[x])
- break;
+ for (x=0; x<rowbytes-1; ++x)
+ if (row[x] != orig[x])
+ break;
display_log(dp, APP_FAIL,
"byte(%lu,%lu) changed 0x%.2x -> 0x%.2x",
@@ -1137,6 +1145,7 @@ compare_read(struct display *dp, int applied_transforms)
display_log(dp, LIBPNG_ERROR, "invalid colour type %d",
color_type);
/*NOTREACHED*/
+ memset(sig_bits, 0, sizeof(sig_bits));
bpp = 0;
break;
}
@@ -1198,7 +1207,7 @@ compare_read(struct display *dp, int applied_transforms)
sig_bits[0] = (png_byte)b;
break;
- case 4: /* Relicate twice */
+ case 4: /* Replicate twice */
/* Value is 1, 2, 3 or 4 */
b = 0xf & ((0xf << 4) >> sig_bits[0]);
b |= b << 4;
@@ -1267,7 +1276,7 @@ compare_read(struct display *dp, int applied_transforms)
#ifdef PNG_WRITE_PNG_SUPPORTED
static void
buffer_write(struct display *dp, struct buffer *buffer, png_bytep data,
- png_size_t size)
+ size_t size)
/* Generic write function used both from the write callback provided to
* libpng and from the generic read code.
*/
@@ -1311,7 +1320,7 @@ buffer_write(struct display *dp, struct buffer *buffer, png_bytep data,
}
static void PNGCBAPI
-write_function(png_structp pp, png_bytep data, png_size_t size)
+write_function(png_structp pp, png_bytep data, size_t size)
{
buffer_write(get_dp(pp), get_buffer(pp), data, size);
}
@@ -1446,7 +1455,7 @@ test_one_file(struct display *dp, const char *filename)
* unsigned, because some transforms are negative on a 16-bit system.
*/
unsigned int active = dp->active_transforms;
- const int exhaustive = (dp->options & EXHAUSTIVE) != 0;
+ int exhaustive = (dp->options & EXHAUSTIVE) != 0;
unsigned int current = first_transform(active);
unsigned int bad_transforms = 0;
unsigned int bad_combo = ~0U; /* bitwise AND of failing transforms */
@@ -1572,7 +1581,7 @@ do_test(struct display *dp, const char *file)
}
int
-main(const int argc, const char * const * const argv)
+main(int argc, char **argv)
{
/* For each file on the command line test it with a range of transforms */
int option_end, ilog = 0;
@@ -1674,7 +1683,7 @@ main(const int argc, const char * const * const argv)
/* Here on any return, including failures, except user/internal issues
*/
{
- const int pass = (d.options & STRICT) ?
+ int pass = (d.options & STRICT) ?
RESULT_STRICT(d.results) : RESULT_RELAXED(d.results);
if (!pass)
@@ -1686,8 +1695,9 @@ main(const int argc, const char * const * const argv)
printf("%s: pngimage ", pass ? "PASS" : "FAIL");
- for (j=1; j<option_end; ++j) if (j != ilog)
- printf("%s ", argv[j]);
+ for (j=1; j<option_end; ++j)
+ if (j != ilog)
+ printf("%s ", argv[j]);
printf("%s\n", d.filename);
}
diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c
index ab4508930..973e60f52 100644
--- a/contrib/libtests/pngstest.c
+++ b/contrib/libtests/pngstest.c
@@ -1,7 +1,7 @@
-/*-
- * pngstest.c
+
+/* pngstest.c
*
- * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 2021 Cosmin Truta
* Copyright (c) 2013-2017 John Cunningham Bowler
*
* This code is released under the libpng license.
@@ -10,8 +10,9 @@
*
* Test for the PNG 'simplified' APIs.
*/
+
#define _ISOC90_SOURCE 1
-#define MALLOC_CHECK_ 2/*glibc facility: turn on debugging*/
+#define MALLOC_CHECK_ 2 /*glibc facility: turn on debugging*/
#include <stddef.h>
#include <stdlib.h>
@@ -372,7 +373,7 @@ print_opts(png_uint_32 opts)
*/
#define FORMAT_COUNT 64
#define FORMAT_MASK 0x3f
-static PNG_CONST char * PNG_CONST format_names[FORMAT_COUNT] =
+static const char * const format_names[FORMAT_COUNT] =
{
"sRGB-gray",
"sRGB-gray+alpha",
@@ -578,11 +579,11 @@ typedef struct
int stride_extra;
FILE *input_file;
png_voidp input_memory;
- png_size_t input_memory_size;
+ size_t input_memory_size;
png_bytep buffer;
ptrdiff_t stride;
- png_size_t bufsize;
- png_size_t allocsize;
+ size_t bufsize;
+ size_t allocsize;
char tmpfile_name[32];
png_uint_16 colormap[256*4];
}
@@ -665,7 +666,7 @@ static void initimage(Image *image, png_uint_32 opts, const char *file_name,
static void
allocbuffer(Image *image)
{
- png_size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride);
+ size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride);
if (size+32 > image->bufsize)
{
@@ -1142,7 +1143,7 @@ get_pixel(png_uint_32 format))(Pixel *p, png_const_voidp pb)
}
}
-/* Convertion between pixel formats. The code above effectively eliminates the
+/* Conversion between pixel formats. The code above effectively eliminates the
* component ordering changes leaving three basic changes:
*
* 1) Remove an alpha channel by pre-multiplication or compositing on a
@@ -1150,7 +1151,7 @@ get_pixel(png_uint_32 format))(Pixel *p, png_const_voidp pb)
*
* 2) Remove color by mapping to grayscale. (Grayscale to color is a no-op.)
*
- * 3) Convert between 8-bit and 16-bit components. (Both directtions are
+ * 3) Convert between 8-bit and 16-bit components. (Both directions are
* relevant.)
*
* This gives the following base format conversion matrix:
@@ -2036,7 +2037,7 @@ typedef struct
/* Precalculated values: */
int in_opaque; /* Value of input alpha that is opaque */
int is_palette; /* Sample values come from the palette */
- int accumulate; /* Accumlate component errors (don't log) */
+ int accumulate; /* Accumulate component errors (don't log) */
int output_8bit; /* Output is 8-bit (else 16-bit) */
void (*in_gp)(Pixel*, png_const_voidp);
@@ -2346,8 +2347,8 @@ static int
logpixel(const Transform *transform, png_uint_32 x, png_uint_32 y,
const Pixel *in, const Pixel *calc, const Pixel *out, const char *reason)
{
- const png_uint_32 in_format = transform->in_image->image.format;
- const png_uint_32 out_format = transform->out_image->image.format;
+ png_uint_32 in_format = transform->in_image->image.format;
+ png_uint_32 out_format = transform->out_image->image.format;
png_uint_32 back_format = out_format & ~PNG_FORMAT_FLAG_ALPHA;
const char *via_linear = "";
@@ -2602,12 +2603,12 @@ compare_two_images(Image *a, Image *b, int via_linear,
ptrdiff_t strideb = b->stride;
png_const_bytep rowa = a->buffer+16;
png_const_bytep rowb = b->buffer+16;
- const png_uint_32 width = a->image.width;
- const png_uint_32 height = a->image.height;
- const png_uint_32 formata = a->image.format;
- const png_uint_32 formatb = b->image.format;
- const unsigned int a_sample = PNG_IMAGE_SAMPLE_SIZE(formata);
- const unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb);
+ png_uint_32 width = a->image.width;
+ png_uint_32 height = a->image.height;
+ png_uint_32 formata = a->image.format;
+ png_uint_32 formatb = b->image.format;
+ unsigned int a_sample = PNG_IMAGE_SAMPLE_SIZE(formata);
+ unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb);
int alpha_added, alpha_removed;
int bchannels;
png_uint_32 y;
@@ -2701,7 +2702,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
{
if ((a->opts & ACCUMULATE) == 0)
{
- char pindex[9];
+ char pindex[16];
sprintf(pindex, "%lu[%lu]", (unsigned long)y,
(unsigned long)a->image.colormap_entries);
logerror(a, a->file_name, ": bad pixel index: ", pindex);
@@ -2712,12 +2713,12 @@ compare_two_images(Image *a, Image *b, int via_linear,
else if (y >= b->image.colormap_entries)
{
if ((b->opts & ACCUMULATE) == 0)
- {
- char pindex[9];
+ {
+ char pindex[16];
sprintf(pindex, "%lu[%lu]", (unsigned long)y,
(unsigned long)b->image.colormap_entries);
logerror(b, b->file_name, ": bad pixel index: ", pindex);
- }
+ }
result = 0;
}
@@ -2726,7 +2727,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
result = 0;
}
- /* If reqested copy the error values back from the Transform. */
+ /* If requested, copy the error values back from the Transform. */
if (a->opts & ACCUMULATE)
{
tr.error_ptr[0] = tr.error[0];
@@ -2790,8 +2791,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
(formata & (formatb ^ PNG_FORMAT_FLAG_COLOR) & PNG_FORMAT_FLAG_COLOR)))
{
/* Was an alpha channel changed? */
- const png_uint_32 alpha_changed = (formata ^ formatb) &
- PNG_FORMAT_FLAG_ALPHA;
+ png_uint_32 alpha_changed = (formata ^ formatb) & PNG_FORMAT_FLAG_ALPHA;
/* Was an alpha channel removed? (The third test.) If so the direct
* comparison is only possible if the input alpha is opaque.
@@ -2821,8 +2821,11 @@ compare_two_images(Image *a, Image *b, int via_linear,
bchannels = component_loc(bloc, formatb);
/* Hence the btoa array. */
- for (i=0; i<4; ++i) if (bloc[i] < 4)
- btoa[bloc[i]] = aloc[i]; /* may be '4' for alpha */
+ for (i=0; i<4; ++i)
+ {
+ if (bloc[i] < 4)
+ btoa[bloc[i]] = aloc[i]; /* may be '4' for alpha */
+ }
if (alpha_added)
alpha_added = bloc[0]; /* location of alpha channel in image b */
@@ -2932,7 +2935,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
}
}
- /* If reqested copy the error values back from the Transform. */
+ /* If requested, copy the error values back from the Transform. */
if (a->opts & ACCUMULATE)
{
tr.error_ptr[0] = tr.error[0];
@@ -3210,10 +3213,10 @@ write_one_file(Image *output, Image *image, int convert_to_8bit)
else if (image->opts & USE_FILE)
{
#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
- static int counter = 0;
+ static unsigned int counter = 0;
char name[32];
- sprintf(name, "%s%d.png", tmpf, ++counter);
+ sprintf(name, "%s%u.png", tmpf, ++counter);
if (png_image_write_to_file(&image->image, name, convert_to_8bit,
image->buffer+16, (png_int_32)image->stride, image->colormap))
@@ -3627,7 +3630,7 @@ main(int argc, char **argv)
if (arg[0] == '-')
{
- const int term = (arg[1] == '0' ? 0 : '\n');
+ int term = (arg[1] == '0' ? 0 : '\n');
unsigned int ich = 0;
/* Loop reading files, use a static buffer to simplify this and just
diff --git a/contrib/libtests/pngunknown.c b/contrib/libtests/pngunknown.c
index 12eab7258..dfa9d10a1 100644
--- a/contrib/libtests/pngunknown.c
+++ b/contrib/libtests/pngunknown.c
@@ -1,7 +1,7 @@
/* pngunknown.c - test the read side unknown chunk handling
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 2021 Cosmin Truta
* Copyright (c) 2015,2017 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*
@@ -56,7 +56,7 @@
defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED)
#if PNG_LIBPNG_VER < 10500
-/* This deliberately lacks the PNG_CONST. */
+/* This deliberately lacks the const. */
typedef png_byte *png_const_bytep;
/* This is copied from 1.5.1 png.h: */
@@ -85,7 +85,7 @@ typedef png_byte *png_const_bytep;
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
-/* This comes from pnglibconf.h afer 1.5: */
+/* This comes from pnglibconf.h after 1.5: */
#define PNG_FP_1 100000
#define PNG_GAMMA_THRESHOLD_FIXED\
((png_fixed_point)(PNG_GAMMA_THRESHOLD * PNG_FP_1))
@@ -370,7 +370,9 @@ find_by_flag(png_uint_32 flag)
{
int i = NINFO;
- while (--i >= 0) if (chunk_info[i].flag == flag) return i;
+ while (--i >= 0)
+ if (chunk_info[i].flag == flag)
+ return i;
fprintf(stderr, "pngunknown: internal error\n");
exit(4);
@@ -547,27 +549,30 @@ read_callback(png_structp pp, png_unknown_chunkp pc)
case PNG_HANDLE_CHUNK_AS_DEFAULT:
case PNG_HANDLE_CHUNK_NEVER:
- discard = 1/*handled; discard*/;
+ discard = 1; /*handled; discard*/
break;
case PNG_HANDLE_CHUNK_IF_SAFE:
case PNG_HANDLE_CHUNK_ALWAYS:
- discard = 0/*not handled; keep*/;
+ discard = 0; /*not handled; keep*/
break;
}
/* Also store information about this chunk in the display, the relevant flag
* is set if the chunk is to be kept ('not handled'.)
*/
- if (chunk >= 0) if (!discard) /* stupidity to stop a GCC warning */
+ if (chunk >= 0)
{
- png_uint_32 flag = chunk_info[chunk].flag;
+ if (!discard) /* stupidity to stop a GCC warning */
+ {
+ png_uint_32 flag = chunk_info[chunk].flag;
- if (pc->location & PNG_AFTER_IDAT)
- d->after_IDAT |= flag;
+ if (pc->location & PNG_AFTER_IDAT)
+ d->after_IDAT |= flag;
- else
- d->before_IDAT |= flag;
+ else
+ d->before_IDAT |= flag;
+ }
}
/* However if there is no support to store unknown chunks don't ask libpng to
@@ -841,8 +846,9 @@ check(FILE *fp, int argc, const char **argv, png_uint_32p flags/*out*/,
{
png_uint_32 y;
- for (y=0; y<height; ++y) if (PNG_ROW_IN_INTERLACE_PASS(y, ipass))
- png_read_row(d->png_ptr, NULL, NULL);
+ for (y=0; y<height; ++y)
+ if (PNG_ROW_IN_INTERLACE_PASS(y, ipass))
+ png_read_row(d->png_ptr, NULL, NULL);
}
}
} /* interlaced */
@@ -1091,15 +1097,15 @@ perform_one_test_safe(FILE *fp, int argc, const char **argv,
static const char *standard_tests[] =
{
- "discard", "default=discard", 0,
- "save", "default=save", 0,
- "if-safe", "default=if-safe", 0,
- "vpAg", "vpAg=if-safe", 0,
- "sTER", "sTER=if-safe", 0,
- "IDAT", "default=discard", "IDAT=save", 0,
- "sAPI", "bKGD=save", "cHRM=save", "gAMA=save", "all=discard", "iCCP=save",
- "sBIT=save", "sRGB=save", "eXIf=save", 0,
- 0/*end*/
+ "discard", "default=discard", NULL,
+ "save", "default=save", NULL,
+ "if-safe", "default=if-safe", NULL,
+ "vpAg", "vpAg=if-safe", NULL,
+ "sTER", "sTER=if-safe", NULL,
+ "IDAT", "default=discard", "IDAT=save", NULL,
+ "sAPI", "bKGD=save", "cHRM=save", "gAMA=save", "all=discard", "iCCP=save",
+ "sBIT=save", "sRGB=save", "eXIf=save", NULL,
+ NULL /*end*/
};
static PNG_NORETURN void
@@ -1115,7 +1121,7 @@ int
main(int argc, const char **argv)
{
FILE *fp;
- png_uint_32 default_flags[4/*valid,unknown{before,after}*/];
+ png_uint_32 default_flags[4]; /*valid,unknown{before,after}*/
int strict = 0, default_tests = 0;
const char *count_argv = "default=save";
const char *touch_file = NULL;
@@ -1153,8 +1159,9 @@ main(int argc, const char **argv)
/* GCC BUG: if (default_tests && argc != 1) triggers some weird GCC argc
* optimization which causes warnings with -Wstrict-overflow!
*/
- else if (default_tests) if (argc != 1)
- usage(d.program, "extra arguments");
+ else if (default_tests)
+ if (argc != 1)
+ usage(d.program, "extra arguments");
/* The name of the test file is the last argument; remove it. */
d.file = argv[--argc];
@@ -1216,7 +1223,11 @@ main(int argc, const char **argv)
const char *result;
int arg_count = 0;
- while (*next) ++next, ++arg_count;
+ while (*next != NULL)
+ {
+ ++next;
+ ++arg_count;
+ }
perform_one_test_safe(fp, arg_count, test, default_flags, &d,
this_test);
diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c
index 4dc4f8447..6a7422e88 100644
--- a/contrib/libtests/pngvalid.c
+++ b/contrib/libtests/pngvalid.c
@@ -1,7 +1,7 @@
/* pngvalid.c - validate libpng by constructing then reading png files.
*
- * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 2021 Cosmin Truta
* Copyright (c) 2014-2017 John Cunningham Bowler
*
* This code is released under the libpng license.
@@ -21,6 +21,8 @@
#define _POSIX_SOURCE 1
#define _ISOC99_SOURCE 1 /* For floating point */
#define _GNU_SOURCE 1 /* For the floating point exception extension */
+#define _BSD_SOURCE 1 /* For the floating point exception extension */
+#define _DEFAULT_SOURCE 1 /* For the floating point exception extension */
#include <signal.h>
#include <stdio.h>
@@ -102,7 +104,7 @@ typedef png_byte *png_const_bytep;
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
-/* This comes from pnglibconf.h afer 1.5: */
+/* This comes from pnglibconf.h after 1.5: */
#define PNG_FP_1 100000
#define PNG_GAMMA_THRESHOLD_FIXED\
((png_fixed_point)(PNG_GAMMA_THRESHOLD * PNG_FP_1))
@@ -711,7 +713,7 @@ typedef struct png_store_file
unsigned int IDAT_bits; /* Number of bits in IDAT size */
png_uint_32 IDAT_size; /* Total size of IDAT data */
png_uint_32 id; /* must be correct (see FILEID) */
- png_size_t datacount; /* In this (the last) buffer */
+ size_t datacount; /* In this (the last) buffer */
png_store_buffer data; /* Last buffer in file */
int npalette; /* Number of entries in palette */
store_palette_entry* palette; /* May be NULL */
@@ -777,10 +779,10 @@ typedef struct png_store
png_infop piread;
png_store_file* current; /* Set when reading */
png_store_buffer* next; /* Set when reading */
- png_size_t readpos; /* Position in *next */
+ size_t readpos; /* Position in *next */
png_byte* image; /* Buffer for reading interlaced images */
- png_size_t cb_image; /* Size of this buffer */
- png_size_t cb_row; /* Row size of the image(s) */
+ size_t cb_image; /* Size of this buffer */
+ size_t cb_row; /* Row size of the image(s) */
uLong IDAT_crc;
png_uint_32 IDAT_len; /* Used when re-chunking IDAT chunks */
png_uint_32 IDAT_pos; /* Used when re-chunking IDAT chunks */
@@ -791,7 +793,7 @@ typedef struct png_store
png_store_file* saved;
png_structp pwrite; /* Used when writing a new file */
png_infop piwrite;
- png_size_t writepos; /* Position in .new */
+ size_t writepos; /* Position in .new */
char wname[FILE_NAME_SIZE];
png_store_buffer new; /* The end of the new PNG file being written. */
store_pool write_memory_pool;
@@ -961,7 +963,7 @@ bits_of(png_uint_32 num)
return b; /* 0..32 */
}
-/* Main interface to file storeage, after writing a new PNG file (see the API
+/* Main interface to file storage, after writing a new PNG file (see the API
* below) call store_storefile to store the result with the given name and id.
*/
static void
@@ -1125,7 +1127,7 @@ static png_bytep
store_image_row(const png_store* ps, png_const_structp pp, int nImage,
png_uint_32 y)
{
- png_size_t coffset = (nImage * ps->image_h + y) * (ps->cb_row + 5) + 2;
+ size_t coffset = (nImage * ps->image_h + y) * (ps->cb_row + 5) + 2;
if (ps->image == NULL)
png_error(pp, "no allocated image");
@@ -1160,9 +1162,9 @@ store_image_free(png_store *ps, png_const_structp pp)
static void
store_ensure_image(png_store *ps, png_const_structp pp, int nImages,
- png_size_t cbRow, png_uint_32 cRows)
+ size_t cbRow, png_uint_32 cRows)
{
- png_size_t cb = nImages * cRows * (cbRow + 5);
+ size_t cb = nImages * cRows * (cbRow + 5);
if (ps->cb_image < cb)
{
@@ -1234,7 +1236,7 @@ store_image_check(const png_store* ps, png_const_structp pp, int iImage)
png_error(pp, "image overwrite");
else
{
- png_size_t cbRow = ps->cb_row;
+ size_t cbRow = ps->cb_row;
png_uint_32 rows = ps->image_h;
image += iImage * (cbRow+5) * ps->image_h;
@@ -1278,7 +1280,7 @@ valid_chunktype(png_uint_32 chunktype)
}
static void PNGCBAPI
-store_write(png_structp ppIn, png_bytep pb, png_size_t st)
+store_write(png_structp ppIn, png_bytep pb, size_t st)
{
png_const_structp pp = ppIn;
png_store *ps = voidcast(png_store*, png_get_io_ptr(pp));
@@ -1346,13 +1348,13 @@ store_write(png_structp ppIn, png_bytep pb, png_size_t st)
else /* chunkpos >= 8 */
{
- png_size_t cb = st;
+ size_t cb = st;
if (cb > STORE_BUFFER_SIZE - writepos)
cb = STORE_BUFFER_SIZE - writepos;
if (cb > chunklen - chunkpos/* bytes left in chunk*/)
- cb = (png_size_t)/*SAFE*/(chunklen - chunkpos);
+ cb = (size_t)/*SAFE*/(chunklen - chunkpos);
memcpy(ps->new.buffer + writepos, pb, cb);
chunkpos += (png_uint_32)/*SAFE*/cb;
@@ -1440,7 +1442,7 @@ store_read_buffer_next(png_store *ps)
* during progressive read, where the io_ptr is set internally by libpng.
*/
static void
-store_read_imp(png_store *ps, png_bytep pb, png_size_t st)
+store_read_imp(png_store *ps, png_bytep pb, size_t st)
{
if (ps->current == NULL || ps->next == NULL)
png_error(ps->pread, "store state damaged");
@@ -1463,14 +1465,13 @@ store_read_imp(png_store *ps, png_bytep pb, png_size_t st)
}
}
-static png_size_t
-store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
- const png_size_t min)
+static size_t
+store_read_chunk(png_store *ps, png_bytep pb, size_t max, size_t min)
{
png_uint_32 chunklen = ps->chunklen;
png_uint_32 chunktype = ps->chunktype;
png_uint_32 chunkpos = ps->chunkpos;
- png_size_t st = max;
+ size_t st = max;
if (st > 0) do
{
@@ -1601,8 +1602,8 @@ store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
store_read_imp(ps, pb, avail);
ps->IDAT_crc = crc32(ps->IDAT_crc, pb, avail);
- pb += (png_size_t)/*SAFE*/avail;
- st -= (png_size_t)/*SAFE*/avail;
+ pb += (size_t)/*SAFE*/avail;
+ st -= (size_t)/*SAFE*/avail;
chunkpos += (png_uint_32)/*SAFE*/avail;
IDAT_size -= (png_uint_32)/*SAFE*/avail;
IDAT_pos += (png_uint_32)/*SAFE*/avail;
@@ -1669,10 +1670,10 @@ store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
else /* Return chunk bytes, including the CRC */
{
- png_size_t avail = st;
+ size_t avail = st;
if (avail > chunklen - chunkpos)
- avail = (png_size_t)/*SAFE*/(chunklen - chunkpos);
+ avail = (size_t)/*SAFE*/(chunklen - chunkpos);
store_read_imp(ps, pb, avail);
pb += avail;
@@ -1698,7 +1699,7 @@ store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
}
static void PNGCBAPI
-store_read(png_structp ppIn, png_bytep pb, png_size_t st)
+store_read(png_structp ppIn, png_bytep pb, size_t st)
{
png_const_structp pp = ppIn;
png_store *ps = voidcast(png_store*, png_get_io_ptr(pp));
@@ -1724,7 +1725,7 @@ store_progressive_read(png_store *ps, png_structp pp, png_infop pi)
while (store_read_buffer_avail(ps) > 0)
{
static png_uint_32 noise = 2;
- png_size_t cb;
+ size_t cb;
png_byte buffer[512];
/* Generate 15 more bits of stuff: */
@@ -2590,7 +2591,7 @@ static double digitize(double value, int depth, int do_round)
* rounding and 'do_round' should be 1, if it is 0 the digitized value will
* be truncated.
*/
- const unsigned int digitization_factor = (1U << depth) -1;
+ unsigned int digitization_factor = (1U << depth) - 1;
/* Limiting the range is done as a convenience to the caller - it's easier to
* do it once here than every time at the call site.
@@ -2991,7 +2992,7 @@ modifier_setbuffer(png_modifier *pm)
* png_struct.
*/
static void
-modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st)
+modifier_read_imp(png_modifier *pm, png_bytep pb, size_t st)
{
while (st > 0)
{
@@ -3137,7 +3138,7 @@ modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st)
*/
if (len+12 <= sizeof pm->buffer)
{
- png_size_t s = len+12-pm->buffer_count;
+ size_t s = len+12-pm->buffer_count;
store_read_chunk(&pm->this, pm->buffer+pm->buffer_count, s, s);
pm->buffer_count = len+12;
@@ -3196,7 +3197,7 @@ modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st)
/* The callback: */
static void PNGCBAPI
-modifier_read(png_structp ppIn, png_bytep pb, png_size_t st)
+modifier_read(png_structp ppIn, png_bytep pb, size_t st)
{
png_const_structp pp = ppIn;
png_modifier *pm = voidcast(png_modifier*, png_get_io_ptr(pp));
@@ -3226,7 +3227,7 @@ modifier_progressive_read(png_modifier *pm, png_structp pp, png_infop pi)
for (;;)
{
static png_uint_32 noise = 1;
- png_size_t cb, cbAvail;
+ size_t cb, cbAvail;
png_byte buffer[512];
/* Generate 15 more bits of stuff: */
@@ -3688,8 +3689,8 @@ init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette,
#ifdef PNG_WRITE_tRNS_SUPPORTED
static void
-set_random_tRNS(png_structp pp, png_infop pi, const png_byte colour_type,
- const int bit_depth)
+set_random_tRNS(png_structp pp, png_infop pi, png_byte colour_type,
+ int bit_depth)
{
/* To make this useful the tRNS color needs to match at least one pixel.
* Random values are fine for gray, including the 16-bit case where we know
@@ -3697,7 +3698,7 @@ set_random_tRNS(png_structp pp, png_infop pi, const png_byte colour_type,
* method as only 65536 different RGB values are generated.
*/
png_color_16 tRNS;
- const png_uint_16 mask = (png_uint_16)((1U << bit_depth)-1);
+ png_uint_16 mask = (png_uint_16)((1U << bit_depth)-1);
R8(tRNS); /* makes unset fields random */
@@ -4338,7 +4339,7 @@ make_size_image(png_store* const ps, png_byte const colour_type,
/* Make a name and get an appropriate id for the store: */
char name[FILE_NAME_SIZE];
- const png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/,
+ png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/,
interlace_type, w, h, do_interlace);
standard_name_from_id(name, sizeof name, 0, id);
@@ -4414,7 +4415,7 @@ make_size_image(png_store* const ps, png_byte const colour_type,
for (pass=0; pass<npasses; ++pass)
{
/* The following two are for checking the macros: */
- const png_uint_32 wPass = PNG_PASS_COLS(w, pass);
+ png_uint_32 wPass = PNG_PASS_COLS(w, pass);
/* If do_interlace is set we don't call png_write_row for every
* row because some of them are empty. In fact, for a 1x1 image,
@@ -4646,7 +4647,7 @@ make_error(png_store* const ps, png_byte const colour_type,
Try
{
png_infop pi;
- const png_structp pp = set_store_for_write(ps, &pi, name);
+ png_structp pp = set_store_for_write(ps, &pi, name);
png_uint_32 w, h;
gnu_volatile(pp)
@@ -4706,7 +4707,7 @@ make_error(png_store* const ps, png_byte const colour_type,
else
{
/* Now write the whole image, just to make sure that the detected, or
- * undetected, errro has not created problems inside libpng. This
+ * undetected, error has not created problems inside libpng. This
* doesn't work if there was a png_error in png_write_info because that
* can abort before PLTE was written.
*/
@@ -5001,7 +5002,7 @@ standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id,
dp->npalette = 0;
/* Preset the transparent color to black: */
memset(&dp->transparent, 0, sizeof dp->transparent);
- /* Preset the palette to full intensity/opaque througout: */
+ /* Preset the palette to full intensity/opaque throughout: */
memset(dp->palette, 0xff, sizeof dp->palette);
}
@@ -5270,7 +5271,7 @@ standard_info_part1(standard_display *dp, png_structp pp, png_infop pi)
*/
standard_palette_validate(dp, pp, pi);
- /* In any case always check for a tranparent color (notice that the
+ /* In any case always check for a transparent color (notice that the
* colour type 3 case must not give a successful return on the get_tRNS call
* with these arguments!)
*/
@@ -5469,14 +5470,14 @@ progressive_row(png_structp ppIn, png_bytep new_row, png_uint_32 y, int pass)
static void
sequential_row(standard_display *dp, png_structp pp, png_infop pi,
- const int iImage, const int iDisplay)
+ int iImage, int iDisplay)
{
- const int npasses = dp->npasses;
- const int do_interlace = dp->do_interlace &&
+ int npasses = dp->npasses;
+ int do_interlace = dp->do_interlace &&
dp->interlace_type == PNG_INTERLACE_ADAM7;
- const png_uint_32 height = standard_height(pp, dp->id);
- const png_uint_32 width = standard_width(pp, dp->id);
- const png_store* ps = dp->ps;
+ png_uint_32 height = standard_height(pp, dp->id);
+ png_uint_32 width = standard_width(pp, dp->id);
+ const png_store* ps = dp->ps;
int pass;
for (pass=0; pass<npasses; ++pass)
@@ -5822,8 +5823,9 @@ test_standard(png_modifier* const pm, png_byte const colour_type,
for (interlace_type = PNG_INTERLACE_NONE;
interlace_type < INTERLACE_LAST; ++interlace_type)
{
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- interlace_type, 0, 0, 0), do_read_interlace, pm->use_update_info);
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, interlace_type, 0, 0, 0), do_read_interlace,
+ pm->use_update_info);
if (fail(pm))
return 0;
@@ -5870,53 +5872,56 @@ test_size(png_modifier* const pm, png_byte const colour_type,
*/
static const png_byte hinc[] = {1, 3, 11, 1, 5};
static const png_byte winc[] = {1, 9, 5, 7, 1};
- const int save_bdlo = bdlo;
+ int save_bdlo = bdlo;
for (; bdlo <= bdhi; ++bdlo)
{
png_uint_32 h, w;
- for (h=1; h<=16; h+=hinc[bdlo]) for (w=1; w<=16; w+=winc[bdlo])
+ for (h=1; h<=16; h+=hinc[bdlo])
{
- /* First test all the 'size' images against the sequential
- * reader using libpng to deinterlace (where required.) This
- * validates the write side of libpng. There are four possibilities
- * to validate.
- */
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_NONE, w, h, 0), 0/*do_interlace*/,
- pm->use_update_info);
+ for (w=1; w<=16; w+=winc[bdlo])
+ {
+ /* First test all the 'size' images against the sequential
+ * reader using libpng to deinterlace (where required.) This
+ * validates the write side of libpng. There are four possibilities
+ * to validate.
+ */
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_NONE, w, h, 0), 0/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
+ if (fail(pm))
+ return 0;
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_NONE, w, h, 1), 0/*do_interlace*/,
- pm->use_update_info);
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_NONE, w, h, 1), 0/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
+ if (fail(pm))
+ return 0;
- /* Now validate the interlaced read side - do_interlace true,
- * in the progressive case this does actually make a difference
- * to the code used in the non-interlaced case too.
- */
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_NONE, w, h, 0), 1/*do_interlace*/,
- pm->use_update_info);
+ /* Now validate the interlaced read side - do_interlace true,
+ * in the progressive case this does actually make a difference
+ * to the code used in the non-interlaced case too.
+ */
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_NONE, w, h, 0), 1/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
+ if (fail(pm))
+ return 0;
-# if CAN_WRITE_INTERLACE
- /* Validate the pngvalid code itself: */
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_ADAM7, w, h, 1), 1/*do_interlace*/,
- pm->use_update_info);
+# if CAN_WRITE_INTERLACE
+ /* Validate the pngvalid code itself: */
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_ADAM7, w, h, 1), 1/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
-# endif
+ if (fail(pm))
+ return 0;
+# endif
+ }
}
}
@@ -5927,45 +5932,48 @@ test_size(png_modifier* const pm, png_byte const colour_type,
{
png_uint_32 h, w;
- for (h=1; h<=16; h+=hinc[bdlo]) for (w=1; w<=16; w+=winc[bdlo])
+ for (h=1; h<=16; h+=hinc[bdlo])
{
-# ifdef PNG_READ_INTERLACING_SUPPORTED
- /* Test with pngvalid generated interlaced images first; we have
- * already verify these are ok (unless pngvalid has self-consistent
- * read/write errors, which is unlikely), so this detects errors in the
- * read side first:
- */
-# if CAN_WRITE_INTERLACE
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_ADAM7, w, h, 1), 0/*do_interlace*/,
- pm->use_update_info);
+ for (w=1; w<=16; w+=winc[bdlo])
+ {
+# ifdef PNG_READ_INTERLACING_SUPPORTED
+ /* Test with pngvalid generated interlaced images first; we have
+ * already verify these are ok (unless pngvalid has self-consistent
+ * read/write errors, which is unlikely), so this detects errors in
+ * the read side first:
+ */
+# if CAN_WRITE_INTERLACE
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_ADAM7, w, h, 1), 0/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
-# endif
-# endif /* READ_INTERLACING */
+ if (fail(pm))
+ return 0;
+# endif
+# endif /* READ_INTERLACING */
-# ifdef PNG_WRITE_INTERLACING_SUPPORTED
- /* Test the libpng write side against the pngvalid read side: */
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_ADAM7, w, h, 0), 1/*do_interlace*/,
- pm->use_update_info);
+# ifdef PNG_WRITE_INTERLACING_SUPPORTED
+ /* Test the libpng write side against the pngvalid read side: */
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_ADAM7, w, h, 0), 1/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
-# endif
+ if (fail(pm))
+ return 0;
+# endif
-# ifdef PNG_READ_INTERLACING_SUPPORTED
-# ifdef PNG_WRITE_INTERLACING_SUPPORTED
- /* Test both together: */
- standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
- PNG_INTERLACE_ADAM7, w, h, 0), 0/*do_interlace*/,
- pm->use_update_info);
+# ifdef PNG_READ_INTERLACING_SUPPORTED
+# ifdef PNG_WRITE_INTERLACING_SUPPORTED
+ /* Test both together: */
+ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo),
+ 0/*palette*/, PNG_INTERLACE_ADAM7, w, h, 0), 0/*do_interlace*/,
+ pm->use_update_info);
- if (fail(pm))
- return 0;
-# endif
-# endif /* READ_INTERLACING */
+ if (fail(pm))
+ return 0;
+# endif
+# endif /* READ_INTERLACING */
+ }
}
}
@@ -6078,12 +6086,12 @@ image_pixel_init(image_pixel *this, png_const_bytep row, png_byte colour_type,
png_byte bit_depth, png_uint_32 x, store_palette palette,
const image_pixel *format /*from pngvalid transform of input*/)
{
- const png_byte sample_depth = (png_byte)(colour_type ==
- PNG_COLOR_TYPE_PALETTE ? 8 : bit_depth);
- const unsigned int max = (1U<<sample_depth)-1;
- const int swap16 = (format != 0 && format->swap16);
- const int littleendian = (format != 0 && format->littleendian);
- const int sig_bits = (format != 0 && format->sig_bits);
+ png_byte sample_depth =
+ (png_byte)(colour_type == PNG_COLOR_TYPE_PALETTE ? 8 : bit_depth);
+ unsigned int max = (1U<<sample_depth)-1;
+ int swap16 = (format != 0 && format->swap16);
+ int littleendian = (format != 0 && format->littleendian);
+ int sig_bits = (format != 0 && format->sig_bits);
/* Initially just set everything to the same number and the alpha to opaque.
* Note that this currently assumes a simple palette where entry x has colour
@@ -6101,7 +6109,7 @@ image_pixel_init(image_pixel *this, png_const_bytep row, png_byte colour_type,
/* This permits the caller to default to the sample value. */
if (palette != 0)
{
- const unsigned int i = this->palette_index;
+ unsigned int i = this->palette_index;
this->red = palette[i].red;
this->green = palette[i].green;
@@ -6432,8 +6440,8 @@ static void
image_transform_mod_end(const image_transform *this, image_pixel *that,
png_const_structp pp, const transform_display *display)
{
- const unsigned int scale = (1U<<that->sample_depth)-1;
- const int sig_bits = that->sig_bits;
+ unsigned int scale = (1U<<that->sample_depth)-1;
+ int sig_bits = that->sig_bits;
UNUSED(this)
UNUSED(pp)
@@ -6711,7 +6719,7 @@ transform_range_check(png_const_structp pp, unsigned int r, unsigned int g,
unsigned int out, png_byte sample_depth, double err, double limit,
const char *name, double digitization_error)
{
- /* Compare the scaled, digitzed, values of our local calculation (in+-err)
+ /* Compare the scaled, digitized, values of our local calculation (in+-err)
* with the digitized values libpng produced; 'sample_depth' is the actual
* digitization depth of the libpng output colors (the bit depth except for
* palette images where it is always 8.) The check on 'err' is to detect
@@ -6756,19 +6764,19 @@ transform_image_validate(transform_display *dp, png_const_structp pp,
{
/* Constants for the loop below: */
const png_store* const ps = dp->this.ps;
- const png_byte in_ct = dp->this.colour_type;
- const png_byte in_bd = dp->this.bit_depth;
- const png_uint_32 w = dp->this.w;
- const png_uint_32 h = dp->this.h;
- const png_byte out_ct = dp->output_colour_type;
- const png_byte out_bd = dp->output_bit_depth;
- const png_byte sample_depth = (png_byte)(out_ct ==
- PNG_COLOR_TYPE_PALETTE ? 8 : out_bd);
- const png_byte red_sBIT = dp->this.red_sBIT;
- const png_byte green_sBIT = dp->this.green_sBIT;
- const png_byte blue_sBIT = dp->this.blue_sBIT;
- const png_byte alpha_sBIT = dp->this.alpha_sBIT;
- const int have_tRNS = dp->this.is_transparent;
+ png_byte in_ct = dp->this.colour_type;
+ png_byte in_bd = dp->this.bit_depth;
+ png_uint_32 w = dp->this.w;
+ png_uint_32 h = dp->this.h;
+ png_byte out_ct = dp->output_colour_type;
+ png_byte out_bd = dp->output_bit_depth;
+ png_byte sample_depth =
+ (png_byte)(out_ct == PNG_COLOR_TYPE_PALETTE ? 8 : out_bd);
+ png_byte red_sBIT = dp->this.red_sBIT;
+ png_byte green_sBIT = dp->this.green_sBIT;
+ png_byte blue_sBIT = dp->this.blue_sBIT;
+ png_byte alpha_sBIT = dp->this.alpha_sBIT;
+ int have_tRNS = dp->this.is_transparent;
double digitization_error;
store_palette out_palette;
@@ -6780,7 +6788,7 @@ transform_image_validate(transform_display *dp, png_const_structp pp,
store_image_check(dp->this.ps, pp, 0);
/* Read the palette corresponding to the output if the output colour type
- * indicates a palette, othewise set out_palette to garbage.
+ * indicates a palette, otherwise set out_palette to garbage.
*/
if (out_ct == PNG_COLOR_TYPE_PALETTE)
{
@@ -6929,7 +6937,7 @@ transform_end(png_structp ppIn, png_infop pi)
/* A single test run. */
static void
-transform_test(png_modifier *pmIn, const png_uint_32 idIn,
+transform_test(png_modifier *pmIn, png_uint_32 idIn,
const image_transform* transform_listIn, const char * const name)
{
transform_display d;
@@ -7635,7 +7643,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this,
else
{
- /* The default (built in) coeffcients, as above: */
+ /* The default (built in) coefficients, as above: */
# if PNG_LIBPNG_VER < 10700
data.red_coefficient = 6968 / 32768.;
data.green_coefficient = 23434 / 32768.;
@@ -7764,7 +7772,7 @@ static void
image_transform_png_set_rgb_to_gray_set(const image_transform *this,
transform_display *that, png_structp pp, png_infop pi)
{
- const int error_action = 1; /* no error, no defines in png.h */
+ int error_action = 1; /* no error, no defines in png.h */
# ifdef PNG_FLOATING_POINT_SUPPORTED
png_set_rgb_to_gray(pp, error_action, data.red_to_set, data.green_to_set);
@@ -7905,10 +7913,10 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
# if DIGITIZE
{
png_modifier *pm = display->pm;
- const unsigned int sample_depth = that->sample_depth;
- const unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 :
+ unsigned int sample_depth = that->sample_depth;
+ unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 :
sample_depth);
- const unsigned int gamma_depth =
+ unsigned int gamma_depth =
(sample_depth == 16 ?
display->max_gamma_8 :
(pm->assume_16_bit_calculations ?
@@ -7991,7 +7999,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
/* Now calculate the actual gray values. Although the error in the
* coefficients depends on whether they were specified on the command
* line (in which case truncation to 15 bits happened) or not (rounding
- * was used) the maxium error in an individual coefficient is always
+ * was used) the maximum error in an individual coefficient is always
* 2/32768, because even in the rounding case the requirement that
* coefficients add up to 32768 can cause a larger rounding error.
*
@@ -8002,7 +8010,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
b * data.blue_coefficient;
{
- const int do_round = data.gamma != 1 || calc_depth == 16;
+ int do_round = data.gamma != 1 || calc_depth == 16;
const double ce = 2. / 32768;
graylo = DD(rlo * (data.red_coefficient-ce) +
@@ -8207,7 +8215,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
that->bluef = that->greenf = that->redf = gray;
that->bluee = that->greene = that->rede = err;
- /* The sBIT is the minium of the three colour channel sBITs. */
+ /* The sBIT is the minimum of the three colour channel sBITs. */
if (that->red_sBIT > that->green_sBIT)
that->red_sBIT = that->green_sBIT;
if (that->red_sBIT > that->blue_sBIT)
@@ -8626,7 +8634,7 @@ image_transform_png_set_filler_mod(const image_transform *this,
(that->colour_type == PNG_COLOR_TYPE_RGB ||
that->colour_type == PNG_COLOR_TYPE_GRAY))
{
- const unsigned int max = (1U << that->bit_depth)-1;
+ unsigned int max = (1U << that->bit_depth)-1;
that->alpha = data.filler & max;
that->alphaf = ((double)that->alpha) / max;
that->alphae = 0;
@@ -8693,7 +8701,7 @@ image_transform_png_set_add_alpha_mod(const image_transform *this,
(that->colour_type == PNG_COLOR_TYPE_RGB ||
that->colour_type == PNG_COLOR_TYPE_GRAY))
{
- const unsigned int max = (1U << that->bit_depth)-1;
+ unsigned int max = (1U << that->bit_depth)-1;
that->alpha = data.filler & max;
that->alphaf = ((double)that->alpha) / max;
that->alphae = 0;
@@ -8884,7 +8892,7 @@ image_transform_png_set_shift_set(const image_transform *this,
* field is randomized independently. This acts as a check that
* libpng does use the correct field.
*/
- const unsigned int depth = that->this.bit_depth;
+ unsigned int depth = that->this.bit_depth;
data.red = (png_byte)/*SAFE*/(random_mod(depth)+1);
data.green = (png_byte)/*SAFE*/(random_mod(depth)+1);
@@ -9057,7 +9065,7 @@ image_transform_reset_count(void)
static int
image_transform_test_counter(png_uint_32 counter, unsigned int max)
{
- /* Test the list to see if there is any point contining, given a current
+ /* Test the list to see if there is any point continuing, given a current
* counter and a 'max' value.
*/
image_transform *next = image_transform_first;
@@ -9299,12 +9307,12 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi)
int mode = dp->do_background - ALPHA_MODE_OFFSET;
/* The gamma value is the output gamma, and is in the standard,
- * non-inverted, represenation. It provides a default for the PNG file
+ * non-inverted, representation. It provides a default for the PNG file
* gamma, but since the file has a gAMA chunk this does not matter.
*/
const double sg = dp->screen_gamma;
# ifndef PNG_FLOATING_POINT_SUPPORTED
- const png_fixed_point g = fix(sg);
+ png_fixed_point g = fix(sg);
# endif
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -9352,7 +9360,7 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi)
*/
const double bg = dp->background_gamma;
# ifndef PNG_FLOATING_POINT_SUPPORTED
- const png_fixed_point g = fix(bg);
+ png_fixed_point g = fix(bg);
# endif
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -9426,7 +9434,7 @@ static void
init_validate_info(validate_info *vi, gamma_display *dp, png_const_structp pp,
int in_depth, int out_depth)
{
- const unsigned int outmax = (1U<<out_depth)-1;
+ unsigned int outmax = (1U<<out_depth)-1;
vi->pp = pp;
vi->dp = dp;
@@ -9588,14 +9596,14 @@ gamma_component_compose(int do_background, double input_sample, double alpha,
/* This API returns the encoded *input* component, in the range 0..1 */
static double
gamma_component_validate(const char *name, const validate_info *vi,
- const unsigned int id, const unsigned int od,
+ unsigned int id, unsigned int od,
const double alpha /* <0 for the alpha channel itself */,
const double background /* component background value */)
{
- const unsigned int isbit = id >> vi->isbit_shift;
- const unsigned int sbit_max = vi->sbit_max;
- const unsigned int outmax = vi->outmax;
- const int do_background = vi->do_background;
+ unsigned int isbit = id >> vi->isbit_shift;
+ unsigned int sbit_max = vi->sbit_max;
+ unsigned int outmax = vi->outmax;
+ int do_background = vi->do_background;
double i;
@@ -9746,7 +9754,7 @@ gamma_component_validate(const char *name, const validate_info *vi,
*
* pngvalid calculations:
* input_sample: linear result; i linearized and composed, range 0..1
- * encoded_sample: encoded result; input_sample scaled to ouput bit depth
+ * encoded_sample: encoded result; input_sample scaled to output bit depth
*
* libpng calculations:
* output: linear result; od scaled to 0..1 and linearized
@@ -10161,13 +10169,13 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
{
/* Get some constants derived from the input and output file formats: */
const png_store* const ps = dp->this.ps;
- const png_byte in_ct = dp->this.colour_type;
- const png_byte in_bd = dp->this.bit_depth;
- const png_uint_32 w = dp->this.w;
- const png_uint_32 h = dp->this.h;
+ png_byte in_ct = dp->this.colour_type;
+ png_byte in_bd = dp->this.bit_depth;
+ png_uint_32 w = dp->this.w;
+ png_uint_32 h = dp->this.h;
const size_t cbRow = dp->this.cbRow;
- const png_byte out_ct = png_get_color_type(pp, pi);
- const png_byte out_bd = png_get_bit_depth(pp, pi);
+ png_byte out_ct = png_get_color_type(pp, pi);
+ png_byte out_bd = png_get_bit_depth(pp, pi);
/* There are three sources of error, firstly the quantization in the
* file encoding, determined by sbit and/or the file depth, secondly
@@ -10183,10 +10191,10 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
* Since the library must quantize the output to 8 or 16 bits there is
* a fundamental limit on the accuracy of the output of +/-.5 - this
* quantization limit is included in addition to the other limits
- * specified by the paramaters to the API. (Effectively, add .5
+ * specified by the parameters to the API. (Effectively, add .5
* everywhere.)
*
- * The behavior of the 'sbit' paramter is defined by section 12.5
+ * The behavior of the 'sbit' parameter is defined by section 12.5
* (sample depth scaling) of the PNG spec. That section forces the
* decoder to assume that the PNG values have been scaled if sBIT is
* present:
@@ -10208,11 +10216,11 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
* The basic tests below do not do this, however if 'use_input_precision'
* is set a subsequent test is performed above.
*/
- const unsigned int samples_per_pixel = (out_ct & 2U) ? 3U : 1U;
+ unsigned int samples_per_pixel = (out_ct & 2U) ? 3U : 1U;
int processing;
png_uint_32 y;
const store_palette_entry *in_palette = dp->this.palette;
- const int in_is_transparent = dp->this.is_transparent;
+ int in_is_transparent = dp->this.is_transparent;
int process_tRNS;
int out_npalette = -1;
int out_is_transparent = 0; /* Just refers to the palette case */
@@ -10260,9 +10268,9 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
double alpha = 1; /* serves as a flag value */
/* Record the palette index for index images. */
- const unsigned int in_index =
+ unsigned int in_index =
in_ct == 3 ? sample(std, 3, in_bd, x, 0, 0, 0) : 256;
- const unsigned int out_index =
+ unsigned int out_index =
out_ct == 3 ? sample(std, 3, out_bd, x, 0, 0, 0) : 256;
/* Handle input alpha - png_set_background will cause the output
@@ -10271,7 +10279,7 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
if ((in_ct & PNG_COLOR_MASK_ALPHA) != 0 ||
(in_ct == 3 && in_is_transparent))
{
- const unsigned int input_alpha = in_ct == 3 ?
+ unsigned int input_alpha = in_ct == 3 ?
dp->this.palette[in_index].alpha :
sample(std, in_ct, in_bd, x, samples_per_pixel, 0, 0);
@@ -10396,14 +10404,14 @@ gamma_end(png_structp ppIn, png_infop pi)
* maxpc: maximum percentage error (as a percentage)
*/
static void
-gamma_test(png_modifier *pmIn, const png_byte colour_typeIn,
- const png_byte bit_depthIn, const int palette_numberIn,
- const int interlace_typeIn,
+gamma_test(png_modifier *pmIn, png_byte colour_typeIn,
+ png_byte bit_depthIn, int palette_numberIn,
+ int interlace_typeIn,
const double file_gammaIn, const double screen_gammaIn,
- const png_byte sbitIn, const int threshold_testIn,
+ png_byte sbitIn, int threshold_testIn,
const char *name,
- const int use_input_precisionIn, const int scale16In,
- const int expand16In, const int do_backgroundIn,
+ int use_input_precisionIn, int scale16In,
+ int expand16In, int do_backgroundIn,
const png_color_16 *bkgd_colorIn, double bkgd_gammaIn)
{
gamma_display d;
@@ -10607,11 +10615,11 @@ perform_gamma_threshold_tests(png_modifier *pm)
}
static void gamma_transform_test(png_modifier *pm,
- const png_byte colour_type, const png_byte bit_depth,
- const int palette_number,
- const int interlace_type, const double file_gamma,
- const double screen_gamma, const png_byte sbit,
- const int use_input_precision, const int scale16)
+ png_byte colour_type, png_byte bit_depth,
+ int palette_number,
+ int interlace_type, const double file_gamma,
+ const double screen_gamma, png_byte sbit,
+ int use_input_precision, int scale16)
{
size_t pos = 0;
char name[64];
@@ -10649,16 +10657,21 @@ static void perform_gamma_transform_tests(png_modifier *pm)
{
unsigned int i, j;
- for (i=0; i<pm->ngamma_tests; ++i) for (j=0; j<pm->ngamma_tests; ++j)
- if (i != j)
+ for (i=0; i<pm->ngamma_tests; ++i)
+ {
+ for (j=0; j<pm->ngamma_tests; ++j)
{
- gamma_transform_test(pm, colour_type, bit_depth, palette_number,
- pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], 0/*sBIT*/,
- pm->use_input_precision, 0 /*do not scale16*/);
+ if (i != j)
+ {
+ gamma_transform_test(pm, colour_type, bit_depth, palette_number,
+ pm->interlace_type, 1/pm->gammas[i], pm->gammas[j],
+ 0/*sBIT*/, pm->use_input_precision, 0/*do not scale16*/);
- if (fail(pm))
- return;
+ if (fail(pm))
+ return;
+ }
}
+ }
}
}
@@ -10687,14 +10700,17 @@ static void perform_gamma_sbit_tests(png_modifier *pm)
{
unsigned int j;
- for (j=0; j<pm->ngamma_tests; ++j) if (i != j)
+ for (j=0; j<pm->ngamma_tests; ++j)
{
- gamma_transform_test(pm, colour_type, bit_depth, npalette,
- pm->interlace_type, 1/pm->gammas[i], pm->gammas[j],
- sbit, pm->use_input_precision_sbit, 0 /*scale16*/);
+ if (i != j)
+ {
+ gamma_transform_test(pm, colour_type, bit_depth, npalette,
+ pm->interlace_type, 1/pm->gammas[i], pm->gammas[j],
+ sbit, pm->use_input_precision_sbit, 0 /*scale16*/);
- if (fail(pm))
- return;
+ if (fail(pm))
+ return;
+ }
}
}
}
@@ -10768,12 +10784,12 @@ static void perform_gamma_scale16_tests(png_modifier *pm)
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
static void gamma_composition_test(png_modifier *pm,
- const png_byte colour_type, const png_byte bit_depth,
- const int palette_number,
- const int interlace_type, const double file_gamma,
+ png_byte colour_type, png_byte bit_depth,
+ int palette_number,
+ int interlace_type, const double file_gamma,
const double screen_gamma,
- const int use_input_precision, const int do_background,
- const int expand_16)
+ int use_input_precision, int do_background,
+ int expand_16)
{
size_t pos = 0;
png_const_charp base;
@@ -10946,14 +10962,17 @@ perform_gamma_composition_tests(png_modifier *pm, int do_background,
unsigned int i, j;
/* Don't skip the i==j case here - it's relevant. */
- for (i=0; i<pm->ngamma_tests; ++i) for (j=0; j<pm->ngamma_tests; ++j)
+ for (i=0; i<pm->ngamma_tests; ++i)
{
- gamma_composition_test(pm, colour_type, bit_depth, palette_number,
- pm->interlace_type, 1/pm->gammas[i], pm->gammas[j],
- pm->use_input_precision, do_background, expand_16);
+ for (j=0; j<pm->ngamma_tests; ++j)
+ {
+ gamma_composition_test(pm, colour_type, bit_depth, palette_number,
+ pm->interlace_type, 1/pm->gammas[i], pm->gammas[j],
+ pm->use_input_precision, do_background, expand_16);
- if (fail(pm))
- return;
+ if (fail(pm))
+ return;
+ }
}
}
}
@@ -11056,7 +11075,7 @@ perform_gamma_test(png_modifier *pm, int summary)
pm->calculations_use_input_precision = 0;
if (summary)
- summarize_gamma_errors(pm, 0/*who*/, 1/*low bit depth*/, 1/*indexed*/);
+ summarize_gamma_errors(pm, NULL/*who*/, 1/*low bit depth*/, 1/*indexed*/);
if (fail(pm))
return;
@@ -11182,8 +11201,10 @@ png_pass_start_row(int pass)
{
int x, y;
++pass;
- for (y=0; y<8; ++y) for (x=0; x<8; ++x) if (adam7[y][x] == pass)
- return y;
+ for (y=0; y<8; ++y)
+ for (x=0; x<8; ++x)
+ if (adam7[y][x] == pass)
+ return y;
return 0xf;
}
@@ -11192,8 +11213,10 @@ png_pass_start_col(int pass)
{
int x, y;
++pass;
- for (x=0; x<8; ++x) for (y=0; y<8; ++y) if (adam7[y][x] == pass)
- return x;
+ for (x=0; x<8; ++x)
+ for (y=0; y<8; ++y)
+ if (adam7[y][x] == pass)
+ return x;
return 0xf;
}
@@ -11202,18 +11225,24 @@ png_pass_row_shift(int pass)
{
int x, y, base=(-1), inc=8;
++pass;
- for (y=0; y<8; ++y) for (x=0; x<8; ++x) if (adam7[y][x] == pass)
+ for (y=0; y<8; ++y)
{
- if (base == (-1))
- base = y;
- else if (base == y)
- {}
- else if (inc == y-base)
- base=y;
- else if (inc == 8)
- inc = y-base, base=y;
- else if (inc != y-base)
- return 0xff; /* error - more than one 'inc' value! */
+ for (x=0; x<8; ++x)
+ {
+ if (adam7[y][x] == pass)
+ {
+ if (base == (-1))
+ base = y;
+ else if (base == y)
+ {}
+ else if (inc == y-base)
+ base=y;
+ else if (inc == 8)
+ inc = y-base, base=y;
+ else if (inc != y-base)
+ return 0xff; /* error - more than one 'inc' value! */
+ }
+ }
}
if (base == (-1)) return 0xfe; /* error - no row in pass! */
@@ -11236,18 +11265,24 @@ png_pass_col_shift(int pass)
{
int x, y, base=(-1), inc=8;
++pass;
- for (x=0; x<8; ++x) for (y=0; y<8; ++y) if (adam7[y][x] == pass)
+ for (x=0; x<8; ++x)
{
- if (base == (-1))
- base = x;
- else if (base == x)
- {}
- else if (inc == x-base)
- base=x;
- else if (inc == 8)
- inc = x-base, base=x;
- else if (inc != x-base)
- return 0xff; /* error - more than one 'inc' value! */
+ for (y=0; y<8; ++y)
+ {
+ if (adam7[y][x] == pass)
+ {
+ if (base == (-1))
+ base = x;
+ else if (base == x)
+ {}
+ else if (inc == x-base)
+ base=x;
+ else if (inc == 8)
+ inc = x-base, base=x;
+ else if (inc != x-base)
+ return 0xff; /* error - more than one 'inc' value! */
+ }
+ }
}
if (base == (-1)) return 0xfe; /* error - no row in pass! */
@@ -11311,8 +11346,9 @@ png_row_in_interlace_pass(png_uint_32 y, int pass)
int x;
y &= 7;
++pass;
- for (x=0; x<8; ++x) if (adam7[y][x] == pass)
- return 1;
+ for (x=0; x<8; ++x)
+ if (adam7[y][x] == pass)
+ return 1;
return 0;
}
@@ -11324,8 +11360,9 @@ png_col_in_interlace_pass(png_uint_32 x, int pass)
int y;
x &= 7;
++pass;
- for (y=0; y<8; ++y) if (adam7[y][x] == pass)
- return 1;
+ for (y=0; y<8; ++y)
+ if (adam7[y][x] == pass)
+ return 1;
return 0;
}
@@ -11339,11 +11376,17 @@ png_pass_rows(png_uint_32 height, int pass)
height &= 7;
++pass;
- for (y=0; y<8; ++y) for (x=0; x<8; ++x) if (adam7[y][x] == pass)
+ for (y=0; y<8; ++y)
{
- rows += tiles;
- if (y < height) ++rows;
- break; /* i.e. break the 'x', column, loop. */
+ for (x=0; x<8; ++x)
+ {
+ if (adam7[y][x] == pass)
+ {
+ rows += tiles;
+ if (y < height) ++rows;
+ break; /* i.e. break the 'x', column, loop. */
+ }
+ }
}
return rows;
@@ -11358,11 +11401,17 @@ png_pass_cols(png_uint_32 width, int pass)
width &= 7;
++pass;
- for (x=0; x<8; ++x) for (y=0; y<8; ++y) if (adam7[y][x] == pass)
+ for (x=0; x<8; ++x)
{
- cols += tiles;
- if (x < width) ++cols;
- break; /* i.e. break the 'y', row, loop. */
+ for (y=0; y<8; ++y)
+ {
+ if (adam7[y][x] == pass)
+ {
+ cols += tiles;
+ if (x < width) ++cols;
+ break; /* i.e. break the 'y', row, loop. */
+ }
+ }
}
return cols;
@@ -11719,7 +11768,7 @@ int main(int argc, char **argv)
/* The following allows results to pass if they correspond to anything in the
* transformed range [input-.5,input+.5]; this is is required because of the
- * way libpng treates the 16_TO_8 flag when building the gamma tables in
+ * way libpng treats the 16_TO_8 flag when building the gamma tables in
* releases up to 1.6.0.
*
* TODO: review this
@@ -11729,7 +11778,7 @@ int main(int argc, char **argv)
/* Some default values (set the behavior for 'make check' here).
* These values simply control the maximum error permitted in the gamma
- * transformations. The practial limits for human perception are described
+ * transformations. The practical limits for human perception are described
* below (the setting for maxpc16), however for 8 bit encodings it isn't
* possible to meet the accepted capabilities of human vision - i.e. 8 bit
* images can never be good enough, regardless of encoding.
@@ -11810,21 +11859,21 @@ int main(int argc, char **argv)
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
else if (strncmp(*argv, "--transform-disable=",
sizeof "--transform-disable") == 0)
- {
+ {
pm.test_transform = 1;
transform_disable(*argv + sizeof "--transform-disable");
- }
+ }
else if (strncmp(*argv, "--transform-enable=",
sizeof "--transform-enable") == 0)
- {
+ {
pm.test_transform = 1;
transform_enable(*argv + sizeof "--transform-enable");
- }
+ }
#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
else if (strcmp(*argv, "--gamma") == 0)
- {
+ {
/* Just do two gamma tests here (2.2 and linear) for speed: */
pm.ngamma_tests = 2U;
pm.test_gamma_threshold = 1;
@@ -11833,7 +11882,7 @@ int main(int argc, char **argv)
pm.test_gamma_scale16 = 1;
pm.test_gamma_background = 1; /* composition */
pm.test_gamma_alpha_mode = 1;
- }
+ }
else if (strcmp(*argv, "--nogamma") == 0)
pm.ngamma_tests = 0;
diff --git a/contrib/libtests/readpng.c b/contrib/libtests/readpng.c
index 3336d4e21..7528e90bd 100644
--- a/contrib/libtests/readpng.c
+++ b/contrib/libtests/readpng.c
@@ -1,9 +1,8 @@
+
/* readpng.c
*
* Copyright (c) 2013 John Cunningham Bowler
*
- * Last changed in libpng 1.6.1 [March 28, 2013]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -60,7 +59,7 @@ read_png(FILE *fp)
png_read_info(png_ptr, info_ptr);
{
- png_size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+ size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
/* Failure to initialize these is harmless */
row = malloc(rowbytes);
diff --git a/contrib/libtests/tarith.c b/contrib/libtests/tarith.c
index cb17ffa76..e35b7ab26 100644
--- a/contrib/libtests/tarith.c
+++ b/contrib/libtests/tarith.c
@@ -1,10 +1,9 @@
/* tarith.c
*
+ * Copyright (c) 2021 Cosmin Truta
* Copyright (c) 2011-2013 John Cunningham Bowler
*
- * Last changed in libpng 1.6.0 [February 14, 2013]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -88,6 +87,7 @@ int validation_ascii_to_fp(int count, int argc, char **argv)
int minorarith = 0;
while (--argc > 0)
+ {
if (strcmp(*++argv, "-a") == 0)
showall = 1;
else if (strcmp(*argv, "-e") == 0 && argc > 0)
@@ -105,10 +105,11 @@ int validation_ascii_to_fp(int count, int argc, char **argv)
fprintf(stderr, "unknown argument %s\n", *argv);
return 1;
}
+ }
do
{
- png_size_t index;
+ size_t index;
int state, failed = 0;
char buffer[64];
@@ -130,8 +131,8 @@ int validation_ascii_to_fp(int count, int argc, char **argv)
*/
if (buffer[precision+7] != 71)
{
- fprintf(stderr, "%g[%d] -> '%s'[%lu] buffer overflow\n", test,
- precision, buffer, (unsigned long)strlen(buffer));
+ fprintf(stderr, "%g[%d] -> '%s'[%lu] buffer overflow\n",
+ test, precision, buffer, (unsigned long)strlen(buffer));
failed = 1;
}
@@ -146,16 +147,16 @@ int validation_ascii_to_fp(int count, int argc, char **argv)
if (test >= 0 && strcmp(buffer, "inf") ||
test < 0 && strcmp(buffer, "-inf"))
{
- fprintf(stderr, "%g[%d] -> '%s' but expected 'inf'\n", test,
- precision, buffer);
+ fprintf(stderr, "%g[%d] -> '%s' but expected 'inf'\n",
+ test, precision, buffer);
failed = 1;
}
}
else if (!png_check_fp_number(buffer, precision+10, &state, &index) ||
buffer[index] != 0)
{
- fprintf(stderr, "%g[%d] -> '%s' but has bad format ('%c')\n", test,
- precision, buffer, buffer[index]);
+ fprintf(stderr, "%g[%d] -> '%s' but has bad format ('%c')\n",
+ test, precision, buffer, buffer[index]);
failed = 1;
}
else if (PNG_FP_IS_NEGATIVE(state) && !(test < 0))
@@ -176,7 +177,7 @@ int validation_ascii_to_fp(int count, int argc, char **argv)
}
else if (PNG_FP_IS_POSITIVE(state) && !(test > 0))
{
- fprintf(stderr, "%g[%d] -> '%s' but postive value not so reported\n",
+ fprintf(stderr, "%g[%d] -> '%s' but positive value not so reported\n",
test, precision, buffer);
failed = 1;
assert(!PNG_FP_IS_NEGATIVE(state));
@@ -187,7 +188,7 @@ int validation_ascii_to_fp(int count, int argc, char **argv)
/* Check the result against the original. */
double out = atof(buffer);
double change = fabs((out - test)/test);
- double allow = .5/pow(10,
+ double allow = .5 / pow(10,
(precision >= DBL_DIG) ? DBL_DIG-1 : precision-1);
/* NOTE: if you hit this error case are you compiling with gcc
@@ -257,8 +258,9 @@ skip:
}
while (--count);
- printf("Tested %d finite values, %d non-finite, %d OK (%d failed) %d minor "
- "arithmetic errors\n", finite, nonfinite, ok, failcount, minorarith);
+ printf("Tested %d finite values, %d non-finite, %d OK (%d failed) "
+ "%d minor arithmetic errors\n",
+ finite, nonfinite, ok, failcount, minorarith);
printf(" Error with >=%d digit precision %.2f%%\n", DBL_DIG, max_abs);
printf(" Error with < %d digit precision %.2f%%\n", DBL_DIG, max);
@@ -329,10 +331,10 @@ static int check_one_character(checkfp_command *co, checkfp_control c, int ch)
{
/* Test this character (ch) to ensure the parser does the correct thing.
*/
- png_size_t index = 0;
+ size_t index = 0;
const char test = (char)ch;
- const int number_is_valid = png_check_fp_number(&test, 1, &c.state, &index);
- const int character_accepted = (index == 1);
+ int number_is_valid = png_check_fp_number(&test, 1, &c.state, &index);
+ int character_accepted = (index == 1);
if (c.check_state != exponent && isdigit(ch) && ch != '0')
c.is_zero = 0;
@@ -371,8 +373,8 @@ static int check_one_character(checkfp_command *co, checkfp_control c, int ch)
/* This should never fail (it's a serious bug if it does): */
if (index != 0 && index != 1)
{
- fprintf(stderr, "%s: read beyond end of string (%lu)\n", co->number,
- (unsigned long)index);
+ fprintf(stderr, "%s: read beyond end of string (%lu)\n",
+ co->number, (unsigned long)index);
return 0;
}
@@ -503,8 +505,8 @@ static int check_one_character(checkfp_command *co, checkfp_control c, int ch)
if (number_is_valid != c.number_was_valid)
{
fprintf(stderr,
- "%s: character '%c' [0x%.2x] changed number validity\n", co->number,
- ch, ch);
+ "%s: character '%c' [0x%.2x] changed number validity\n",
+ co->number, ch, ch);
return 0;
}
@@ -521,10 +523,13 @@ static int check_all_characters(checkfp_command *co, checkfp_control c)
{
int ch;
- if (c.cnumber+4 < sizeof co->number) for (ch=0; ch<256; ++ch)
+ if (c.cnumber+4 < sizeof co->number)
{
- if (!check_one_character(co, c, ch))
- return 0;
+ for (ch=0; ch<256; ++ch)
+ {
+ if (!check_one_character(co, c, ch))
+ return 0;
+ }
}
return 1;
@@ -539,10 +544,13 @@ static int check_some_characters(checkfp_command *co, checkfp_control c,
if (c.cnumber+4 < sizeof co->number && c.limit >= 0)
{
- if (c.limit > 0) for (i=0; tests[i]; ++i)
+ if (c.limit > 0)
{
- if (!check_one_character(co, c, tests[i]))
- return 0;
+ for (i=0; tests[i]; ++i)
+ {
+ if (!check_one_character(co, c, tests[i]))
+ return 0;
+ }
}
/* At the end check all the characters. */
@@ -616,10 +624,10 @@ int validation_muldiv(int count, int argc, char **argv)
png_int_32 times, div;
while (--argc > 0)
- {
- fprintf(stderr, "unknown argument %s\n", *++argv);
- return 1;
- }
+ {
+ fprintf(stderr, "unknown argument %s\n", *++argv);
+ return 1;
+ }
/* Find out about the random number generator. */
randbuffer = RAND_MAX;
@@ -687,25 +695,25 @@ int validation_muldiv(int count, int argc, char **argv)
ok = 0, ++overflow, fpround = fp/*misleading*/;
if (verbose)
- fprintf(stderr, "TEST %d * %d / %d -> %lld (%s)\n", a, times, div,
- fp, ok ? "ok" : "overflow");
+ fprintf(stderr, "TEST %d * %d / %d -> %lld (%s)\n",
+ a, times, div, fp, ok ? "ok" : "overflow");
++tested;
if (png_muldiv(&result, a, times, div) != ok)
{
++error;
if (ok)
- fprintf(stderr, "%d * %d / %d -> overflow (expected %lld)\n", a,
- times, div, fp);
+ fprintf(stderr, "%d * %d / %d -> overflow (expected %lld)\n",
+ a, times, div, fp);
else
- fprintf(stderr, "%d * %d / %d -> %d (expected overflow %lld)\n", a,
- times, div, result, fp);
+ fprintf(stderr, "%d * %d / %d -> %d (expected overflow %lld)\n",
+ a, times, div, result, fp);
}
else if (ok && result != fpround)
{
++error;
- fprintf(stderr, "%d * %d / %d -> %d not %lld\n", a, times, div, result,
- fp);
+ fprintf(stderr, "%d * %d / %d -> %d not %lld\n",
+ a, times, div, result, fp);
}
else
++passed;
@@ -721,8 +729,8 @@ int validation_muldiv(int count, int argc, char **argv)
}
while (--count > 0);
- printf("%d tests including %d overflows, %d passed, %d failed (%d 64-bit "
- "errors)\n", tested, overflow, passed, error, error64);
+ printf("%d tests including %d overflows, %d passed, %d failed "
+ "(%d 64-bit errors)\n", tested, overflow, passed, error, error64);
return 0;
}
@@ -821,8 +829,9 @@ int validation_gamma(int argc, char **argv)
{
if (error > .68) /* By experiment error is less than .68 */
{
- fprintf(stderr, "16-bit log error: %d: got %u, expected %f"
- " error: %f\n", i, png_log16bit(i), correct, error);
+ fprintf(stderr,
+ "16-bit log error: %d: got %u, expected %f error: %f\n",
+ i, png_log16bit(i), correct, error);
}
}
}
@@ -841,8 +850,9 @@ int validation_gamma(int argc, char **argv)
maxerr = fabs(error);
if (fabs(error) > 1883) /* By experiment. */
{
- fprintf(stderr, "32-bit exp error: %d: got %u, expected %f"
- " error: %f\n", i, png_exp(i), correct, error);
+ fprintf(stderr,
+ "32-bit exp error: %d: got %u, expected %f error: %f\n",
+ i, png_exp(i), correct, error);
}
}
@@ -859,8 +869,9 @@ int validation_gamma(int argc, char **argv)
maxerr = fabs(error);
if (fabs(error) > .50002) /* By experiment */
{
- fprintf(stderr, "8-bit exp error: %d: got %u, expected %f"
- " error: %f\n", i, png_exp8bit(i), correct, error);
+ fprintf(stderr,
+ "8-bit exp error: %d: got %u, expected %f error: %f\n",
+ i, png_exp8bit(i), correct, error);
}
}
@@ -877,8 +888,9 @@ int validation_gamma(int argc, char **argv)
maxerr = fabs(error);
if (fabs(error) > .524) /* By experiment */
{
- fprintf(stderr, "16-bit exp error: %d: got %u, expected %f"
- " error: %f\n", i, png_exp16bit(i), correct, error);
+ fprintf(stderr,
+ "16-bit exp error: %d: got %u, expected %f error: %f\n",
+ i, png_exp16bit(i), correct, error);
}
}
@@ -940,7 +952,7 @@ int validation_gamma(int argc, char **argv)
/**************************** VALIDATION TESTS ********************************/
/* Various validation routines are included herein, they require some
- * definition for png_warning and png_error, seetings of VALIDATION:
+ * definition for png_warning and png_error, settings of VALIDATION:
*
* 1: validates the ASCII to floating point conversions
* 2: validates png_muldiv
diff --git a/contrib/libtests/timepng.c b/contrib/libtests/timepng.c
index 3bcfde5a3..0093a4548 100644
--- a/contrib/libtests/timepng.c
+++ b/contrib/libtests/timepng.c
@@ -1,9 +1,8 @@
+
/* timepng.c
*
* Copyright (c) 2013,2016 John Cunningham Bowler
*
- * Last changed in libpng 1.6.22 [May 26, 2016]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -65,7 +64,7 @@ typedef struct
} io_data;
static PNG_CALLBACK(void, read_and_copy,
- (png_structp png_ptr, png_bytep buffer, png_size_t cb))
+ (png_structp png_ptr, png_bytep buffer, size_t cb))
{
io_data *io = (io_data*)png_get_io_ptr(png_ptr);
@@ -100,7 +99,7 @@ static void read_by_row(png_structp png_ptr, png_infop info_ptr,
png_read_info(png_ptr, info_ptr);
{
- png_size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+ size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);
row = voidcast(png_bytep,malloc(rowbytes));
display = voidcast(png_bytep,malloc(rowbytes));
@@ -528,7 +527,7 @@ int main(int argc, char **argv)
}
}
- else if (nfiles == 0) /* Read from stdin withoout --dissemble */
+ else if (nfiles == 0) /* Read from stdin without --dissemble */
{
char filename[FILENAME_MAX+1];
diff --git a/contrib/mips-msa/linux.c b/contrib/mips-msa/linux.c
index 140215c4e..3bac6111b 100644
--- a/contrib/mips-msa/linux.c
+++ b/contrib/mips-msa/linux.c
@@ -1,8 +1,9 @@
+
/* contrib/mips-msa/linux.c
*
+ * Copyright (c) 2020 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
* Written by Mandar Sahastrabuddhe, 2016.
- * Last changed in libpng 1.6.25beta03 [August 29, 2016]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -47,8 +48,10 @@ png_have_msa(png_structp png_ptr)
int val = strcmp(string, word);
- if (val == 0)
+ if (val == 0) {
+ fclose(f);
return 1;
+ }
i = 0;
memset(word, 0, 10);
diff --git a/contrib/oss-fuzz/Dockerfile b/contrib/oss-fuzz/Dockerfile
index 7e4d1ebff..f5bc1a985 100644
--- a/contrib/oss-fuzz/Dockerfile
+++ b/contrib/oss-fuzz/Dockerfile
@@ -16,9 +16,10 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER glennrp@gmail.com
-RUN apt-get update && apt-get install -y make autoconf automake libtool zlib1g-dev
+RUN apt-get update && \
+ apt-get install -y make autoconf automake libtool
+RUN git clone --depth 1 https://github.com/madler/zlib.git
RUN git clone --depth 1 https://github.com/glennrp/libpng.git
-RUN (cd libpng; git log | head -1)
+RUN cp libpng/contrib/oss-fuzz/build.sh $SRC
WORKDIR libpng
-COPY build.sh $SRC/
diff --git a/contrib/oss-fuzz/README.txt b/contrib/oss-fuzz/README.txt
index a2b673665..66d5242c5 100644
--- a/contrib/oss-fuzz/README.txt
+++ b/contrib/oss-fuzz/README.txt
@@ -1,4 +1,3 @@
-Last changed in libpng 1.6.33 [September 28, 2017]
Copyright (c) 2017 Glenn Randers-Pehrson
This code is released under the libpng license.
@@ -24,13 +23,13 @@ The files are
Filename or derived Copyright License
========================= ========== ================ ==========
Dockerfile* derived 2017, Glenn R-P Apache 2.0
- build.sh* derived 2017, Glenn R-P Apache 2.0
+ build.sh derived 2017, Glenn R-P Apache 2.0
libpng_read_fuzzer.cc derived 2017, Glenn R-P Chromium
libpng_read_fuzzer.options original 2015, Chrome Devs Chromium
png.dict original 2015, Chrome Devs Chromium
README.txt (this file) original 2017, Glenn R-P libpng
- * Dockerfile and build.sh are copies of the files used by oss-fuzz.
+ * Dockerfile is a copy of the file used by oss-fuzz. build.sh,
png.dict and libpng_read_fuzzer.* are the actual files used by oss-fuzz,
which retrieves them from the libpng repository at Github.
diff --git a/contrib/oss-fuzz/build.sh b/contrib/oss-fuzz/build.sh
index d2137b13e..7b8f02639 100755
--- a/contrib/oss-fuzz/build.sh
+++ b/contrib/oss-fuzz/build.sh
@@ -1,5 +1,6 @@
#!/bin/bash -eu
-# Copyright 2017 Glenn Randers-Pehrson
+
+# Copyright 2017-2018 Glenn Randers-Pehrson
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,12 +15,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# Last changed in libpng 1.6.33 [September 28, 2017]
-#
-# Revisions by Glenn Randers-Pehson, 2017:
+# Revisions by Glenn Randers-Pehrson, 2017:
# 1. Build only the library, not the tools (changed "make -j$(nproc) all" to
# "make -j$(nproc) libpng16.la").
# 2. Disabled WARNING and WRITE options in pnglibconf.dfa.
+# 3. Build zlib alongside libpng
################################################################################
# Disable logging via library build configuration control.
@@ -30,9 +30,9 @@ cat scripts/pnglibconf.dfa | \
> scripts/pnglibconf.dfa.temp
mv scripts/pnglibconf.dfa.temp scripts/pnglibconf.dfa
-# build the library.
+# build the libpng library.
autoreconf -f -i
-./configure
+./configure --with-libpng-prefix=OSS_FUZZ_
make -j$(nproc) clean
make -j$(nproc) libpng16.la
diff --git a/contrib/oss-fuzz/libpng_read_fuzzer.cc b/contrib/oss-fuzz/libpng_read_fuzzer.cc
index 78c7c9ff0..0190cf786 100644
--- a/contrib/oss-fuzz/libpng_read_fuzzer.cc
+++ b/contrib/oss-fuzz/libpng_read_fuzzer.cc
@@ -1,21 +1,21 @@
// libpng_read_fuzzer.cc
-// Copyright 2017 Glenn Randers-Pehrson
+// Copyright 2017-2018 Glenn Randers-Pehrson
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that may
// be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE
-// Last changed in libpng 1.6.32 [August 24, 2017]
-
// The modifications in 2017 by Glenn Randers-Pehrson include
// 1. addition of a PNG_CLEANUP macro,
// 2. setting the option to ignore ADLER32 checksums,
// 3. adding "#include <string.h>" which is needed on some platforms
// to provide memcpy().
// 4. adding read_end_info() and creating an end_info structure.
+// 5. adding calls to png_set_*() transforms commonly used by browsers.
#include <stddef.h>
#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include <vector>
@@ -59,7 +59,7 @@ struct PngObjectHandler {
png_free(png_ptr, row_ptr);
if (end_info_ptr)
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
- else if (info_ptr)
+ else if (info_ptr)
png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
else
png_destroy_read_struct(&png_ptr, nullptr, nullptr);
@@ -67,7 +67,7 @@ struct PngObjectHandler {
}
};
-void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
+void user_read_data(png_structp png_ptr, png_bytep data, size_t length) {
BufState* buf_state = static_cast<BufState*>(png_get_io_ptr(png_ptr));
if (length > buf_state->bytes_left) {
png_error(png_ptr, "read error");
@@ -77,6 +77,22 @@ void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
buf_state->data += length;
}
+void* limited_malloc(png_structp, png_alloc_size_t size) {
+ // libpng may allocate large amounts of memory that the fuzzer reports as
+ // an error. In order to silence these errors, make libpng fail when trying
+ // to allocate a large amount. This allocator used to be in the Chromium
+ // version of this fuzzer.
+ // This number is chosen to match the default png_user_chunk_malloc_max.
+ if (size > 8000000)
+ return nullptr;
+
+ return malloc(size);
+}
+
+void default_free(png_structp, png_voidp ptr) {
+ return free(ptr);
+}
+
static const int kPngHeaderSize = 8;
// Entry point for LibFuzzer.
@@ -117,6 +133,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
}
+ // Use a custom allocator that fails for large allocations to avoid OOM.
+ png_set_mem_fn(png_handler.png_ptr, nullptr, limited_malloc, default_free);
+
png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
#ifdef PNG_IGNORE_ADLER32
png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
@@ -136,9 +155,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Reading.
png_read_info(png_handler.png_ptr, png_handler.info_ptr);
- png_handler.row_ptr = png_malloc(
- png_handler.png_ptr, png_get_rowbytes(png_handler.png_ptr,
- png_handler.info_ptr));
// reset error handler to put png_deleter into scope.
if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
@@ -163,8 +179,20 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
}
+ // Set several transforms that browsers typically use:
+ png_set_gray_to_rgb(png_handler.png_ptr);
+ png_set_expand(png_handler.png_ptr);
+ png_set_packing(png_handler.png_ptr);
+ png_set_scale_16(png_handler.png_ptr);
+ png_set_tRNS_to_alpha(png_handler.png_ptr);
+
int passes = png_set_interlace_handling(png_handler.png_ptr);
- png_start_read_image(png_handler.png_ptr);
+
+ png_read_update_info(png_handler.png_ptr, png_handler.info_ptr);
+
+ png_handler.row_ptr = png_malloc(
+ png_handler.png_ptr, png_get_rowbytes(png_handler.png_ptr,
+ png_handler.info_ptr));
for (int pass = 0; pass < passes; ++pass) {
for (png_uint_32 y = 0; y < height; ++y) {
diff --git a/contrib/oss-fuzz/newcc b/contrib/oss-fuzz/newcc
deleted file mode 100644
index 0fc9e206c..000000000
--- a/contrib/oss-fuzz/newcc
+++ /dev/null
@@ -1,190 +0,0 @@
-
-// libpng_read_fuzzer.cc
-// Copyright 2017 Glenn Randers-Pehrson
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that may
-// be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE
-
-// Last changed in libpng 1.6.33beta03 [September 27, 2017]
-
-// The modifications in 2017 by Glenn Randers-Pehrson include
-// 1. addition of a PNG_CLEANUP macro,
-// 2. setting the option to ignore ADLER32 checksums,
-// 3. adding "#include <string.h>" which is needed on some platforms
-// to provide memcpy().
-// 4. adding read_end_info() and creating an end_info structure.
-
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <vector>
-
-#define PNG_INTERNAL
-#include "png.h"
-
-struct BufState {
- const uint8_t* data;
- size_t bytes_left;
-};
-
-struct PngObjectHandler {
- png_infop info_ptr = nullptr;
- png_structp png_ptr = nullptr;
- png_infop end_info_ptr = nullptr;
- png_voidp row_ptr = nullptr;
- BufState* buf_state = nullptr;
-
- ~PngObjectHandler() {
- if (row_ptr)
- png_free(png_ptr, row_ptr);
- if (end_info_ptr)
- png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
- else if (info_ptr)
- png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
- else
- png_destroy_read_struct(&png_ptr, nullptr, nullptr);
- delete buf_state;
- }
-};
-
-void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
- BufState* buf_state = static_cast<BufState*>(png_get_io_ptr(png_ptr));
- if (length > buf_state->bytes_left) {
- png_error(png_ptr, "read error");
- }
- memcpy(data, buf_state->data, length);
- buf_state->bytes_left -= length;
- buf_state->data += length;
-}
-
-static const int kPngHeaderSize = 8;
-
-// Entry point for LibFuzzer.
-// Roughly follows the libpng book example:
-// http://www.libpng.org/pub/png/book/chapter13.html
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- if (size < kPngHeaderSize) {
- return 0;
- }
-
- std::vector<unsigned char> v(data, data + size);
- if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
- // not a PNG.
- return 0;
- }
-
- PngObjectHandler png_handler;
- png_handler.png_ptr = nullptr;
- png_handler.row_ptr = nullptr;
- png_handler.info_ptr = nullptr;
- png_handler.end_info_ptr = nullptr;
-
- png_handler.png_ptr = png_create_read_struct
- (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
- if (!png_handler.png_ptr) {
- return 0;
- }
-
-#define PNG_CLEANUP \
- if(png_handler.png_ptr) \
- { \
- if (png_handler.row_ptr) \
- png_free(png_handler.png_ptr, png_handler.row_ptr); \
- if (png_handler.end_info_ptr) \
- png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
- &png_handler.end_info_ptr); \
- else if (png_handler.info_ptr) \
- png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
- nullptr); \
- else \
- png_destroy_read_struct(&png_handler.png_ptr, nullptr, nullptr); \
- png_handler.png_ptr = nullptr; \
- png_handler.row_ptr = nullptr; \
- png_handler.info_ptr = nullptr; \
- png_handler.end_info_ptr = nullptr; \
- }
-
- png_handler.info_ptr = png_create_info_struct(png_handler.png_ptr);
- if (!png_handler.info_ptr) {
- PNG_CLEANUP
- return 0;
- }
-
- png_handler.end_info_ptr = png_create_info_struct(png_handler.png_ptr);
- if (!png_handler.end_info_ptr) {
- PNG_CLEANUP
- return 0;
- }
-
- /* Treat benign errors as warnings */
- png_set_benign_errors(png_handler.png_ptr, 1);
-
- png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
-
-#ifdef PNG_IGNORE_ADLER32
- png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
-#endif
-
- // Setting up reading from buffer.
- png_handler.buf_state = new BufState();
- png_handler.buf_state->data = data + kPngHeaderSize;
- png_handler.buf_state->bytes_left = size - kPngHeaderSize;
- png_set_read_fn(png_handler.png_ptr, png_handler.buf_state, user_read_data);
- png_set_sig_bytes(png_handler.png_ptr, kPngHeaderSize);
-
- if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
- PNG_CLEANUP
- return 0;
- }
-
- // Reading.
- png_read_info(png_handler.png_ptr, png_handler.info_ptr);
- png_read_update_info(png_handler.png_ptr, png_handler.info_ptr);
- png_handler.row_ptr = png_malloc(
- png_handler.png_ptr, png_get_rowbytes(png_handler.png_ptr,
- png_handler.info_ptr));
-
- // reset error handler to put png_deleter into scope.
- if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
- PNG_CLEANUP
- return 0;
- }
-
- png_uint_32 width, height;
- int bit_depth, color_type, interlace_type, compression_type;
- int filter_type;
-
- if (!png_get_IHDR(png_handler.png_ptr, png_handler.info_ptr, &width,
- &height, &bit_depth, &color_type, &interlace_type,
- &compression_type, &filter_type)) {
- PNG_CLEANUP
- return 0;
- }
-
- // This is going to be too slow.
- if (width && height > 100000000 / width) {
- PNG_CLEANUP
- return 0;
- }
-
- int passes = png_set_interlace_handling(png_handler.png_ptr);
- png_start_read_image(png_handler.png_ptr);
-
- /* To do: prevent the optimizer from removing this code entirely */
- for (int pass = 0; pass < passes; ++pass) {
- for (png_uint_32 y = 0; y < height; ++y) {
- png_read_row(png_handler.png_ptr,
- static_cast<png_bytep>(png_handler.row_ptr), nullptr);
- }
- }
-
- png_read_end(png_handler.png_ptr, png_handler.end_info_ptr);
-
- PNG_CLEANUP
-
- /* TO do: exercise the progressive reader here */
-
- return 0;
-}
diff --git a/contrib/pngminus/CHANGES.txt b/contrib/pngminus/CHANGES.txt
new file mode 100644
index 000000000..4e64e5ee6
--- /dev/null
+++ b/contrib/pngminus/CHANGES.txt
@@ -0,0 +1,13 @@
+
+pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file
+copyright (C) 1999-2019 by Willem van Schaik <willem at schaik dot com>
+
+version 1.0 - 1999.10.15 - First version.
+ 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson)
+ 1.2 - 2017.04.22 - Add buffer-size check
+ 1.3 - 2017.08.24 - Fix potential overflow in buffer-size check
+ (Glenn Randers-Pehrson)
+ 1.4 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
+ 1.5 - 2018.08.05 - Fix buffer overflow in tokenizer (Cosmin Truta)
+ 1.6 - 2018.08.05 - Improve portability and fix style (Cosmin Truta)
+ 1.7 - 2019.01.22 - Change license to MIT (Willem van Schaik)
diff --git a/contrib/pngminus/CMakeLists.txt b/contrib/pngminus/CMakeLists.txt
new file mode 100644
index 000000000..1f815a582
--- /dev/null
+++ b/contrib/pngminus/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 3.1)
+cmake_policy(VERSION 3.1)
+
+project(PNGMINUS C)
+
+option(PNGMINUS_USE_STATIC_LIBRARIES "Use the static library builds" ON)
+
+# libpng
+add_subdirectory(../.. libpng)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../..)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/libpng)
+if(PNGMINUS_USE_STATIC_LIBRARIES)
+ set(PNGMINUS_PNG_LIBRARY png_static)
+else()
+ set(PNGMINUS_PNG_LIBRARY png)
+endif()
+
+# png2pnm
+add_executable(png2pnm png2pnm.c)
+target_link_libraries(png2pnm ${PNGMINUS_PNG_LIBRARY})
+
+# pnm2png
+add_executable(pnm2png pnm2png.c)
+target_link_libraries(pnm2png ${PNGMINUS_PNG_LIBRARY})
diff --git a/contrib/pngminus/LICENSE.txt b/contrib/pngminus/LICENSE.txt
new file mode 100644
index 000000000..a8d413728
--- /dev/null
+++ b/contrib/pngminus/LICENSE.txt
@@ -0,0 +1,22 @@
+
+pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file
+
+copyright (C) 1999-2019 by Willem van Schaik <willem at schaik dot com>
+
+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.
diff --git a/contrib/pngminus/Makefile b/contrib/pngminus/Makefile
new file mode 100644
index 000000000..4bba07961
--- /dev/null
+++ b/contrib/pngminus/Makefile
@@ -0,0 +1,62 @@
+# Makefile for PngMinus (png2pnm and pnm2png)
+# Linux / Unix
+
+#CC = cc
+CC = gcc
+LD = $(CC)
+
+RM = rm -f
+
+PNGINC = -I../..
+PNGLIB_SHARED = -L../.. -lpng
+PNGLIB_STATIC = ../../libpng.a
+
+# Uncomment the following if you have a custom zlib build at ../../../zlib
+#ZINC = -I../../../zlib
+#ZLIB_SHARED = -L../../../zlib -lz
+#ZLIB_STATIC = ../../../zlib/libz.a
+
+# Use the system zlib otherwise
+ZLIB_SHARED = -lz
+ZLIB_STATIC = -lz
+
+CPPFLAGS = $(PNGINC) $(ZINC)
+CFLAGS =
+LDFLAGS =
+LIBS_SHARED = $(PNGLIB_SHARED) $(ZLIB_SHARED)
+LIBS_STATIC = $(PNGLIB_STATIC) $(ZLIB_STATIC)
+
+EXEEXT =
+#EXEEXT = .exe
+
+# dependencies
+
+all: png2pnm$(EXEEXT) pnm2png$(EXEEXT) png2pnm-static$(EXEEXT) pnm2png-static$(EXEEXT)
+
+png2pnm.o: png2pnm.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) png2pnm.c
+
+pnm2png.o: pnm2png.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) pnm2png.c
+
+png2pnm$(EXEEXT): png2pnm.o
+ $(LD) $(LDFLAGS) -o png2pnm$(EXEEXT) png2pnm.o $(LIBS_SHARED) -lm
+
+pnm2png$(EXEEXT): pnm2png.o
+ $(LD) $(LDFLAGS) -o pnm2png$(EXEEXT) pnm2png.o $(LIBS_SHARED) -lm
+
+png2pnm-static$(EXEEXT): png2pnm.o
+ $(LD) $(LDFLAGS) -o png2pnm-static$(EXEEXT) png2pnm.o $(LIBS_STATIC) -lm
+
+pnm2png-static$(EXEEXT): pnm2png.o
+ $(LD) $(LDFLAGS) -o pnm2png-static$(EXEEXT) pnm2png.o $(LIBS_STATIC) -lm
+
+clean:
+ $(RM) png2pnm.o
+ $(RM) pnm2png.o
+ $(RM) png2pnm$(EXEEXT)
+ $(RM) pnm2png$(EXEEXT)
+ $(RM) png2pnm-static$(EXEEXT)
+ $(RM) pnm2png-static$(EXEEXT)
+
+# End of makefile for png2pnm / pnm2png
diff --git a/contrib/pngminus/README b/contrib/pngminus/README.txt
index fbcfc9861..f7f6ecb3a 100644
--- a/contrib/pngminus/README
+++ b/contrib/pngminus/README.txt
@@ -1,26 +1,16 @@
PngMinus
--------
-(copyright Willem van Schaik, 1999)
+(copyright Willem van Schaik, 1999-2019)
-License
--------
-
-Permission to use, copy, modify, and distribute this software and
-its documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and
-that both that copyright notice and this permission notice appear in
-supporting documentation. This software is provided "as is" without
-express or implied warranty.
-
Some history
------------
Soon after the creation of PNG in 1995, the need was felt for a set of
-pnmtopng / pngtopnm utilities. Independantly Alexander Lehmann and I
+pnmtopng / pngtopnm utilities. Independently Alexander Lehmann and I
(Willem van Schaik) started such a project. Luckily we discovered this
-and merged the two together into pnmtopng.tar.gz, which is available
-from a/o ftp://ftp.simplesystems.org/pub/libpng/png/.
+and merged the two, which later became part of NetPBM, available from
+SourceForge.
These two utilities have many, many options and make use of most of the
features of PNG, like gamma, alpha, sbit, text-chunks, etc. This makes
@@ -35,8 +25,8 @@ makes the whole setup a bit bulky. But that's unavoidable given the many
features of pnmtopng.
-What now
---------
+What now (1999)
+---------------
At this moment libpng is in a very stable state and can do much of the
work done in pnmtopng. Also, pnmtopng needs to be upgraded to the new
interface of libpng. Hence, it is time for a rewrite from the ground up
@@ -49,8 +39,8 @@ a small prototype that contains only the basic functionality. It doesn't
have any of the options to read or write special chunks and it will do
no gamma correction. But this makes it also a simple program that is
quite easy to understand and can serve well as a template for other
-software developments. (By now there are of course a couple of programs,
-like Greg Roelofs' rpng/wpng, that can be used just as good.)
+software developments. By now there are of course a couple of programs,
+like Greg Roelofs' rpng/wpng, that can be used just as good.
Can and can not
@@ -60,7 +50,8 @@ PngMinus. Because I started this development in good-old Turbo-C, I
avoided the use the netpbm library, which requires DOS extenders. Again,
another reason to call it PngMinus (minus netpbm :-). So, part of the
program are some elementary routines to read / write pgm- and ppm-files.
-It does not read b&w pbm-files.
+It does not handle B&W pbm-files, but instead you could do pgm with bit-
+depth 1.
The downside of this approach is that you can not use them on images
that require blocks of memory bigger than 64k (the DOS version). For
@@ -96,58 +87,34 @@ To list the options type "png2pnm -h" or "pnm2png -h".
Just like Scandinavian furniture
--------------------------------
-You have to put it together yourself. I did test the software under
-MS-DOS with Turbo-C 3.0 and under RedHat Linux 4.2 with gcc. In both
-cases I used libpng-1.0.4 and zlib-1.1.3. Later versions should be OK,
-however some older libpng versions have a bug in pngmem.c when using
-Turbo-C 3.0 (see below).
-
-You can build it using one of the two makefiles (make -f makefile.###)
-or use the batch/script files pngminus.bat / pngminus.sh. This assumes
-that you have built the libraries in ../libpng and ../zlib. Using Linux,
-make sure that you have built libpng with makefile.std and not
-makefile.linux (also called .lnx in earlier versions of libpng). The
-latter creates a .so shared-library, while the PngMinus makefile assumes
-a normal .a static library.
+You have to put it together yourself. I developed the software on MS-DOS
+with Turbo-C 3.0 and RedHat Linux 4.2 with gcc. In both cases I used
+libpng-1.0.4 and zlib-1.1.3. By now (2019) it is twenty years later and
+more current versions are OK.
+
+The makefile assumes that the libpng libraries can be found in ../.. and
+libz in ../../../zlib. But you can change this to for example ../libpng
+and ../zlib. The makefile creates two versions of each program, one with
+static library support and the other using shared libraries.
If you create a ../pngsuite directory and then store the basn####.png
files from PngSuite (http://www.schaik.com/pngsuite/) in there, you can
-test in one go the proper functioning of PngMinus, see png2pnm.bat and
-pnm2png.bat (or the .sh versions).
+test the proper functioning of PngMinus by running pngminus.sh.
Warranty
-------
Please, remember that this was just a small experiment to learn a few
-things. It will have many unforeseen features <vbg>. Who said bugs? Use
-it when you are in need for something simple or when you want to start
-developing your own stuff.
-
-
-The Turbo bug
--------------
-** pngmem.old
- hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L);
- hptr += 16L;
-** pngmem.c
- hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L);
- hptr = hptr + 16L;
-**
-
-** pngmem.old
- png_ptr->offset_table_ptr[i] = (png_bytep)hptr;
- hptr += (png_uint_32)65536L;
-** pngmem.c
- png_ptr->offset_table_ptr[i] = (png_bytep)hptr;
- hptr = hptr + 65536L;
-**
+things. It will have many unforeseen features <vbg> ... who said bugs? Use
+it when you are in need for something simple or when you want a starting
+point for developing your own stuff.
The end
-------
Willem van Schaik
-mailto:willem at schaik.com
+mailto:willem at schaik dot com
http://www.schaik.com/png/
--------
-Oct 1999
+
+Oct 1999, Jan 2019
diff --git a/contrib/pngminus/makefile.std b/contrib/pngminus/makefile.std
deleted file mode 100644
index 14e25cd64..000000000
--- a/contrib/pngminus/makefile.std
+++ /dev/null
@@ -1,66 +0,0 @@
-# Makefile for PngMinus (png2pnm and pnm2png)
-# Linux / Unix
-
-#CC=cc
-CC=gcc
-LD=$(CC)
-
-RM=rm -f
-
-#PNGPATH = /usr/local
-#PNGINC = -I$(PNGPATH)/include/libpng16
-#PNGLIB = -L$(PNGPATH)/lib -lpng16
-#PNGLIBS = $(PNGPATH)/lib/libpng16.a
-PNGINC = -I../..
-PNGLIB = -L../.. -lpng
-PNGLIBS = ../../libpng.a
-
-#ZPATH = /usr/local
-#ZINC = -I$(ZPATH)/include
-#ZLIB = -L$(ZPATH)/lib -lz
-#ZLIBS = $(ZPATH)/lib/libz.a
-ZINC = -I../../../zlib
-ZLIB = -L../../../zlib -lz
-ZLIBS = ../../../zlib/libz.a
-
-CPPFLAGS=$(PNGINC) $(ZINC)
-CFLAGS=
-LDLIBS=$(PNGLIB) $(ZLIB)
-LDLIBSS=$(PNGLIBS) $(ZLIBS)
-C=.c
-O=.o
-L=.a
-E=
-
-# dependencies
-
-#all: png2pnm$(E) pnm2png$(E)
-all: png2pnm$(E) pnm2png$(E) png2pnm-static$(E) pnm2png-static$(E)
-
-png2pnm$(O): png2pnm$(C)
- $(CC) -c $(CPPFLAGS) $(CFLAGS) png2pnm$(C)
-
-png2pnm$(E): png2pnm$(O)
- $(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm
-
-png2pnm-static$(E): png2pnm$(O)
- $(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm
-
-pnm2png$(O): pnm2png$(C)
- $(CC) -c $(CPPFLAGS) $(CFLAGS) pnm2png$(C)
-
-pnm2png$(E): pnm2png$(O)
- $(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm
-
-pnm2png-static$(E): pnm2png$(O)
- $(LD) $(LDFLAGS) -o pnm2png-static$(E) pnm2png$(O) $(LDLIBSS) -lm
-
-clean:
- $(RM) png2pnm$(O)
- $(RM) pnm2png$(O)
- $(RM) png2pnm$(E)
- $(RM) pnm2png$(E)
- $(RM) png2pnm-static$(E)
- $(RM) pnm2png-static$(E)
-
-# End of makefile for png2pnm / pnm2png
diff --git a/contrib/pngminus/makefile.tc3 b/contrib/pngminus/makefile.tc3
deleted file mode 100644
index 6a2f4b985..000000000
--- a/contrib/pngminus/makefile.tc3
+++ /dev/null
@@ -1,38 +0,0 @@
-# Makefile for PngMinus (png2pnm and pnm2png)
-# TurboC++ 3.0
-
-CC=tcc -Ic:\tc3\inc
-LD=tcc -Lc:\tc3\lib
-LB=tlib
-RM=del
-CP=copy
-MODEL=l
-CPPFLAGS=-I..\libpng -I..\zlib
-CFLAGS=-O -m$(MODEL)
-LDFLAGS=-m$(MODEL) -L..\libpng -L..\zlib
-C=.c
-O=.obj
-L=.lib
-E=.exe
-
-# dependencies
-
-all: png2pnm$(E) pnm2png$(E)
-
-png2pnm$(O): png2pnm$(C)
- $(CC) -c $(CPPFLAGS) $(CFLAGS) png2pnm$(C)
-
-png2pnm$(E): png2pnm$(O)
- $(LD) $(LDFLAGS) png2pnm$(O) libpng$(L) zlib$(L)
-
-pnm2png$(O): pnm2png$(C)
- $(CC) -c $(CPPFLAGS) $(CFLAGS) pnm2png$(C)
-
-pnm2png$(E): pnm2png$(O)
- $(LD) $(LDFLAGS) pnm2png$(O) libpng$(L) zlib$(L)
-
-clean:
- $(RM) *$(O)
- $(RM) *$(E)
-
-# End of makefile for png2pnm / pnm2png
diff --git a/contrib/pngminus/png2pnm.bat b/contrib/pngminus/png2pnm.bat
index 449cf3675..a2798c340 100755
--- a/contrib/pngminus/png2pnm.bat
+++ b/contrib/pngminus/png2pnm.bat
@@ -7,7 +7,7 @@ png2pnm.exe -noraw ..\pngsuite\basn0g16.png basn0g16.pgm
REM -- full-color
png2pnm.exe -noraw ..\pngsuite\basn2c08.png basn2c08.ppm
png2pnm.exe -noraw ..\pngsuite\basn2c16.png basn2c16.ppm
-REM -- palletted
+REM -- paletted
png2pnm.exe -noraw ..\pngsuite\basn3p01.png basn3p01.ppm
png2pnm.exe -noraw ..\pngsuite\basn3p02.png basn3p02.ppm
png2pnm.exe -noraw ..\pngsuite\basn3p04.png basn3p04.ppm
@@ -27,7 +27,7 @@ png2pnm.exe -raw ..\pngsuite\basn0g16.png rawn0g16.pgm
REM -- full-color
png2pnm.exe -raw ..\pngsuite\basn2c08.png rawn2c08.ppm
png2pnm.exe -raw ..\pngsuite\basn2c16.png rawn2c16.ppm
-REM -- palletted
+REM -- paletted
png2pnm.exe -raw ..\pngsuite\basn3p01.png rawn3p01.ppm
png2pnm.exe -raw ..\pngsuite\basn3p02.png rawn3p02.ppm
png2pnm.exe -raw ..\pngsuite\basn3p04.png rawn3p04.ppm
diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c
index 1420a783b..5fef7ed14 100644
--- a/contrib/pngminus/png2pnm.c
+++ b/contrib/pngminus/png2pnm.c
@@ -1,28 +1,14 @@
/*
* png2pnm.c --- conversion from PNG-file to PGM/PPM-file
- * copyright (C) 1999,2017 by Willem van Schaik <willem at schaik.com>
+ * copyright (C) 1999-2019 by Willem van Schaik <willem at schaik dot com>
*
- * version 1.0 - 1999.10.15 - First version.
- * 1.1 - 2017.04.22 - Add buffer-size check (Glenn Randers-Pehrson)
- * 1.2 - 2017.08.24 - Fix potential overflow in buffer-size check
- * (Glenn Randers-Pehrson)
- * 1.3 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation. This software is provided "as is" without
- * express or implied warranty.
+ * This software is released under the MIT license. For conditions of
+ * distribution and use, see the LICENSE file part of this package.
*/
#include <stdio.h>
#include <stdlib.h>
-#ifdef __TURBOC__
-#include <mem.h>
#include <fcntl.h>
-#endif
-#include <zlib.h>
#ifndef BOOL
#define BOOL unsigned char
@@ -34,45 +20,25 @@
#define FALSE (BOOL) 0
#endif
-#ifdef __TURBOC__
-#define STDIN 0
-#define STDOUT 1
-#define STDERR 2
-#endif
-
-/* to make png2pnm verbose so we can find problems (needs to be before png.h) */
+/* make png2pnm verbose so we can find problems (needs to be before png.h) */
#ifndef PNG_DEBUG
#define PNG_DEBUG 0
#endif
-
#include "png.h"
-/* 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
-
-#ifndef PNGMINUS_UNUSED
-/* Unused formal parameter warnings are silenced using the following macro
- * which is expected to have no bad effects on performance (optimizing
- * compilers will probably remove it entirely).
- */
-# define PNGMINUS_UNUSED(param) (void)param
-#endif
-
/* function prototypes */
-int main (int argc, char *argv[]);
+int main (int argc, char *argv[]);
void usage ();
-BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw,
- BOOL alpha);
+BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
+ BOOL raw, BOOL alpha);
/*
* main
*/
-int main(int argc, char *argv[])
+int main (int argc, char *argv[])
{
FILE *fp_rd = stdin;
FILE *fp_wr = stdout;
@@ -99,21 +65,21 @@ int main(int argc, char *argv[])
if ((fp_al = fopen (argv[argi], "wb")) == NULL)
{
fprintf (stderr, "PNM2PNG\n");
- fprintf (stderr, "Error: can not create alpha-channel file %s\n",
- argv[argi]);
+ fprintf (stderr, "Error: cannot create alpha-channel file %s\n",
+ argv[argi]);
exit (1);
}
break;
case 'h':
case '?':
- usage();
- exit(0);
+ usage ();
+ exit (0);
break;
default:
fprintf (stderr, "PNG2PNM\n");
fprintf (stderr, "Error: unknown option %s\n", argv[argi]);
- usage();
- exit(1);
+ usage ();
+ exit (1);
break;
} /* end switch */
}
@@ -121,9 +87,9 @@ int main(int argc, char *argv[])
{
if ((fp_rd = fopen (argv[argi], "rb")) == NULL)
{
- fprintf (stderr, "PNG2PNM\n");
- fprintf (stderr, "Error: file %s does not exist\n", argv[argi]);
- exit (1);
+ fprintf (stderr, "PNG2PNM\n");
+ fprintf (stderr, "Error: file %s does not exist\n", argv[argi]);
+ exit (1);
}
}
else if (fp_wr == stdout)
@@ -131,7 +97,7 @@ int main(int argc, char *argv[])
if ((fp_wr = fopen (argv[argi], "wb")) == NULL)
{
fprintf (stderr, "PNG2PNM\n");
- fprintf (stderr, "Error: can not create file %s\n", argv[argi]);
+ fprintf (stderr, "Error: cannot create file %s\n", argv[argi]);
exit (1);
}
}
@@ -139,21 +105,17 @@ int main(int argc, char *argv[])
{
fprintf (stderr, "PNG2PNM\n");
fprintf (stderr, "Error: too many parameters\n");
- usage();
- exit(1);
+ usage ();
+ exit (1);
}
} /* end for */
-#ifdef __TURBOC__
+#if defined(O_BINARY) && (O_BINARY != 0)
/* set stdin/stdout if required to binary */
if (fp_rd == stdin)
- {
- setmode (STDIN, O_BINARY);
- }
+ setmode (fileno (stdin), O_BINARY);
if ((raw) && (fp_wr == stdout))
- {
- setmode (STDOUT, O_BINARY);
- }
+ setmode (fileno (stdout), O_BINARY);
#endif
/* call the conversion program itself */
@@ -161,7 +123,7 @@ int main(int argc, char *argv[])
{
fprintf (stderr, "PNG2PNM\n");
fprintf (stderr, "Error: unsuccessful conversion of PNG-image\n");
- exit(1);
+ exit (1);
}
/* close input file */
@@ -179,23 +141,18 @@ int main(int argc, char *argv[])
* usage
*/
-void usage()
+void usage ()
{
fprintf (stderr, "PNG2PNM\n");
fprintf (stderr, " by Willem van Schaik, 1999\n");
-#ifdef __TURBOC__
- fprintf (stderr, " for Turbo-C and Borland-C compilers\n");
-#else
- fprintf (stderr, " for Linux (and Unix) compilers\n");
-#endif
fprintf (stderr, "Usage: png2pnm [options] <file>.png [<file>.pnm]\n");
fprintf (stderr, " or: ... | png2pnm [options]\n");
fprintf (stderr, "Options:\n");
fprintf (stderr,
- " -r[aw] write pnm-file in binary format (P4/P5/P6) (default)\n");
+ " -r[aw] write pnm-file in binary format (P4/P5/P6) (default)\n");
fprintf (stderr, " -n[oraw] write pnm-file in ascii format (P1/P2/P3)\n");
fprintf (stderr,
- " -a[lpha] <file>.pgm write PNG alpha channel as pgm-file\n");
+ " -a[lpha] <file>.pgm write PNG alpha channel as pgm-file\n");
fprintf (stderr, " -h | -? print this help-information\n");
}
@@ -204,10 +161,10 @@ void usage()
*/
BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
- volatile BOOL raw, BOOL alpha)
+ BOOL raw, BOOL alpha)
{
png_struct *png_ptr = NULL;
- png_info *info_ptr = NULL;
+ png_info *info_ptr = NULL;
png_byte buf[8];
png_byte *png_pixels = NULL;
png_byte **row_pointers = NULL;
@@ -231,24 +188,24 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
return FALSE;
ret = png_sig_cmp (buf, 0, 8);
- if (ret)
+ if (ret != 0)
return FALSE;
/* create png and info structures */
png_ptr = png_create_read_struct (png_get_libpng_ver(NULL),
- NULL, NULL, NULL);
+ NULL, NULL, NULL);
if (!png_ptr)
- return FALSE; /* out of memory */
+ return FALSE; /* out of memory */
info_ptr = png_create_info_struct (png_ptr);
if (!info_ptr)
{
png_destroy_read_struct (&png_ptr, NULL, NULL);
- return FALSE; /* out of memory */
+ return FALSE; /* out of memory */
}
- if (setjmp (png_jmpbuf(png_ptr)))
+ if (setjmp (png_jmpbuf (png_ptr)))
{
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return FALSE;
@@ -256,15 +213,14 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
/* set up the input control for C streams */
png_init_io (png_ptr, png_file);
- png_set_sig_bytes (png_ptr, 8); /* we already read the 8 signature bytes */
+ png_set_sig_bytes (png_ptr, 8); /* we already read the 8 signature bytes */
/* read the file information */
png_read_info (png_ptr, info_ptr);
/* get size and bit-depth of the PNG-image */
- png_get_IHDR (png_ptr, info_ptr,
- &width, &height, &bit_depth, &color_type,
- NULL, NULL, NULL);
+ png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
+ NULL, NULL, NULL);
/* set-up the transformations */
@@ -284,7 +240,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
png_set_strip_16 (png_ptr);
/* transform grayscale images into full-color */
if (color_type == PNG_COLOR_TYPE_GRAY ||
- color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb (png_ptr);
/* only if file has a file gamma, we do a correction */
if (png_get_gAMA (png_ptr, info_ptr, &file_gamma))
@@ -298,14 +254,14 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
/* get the new color-type and bit-depth (after expansion/stripping) */
png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
- NULL, NULL, NULL);
+ NULL, NULL, NULL);
/* check for 16-bit files */
if (bit_depth == 16)
{
raw = FALSE;
-#ifdef __TURBOC__
- pnm_file->flags &= ~((unsigned) _F_BIN);
+#if defined(O_BINARY) && (O_BINARY != 0)
+ setmode (fileno (pnm_file), O_BINARY);
#endif
}
@@ -333,25 +289,25 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
/* row_bytes is the width x number of channels x (bit-depth / 8) */
row_bytes = png_get_rowbytes (png_ptr, info_ptr);
- if ((row_bytes == 0 || (size_t)height > ((size_t)(-1))/(size_t)row_bytes))
+ if ((row_bytes == 0) ||
+ ((size_t) height > (size_t) (-1) / (size_t) row_bytes))
{
- /* too big */
+ /* too big */
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return FALSE;
}
if ((png_pixels = (png_byte *)
- malloc ((size_t)row_bytes * (size_t)height * sizeof (png_byte))) == NULL)
+ malloc ((size_t) row_bytes * (size_t) height)) == NULL)
{
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return FALSE;
}
if ((row_pointers = (png_byte **)
- malloc ((size_t)height * sizeof (png_bytep))) == NULL)
+ malloc ((size_t) height * sizeof (png_byte *))) == NULL)
{
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
free (png_pixels);
- png_pixels = NULL;
return FALSE;
}
@@ -366,7 +322,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
png_read_end (png_ptr, info_ptr);
/* clean up after the read, and free any memory allocated - REQUIRED */
- png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp) NULL);
+ png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
/* write header of PNM file */
@@ -406,14 +362,21 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
for (i = 0; i < (channels - alpha_present); i++)
{
if (raw)
- fputc ((int) *pix_ptr++ , pnm_file);
+ {
+ fputc ((int) *pix_ptr++, pnm_file);
+ }
else
- if (bit_depth == 16){
+ {
+ if (bit_depth == 16)
+ {
dep_16 = (long) *pix_ptr++;
fprintf (pnm_file, "%ld ", (dep_16 << 8) + ((long) *pix_ptr++));
}
else
+ {
fprintf (pnm_file, "%ld ", (long) *pix_ptr++);
+ }
+ }
}
if (alpha_present)
{
@@ -426,17 +389,23 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
else /* output alpha-channel as pgm file */
{
if (raw)
- fputc ((int) *pix_ptr++ , alpha_file);
+ {
+ fputc ((int) *pix_ptr++, alpha_file);
+ }
else
+ {
if (bit_depth == 16)
{
dep_16 = (long) *pix_ptr++;
fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++);
}
else
+ {
fprintf (alpha_file, "%ld ", (long) *pix_ptr++);
+ }
+ }
}
- } /* if alpha_present */
+ } /* end if alpha_present */
if (!raw)
if (col % 4 == 3)
@@ -448,13 +417,11 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
fprintf (pnm_file, "\n");
} /* end for row */
- if (row_pointers != (unsigned char**) NULL)
+ if (row_pointers != NULL)
free (row_pointers);
- if (png_pixels != (unsigned char*) NULL)
+ if (png_pixels != NULL)
free (png_pixels);
- PNGMINUS_UNUSED(raw); /* to quiet a Coverity defect */
return TRUE;
} /* end of source */
-
diff --git a/contrib/pngminus/png2pnm.sh b/contrib/pngminus/png2pnm.sh
index b1c05370d..756126a53 100755
--- a/contrib/pngminus/png2pnm.sh
+++ b/contrib/pngminus/png2pnm.sh
@@ -8,7 +8,7 @@
# -- full-color
./png2pnm -noraw ../pngsuite/basn2c08.png basn2c08.ppm
./png2pnm -noraw ../pngsuite/basn2c16.png basn2c16.ppm
-# -- palletted
+# -- paletted
./png2pnm -noraw ../pngsuite/basn3p01.png basn3p01.ppm
./png2pnm -noraw ../pngsuite/basn3p02.png basn3p02.ppm
./png2pnm -noraw ../pngsuite/basn3p04.png basn3p04.ppm
@@ -28,7 +28,7 @@
# -- full-color
./png2pnm -raw ../pngsuite/basn2c08.png rawn2c08.ppm
./png2pnm -raw ../pngsuite/basn2c16.png rawn2c16.ppm
-# -- palletted
+# -- paletted
./png2pnm -raw ../pngsuite/basn3p01.png rawn3p01.ppm
./png2pnm -raw ../pngsuite/basn3p02.png rawn3p02.ppm
./png2pnm -raw ../pngsuite/basn3p04.png rawn3p04.ppm
diff --git a/contrib/pngminus/pngminus.bat b/contrib/pngminus/pngminus.bat
index 911bb8dff..fa60e7de0 100755
--- a/contrib/pngminus/pngminus.bat
+++ b/contrib/pngminus/pngminus.bat
@@ -1,4 +1,4 @@
-make -f makefile.tc3
+make
call png2pnm.bat
call pnm2png.bat
diff --git a/contrib/pngminus/pngminus.sh b/contrib/pngminus/pngminus.sh
index 2a0a9d8fb..cc9b4a56e 100755
--- a/contrib/pngminus/pngminus.sh
+++ b/contrib/pngminus/pngminus.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-make -f makefile.std
+make
sh png2pnm.sh
sh pnm2png.sh
diff --git a/contrib/pngminus/pnm2png.bat b/contrib/pngminus/pnm2png.bat
index f756cb84d..c02b80bec 100755
--- a/contrib/pngminus/pnm2png.bat
+++ b/contrib/pngminus/pnm2png.bat
@@ -7,7 +7,7 @@ pnm2png.exe basn0g16.pgm basn0g16.png
REM -- full-color
pnm2png.exe basn2c08.ppm basn2c08.png
pnm2png.exe basn2c16.ppm basn2c16.png
-REM -- palletted
+REM -- paletted
pnm2png.exe basn3p01.ppm basn3p01.png
pnm2png.exe basn3p02.ppm basn3p02.png
pnm2png.exe basn3p04.ppm basn3p04.png
@@ -27,7 +27,7 @@ pnm2png.exe rawn0g16.pgm rawn0g16.png
REM -- full-color
pnm2png.exe rawn2c08.ppm rawn2c08.png
pnm2png.exe rawn2c16.ppm rawn2c16.png
-REM -- palletted
+REM -- paletted
pnm2png.exe rawn3p01.ppm rawn3p01.png
pnm2png.exe rawn3p02.ppm rawn3p02.png
pnm2png.exe rawn3p04.ppm rawn3p04.png
diff --git a/contrib/pngminus/pnm2png.c b/contrib/pngminus/pnm2png.c
index 0d2caef96..a2c2551da 100644
--- a/contrib/pngminus/pnm2png.c
+++ b/contrib/pngminus/pnm2png.c
@@ -1,29 +1,14 @@
/*
* pnm2png.c --- conversion from PBM/PGM/PPM-file to PNG-file
- * copyright (C) 1999,2015,2017 by Willem van Schaik <willem at schaik.com>
+ * copyright (C) 1999-2019 by Willem van Schaik <willem at schaik dot com>
*
- * version 1.0 - 1999.10.15 - First version.
- * version 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson)
- * version 1.2 - 2017.04.22 - Add buffer-size check
- * 1.3 - 2017.08.24 - Fix potential overflow in buffer-size check
- * (Glenn Randers-Pehrson)
- * 1.4 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation. This software is provided "as is" without
- * express or implied warranty.
+ * This software is released under the MIT license. For conditions of
+ * distribution and use, see the LICENSE file part of this package.
*/
#include <stdio.h>
#include <stdlib.h>
-#ifdef __TURBOC__
-#include <mem.h>
#include <fcntl.h>
-#endif
-#include <zlib.h>
#ifndef BOOL
#define BOOL unsigned char
@@ -35,38 +20,20 @@
#define FALSE (BOOL) 0
#endif
-#define STDIN 0
-#define STDOUT 1
-#define STDERR 2
-
-/* to make pnm2png verbose so we can find problems (needs to be before png.h) */
+/* make pnm2png verbose so we can find problems (needs to be before png.h) */
#ifndef PNG_DEBUG
#define PNG_DEBUG 0
#endif
#include "png.h"
-/* 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
-
-#ifndef PNGMINUS_UNUSED
-/* Unused formal parameter warnings are silenced using the following macro
- * which is expected to have no bad effects on performance (optimizing
- * compilers will probably remove it entirely).
- */
-# define PNGMINUS_UNUSED(param) (void)param
-#endif
-
-
/* function prototypes */
-int main (int argc, char *argv[]);
+int main (int argc, char *argv[]);
void usage ();
-BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
- BOOL alpha);
-void get_token(FILE *pnm_file, char *token);
+BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file,
+ BOOL interlace, BOOL alpha);
+void get_token (FILE *pnm_file, char *token_buf, size_t token_buf_size);
png_uint_32 get_data (FILE *pnm_file, int depth);
png_uint_32 get_value (FILE *pnm_file, int depth);
@@ -74,7 +41,7 @@ png_uint_32 get_value (FILE *pnm_file, int depth);
* main
*/
-int main(int argc, char *argv[])
+int main (int argc, char *argv[])
{
FILE *fp_rd = stdin;
FILE *fp_al = NULL;
@@ -99,20 +66,20 @@ int main(int argc, char *argv[])
{
fprintf (stderr, "PNM2PNG\n");
fprintf (stderr, "Error: alpha-channel file %s does not exist\n",
- argv[argi]);
+ argv[argi]);
exit (1);
}
break;
case 'h':
case '?':
- usage();
- exit(0);
+ usage ();
+ exit (0);
break;
default:
fprintf (stderr, "PNM2PNG\n");
fprintf (stderr, "Error: unknown option %s\n", argv[argi]);
- usage();
- exit(1);
+ usage ();
+ exit (1);
break;
} /* end switch */
}
@@ -130,7 +97,7 @@ int main(int argc, char *argv[])
if ((fp_wr = fopen (argv[argi], "wb")) == NULL)
{
fprintf (stderr, "PNM2PNG\n");
- fprintf (stderr, "Error: can not create PNG-file %s\n", argv[argi]);
+ fprintf (stderr, "Error: cannot create PNG-file %s\n", argv[argi]);
exit (1);
}
}
@@ -138,21 +105,19 @@ int main(int argc, char *argv[])
{
fprintf (stderr, "PNM2PNG\n");
fprintf (stderr, "Error: too many parameters\n");
- usage();
+ usage ();
exit (1);
}
} /* end for */
-#ifdef __TURBOC__
- /* set stdin/stdout to binary, we're reading the PNM always! in binary format */
+#if defined(O_BINARY) && (O_BINARY != 0)
+ /* set stdin/stdout to binary,
+ * we're reading the PNM always! in binary format
+ */
if (fp_rd == stdin)
- {
- setmode (STDIN, O_BINARY);
- }
+ setmode (fileno (stdin), O_BINARY);
if (fp_wr == stdout)
- {
- setmode (STDOUT, O_BINARY);
- }
+ setmode (fileno (stdout), O_BINARY);
#endif
/* call the conversion program itself */
@@ -178,15 +143,10 @@ int main(int argc, char *argv[])
* usage
*/
-void usage()
+void usage ()
{
fprintf (stderr, "PNM2PNG\n");
fprintf (stderr, " by Willem van Schaik, 1999\n");
-#ifdef __TURBOC__
- fprintf (stderr, " for Turbo-C and Borland-C compilers\n");
-#else
- fprintf (stderr, " for Linux (and Unix) compilers\n");
-#endif
fprintf (stderr, "Usage: pnm2png [options] <file>.<pnm> [<file>.png]\n");
fprintf (stderr, " or: ... | pnm2png [options]\n");
fprintf (stderr, "Options:\n");
@@ -200,31 +160,31 @@ void usage()
* pnm2png
*/
-BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
- BOOL alpha)
+BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file,
+ BOOL interlace, BOOL alpha)
{
png_struct *png_ptr = NULL;
png_info *info_ptr = NULL;
png_byte *png_pixels = NULL;
png_byte **row_pointers = NULL;
png_byte *pix_ptr = NULL;
- volatile png_uint_32 row_bytes;
+ volatile png_uint_32 row_bytes;
char type_token[16];
char width_token[16];
char height_token[16];
char maxval_token[16];
- volatile int color_type=1;
- unsigned long ul_width=0, ul_alpha_width=0;
- unsigned long ul_height=0, ul_alpha_height=0;
- unsigned long ul_maxval=0;
- volatile png_uint_32 width=0, height=0;
- volatile png_uint_32 alpha_width=0, alpha_height=0;
+ volatile int color_type = 1;
+ unsigned long ul_width = 0, ul_alpha_width = 0;
+ unsigned long ul_height = 0, ul_alpha_height = 0;
+ unsigned long ul_maxval = 0;
+ volatile png_uint_32 width = 0, height = 0;
+ volatile png_uint_32 alpha_width = 0, alpha_height = 0;
png_uint_32 maxval;
- volatile int bit_depth = 0;
- int channels=0;
+ volatile int bit_depth = 0;
+ int channels = 0;
int alpha_depth = 0;
- int alpha_present=0;
+ int alpha_present = 0;
int row, col;
BOOL raw, alpha_raw = FALSE;
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
@@ -235,7 +195,7 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
/* read header of PNM file */
- get_token(pnm_file, type_token);
+ get_token (pnm_file, type_token, sizeof (type_token));
if (type_token[0] != 'P')
{
return FALSE;
@@ -245,30 +205,31 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
raw = (type_token[1] == '4');
color_type = PNG_COLOR_TYPE_GRAY;
- get_token(pnm_file, width_token);
+ get_token (pnm_file, width_token, sizeof (width_token));
sscanf (width_token, "%lu", &ul_width);
width = (png_uint_32) ul_width;
- get_token(pnm_file, height_token);
+ get_token (pnm_file, height_token, sizeof (height_token));
sscanf (height_token, "%lu", &ul_height);
height = (png_uint_32) ul_height;
bit_depth = 1;
packed_bitmap = TRUE;
#else
- fprintf (stderr, "PNM2PNG built without PNG_WRITE_INVERT_SUPPORTED and \n");
+ fprintf (stderr, "PNM2PNG built without PNG_WRITE_INVERT_SUPPORTED and\n");
fprintf (stderr, "PNG_WRITE_PACK_SUPPORTED can't read PBM (P1,P4) files\n");
+ return FALSE;
#endif
}
else if ((type_token[1] == '2') || (type_token[1] == '5'))
{
raw = (type_token[1] == '5');
color_type = PNG_COLOR_TYPE_GRAY;
- get_token(pnm_file, width_token);
+ get_token (pnm_file, width_token, sizeof (width_token));
sscanf (width_token, "%lu", &ul_width);
width = (png_uint_32) ul_width;
- get_token(pnm_file, height_token);
+ get_token (pnm_file, height_token, sizeof (height_token));
sscanf (height_token, "%lu", &ul_height);
height = (png_uint_32) ul_height;
- get_token(pnm_file, maxval_token);
+ get_token (pnm_file, maxval_token, sizeof (maxval_token));
sscanf (maxval_token, "%lu", &ul_maxval);
maxval = (png_uint_32) ul_maxval;
@@ -280,20 +241,22 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
bit_depth = 4;
else if (maxval <= 255)
bit_depth = 8;
- else /* if (maxval <= 65535) */
+ else if (maxval <= 65535U)
bit_depth = 16;
+ else /* maxval > 65535U */
+ return FALSE;
}
else if ((type_token[1] == '3') || (type_token[1] == '6'))
{
raw = (type_token[1] == '6');
color_type = PNG_COLOR_TYPE_RGB;
- get_token(pnm_file, width_token);
+ get_token (pnm_file, width_token, sizeof (width_token));
sscanf (width_token, "%lu", &ul_width);
width = (png_uint_32) ul_width;
- get_token(pnm_file, height_token);
+ get_token (pnm_file, height_token, sizeof (height_token));
sscanf (height_token, "%lu", &ul_height);
height = (png_uint_32) ul_height;
- get_token(pnm_file, maxval_token);
+ get_token (pnm_file, maxval_token, sizeof (maxval_token));
sscanf (maxval_token, "%lu", &ul_maxval);
maxval = (png_uint_32) ul_maxval;
if (maxval <= 1)
@@ -304,8 +267,10 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
bit_depth = 4;
else if (maxval <= 255)
bit_depth = 8;
- else /* if (maxval <= 65535) */
+ else if (maxval <= 65535U)
bit_depth = 16;
+ else /* maxval > 65535U */
+ return FALSE;
}
else
{
@@ -321,7 +286,7 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
if (color_type == PNG_COLOR_TYPE_RGB)
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
- get_token(alpha_file, type_token);
+ get_token (alpha_file, type_token, sizeof (type_token));
if (type_token[0] != 'P')
{
return FALSE;
@@ -329,17 +294,17 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
else if ((type_token[1] == '2') || (type_token[1] == '5'))
{
alpha_raw = (type_token[1] == '5');
- get_token(alpha_file, width_token);
+ get_token (alpha_file, width_token, sizeof (width_token));
sscanf (width_token, "%lu", &ul_alpha_width);
- alpha_width=(png_uint_32) ul_alpha_width;
+ alpha_width = (png_uint_32) ul_alpha_width;
if (alpha_width != width)
return FALSE;
- get_token(alpha_file, height_token);
+ get_token (alpha_file, height_token, sizeof (height_token));
sscanf (height_token, "%lu", &ul_alpha_height);
alpha_height = (png_uint_32) ul_alpha_height;
if (alpha_height != height)
return FALSE;
- get_token(alpha_file, maxval_token);
+ get_token (alpha_file, maxval_token, sizeof (maxval_token));
sscanf (maxval_token, "%lu", &ul_maxval);
maxval = (png_uint_32) ul_maxval;
if (maxval <= 1)
@@ -350,8 +315,10 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
alpha_depth = 4;
else if (maxval <= 255)
alpha_depth = 8;
- else /* if (maxval <= 65535) */
+ else if (maxval <= 65535U)
alpha_depth = 16;
+ else /* maxval > 65535U */
+ return FALSE;
if (alpha_depth != bit_depth)
return FALSE;
}
@@ -379,21 +346,29 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
if (packed_bitmap)
+ {
/* row data is as many bytes as can fit width x channels x bit_depth */
row_bytes = (width * channels * bit_depth + 7) / 8;
+ }
else
#endif
- /* row_bytes is the width x number of channels x (bit-depth / 8) */
+ {
+ /* row_bytes is the width x number of channels x (bit-depth / 8) */
row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
+ }
- if ((row_bytes == 0 || (size_t)height > ((size_t)(-1))/(size_t)row_bytes))
+ if ((row_bytes == 0) ||
+ ((size_t) height > (size_t) (-1) / (size_t) row_bytes))
{
- /* too big */
+ /* too big */
return FALSE;
}
if ((png_pixels = (png_byte *)
- malloc ((size_t)row_bytes * (size_t)height * sizeof (png_byte))) == NULL)
+ malloc ((size_t) row_bytes * (size_t) height)) == NULL)
+ {
+ /* out of memory */
return FALSE;
+ }
/* read data from PNM file */
pix_ptr = png_pixels;
@@ -404,9 +379,12 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
if (packed_bitmap)
{
for (i = 0; i < (int) row_bytes; i++)
+ {
/* png supports this format natively so no conversion is needed */
*pix_ptr++ = get_data (pnm_file, 8);
- } else
+ }
+ }
+ else
#endif
{
for (col = 0; col < (int) width; col++)
@@ -414,10 +392,15 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
for (i = 0; i < (channels - alpha_present); i++)
{
if (raw)
+ {
*pix_ptr++ = get_data (pnm_file, bit_depth);
+ }
else
+ {
if (bit_depth <= 8)
+ {
*pix_ptr++ = get_value (pnm_file, bit_depth);
+ }
else
{
tmp16 = get_value (pnm_file, bit_depth);
@@ -426,41 +409,46 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
*pix_ptr = (png_byte) (tmp16 & 0xFF);
pix_ptr++;
}
+ }
}
if (alpha) /* read alpha-channel from pgm file */
{
if (alpha_raw)
+ {
*pix_ptr++ = get_data (alpha_file, alpha_depth);
+ }
else
+ {
if (alpha_depth <= 8)
+ {
*pix_ptr++ = get_value (alpha_file, bit_depth);
+ }
else
{
tmp16 = get_value (alpha_file, bit_depth);
*pix_ptr++ = (png_byte) ((tmp16 >> 8) & 0xFF);
*pix_ptr++ = (png_byte) (tmp16 & 0xFF);
}
- } /* if alpha */
- } /* if packed_bitmap */
+ }
+ } /* end if alpha */
+ } /* end if packed_bitmap */
} /* end for col */
} /* end for row */
/* prepare the standard PNG structures */
- png_ptr = png_create_write_struct (png_get_libpng_ver(NULL), NULL, NULL,
- NULL);
+ png_ptr = png_create_write_struct (png_get_libpng_ver(NULL),
+ NULL, NULL, NULL);
if (!png_ptr)
{
free (png_pixels);
- png_pixels = NULL;
return FALSE;
}
info_ptr = png_create_info_struct (png_ptr);
if (!info_ptr)
{
- png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
+ png_destroy_write_struct (&png_ptr, NULL);
free (png_pixels);
- png_pixels = NULL;
return FALSE;
}
@@ -472,12 +460,10 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
}
#endif
- /* setjmp() must be called in every function that calls a PNG-reading libpng function */
- if (setjmp (png_jmpbuf(png_ptr)))
+ if (setjmp (png_jmpbuf (png_ptr)))
{
png_destroy_write_struct (&png_ptr, &info_ptr);
free (png_pixels);
- png_pixels = NULL;
return FALSE;
}
@@ -486,21 +472,20 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
/* we're going to write more or less the same PNG as the input file */
png_set_IHDR (png_ptr, info_ptr, width, height, bit_depth, color_type,
- (!interlace) ? PNG_INTERLACE_NONE : PNG_INTERLACE_ADAM7,
- PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+ (!interlace) ? PNG_INTERLACE_NONE : PNG_INTERLACE_ADAM7,
+ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
/* write the file header information */
png_write_info (png_ptr, info_ptr);
/* if needed we will allocate memory for an new array of row-pointers */
- if (row_pointers == (unsigned char**) NULL)
+ if (row_pointers == NULL)
{
if ((row_pointers = (png_byte **)
- malloc (height * sizeof (png_bytep))) == NULL)
+ malloc (height * sizeof (png_byte *))) == NULL)
{
png_destroy_write_struct (&png_ptr, &info_ptr);
free (png_pixels);
- png_pixels = NULL;
return FALSE;
}
}
@@ -518,62 +503,60 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
/* clean up after the write, and free any memory allocated */
png_destroy_write_struct (&png_ptr, &info_ptr);
- if (row_pointers != (unsigned char**) NULL)
+ if (row_pointers != NULL)
free (row_pointers);
- if (png_pixels != (unsigned char*) NULL)
+ if (png_pixels != NULL)
free (png_pixels);
- PNGMINUS_UNUSED(raw); /* Quiet a Coverity defect */
-
return TRUE;
} /* end of pnm2png */
/*
- * get_token() - gets the first string after whitespace
+ * get_token - gets the first string after whitespace
*/
-void get_token(FILE *pnm_file, char *token)
+void get_token (FILE *pnm_file, char *token_buf, size_t token_buf_size)
{
- int i = 0;
+ size_t i = 0;
int ret;
/* remove white-space and comment lines */
do
{
- ret = fgetc(pnm_file);
+ ret = fgetc (pnm_file);
if (ret == '#')
{
/* the rest of this line is a comment */
do
{
- ret = fgetc(pnm_file);
+ ret = fgetc (pnm_file);
}
while ((ret != '\n') && (ret != '\r') && (ret != EOF));
}
if (ret == EOF) break;
- token[i] = (unsigned char) ret;
+ token_buf[i] = (char) ret;
}
- while ((token[i] == '\n') || (token[i] == '\r') || (token[i] == ' '));
+ while ((ret == '\n') || (ret == '\r') || (ret == ' '));
/* read string */
do
{
- ret = fgetc(pnm_file);
+ ret = fgetc (pnm_file);
if (ret == EOF) break;
- i++;
- token[i] = (unsigned char) ret;
+ if (++i == token_buf_size - 1) break;
+ token_buf[i] = (char) ret;
}
- while ((token[i] != '\n') && (token[i] != '\r') && (token[i] != ' '));
+ while ((ret != '\n') && (ret != '\r') && (ret != ' '));
- token[i] = '\0';
+ token_buf[i] = '\0';
return;
}
/*
- * get_data() - takes first byte and converts into next pixel value,
- * taking as much bits as defined by bit-depth and
- * using the bit-depth to fill up a byte (0Ah -> AAh)
+ * get_data - takes first byte and converts into next pixel value,
+ * taking as much bits as defined by bit-depth and
+ * using the bit-depth to fill up a byte (0Ah -> AAh)
*/
png_uint_32 get_data (FILE *pnm_file, int depth)
@@ -605,14 +588,14 @@ png_uint_32 get_data (FILE *pnm_file, int depth)
}
/*
- * get_value() - takes first (numeric) string and converts into number,
- * using the bit-depth to fill up a byte (0Ah -> AAh)
+ * get_value - takes first (numeric) string and converts into number,
+ * using the bit-depth to fill up a byte (0Ah -> AAh)
*/
png_uint_32 get_value (FILE *pnm_file, int depth)
{
static png_uint_32 mask = 0;
- png_byte token[16];
+ char token[16];
unsigned long ul_ret_value;
png_uint_32 ret_value;
int i = 0;
@@ -621,8 +604,8 @@ png_uint_32 get_value (FILE *pnm_file, int depth)
for (i = 0; i < depth; i++)
mask = (mask << 1) | 0x01;
- get_token (pnm_file, (char *) token);
- sscanf ((const char *) token, "%lu", &ul_ret_value);
+ get_token (pnm_file, token, sizeof (token));
+ sscanf (token, "%lu", &ul_ret_value);
ret_value = (png_uint_32) ul_ret_value;
ret_value &= mask;
@@ -635,4 +618,3 @@ png_uint_32 get_value (FILE *pnm_file, int depth)
}
/* end of source */
-
diff --git a/contrib/pngminus/pnm2png.sh b/contrib/pngminus/pnm2png.sh
index d79df2fae..2ad17a608 100755
--- a/contrib/pngminus/pnm2png.sh
+++ b/contrib/pngminus/pnm2png.sh
@@ -8,7 +8,7 @@
# -- full-color
./pnm2png basn2c08.ppm basn2c08.png
./pnm2png basn2c16.ppm basn2c16.png
-# -- palletted
+# -- paletted
./pnm2png basn3p01.ppm basn3p01.png
./pnm2png basn3p02.ppm basn3p02.png
./pnm2png basn3p04.ppm basn3p04.png
@@ -28,7 +28,7 @@
# -- full-color
./pnm2png rawn2c08.ppm rawn2c08.png
./pnm2png rawn2c16.ppm rawn2c16.png
-# -- palletted
+# -- paletted
./pnm2png rawn3p01.ppm rawn3p01.png
./pnm2png rawn3p02.ppm rawn3p02.png
./pnm2png rawn3p04.ppm rawn3p04.png
diff --git a/contrib/pngsuite/README b/contrib/pngsuite/README
index 53ba5c8f7..d236b02e7 100644
--- a/contrib/pngsuite/README
+++ b/contrib/pngsuite/README
@@ -16,6 +16,8 @@ chunks, etc.
The "ft*.png" images are "free/libre" replacements for the transparent
corresponding t*.png images in the PngSuite.
+The "i*.png" images are the same images, but interlaced.
+
The images in this directory represent the basic PNG color-types:
grayscale (1-16 bit deep), full color (8 or 16 bit), paletted
(1-8 bit) and grayscale or color images with alpha channel. You
diff --git a/contrib/pngsuite/bad_interlace_conversions.txt b/contrib/pngsuite/bad_interlace_conversions.txt
new file mode 100644
index 000000000..8afbde790
--- /dev/null
+++ b/contrib/pngsuite/bad_interlace_conversions.txt
@@ -0,0 +1,9 @@
+basn0g01.png
+basn0g02.png
+basn0g04.png
+basn3p01.png
+basn3p02.png
+basn3p04.png
+ftbbn0g01.png
+ftbbn0g02.png
+ftbbn0g04.png
diff --git a/contrib/pngsuite/ibasn0g08.png b/contrib/pngsuite/ibasn0g08.png
new file mode 100644
index 000000000..90b5305e6
--- /dev/null
+++ b/contrib/pngsuite/ibasn0g08.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn0g16.png b/contrib/pngsuite/ibasn0g16.png
new file mode 100644
index 000000000..c82f230ee
--- /dev/null
+++ b/contrib/pngsuite/ibasn0g16.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn2c08.png b/contrib/pngsuite/ibasn2c08.png
new file mode 100644
index 000000000..05d468885
--- /dev/null
+++ b/contrib/pngsuite/ibasn2c08.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn2c16.png b/contrib/pngsuite/ibasn2c16.png
new file mode 100644
index 000000000..399f1be5e
--- /dev/null
+++ b/contrib/pngsuite/ibasn2c16.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn3p08.png b/contrib/pngsuite/ibasn3p08.png
new file mode 100644
index 000000000..6df8370aa
--- /dev/null
+++ b/contrib/pngsuite/ibasn3p08.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn4a08.png b/contrib/pngsuite/ibasn4a08.png
new file mode 100644
index 000000000..bda8e3c65
--- /dev/null
+++ b/contrib/pngsuite/ibasn4a08.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn4a16.png b/contrib/pngsuite/ibasn4a16.png
new file mode 100644
index 000000000..500f9128e
--- /dev/null
+++ b/contrib/pngsuite/ibasn4a16.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn6a08.png b/contrib/pngsuite/ibasn6a08.png
new file mode 100644
index 000000000..258f94050
--- /dev/null
+++ b/contrib/pngsuite/ibasn6a08.png
Binary files differ
diff --git a/contrib/pngsuite/ibasn6a16.png b/contrib/pngsuite/ibasn6a16.png
new file mode 100644
index 000000000..e4de69fef
--- /dev/null
+++ b/contrib/pngsuite/ibasn6a16.png
Binary files differ
diff --git a/contrib/pngsuite/iftbbn2c16.png b/contrib/pngsuite/iftbbn2c16.png
new file mode 100644
index 000000000..64a9cdf2f
--- /dev/null
+++ b/contrib/pngsuite/iftbbn2c16.png
Binary files differ
diff --git a/contrib/pngsuite/iftbbn3p08.png b/contrib/pngsuite/iftbbn3p08.png
new file mode 100644
index 000000000..47d6eeb3c
--- /dev/null
+++ b/contrib/pngsuite/iftbbn3p08.png
Binary files differ
diff --git a/contrib/pngsuite/iftbgn2c16.png b/contrib/pngsuite/iftbgn2c16.png
new file mode 100644
index 000000000..64a9cdf2f
--- /dev/null
+++ b/contrib/pngsuite/iftbgn2c16.png
Binary files differ
diff --git a/contrib/pngsuite/iftbgn3p08.png b/contrib/pngsuite/iftbgn3p08.png
new file mode 100644
index 000000000..47d6eeb3c
--- /dev/null
+++ b/contrib/pngsuite/iftbgn3p08.png
Binary files differ
diff --git a/contrib/pngsuite/iftbrn2c08.png b/contrib/pngsuite/iftbrn2c08.png
new file mode 100644
index 000000000..08ebbae2c
--- /dev/null
+++ b/contrib/pngsuite/iftbrn2c08.png
Binary files differ
diff --git a/contrib/pngsuite/iftbwn0g16.png b/contrib/pngsuite/iftbwn0g16.png
new file mode 100644
index 000000000..4b7537e30
--- /dev/null
+++ b/contrib/pngsuite/iftbwn0g16.png
Binary files differ
diff --git a/contrib/pngsuite/iftbwn3p08.png b/contrib/pngsuite/iftbwn3p08.png
new file mode 100644
index 000000000..47d6eeb3c
--- /dev/null
+++ b/contrib/pngsuite/iftbwn3p08.png
Binary files differ
diff --git a/contrib/pngsuite/iftbyn3p08.png b/contrib/pngsuite/iftbyn3p08.png
new file mode 100644
index 000000000..47d6eeb3c
--- /dev/null
+++ b/contrib/pngsuite/iftbyn3p08.png
Binary files differ
diff --git a/contrib/pngsuite/iftp0n0g08.png b/contrib/pngsuite/iftp0n0g08.png
new file mode 100644
index 000000000..aa826b863
--- /dev/null
+++ b/contrib/pngsuite/iftp0n0g08.png
Binary files differ
diff --git a/contrib/pngsuite/iftp0n2c08.png b/contrib/pngsuite/iftp0n2c08.png
new file mode 100644
index 000000000..b12bd0a7f
--- /dev/null
+++ b/contrib/pngsuite/iftp0n2c08.png
Binary files differ
diff --git a/contrib/pngsuite/iftp0n3p08.png b/contrib/pngsuite/iftp0n3p08.png
new file mode 100644
index 000000000..37aa0cb0d
--- /dev/null
+++ b/contrib/pngsuite/iftp0n3p08.png
Binary files differ
diff --git a/contrib/pngsuite/iftp1n3p08.png b/contrib/pngsuite/iftp1n3p08.png
new file mode 100644
index 000000000..47d6eeb3c
--- /dev/null
+++ b/contrib/pngsuite/iftp1n3p08.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/README b/contrib/pngsuite/interlaced/README
new file mode 100644
index 000000000..f171eee01
--- /dev/null
+++ b/contrib/pngsuite/interlaced/README
@@ -0,0 +1,2 @@
+
+These images fail the "pngimage-quick" and "pngimage-full" tests.
diff --git a/contrib/pngsuite/interlaced/ibasn0g01.png b/contrib/pngsuite/interlaced/ibasn0g01.png
new file mode 100644
index 000000000..828fa7603
--- /dev/null
+++ b/contrib/pngsuite/interlaced/ibasn0g01.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/ibasn0g02.png b/contrib/pngsuite/interlaced/ibasn0g02.png
new file mode 100644
index 000000000..7fc17e3a1
--- /dev/null
+++ b/contrib/pngsuite/interlaced/ibasn0g02.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/ibasn0g04.png b/contrib/pngsuite/interlaced/ibasn0g04.png
new file mode 100644
index 000000000..1beade28f
--- /dev/null
+++ b/contrib/pngsuite/interlaced/ibasn0g04.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/ibasn3p01.png b/contrib/pngsuite/interlaced/ibasn3p01.png
new file mode 100644
index 000000000..f91e7233e
--- /dev/null
+++ b/contrib/pngsuite/interlaced/ibasn3p01.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/ibasn3p02.png b/contrib/pngsuite/interlaced/ibasn3p02.png
new file mode 100644
index 000000000..0f9ce76e6
--- /dev/null
+++ b/contrib/pngsuite/interlaced/ibasn3p02.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/ibasn3p04.png b/contrib/pngsuite/interlaced/ibasn3p04.png
new file mode 100644
index 000000000..b2ca72074
--- /dev/null
+++ b/contrib/pngsuite/interlaced/ibasn3p04.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/iftbbn0g01.png b/contrib/pngsuite/interlaced/iftbbn0g01.png
new file mode 100644
index 000000000..6eb27d10e
--- /dev/null
+++ b/contrib/pngsuite/interlaced/iftbbn0g01.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/iftbbn0g02.png b/contrib/pngsuite/interlaced/iftbbn0g02.png
new file mode 100644
index 000000000..46ba49777
--- /dev/null
+++ b/contrib/pngsuite/interlaced/iftbbn0g02.png
Binary files differ
diff --git a/contrib/pngsuite/interlaced/iftbbn0g04.png b/contrib/pngsuite/interlaced/iftbbn0g04.png
new file mode 100644
index 000000000..e9db0ad50
--- /dev/null
+++ b/contrib/pngsuite/interlaced/iftbbn0g04.png
Binary files differ
diff --git a/contrib/powerpc-vsx/README b/contrib/powerpc-vsx/README
index e566147ea..4970a52c6 100644
--- a/contrib/powerpc-vsx/README
+++ b/contrib/powerpc-vsx/README
@@ -46,7 +46,7 @@ everything should be static. It must define the function:
static int png_have_vsx(png_structp png_ptr);
-That function must return 1 if ARM NEON instructions are supported, 0 if not.
+That function must return 1 if POWERPC_VSX instructions are supported, 0 if not.
It must not execute png_error unless it detects a bug. A png_error will prevent
the reading of the PNG and in the future, writing too.
diff --git a/contrib/powerpc-vsx/linux.c b/contrib/powerpc-vsx/linux.c
index 32ed9d749..d861b2826 100644
--- a/contrib/powerpc-vsx/linux.c
+++ b/contrib/powerpc-vsx/linux.c
@@ -2,7 +2,6 @@
*
* Copyright (c) 2017 Glenn Randers-Pehrson
* Written by Vadim Barkov, 2017.
- * Last changed in libpng 1.6.29 [March 16, 2017]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -12,7 +11,7 @@
* BUG REPORTS: png-mng-implement@sourceforge.net
*
* png_have_vsx implemented for Linux by reading the widely available
- * pseudo-file /proc/cpuinfo.
+ * pseudo-file /proc/cpuinfo.
*
* This code is strict ANSI-C and is probably moderately portable; it does
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
diff --git a/contrib/powerpc-vsx/linux_aux.c b/contrib/powerpc-vsx/linux_aux.c
index 796922d77..6ec048e80 100644
--- a/contrib/powerpc-vsx/linux_aux.c
+++ b/contrib/powerpc-vsx/linux_aux.c
@@ -2,7 +2,6 @@
*
* Copyright (c) 2017 Glenn Randers-Pehrson
* Written by Vadim Barkov, 2017.
- * Last changed in libpng 1.6.29 [March 16, 2017]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -23,14 +22,12 @@
static int
png_have_vsx(png_structp png_ptr)
{
-
- const unsigned long auxv = getauxval( AT_HWCAP );
+ unsigned long auxv = getauxval(AT_HWCAP);
PNG_UNUSED(png_ptr)
- if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX ))
+ if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX))
return 1;
else
return 0;
}
-
diff --git a/contrib/testpngs/makepngs.sh b/contrib/testpngs/makepngs.sh
index 059503e23..270f0630a 100755
--- a/contrib/testpngs/makepngs.sh
+++ b/contrib/testpngs/makepngs.sh
@@ -1,12 +1,10 @@
#!/bin/sh
-#
+
# Make a set of test PNG files, MAKEPNG is the name of the makepng executable
# built from contrib/libtests/makepng.c
# Copyright (c) 2015 John Cunningham Bowler
-# Last changed in libpng 1.6.20 [December 3, 2015]
-
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
@@ -74,7 +72,7 @@ case "$1" in
--coverage)
# Comments below indicate cases known to be required and not duplicated
# in other (required) cases; the aim is to get a minimal set that gives
- # the maxium code coverage.
+ # the maximum code coverage.
mpg none gray-alpha 8 # required: code coverage, sRGB opaque component
mpg none palette 8 # required: basic palette read
mpg 1.8 gray 2 # required: tests gamma threshold code
diff --git a/contrib/tools/checksum-icc.c b/contrib/tools/checksum-icc.c
index 581e7088a..83e1f9a43 100644
--- a/contrib/tools/checksum-icc.c
+++ b/contrib/tools/checksum-icc.c
@@ -2,8 +2,6 @@
*
* Copyright (c) 2013 John Cunningham Bowler
*
- * Last changed in libpng 1.6.0 [February 14, 2013]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -11,8 +9,8 @@
* Generate crc32 and adler32 checksums of the given input files, used to
* generate check-codes for use when matching ICC profiles within libpng.
*/
-#include <stdio.h>
+#include <stdio.h>
#include <zlib.h>
static int
diff --git a/contrib/tools/chkfmt b/contrib/tools/chkfmt.sh
index a1b88ccbf..8810aa7b5 100755
--- a/contrib/tools/chkfmt
+++ b/contrib/tools/chkfmt.sh
@@ -1,21 +1,28 @@
#!/bin/sh
-# chkfmt
+# chkfmt.sh
#
-# COPYRIGHT: Written by John Cunningham Bowler, 2010.
+# COPYRIGHT:
+# Written by John Cunningham Bowler, 2010.
+# Revised by Cosmin Truta, 2022.
# 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.
+# related or neighboring rights to this work. The author published this work
+# from the United States.
#
-# Check the format of the source files in the current directory - checks for a
-# line length of 80 characters max and no tab characters.
+# Check the format of the source files in the current directory:
+#
+# * The lines should not exceed a predefined maximum length.
+# * Tab characters should appear only where necessary (e.g. in makefiles).
#
# Optionally arguments are files or directories to check.
#
-# -v: output the long lines (makes fixing them easier)
-# -e: spawn an editor for each file that needs a change ($EDITOR must be
-# defined). When using -e the script MUST be run from an interactive
-# command line.
+# -v: output the long lines (makes fixing them easier)
+# -e: spawn an editor for each file that needs a change ($EDITOR must be
+# defined). When using -e the script MUST be run from an interactive
+# command line.
+
+script_name=`basename "$0"`
+
verbose=
edit=
vers=
@@ -32,14 +39,14 @@ test "$1" = "-e" && {
# Copy the standard streams for the editor
exec 3>&0 4>&1 5>&2
else
- echo "chkfmt -e: EDITOR must be defined" >&2
+ echo "$script_name -e: EDITOR must be defined" >&2
exit 1
fi
}
# Function to edit a single file - if the file isn't changed ask the user
-# whether or not to continue. This stuff only works if the script is run from
-# the command line (otherwise, don't specify -e or you will be sorry).
+# whether or not to continue. This stuff only works if the script is run
+# from the command line (otherwise, don't specify -e or you will be sorry).
doed(){
cp "$file" "$file".orig
"$EDITOR" "$file" 0>&3 1>&4 2>&5 3>&- 4>&- 5>&- || exit 1
@@ -53,19 +60,22 @@ doed(){
return 0
}
-# In beta versions the version string which appears in files can be a little
-# long and cause spuriously overlong lines. To avoid this subtitute the version
-# string with a 'standard' version a.b.cc before checking for long lines.
+# In beta versions, the version string which appears in files can be a little
+# long and cause spuriously overlong lines. To avoid this, substitute the
+# version string with a placeholder string "a.b.cc" before checking for long
+# lines.
+# (Starting from libpng version 1.6.36, we switched to a conventional Git
+# workflow, and we are no longer publishing beta versions.)
if test -r png.h
then
vers="`sed -n -e \
's/^#define PNG_LIBPNG_VER_STRING .\([0-9]\.[0-9]\.[0-9][0-9a-z]*\).$/\1/p' \
png.h`"
- echo "chkfmt: checking version $vers"
+ echo "$script_name: checking version $vers"
fi
if test -z "$vers"
then
- echo "chkfmt: png.h not found, ignoring version number" >&2
+ echo "$script_name: png.h not found, ignoring version number" >&2
fi
test -n "$1" || set -- .
@@ -89,13 +99,16 @@ find "$@" \( -type d \( -name '.git' -o -name '.libs' -o -name 'projects' \) \
check_tabs=
line_length=100;;
*.awk)
- # Includes literal tabs
+ # Allow literal tabs.
check_tabs=
- # The following is arbitrary
+ # Mainframe line printer, anyone?
line_length=132;;
+ */ci_*.sh)
+ check_tabs=yes
+ line_length=100;;
*contrib/*/*.[ch])
check_tabs=yes
- line_length=96;;
+ line_length=100;;
*)
check_tabs=yes
line_length=80;;
diff --git a/contrib/tools/cvtcolor.c b/contrib/tools/cvtcolor.c
index e6793c7d5..111dfcee7 100644
--- a/contrib/tools/cvtcolor.c
+++ b/contrib/tools/cvtcolor.c
@@ -1,7 +1,4 @@
-/*-
- * convert.c
- *
- * Last changed in libpng 1.6.0 [February 14, 2013]
+/* convert.c
*
* COPYRIGHT: Written by John Cunningham Bowler, 2013.
* To the extent possible under law, the author has waived all copyright and
@@ -10,6 +7,7 @@
*
* Convert 8-bit sRGB or 16-bit linear values to another format.
*/
+
#define _ISOC99_SOURCE 1
#include <stdlib.h>
diff --git a/contrib/tools/genpng.c b/contrib/tools/genpng.c
index 0b3f98196..c43bea906 100644
--- a/contrib/tools/genpng.c
+++ b/contrib/tools/genpng.c
@@ -1,4 +1,4 @@
-/*- genpng
+/* genpng
*
* COPYRIGHT: Written by John Cunningham Bowler, 2015.
* Revised by Glenn Randers-Pehrson, 2017, to add buffer-size check.
@@ -69,6 +69,7 @@
* joins are mitres; the outside of the lines are continued to the point of
* intersection.
*/
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
@@ -453,7 +454,7 @@ check_square(const struct arg *arg, double x, double y)
* { inside_circle_filled, check_circle_filled },
* { inside_circle, check_circle }
*
- * The functions here are analoguous to the square ones; however, they check
+ * The functions here are analogous to the square ones; however, they check
* the corresponding ellipse as opposed to the rectangle.
*/
static int
diff --git a/contrib/tools/intgamma.sh b/contrib/tools/intgamma.sh
index 41c5d6dd2..3198cb241 100755
--- a/contrib/tools/intgamma.sh
+++ b/contrib/tools/intgamma.sh
@@ -1,13 +1,11 @@
#!/bin/sh
-#
+
# intgamma.sh
#
-# Last changed in libpng 1.6.0 [February 14, 2013]
-#
# COPYRIGHT: Written by John Cunningham Bowler, 2013.
# 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.
+# related or neighboring rights to this work. The author published this work
+# from the United States.
#
# Shell script to generate png.c 8-bit and 16-bit log tables (see the code in
# png.c for details).
@@ -17,10 +15,10 @@
# (0..255) value and a similar table for the exponent calculation.
#
# "bc" must be on the path when the script is executed, and the math library
-# (-lm) must be available
-#
-# function to print out a list of numbers as integers; the function truncates
-# the integers which must be one-per-line
+# (-lm) must be available.
+
+# Function to print out a list of numbers as integers; the function truncates
+# the integers which must be one-per-line.
function print(){
awk 'BEGIN{
str = ""
diff --git a/contrib/tools/makesRGB.c b/contrib/tools/makesRGB.c
index e66c9f157..5ef3ddf99 100644
--- a/contrib/tools/makesRGB.c
+++ b/contrib/tools/makesRGB.c
@@ -1,7 +1,5 @@
/* makesRGB.c -- build sRGB-to-linear and linear-to-sRGB conversion tables
*
- * Last changed in libpng 1.6.0 [February 14, 2013]
- *
* COPYRIGHT: Written by John Cunningham Bowler, 2013.
* 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:
@@ -14,6 +12,7 @@
* approximation to the 8-bit sRGB encoded value. Calculate the error in these
* tables and display it.
*/
+
#define _C99_SOURCE 1
#include <stdio.h>
#include <math.h>
@@ -388,7 +387,7 @@ main(int argc, char **argv)
if (!test_only)
{
- printf("PNG_CONST png_uint_16 png_sRGB_table[256] =\n{\n ");
+ printf("const png_uint_16 png_sRGB_table[256] =\n{\n ");
for (i=0; i<255; )
{
do
@@ -401,7 +400,7 @@ main(int argc, char **argv)
printf("%d\n};\n\n", png_sRGB_table[i]);
- printf("PNG_CONST png_uint_16 png_sRGB_base[512] =\n{\n ");
+ printf("const png_uint_16 png_sRGB_base[512] =\n{\n ");
for (i=0; i<511; )
{
do
@@ -413,7 +412,7 @@ main(int argc, char **argv)
}
printf("%d\n};\n\n", png_sRGB_base[i]);
- printf("PNG_CONST png_byte png_sRGB_delta[512] =\n{\n ");
+ printf("const png_byte png_sRGB_delta[512] =\n{\n ");
for (i=0; i<511; )
{
do
diff --git a/contrib/tools/png-fix-itxt.c b/contrib/tools/png-fix-itxt.c
index c7654c113..b8286b9e5 100644
--- a/contrib/tools/png-fix-itxt.c
+++ b/contrib/tools/png-fix-itxt.c
@@ -1,8 +1,6 @@
-
-/* png-fix-itxt version 1.0.0
+/* png-fix-itxt
*
* Copyright 2015 Glenn Randers-Pehrson
- * Last changed in libpng 1.6.18 [July 23, 2015]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -10,7 +8,7 @@
*
* Usage:
*
- * png-fix-itxt.exe < bad.png > good.png
+ * png-fix-itxt < bad.png > good.png
*
* Fixes a PNG file written with libpng-1.6.0 or 1.6.1 that has one or more
* uncompressed iTXt chunks. Assumes that the actual length is greater
diff --git a/contrib/tools/pngcp.c b/contrib/tools/pngcp.c
index e82dddccc..579e28d2b 100644
--- a/contrib/tools/pngcp.c
+++ b/contrib/tools/pngcp.c
@@ -1,8 +1,6 @@
/* pngcp.c
*
- * Copyright (c) 2016 John Cunningham Bowler
- *
- * Last changed in libpng 1.6.24 [August 4, 2016]
+ * Copyright (c) 2016,2022 John Cunningham Bowler
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -14,7 +12,12 @@
*
* For a more extensive example that uses the transforms see
* contrib/libtests/pngimage.c in the libpng distribution.
+ *
+ * This code is not intended for installation in a release system; the command
+ * line options are not documented and most of the behavior is intended for
+ * testing libpng performance, both speed and compression.
*/
+
#include "pnglibconf.h" /* To find how libpng was configured. */
#ifdef PNG_PNGCP_TIMING_SUPPORTED
@@ -191,7 +194,7 @@ vl_strategy[] =
/* This controls the order of search. */
{ "huffman", Z_HUFFMAN_ONLY },
{ "RLE", Z_RLE },
- { "fixed", Z_FIXED }, /* the remainder do window searchs */
+ { "fixed", Z_FIXED }, /* the remainder do window searches */
{ "filtered", Z_FILTERED },
{ "default", Z_DEFAULT_STRATEGY },
{ all, 0 }
@@ -336,7 +339,7 @@ static const option options[] =
# define VLC(name) VLCIDAT(name) VLCiCCP(name) VLCzTXt(name)
# ifdef PNG_SW_COMPRESS_png_level
- /* The libpng compression level isn't searched beause it justs sets the
+ /* The libpng compression level isn't searched because it just sets the
* other things that are searched!
*/
VLO("compression", compression, 0)
@@ -503,10 +506,10 @@ display_init(struct display *dp)
}
static void
-display_clean_read(struct display *dp)
+display_clean_read(struct display *dp, int freeinfo)
{
if (dp->read_pp != NULL)
- png_destroy_read_struct(&dp->read_pp, NULL, NULL);
+ png_destroy_read_struct(&dp->read_pp, freeinfo ? &dp->ip : NULL, NULL);
if (dp->fp != NULL)
{
@@ -517,7 +520,7 @@ display_clean_read(struct display *dp)
}
static void
-display_clean_write(struct display *dp)
+display_clean_write(struct display *dp, int freeinfo)
{
if (dp->fp != NULL)
{
@@ -527,14 +530,14 @@ display_clean_write(struct display *dp)
}
if (dp->write_pp != NULL)
- png_destroy_write_struct(&dp->write_pp, dp->tsp > 0 ? NULL : &dp->ip);
+ png_destroy_write_struct(&dp->write_pp, freeinfo ? &dp->ip : NULL);
}
static void
display_clean(struct display *dp)
{
- display_clean_read(dp);
- display_clean_write(dp);
+ display_clean_read(dp, 1/*freeinfo*/);
+ display_clean_write(dp, 1/*freeinfo*/);
dp->output_file = NULL;
# if PNG_LIBPNG_VER < 10700 && defined PNG_TEXT_SUPPORTED
@@ -735,7 +738,7 @@ option_index(struct display *dp, const char *opt, size_t len)
static int
get_option(struct display *dp, const char *opt, int *value)
{
- const png_byte i = option_index(dp, opt, strlen(opt));
+ png_byte i = option_index(dp, opt, strlen(opt));
if (dp->entry[i]) /* option was set on command line */
{
@@ -778,7 +781,7 @@ static void
set_opt_string(struct display *dp, unsigned int sp)
/* Add the appropriate option string to dp->curr. */
{
- dp->stack[sp].opt_string_end = set_opt_string_(dp, sp, dp->stack[sp].opt,
+ dp->stack[sp].opt_string_end = set_opt_string_(dp, sp, dp->stack[sp].opt,
options[dp->stack[sp].opt].values[dp->stack[sp].entry].name);
}
@@ -789,7 +792,7 @@ record_opt(struct display *dp, png_byte opt, const char *entry_name)
* numerical value.
*/
{
- const unsigned int sp = dp->csp; /* stack entry of next searched option */
+ unsigned int sp = dp->csp; /* stack entry of next searched option */
if (sp >= dp->tsp)
{
@@ -797,7 +800,7 @@ record_opt(struct display *dp, png_byte opt, const char *entry_name)
* searched entry or the start of the dp->curr buffer if there is nothing
* on the stack yet (sp == 0).
*/
- const int offset = set_opt_string_(dp, sp, opt, entry_name);
+ int offset = set_opt_string_(dp, sp, opt, entry_name);
if (sp > 0)
dp->stack[sp-1].opt_string_end = offset;
@@ -1222,7 +1225,7 @@ advance_opt(struct display *dp, png_byte opt, int search)
}
static int
-getallopts_(struct display *dp, const png_byte opt, int *value, int record)
+getallopts_(struct display *dp, png_byte opt, int *value, int record)
/* Like getop but iterate over all the values if the option was set to "all".
*/
{
@@ -1259,7 +1262,7 @@ getsearchopts(struct display *dp, const char *opt_str, int *value)
/* As above except that if the option was not set try a search */
{
png_byte istrat;
- const png_byte opt = option_index(dp, opt_str, strlen(opt_str));
+ png_byte opt = option_index(dp, opt_str, strlen(opt_str));
int record = options[opt].search;
const char *entry_name;
@@ -1725,7 +1728,7 @@ display_start_read(struct display *dp, const char *filename)
}
static void PNGCBAPI
-read_function(png_structp pp, png_bytep data, png_size_t size)
+read_function(png_structp pp, png_bytep data, size_t size)
{
struct display *dp = get_dp(pp);
@@ -1745,7 +1748,17 @@ read_function(png_structp pp, png_bytep data, png_size_t size)
static void
read_png(struct display *dp, const char *filename)
{
- display_clean_read(dp); /* safety */
+ /* This is an assumption of the code; it may happen if a previous write fails
+ * and there is a bug in the cleanup handling below (look for setjmp).
+ * Passing freeinfo==1 to display_clean_read below avoids a second error
+ * on dp->ip != NULL below.
+ */
+ if (dp->read_pp != NULL)
+ {
+ display_log(dp, APP_FAIL, "unexpected png_read_struct");
+ display_clean_read(dp, 1/*freeinfo*/); /* recovery */
+ }
+
display_start_read(dp, filename);
dp->read_pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, dp,
@@ -1769,6 +1782,13 @@ read_png(struct display *dp, const char *filename)
png_set_check_for_invalid_index(dp->read_pp, -1/*off completely*/);
# endif /* IGNORE_INDEX */
+ if (dp->ip != NULL)
+ {
+ /* UNEXPECTED: some problem in the display_clean function calls! */
+ display_log(dp, APP_FAIL, "read_png: freeing old info struct");
+ png_destroy_info_struct(dp->read_pp, &dp->ip);
+ }
+
/* The png_read_png API requires us to make the info struct, but it does the
* call to png_read_info.
*/
@@ -1848,7 +1868,14 @@ read_png(struct display *dp, const char *filename)
}
#endif /* FIX_INDEX */
- display_clean_read(dp);
+ /* NOTE: dp->ip is where all the information about the PNG that was just read
+ * is stored. It can be used to write and write again a single PNG file,
+ * however be aware that prior to libpng 1.7 text chunks could only be
+ * written once; this is a bug which would require a significant code rewrite
+ * to fix, it has been there in several versions of libpng (it was introduced
+ * to fix another bug involving duplicate writes of the text chunks.)
+ */
+ display_clean_read(dp, 0/*freeiinfo*/);
dp->operation = "none";
}
@@ -1881,7 +1908,7 @@ display_start_write(struct display *dp, const char *filename)
}
static void PNGCBAPI
-write_function(png_structp pp, png_bytep data, png_size_t size)
+write_function(png_structp pp, png_bytep data, size_t size)
{
struct display *dp = get_dp(pp);
@@ -1975,7 +2002,21 @@ set_text_compression(struct display *dp)
static void
write_png(struct display *dp, const char *destname)
{
- display_clean_write(dp); /* safety */
+ /* If this test fails png_write_png would fail *silently* below; this
+ * is not helpful, so catch the problem now and give up:
+ */
+ if (dp->ip == NULL)
+ display_log(dp, INTERNAL_ERROR, "missing png_info");
+
+ /* This is an assumption of the code; it may happen if a previous
+ * write fails and there is a bug in the cleanup handling below.
+ */
+ if (dp->write_pp != NULL)
+ {
+ display_log(dp, APP_FAIL, "unexpected png_write_struct");
+ display_clean_write(dp, 0/*!freeinfo*/);
+ }
+
display_start_write(dp, destname);
dp->write_pp = png_create_write_struct(PNG_LIBPNG_VER_STRING, dp,
@@ -2073,10 +2114,6 @@ write_png(struct display *dp, const char *destname)
destname == NULL ? "stdout" : destname, strerror(errno));
}
- /* Clean it on the way out - if control returns to the caller then the
- * written_file contains the required data.
- */
- display_clean_write(dp);
dp->operation = "none";
}
@@ -2117,7 +2154,7 @@ better_options(const struct display *dp)
*
* This function looks through the stack from the bottom up looking for an
* option that does not match the current best value. When it finds one it
- * checks to see if it is more or less desireable and returns true or false
+ * checks to see if it is more or less desirable and returns true or false
* as appropriate.
*
* Notice that this means that the order options are pushed onto the stack
@@ -2220,7 +2257,7 @@ cp_one_file(struct display *dp, const char *filename, const char *destname)
strcpy(dp->best, dp->curr);
dp->best_size = dp->write_size;
- if (dp->nsp > 0) /* interating over lists */
+ if (dp->nsp > 0) /* iterating over lists */
{
char *tmpname, tmpbuf[(sizeof dp->namebuf) + 4];
assert(dp->curr[0] == ' ' && dp->tsp > 0);
@@ -2243,6 +2280,10 @@ cp_one_file(struct display *dp, const char *filename, const char *destname)
/* Loop to find the best option. */
do
{
+ /* Clean before each write_png; this just removes *dp->write_pp which
+ * cannot be reused.
+ */
+ display_clean_write(dp, 0/*!freeinfo*/);
write_png(dp, tmpname);
/* And compare the sizes (the write function makes sure write_size
@@ -2272,6 +2313,8 @@ cp_one_file(struct display *dp, const char *filename, const char *destname)
/* Do this for the 'sizes' option so that it reports the correct size. */
dp->write_size = dp->best_size;
}
+
+ display_clean_write(dp, 1/*freeinfo*/);
}
static int
@@ -2302,7 +2345,7 @@ cppng(struct display *dp, const char *file, const char *gv dest)
}
int
-main(const int argc, const char * const * const argv)
+main(int argc, char **argv)
{
/* For each file on the command line test it with a range of transforms */
int option_end;
@@ -2379,7 +2422,7 @@ main(const int argc, const char * const * const argv)
/* Here on any return, including failures, except user/internal issues
*/
{
- const int pass = (d.options & STRICT) ?
+ int pass = (d.options & STRICT) ?
RESULT_STRICT(d.results) : RESULT_RELAXED(d.results);
if (!pass)
diff --git a/contrib/tools/pngfix.c b/contrib/tools/pngfix.c
index 69ffc170e..cdf3f1cb4 100644
--- a/contrib/tools/pngfix.c
+++ b/contrib/tools/pngfix.c
@@ -1,6 +1,5 @@
/* pngfix.c
*
- * Last changed in libpng 1.6.31 [July 27, 2017]
* Copyright (c) 2014-2017 John Cunningham Bowler
*
* This code is released under the libpng license.
@@ -10,6 +9,7 @@
* Tool to check and fix the zlib inflate 'too far back' problem.
* See the usage message for more information.
*/
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -772,7 +772,7 @@ skip_chunk_type(const struct global *global, png_uint_32 type)
return 0;
/* Chunks that specify gamma encoding which should therefore only be
- * removed the the user insists:
+ * removed if the user insists:
*/
case png_gAMA: case png_sRGB:
if (global->skip >= SKIP_ALL)
@@ -867,7 +867,7 @@ struct file
* signature (in length,type).
*
* When a chunk control structure is instantiated these values are copied
- * into the structure and can then be overritten with the data for the next
+ * into the structure and can then be overwritten with the data for the next
* chunk.
*/
fpos_t data_pos; /* Position of first byte of chunk data */
@@ -1598,7 +1598,7 @@ chunk_init(struct chunk * const chunk, struct file * const file)
chunk->chunk_length = file->length;
chunk->chunk_type = file->type;
- /* Compresssed/uncompressed size information (from the zlib control structure
+ /* Compressed/uncompressed size information (from the zlib control structure
* that is used to check the compressed data in a chunk.)
*/
chunk->uncompressed_digits = 0;
@@ -2363,7 +2363,7 @@ zlib_advance(struct zlib *zlib, png_uint_32 nbytes)
flush = Z_NO_FLUSH;
out_bytes = 0;
- /* NOTE: expression 3 is only evaluted on 'continue', because of the
+ /* NOTE: expression 3 is only evaluated on 'continue', because of the
* 'break' at the end of this loop below.
*/
for (;endrc == ZLIB_OK;
@@ -2514,7 +2514,7 @@ zlib_run(struct zlib *zlib)
*/
for (;;)
{
- const unsigned int count = list->count;
+ unsigned int count = list->count;
unsigned int i;
for (i = 0; i<count; ++i)
@@ -2664,7 +2664,7 @@ zlib_check(struct file *file, png_uint_32 offset)
* this case, so do the optimization anyway.
*/
if (zlib.cksum)
- chunk_message(zlib.chunk, "zlib checkum");
+ chunk_message(zlib.chunk, "zlib checksum");
break;
@@ -2791,7 +2791,7 @@ process_chunk(struct file *file, png_uint_32 file_crc, png_uint_32 next_length,
* to read_chunk.
*/
{
- const png_uint_32 type = file->type;
+ png_uint_32 type = file->type;
if (file->global->verbose > 1)
{
@@ -2929,7 +2929,7 @@ process_chunk(struct file *file, png_uint_32 file_crc, png_uint_32 next_length,
}
/* Control reaches this point if the chunk must be skipped. For chunks other
- * than IDAT this means that the zlib compressed data is fatally damanged and
+ * than IDAT this means that the zlib compressed data is fatally damaged and
* the chunk will not be passed to libpng. For IDAT it means that the end of
* the IDAT stream has not yet been reached and we must handle the next
* (IDAT) chunk. If the LZ data in an IDAT stream cannot be read 'stop' must
@@ -3152,7 +3152,7 @@ read_chunk(struct file *file)
}
}
- /* Control gets to here if the the stream seems invalid or damaged in some
+ /* Control gets to here if the stream seems invalid or damaged in some
* way. Either there was a problem reading all the expected data (this
* chunk's data, its CRC and the length and type of the next chunk) or the
* next chunk length/type are invalid. Notice that the cases that end up
@@ -3678,7 +3678,7 @@ usage(const char *prog)
size_t i;
static const char *usage_string[] = {
" Tests, optimizes and optionally fixes the zlib header in PNG files.",
-" Optionally, when fixing, strips ancilliary chunks from the file.",
+" Optionally, when fixing, strips ancillary chunks from the file.",
0,
"OPTIONS",
" OPERATION",
@@ -3710,7 +3710,7 @@ usage(const char *prog)
" practice most programs will ignore it.",
" bKGD [transform]: This is used by libpng transforms."
" --max=<number>:",
-" Use IDAT chunks sized <number>. If no number is given the the IDAT",
+" Use IDAT chunks sized <number>. If no number is given the IDAT",
" chunks will be the maximum size permitted; 2^31-1 bytes. If the option",
" is omitted the original chunk sizes will not be changed. When the",
" option is given --strip=unsafe is set automatically. This may be",
@@ -3961,6 +3961,14 @@ main(int argc, const char **argv)
{
size_t outlen = strlen(*argv);
+ if (outlen > FILENAME_MAX)
+ {
+ fprintf(stderr, "%s: output file name too long: %s%s%s\n",
+ prog, prefix, *argv, suffix ? suffix : "");
+ global.status_code |= WRITE_ERROR;
+ continue;
+ }
+
if (outfile == NULL) /* else this takes precedence */
{
/* Consider the prefix/suffix options */
@@ -4046,4 +4054,3 @@ main(void)
return 77;
}
#endif /* PNG_SETJMP_SUPPORTED */
-
diff --git a/contrib/tools/reindent b/contrib/tools/reindent
deleted file mode 100755
index f4df309b6..000000000
--- a/contrib/tools/reindent
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-# reindent a libpng C source
-
-# COPYRIGHT: Written by Glenn Randers-Pehrson, 2016.
-# 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.
-
-# Usage:
-# reindent inputtabsize outputtabsize inputcontinuestring outputcontinuestring
-#
-# Assumes that continued lines begin with indentation plus one space, and
-# that continued comments begin with indentation plus " *".
-#
-# eg, to change libpng coding style from 3-space indentation with 4-space
-# continuations to 4-space indentation with 2-space continuations:
-#
-# reindent 3 4 "\t " " " < example.c > example.c_4_2
-# and to restore the file back to libpng coding style
-# reindent 4 3 " " " " < example.c_4_2 > example.c_3_4
-
-unexpand --first-only --t $1 | \
- sed -e "/^ *$3[^\*]/{s/$3/$4/}" | \
- expand -t $2
diff --git a/contrib/tools/sRGB.h b/contrib/tools/sRGB.h
index d1ece5129..7f6bdfc28 100644
--- a/contrib/tools/sRGB.h
+++ b/contrib/tools/sRGB.h
@@ -1,7 +1,4 @@
-/*-
- * sRGB.h
- *
- * Last changed in libpng 1.6.0 [February 14, 2013]
+/* sRGB.h
*
* COPYRIGHT: Written by John Cunningham Bowler, 2013.
* To the extent possible under law, the author has waived all copyright and
@@ -16,6 +13,7 @@
* (in fact the source of the numbers is the wikipedia article at
* https://en.wikipedia.org/wiki/SRGB).
*/
+
static double
sRGB_from_linear(double l)
{
diff --git a/contrib/visupng/PngFile.c b/contrib/visupng/PngFile.c
index d46318f44..cf943f32a 100644
--- a/contrib/visupng/PngFile.c
+++ b/contrib/visupng/PngFile.c
@@ -410,15 +410,14 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
#ifndef PNG_STDIO_SUPPORTED
static void
-png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
+png_read_data(png_structp png_ptr, png_bytep data, size_t length)
{
- png_size_t check;
+ size_t check;
- /* fread() returns 0 on error, so it is OK to store this in a png_size_t
+ /* 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.
*/
- check = (png_size_t)fread(data, (png_size_t)1, length,
- (FILE *)png_ptr->io_ptr);
+ check = fread(data, 1, length, (FILE *)png_ptr->io_ptr);
if (check != length)
{
@@ -427,7 +426,7 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
}
static void
-png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
+png_write_data(png_structp png_ptr, png_bytep data, size_t length)
{
png_uint_32 check;
diff --git a/contrib/visupng/PngFile.h b/contrib/visupng/PngFile.h
index 474426c22..1b7b9be3c 100644
--- a/contrib/visupng/PngFile.h
+++ b/contrib/visupng/PngFile.h
@@ -23,8 +23,8 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
int iWidth, int iHeight, png_color BkgColor);
#ifndef PNG_STDIO_SUPPORTED
-static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length);
-static void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length);
+static void png_read_data(png_structp png_ptr, png_bytep data, size_t length);
+static void png_write_data(png_structp png_ptr, png_bytep data, size_t length);
static void png_flush(png_structp png_ptr);
#endif
diff --git a/contrib/visupng/VisualPng.c b/contrib/visupng/VisualPng.c
index 20e1625fa..6f7b1dfe5 100644
--- a/contrib/visupng/VisualPng.c
+++ b/contrib/visupng/VisualPng.c
@@ -103,7 +103,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
return 0;
}
- /* if filename given on commandline, store it */
+ /* if filename given on command line, store it */
if ((szCmdLine != NULL) && (*szCmdLine != '\0'))
if (szCmdLine[0] == '"')
strncpy (szCmdFileName, szCmdLine + 1, strlen(szCmdLine) - 2);
@@ -716,7 +716,7 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
png_color bkgGray = {127, 127, 127};
png_color bkgWhite = {255, 255, 255};
- /* allocate memory for the Device Independant bitmap */
+ /* allocate memory for the Device Independent bitmap */
wDIRowBytes = (WORD) ((3 * cxWinSize + 3L) >> 2) << 2;
diff --git a/depcomp b/depcomp
index fc98710e2..715e34311 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -783,9 +783,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/example.c b/example.c
index 99d2f054a..b3038efb0 100644
--- a/example.c
+++ b/example.c
@@ -2,18 +2,20 @@
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
- * Last changed in libpng 1.6.24 [August 4, 2016]
+ *
+ * Maintained 2018 Cosmin Truta
* Maintained 1998-2016 Glenn Randers-Pehrson
- * Maintained 1996, 1997 Andreas Dilger)
- * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Maintained 1996-1997 Andreas Dilger
+ * Written 1995-1996 Guy Eric Schalnat, Group 42, Inc.
+ *
* To the extent possible under law, the authors have waived
* all copyright and related or neighboring rights to this file.
- * This work is published from: United States.
+ * This work is published from: United States, Canada.
*/
/* This is an example of how to use libpng to read and write PNG files.
- * The file libpng-manual.txt is much more verbose then this. If you have not
- * read it, do so first. This was designed to be a starting point of an
+ * The file libpng-manual.txt is much more verbose then this. If you have
+ * not read it, do so first. This was designed to be a starting point of an
* implementation. This is not officially part of libpng, is hereby placed
* in the public domain, and therefore does not require a copyright notice.
*
@@ -24,16 +26,17 @@
* see also the programs in the contrib directory.
*/
-/* The simple, but restricted, approach to reading a PNG file or data stream
- * just requires two function calls, as in the following complete program.
- * Writing a file just needs one function call, so long as the data has an
+/* The simple, but restricted approach to reading a PNG file or data stream
+ * requires just two function calls, as in the following complete program.
+ * Writing a file needs just one function call, so long as the data has an
* appropriate layout.
*
* The following code reads PNG image data from a file and writes it, in a
- * potentially new format, to a new file. While this code will compile there is
- * minimal (insufficient) error checking; for a more realistic version look at
- * contrib/examples/pngtopng.c
+ * potentially new format, to a new file. While this code will compile, there
+ * is minimal (insufficient) error checking. For a more realistic version,
+ * see contrib/examples/pngtopng.c
*/
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
@@ -68,28 +71,28 @@ int main(int argc, const char **argv)
*/
buffer = malloc(PNG_IMAGE_SIZE(image));
- /* If enough memory was available read the image in the desired format
- * then write the result out to the new file. 'background' is not
- * necessary when reading the image because the alpha channel is
+ /* If enough memory was available, read the image in the desired
+ * format, then write the result out to the new file. 'background' is
+ * not necessary when reading the image, because the alpha channel is
* preserved; if it were to be removed, for example if we requested
* PNG_FORMAT_RGB, then either a solid background color would have to
- * be supplied or the output buffer would have to be initialized to the
- * actual background of the image.
+ * be supplied, or the output buffer would have to be initialized to
+ * the actual background of the image.
*
* The fourth argument to png_image_finish_read is the 'row_stride' -
* this is the number of components allocated for the image in each
* row. It has to be at least as big as the value returned by
* PNG_IMAGE_ROW_STRIDE, but if you just allocate space for the
- * default, minimum, size using PNG_IMAGE_SIZE as above you can pass
+ * default, minimum size, using PNG_IMAGE_SIZE as above, you can pass
* zero.
*
* The final argument is a pointer to a buffer for the colormap;
- * colormaps have exactly the same format as a row of image pixels (so
- * you choose what format to make the colormap by setting
+ * colormaps have exactly the same format as a row of image pixels
+ * (so you choose what format to make the colormap by setting
* image.format). A colormap is only returned if
* PNG_FORMAT_FLAG_COLORMAP is also set in image.format, so in this
* case NULL is passed as the final argument. If you do want to force
- * all images into an index/color-mapped format then you can use:
+ * all images into an index/color-mapped format, then you can use:
*
* PNG_IMAGE_COLORMAP_SIZE(image)
*
@@ -111,84 +114,85 @@ int main(int argc, const char **argv)
exit(0);
}
}
-
else
{
/* Calling png_image_free is optional unless the simplified API was
- * not run to completion. In this case if there wasn't enough
- * memory for 'buffer' we didn't complete the read, so we must free
- * the image:
+ * not run to completion. In this case, if there wasn't enough
+ * memory for 'buffer', we didn't complete the read, so we must
+ * free the image:
*/
if (buffer == NULL)
png_image_free(&image);
-
else
free(buffer);
+ }
}
/* Something went wrong reading or writing the image. libpng stores a
* textual message in the 'png_image' structure:
*/
fprintf(stderr, "pngtopng: error: %s\n", image.message);
- exit (1);
+ exit(1);
}
fprintf(stderr, "pngtopng: usage: pngtopng input-file output-file\n");
- exit(1);
+ exit(2);
}
/* That's it ;-) Of course you probably want to do more with PNG files than
* just converting them all to 32-bit RGBA PNG files; you can do that between
* the call to png_image_finish_read and png_image_write_to_file. You can also
- * ask for the image data to be presented in a number of different formats. You
- * do this by simply changing the 'format' parameter set before allocating the
- * buffer.
+ * ask for the image data to be presented in a number of different formats.
+ * You do this by simply changing the 'format' parameter set before allocating
+ * the buffer.
*
* The format parameter consists of five flags that define various aspects of
- * the image, you can simply add these together to get the format or you can use
- * one of the predefined macros from png.h (as above):
+ * the image. You can simply add these together to get the format, or you can
+ * use one of the predefined macros from png.h (as above):
*
- * PNG_FORMAT_FLAG_COLOR: if set the image will have three color components per
- * pixel (red, green and blue), if not set the image will just have one
+ * PNG_FORMAT_FLAG_COLOR: if set, the image will have three color components
+ * per pixel (red, green and blue); if not set, the image will just have one
* luminance (grayscale) component.
*
- * PNG_FORMAT_FLAG_ALPHA: if set each pixel in the image will have an additional
- * alpha value; a linear value that describes the degree the image pixel
- * covers (overwrites) the contents of the existing pixel on the display.
+ * PNG_FORMAT_FLAG_ALPHA: if set, each pixel in the image will have an
+ * additional alpha value; a linear value that describes the degree the
+ * image pixel covers (overwrites) the contents of the existing pixel on the
+ * display.
*
- * PNG_FORMAT_FLAG_LINEAR: if set the components of each pixel will be returned
- * as a series of 16-bit linear values, if not set the components will be
- * returned as a series of 8-bit values encoded according to the 'sRGB'
- * standard. The 8-bit format is the normal format for images intended for
- * direct display, because almost all display devices do the inverse of the
- * sRGB transformation to the data they receive. The 16-bit format is more
- * common for scientific data and image data that must be further processed;
- * because it is linear simple math can be done on the component values.
- * Regardless of the setting of this flag the alpha channel is always linear,
- * although it will be 8 bits or 16 bits wide as specified by the flag.
+ * PNG_FORMAT_FLAG_LINEAR: if set, the components of each pixel will be
+ * returned as a series of 16-bit linear values; if not set, the components
+ * will be returned as a series of 8-bit values encoded according to the
+ * sRGB standard. The 8-bit format is the normal format for images intended
+ * for direct display, because almost all display devices do the inverse of
+ * the sRGB transformation to the data they receive. The 16-bit format is
+ * more common for scientific data and image data that must be further
+ * processed; because it is linear, simple math can be done on the component
+ * values. Regardless of the setting of this flag, the alpha channel is
+ * always linear, although it will be 8 bits or 16 bits wide as specified by
+ * the flag.
*
- * PNG_FORMAT_FLAG_BGR: if set the components of a color pixel will be returned
- * in the order blue, then green, then red. If not set the pixel components
- * are in the order red, then green, then blue.
+ * PNG_FORMAT_FLAG_BGR: if set, the components of a color pixel will be
+ * returned in the order blue, then green, then red. If not set, the pixel
+ * components are in the order red, then green, then blue.
*
- * PNG_FORMAT_FLAG_AFIRST: if set the alpha channel (if present) precedes the
- * color or grayscale components. If not set the alpha channel follows the
+ * PNG_FORMAT_FLAG_AFIRST: if set, the alpha channel (if present) precedes the
+ * color or grayscale components. If not set, the alpha channel follows the
* components.
*
* You do not have to read directly from a file. You can read from memory or,
* on systems that support it, from a <stdio.h> FILE*. This is controlled by
- * the particular png_image_read_from_ function you call at the start. Likewise
- * on write you can write to a FILE* if your system supports it. Check the
- * macro PNG_STDIO_SUPPORTED to see if stdio support has been included in your
- * libpng build.
+ * the particular png_image_read_from_ function you call at the start.
+ * Likewise, on write, you can write to a FILE* if your system supports it.
+ * Check the macro PNG_STDIO_SUPPORTED to see if stdio support has been
+ * included in your libpng build.
*
- * If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data you may need to write it in
- * the 8-bit format for display. You do this by setting the convert_to_8bit
+ * If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data, you may need to write it
+ * in the 8-bit format for display. You do this by setting the convert_to_8bit
* flag to 'true'.
*
* Don't repeatedly convert between the 8-bit and 16-bit forms. There is
- * significant data loss when 16-bit data is converted to the 8-bit encoding and
- * the current libpng implementation of conversion to 16-bit is also
+ * significant data loss when 16-bit data is converted to the 8-bit encoding,
+ * and the current libpng implementation of conversion to 16-bit is also
* significantly lossy. The latter will be fixed in the future, but the former
* is unavoidable - the 8-bit format just doesn't have enough resolution.
*/
@@ -199,10 +203,10 @@ int main(int argc, const char **argv)
* interfaces.
*
* All these interfaces require that you do your own error handling - your
- * program must be able to arrange for control to return to your own code any
- * time libpng encounters a problem. There are several ways to do this, but the
- * standard way is to use the ANSI-C (C90) <setjmp.h> interface to establish a
- * return point within your own code. You must do this if you do not use the
+ * program must be able to arrange for control to return to your own code, any
+ * time libpng encounters a problem. There are several ways to do this, but
+ * the standard way is to use the <setjmp.h> interface to establish a return
+ * point within your own code. You must do this if you do not use the
* simplified interface (above).
*
* The first step is to include the header files you need, including the libpng
@@ -214,7 +218,7 @@ int main(int argc, const char **argv)
/* The png_jmpbuf() macro, used in error handling, became available in
* libpng version 1.0.6. If you want to be able to run your code with older
* versions of libpng, you must define the macro yourself (but only if it
- * is not already defined by libpng!).
+ * is not already defined by libpng!)
*/
#ifndef png_jmpbuf
@@ -222,10 +226,10 @@ int main(int argc, const char **argv)
#endif
/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp()
- * returns zero if the image is a PNG and nonzero if it isn't a PNG.
+ * returns zero if the image is a PNG, and nonzero otherwise.
*
* The function check_if_png() shown here, but not used, returns nonzero (true)
- * if the file can be opened and is a PNG, 0 (false) otherwise.
+ * if the file can be opened and is a PNG, and 0 (false) otherwise.
*
* If this call is successful, and you are going to keep the file open,
* you should call png_set_sig_bytes(png_ptr, PNG_BYTES_TO_CHECK); once
@@ -238,7 +242,7 @@ int main(int argc, const char **argv)
*
* Many applications already read the first 2 or 4 bytes from the start
* of the image to determine the file type, so it would be easiest just
- * to pass the bytes to png_sig_cmp() or even skip that if you know
+ * to pass the bytes to png_sig_cmp(), or even skip that if you know
* you have a PNG file, and call png_set_sig_bytes().
*/
#define PNG_BYTES_TO_CHECK 4
@@ -250,14 +254,14 @@ int check_if_png(char *file_name, FILE **fp)
if ((*fp = fopen(file_name, "rb")) == NULL)
return 0;
- /* Read in some of the signature bytes */
+ /* Read in some of the signature bytes. */
if (fread(buf, 1, PNG_BYTES_TO_CHECK, *fp) != PNG_BYTES_TO_CHECK)
return 0;
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature.
- Return nonzero (true) if they match */
-
- return(!png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK));
+ * Return nonzero (true) if they match.
+ */
+ return(!png_sig_cmp(buf, 0, PNG_BYTES_TO_CHECK));
}
/* Read a PNG file. You may want to return an error code if the read
@@ -267,7 +271,7 @@ int check_if_png(char *file_name, FILE **fp)
* some or all of the magic bytes read - see comments above).
*/
#ifdef open_file /* prototype 1 */
-void read_png(char *file_name) /* We need to open the file */
+void read_png(char *file_name) /* We need to open the file */
{
png_structp png_ptr;
png_infop info_ptr;
@@ -280,7 +284,7 @@ void read_png(char *file_name) /* We need to open the file */
return (ERROR);
#else no_open_file /* prototype 2 */
-void read_png(FILE *fp, int sig_read) /* File is already open */
+void read_png(FILE *fp, int sig_read) /* File is already open */
{
png_structp png_ptr;
png_infop info_ptr;
@@ -292,7 +296,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
* functions. If you want to use the default stderr and longjump method,
* you can supply NULL for the last three parameters. We also supply the
* the compiler header file version, so that we know if the application
- * was compiled with a compatible version of the library. REQUIRED
+ * was compiled with a compatible version of the library. REQUIRED.
*/
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
png_voidp user_error_ptr, user_error_fn, user_warning_fn);
@@ -316,35 +320,33 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
-
if (setjmp(png_jmpbuf(png_ptr)))
{
- /* Free all of the memory associated with the png_ptr and info_ptr */
+ /* Free all of the memory associated with the png_ptr and info_ptr. */
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(fp);
- /* If we get here, we had a problem reading the file */
+ /* If we get here, we had a problem reading the file. */
return (ERROR);
}
- /* One of the following I/O initialization methods is REQUIRED */
+ /* One of the following I/O initialization methods is REQUIRED. */
#ifdef streams /* PNG file I/O method 1 */
- /* Set up the input control if you are using standard C streams */
+ /* Set up the input control if you are using standard C streams. */
png_init_io(png_ptr, fp);
#else no_streams /* PNG file I/O method 2 */
/* If you are using replacement read functions, instead of calling
- * png_init_io() here you would call:
+ * png_init_io(), you would call:
*/
png_set_read_fn(png_ptr, (void *)user_io_ptr, user_read_fn);
- /* where user_io_ptr is a structure you want available to the callbacks */
+ /* where user_io_ptr is a structure you want available to the callbacks. */
#endif no_streams /* Use only one I/O method! */
/* If we have already read some of the signature */
png_set_sig_bytes(png_ptr, sig_read);
#ifdef hilevel
- /*
- * If you have enough memory to read in the entire image at once,
+ /* If you have enough memory to read in the entire image at once,
* and you need to specify only transforms that can be controlled
* with one of the PNG_TRANSFORM_* bits (this presently excludes
* quantizing, filling, setting background, and doing gamma
@@ -354,10 +356,10 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
png_read_png(png_ptr, info_ptr, png_transforms, NULL);
#else
- /* OK, you're doing it the hard way, with the lower-level functions */
+ /* OK, you're doing it the hard way, with the lower-level functions. */
/* The call to png_read_info() gives us all of the information from the
- * PNG file before the first IDAT (image data chunk). REQUIRED
+ * PNG file before the first IDAT (image data chunk). REQUIRED.
*/
png_read_info(png_ptr, info_ptr);
@@ -385,20 +387,21 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
*/
png_set_strip_alpha(png_ptr);
- /* Extract multiple pixels with bit depths of 1, 2, and 4 from a single
+ /* Extract multiple pixels with bit depths of 1, 2 or 4 from a single
* byte into separate bytes (useful for paletted and grayscale images).
*/
png_set_packing(png_ptr);
/* Change the order of packed pixels to least significant bit first
- * (not useful if you are using png_set_packing). */
+ * (not useful if you are using png_set_packing).
+ */
png_set_packswap(png_ptr);
- /* Expand paletted colors into true RGB triplets */
+ /* Expand paletted colors into true RGB triplets. */
if (color_type == PNG_COLOR_TYPE_PALETTE)
png_set_palette_to_rgb(png_ptr);
- /* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */
+ /* Expand grayscale images to the full 8 bits from 1, 2 or 4 bits/pixel. */
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
png_set_expand_gray_1_2_4_to_8(png_ptr);
@@ -409,12 +412,11 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
png_set_tRNS_to_alpha(png_ptr);
/* Set the background color to draw transparent and alpha images over.
- * It is possible to set the red, green, and blue components directly
- * for paletted images instead of supplying a palette index. Note that
+ * It is possible to set the red, green and blue components directly
+ * for paletted images, instead of supplying a palette index. Note that,
* even if the PNG file supplies a background, you are not required to
* use it - you should use the (solid) application background if it has one.
*/
-
png_color_16 my_background, *image_background;
if (png_get_bKGD(png_ptr, info_ptr, &image_background) != 0)
@@ -424,32 +426,29 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
png_set_background(png_ptr, &my_background,
PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
- /* Some suggestions as to how to get a screen gamma value
+ /* Some suggestions as to how to get a screen gamma value.
*
* Note that screen gamma is the display_exponent, which includes
- * the CRT_exponent and any correction for viewing conditions
+ * the CRT_exponent and any correction for viewing conditions.
*/
if (/* We have a user-defined screen gamma value */)
- {
screen_gamma = user-defined screen_gamma;
- }
- /* This is one way that applications share the same screen gamma value */
+ /* This is one way that applications share the same screen gamma value. */
else if ((gamma_str = getenv("SCREEN_GAMMA")) != NULL)
- {
screen_gamma = atof(gamma_str);
- }
/* If we don't have another value */
else
{
- screen_gamma = PNG_DEFAULT_sRGB; /* A good guess for a PC monitor
- in a dimly lit room */
- screen_gamma = PNG_GAMMA_MAC_18 or 1.0; /* Good guesses for Mac systems */
+ screen_gamma = PNG_DEFAULT_sRGB; /* A good guess for a PC monitor
+ in a dimly lit room */
+ screen_gamma = PNG_GAMMA_MAC_18 or 1.0; /* Good guesses for Mac
+ systems */
}
/* Tell libpng to handle the gamma conversion for you. The final call
* is a good guess for PC generated images, but it should be configurable
- * by the user at run time by the user. It is strongly suggested that
- * your application support gamma correction.
+ * by the user at run time. Gamma correction support in your application
+ * is strongly recommended.
*/
int intent;
@@ -466,7 +465,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
}
#ifdef PNG_READ_QUANTIZE_SUPPORTED
- /* Quantize RGB files down to 8-bit palette or reduce palettes
+ /* Quantize RGB files down to 8-bit palette, or reduce palettes
* to the number of colors available on your screen.
*/
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
@@ -474,29 +473,26 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
int num_palette;
png_colorp palette;
- /* This reduces the image to the application supplied palette */
+ /* This reduces the image to the application-supplied palette. */
if (/* We have our own palette */)
{
- /* An array of colors to which the image should be quantized */
+ /* An array of colors to which the image should be quantized. */
png_color std_color_cube[MAX_SCREEN_COLORS];
-
png_set_quantize(png_ptr, std_color_cube, MAX_SCREEN_COLORS,
MAX_SCREEN_COLORS, NULL, 0);
}
- /* This reduces the image to the palette supplied in the file */
+ /* This reduces the image to the palette supplied in the file. */
else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) != 0)
{
png_uint_16p histogram = NULL;
-
png_get_hIST(png_ptr, info_ptr, &histogram);
-
png_set_quantize(png_ptr, palette, num_palette,
max_screen_colors, histogram, 0);
}
}
#endif /* READ_QUANTIZE */
- /* Invert monochrome files to have 0 as white and 1 as black */
+ /* Invert monochrome files to have 0 as white and 1 as black. */
png_set_invert_mono(png_ptr);
/* If you want to shift the pixel values from the range [0,255] or
@@ -506,22 +502,21 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT) != 0)
{
png_color_8p sig_bit_p;
-
png_get_sBIT(png_ptr, info_ptr, &sig_bit_p);
png_set_shift(png_ptr, sig_bit_p);
}
- /* Flip the RGB pixels to BGR (or RGBA to BGRA) */
+ /* Flip the RGB pixels to BGR (or RGBA to BGRA). */
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
png_set_bgr(png_ptr);
- /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */
+ /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR). */
png_set_swap_alpha(png_ptr);
- /* Swap bytes of 16-bit files to least significant byte first */
+ /* Swap bytes of 16-bit files to least significant byte first. */
png_set_swap(png_ptr);
- /* Add filler (or alpha) byte (before/after each RGB triplet) */
+ /* Add filler (or alpha) byte (before/after each RGB triplet). */
png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER);
#ifdef PNG_READ_INTERLACING_SUPPORTED
@@ -534,40 +529,31 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
number_passes = 1;
#endif /* READ_INTERLACING */
-
/* Optional call to gamma correct and add the background to the palette
* and update info structure. REQUIRED if you are expecting libpng to
- * update the palette for you (ie you selected such a transform above).
+ * update the palette for you (i.e. you selected such a transform above).
*/
png_read_update_info(png_ptr, info_ptr);
/* Allocate the memory to hold the image using the fields of info_ptr. */
-
- /* The easiest way to read the image: */
png_bytep row_pointers[height];
-
- /* Clear the pointer array */
for (row = 0; row < height; row++)
- row_pointers[row] = NULL;
-
+ row_pointers[row] = NULL; /* Clear the pointer array */
for (row = 0; row < height; row++)
row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr,
info_ptr));
- /* Now it's time to read the image. One of these methods is REQUIRED */
+ /* Now it's time to read the image. One of these methods is REQUIRED. */
#ifdef entire /* Read the entire image in one go */
png_read_image(png_ptr, row_pointers);
#else no_entire /* Read the image one or more scanlines at a time */
/* The other way to read images - deal with interlacing: */
-
for (pass = 0; pass < number_passes; pass++)
{
#ifdef single /* Read the image a single row at a time */
for (y = 0; y < height; y++)
- {
png_read_rows(png_ptr, &row_pointers[y], NULL, 1);
- }
#else no_single /* Read the image several rows at a time */
for (y = 0; y < height; y += number_of_rows)
@@ -581,24 +567,24 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
#endif no_sparkle /* Use only one of these two methods */
}
- /* If you want to display the image after every pass, do so here */
+ /* If you want to display the image after every pass, do so here. */
#endif no_single /* Use only one of these two methods */
}
#endif no_entire /* Use only one of these two methods */
- /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
+ /* Read rest of file, and get additional chunks in info_ptr. REQUIRED. */
png_read_end(png_ptr, info_ptr);
#endif hilevel
- /* At this point you have read the entire image */
+ /* At this point you have read the entire image. */
- /* Clean up after the read, and free any memory allocated - REQUIRED */
+ /* Clean up after the read, and free any memory allocated. REQUIRED. */
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- /* Close the file */
+ /* Close the file. */
fclose(fp);
- /* That's it */
+ /* That's it! */
return (OK);
}
@@ -610,34 +596,30 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
/* Create and initialize the png_struct with the desired error handler
* functions. If you want to use the default stderr and longjump method,
* you can supply NULL for the last three parameters. We also check that
- * the library version is compatible in case we are using dynamically
+ * the library version is compatible, in case we are using dynamically
* linked libraries.
*/
*png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
png_voidp user_error_ptr, user_error_fn, user_warning_fn);
-
if (*png_ptr == NULL)
{
*info_ptr = NULL;
return (ERROR);
}
-
*info_ptr = png_create_info_struct(png_ptr);
-
if (*info_ptr == NULL)
{
png_destroy_read_struct(png_ptr, info_ptr, NULL);
return (ERROR);
}
-
if (setjmp(png_jmpbuf((*png_ptr))))
{
png_destroy_read_struct(png_ptr, info_ptr, NULL);
return (ERROR);
}
- /* This one's new. You will need to provide all three
- * function callbacks, even if you aren't using them all.
+ /* You will need to provide all three function callbacks,
+ * even if you aren't using all of them.
* If you aren't using all functions, you can specify NULL
* parameters. Even when all three functions are NULL,
* you need to call png_set_progressive_read_fn().
@@ -650,7 +632,6 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
*/
png_set_progressive_read_fn(*png_ptr, (void *)stream_data,
info_callback, row_callback, end_callback);
-
return (OK);
}
@@ -660,18 +641,18 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
{
if (setjmp(png_jmpbuf((*png_ptr))))
{
- /* Free the png_ptr and info_ptr memory on error */
+ /* Free the png_ptr and info_ptr memory on error. */
png_destroy_read_struct(png_ptr, info_ptr, NULL);
return (ERROR);
}
- /* This one's new also. Simply give it chunks of data as
- * they arrive from the data stream (in order, of course).
+ /* Give chunks of data as they arrive from the data stream
+ * (in order, of course).
* On segmented machines, don't give it any more than 64K.
* The library seems to run fine with sizes of 4K, although
- * you can give it much less if necessary (I assume you can
+ * you can give it much less if necessary. (I assume you can
* give it chunks of 1 byte, but I haven't tried with less
- * than 256 bytes yet). When this function returns, you may
+ * than 256 bytes yet.) When this function returns, you may
* want to display any rows that were generated in the row
* callback, if you aren't already displaying them there.
*/
@@ -693,8 +674,7 @@ info_callback(png_structp png_ptr, png_infop info)
row_callback(png_structp png_ptr, png_bytep new_row,
png_uint_32 row_num, int pass)
{
- /*
- * This function is called for every row in the image. If the
+ /* This function is called for every row in the image. If the
* image is interlaced, and you turned on the interlace handler,
* this function will be called for every row in every pass.
*
@@ -705,25 +685,22 @@ row_callback(png_structp png_ptr, png_bytep new_row,
* The new row data pointer "new_row" may be NULL, indicating there is
* no new data to be replaced (in cases of interlace loading).
*
- * If new_row is not NULL then you need to call
- * png_progressive_combine_row() to replace the corresponding row as
+ * If new_row is not NULL, then you need to call
+ * png_progressive_combine_row(), to replace the corresponding row as
* shown below:
*/
- /* Get pointer to corresponding row in our
- * PNG read buffer.
- */
+ /* Get pointer to corresponding row in our PNG read buffer. */
png_bytep old_row = ((png_bytep *)our_data)[row_num];
#ifdef PNG_READ_INTERLACING_SUPPORTED
- /* If both rows are allocated then copy the new row
+ /* If both rows are allocated, then copy the new row
* data to the corresponding row data.
*/
- if ((old_row != NULL) && (new_row != NULL))
- png_progressive_combine_row(png_ptr, old_row, new_row);
+ if (old_row != NULL && new_row != NULL)
+ png_progressive_combine_row(png_ptr, old_row, new_row);
- /*
- * The rows and passes are called in order, so you don't really
+ /* The rows and passes are called in order, so you don't really
* need the row_num and pass, but I'm supplying them because it
* may make your life easier.
*
@@ -734,7 +711,6 @@ row_callback(png_structp png_ptr, png_bytep new_row,
* (it just does the memcpy for you) if it will make the code
* easier. Thus, you can just do this for all cases:
*/
-
png_progressive_combine_row(png_ptr, old_row, new_row);
/* where old_row is what was displayed for previous rows. Note
@@ -781,14 +757,13 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
png_voidp user_error_ptr, user_error_fn, user_warning_fn);
-
if (png_ptr == NULL)
{
fclose(fp);
return (ERROR);
}
- /* Allocate/initialize the image information data. REQUIRED */
+ /* Allocate/initialize the image information data. REQUIRED. */
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL)
{
@@ -797,30 +772,30 @@ void write_png(char *file_name /* , ... other image information ... */)
return (ERROR);
}
- /* Set error handling. REQUIRED if you aren't supplying your own
+ /* Set up error handling. REQUIRED if you aren't supplying your own
* error handling functions in the png_create_write_struct() call.
*/
if (setjmp(png_jmpbuf(png_ptr)))
{
- /* If we get here, we had a problem writing the file */
+ /* If we get here, we had a problem writing the file. */
fclose(fp);
png_destroy_write_struct(&png_ptr, &info_ptr);
return (ERROR);
}
- /* One of the following I/O initialization functions is REQUIRED */
+ /* One of the following I/O initialization functions is REQUIRED. */
#ifdef streams /* I/O initialization method 1 */
- /* Set up the output control if you are using standard C streams */
+ /* Set up the output control if you are using standard C streams. */
png_init_io(png_ptr, fp);
#else no_streams /* I/O initialization method 2 */
/* If you are using replacement write functions, instead of calling
- * png_init_io() here you would call
+ * png_init_io(), you would call:
*/
png_set_write_fn(png_ptr, (void *)user_io_ptr, user_write_fn,
user_IO_flush_function);
- /* where user_io_ptr is a structure you want available to the callbacks */
+ /* where user_io_ptr is a structure you want available to the callbacks. */
#endif no_streams /* Only use one initialization method */
#ifdef hilevel
@@ -831,30 +806,32 @@ void write_png(char *file_name /* , ... other image information ... */)
png_write_png(png_ptr, info_ptr, png_transforms, NULL);
#else
- /* This is the hard way */
+ /* This is the hard way. */
/* Set the image information here. Width and height are up to 2^31,
- * bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
- * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
+ * bit_depth is one of 1, 2, 4, 8 or 16, but valid values also depend on
+ * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
* PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
* or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or
* PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST
- * currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED
+ * currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE.
+ * REQUIRED.
*/
- png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_???,
- PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+ png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth,
+ PNG_COLOR_TYPE_???, PNG_INTERLACE_????,
+ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
- /* Set the palette if there is one. REQUIRED for indexed-color images */
- palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH
- * (sizeof (png_color)));
+ /* Set the palette if there is one. REQUIRED for indexed-color images. */
+ palette = (png_colorp)png_malloc(png_ptr,
+ PNG_MAX_PALETTE_LENGTH * (sizeof (png_color)));
/* ... Set palette colors ... */
png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);
- /* You must not free palette here, because png_set_PLTE only makes a link to
- * the palette that you malloced. Wait until you are about to destroy
+ /* You must not free palette here, because png_set_PLTE only makes a link
+ * to the palette that you allocated. Wait until you are about to destroy
* the png structure.
*/
- /* Optional significant bit (sBIT) chunk */
+ /* Optional significant bit (sBIT) chunk. */
png_color_8 sig_bit;
/* If we are dealing with a grayscale image then */
@@ -870,18 +847,17 @@ void write_png(char *file_name /* , ... other image information ... */)
png_set_sBIT(png_ptr, info_ptr, &sig_bit);
-
/* Optional gamma chunk is strongly suggested if you have any guess
* as to the correct gamma of the image.
*/
png_set_gAMA(png_ptr, info_ptr, gamma);
- /* Optionally write comments into the image */
+ /* Optionally write comments into the image. */
{
png_text text_ptr[3];
- char key0[]="Title";
- char text0[]="Mona Lisa";
+ char key0[] = "Title";
+ char text0[] = "Mona Lisa";
text_ptr[0].key = key0;
text_ptr[0].text = text0;
text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE;
@@ -889,8 +865,8 @@ void write_png(char *file_name /* , ... other image information ... */)
text_ptr[0].lang = NULL;
text_ptr[0].lang_key = NULL;
- char key1[]="Author";
- char text1[]="Leonardo DaVinci";
+ char key1[] = "Author";
+ char text1[] = "Leonardo DaVinci";
text_ptr[1].key = key1;
text_ptr[1].text = text1;
text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE;
@@ -898,8 +874,8 @@ void write_png(char *file_name /* , ... other image information ... */)
text_ptr[1].lang = NULL;
text_ptr[1].lang_key = NULL;
- char key2[]="Description";
- char text2[]="<long text>";
+ char key2[] = "Description";
+ char text2[] = "<long text>";
text_ptr[2].key = key2;
text_ptr[2].text = text2;
text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt;
@@ -910,14 +886,14 @@ void write_png(char *file_name /* , ... other image information ... */)
png_set_text(write_ptr, write_info_ptr, text_ptr, 3);
}
- /* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */
+ /* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs. */
- /* Note that if sRGB is present the gAMA and cHRM chunks must be ignored
+ /* Note that if sRGB is present, the gAMA and cHRM chunks must be ignored
* on read and, if your application chooses to write them, they must
- * be written in accordance with the sRGB profile
+ * be written in accordance with the sRGB profile.
*/
- /* Write the file header information. REQUIRED */
+ /* Write the file header information. REQUIRED. */
png_write_info(png_ptr, info_ptr);
/* If you want, you can write the info in two steps, in case you need to
@@ -941,7 +917,7 @@ void write_png(char *file_name /* , ... other image information ... */)
* all optional. Only call them if you want them.
*/
- /* Invert monochrome pixels */
+ /* Invert monochrome pixels. */
png_set_invert_mono(png_ptr);
/* Shift the pixels up to a legal bit depth and fill in
@@ -949,30 +925,29 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
png_set_shift(png_ptr, &sig_bit);
- /* Pack pixels into bytes */
+ /* Pack pixels into bytes. */
png_set_packing(png_ptr);
- /* Swap location of alpha bytes from ARGB to RGBA */
+ /* Swap location of alpha bytes from ARGB to RGBA. */
png_set_swap_alpha(png_ptr);
/* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into
- * RGB (4 channels -> 3 channels). The second parameter is not used.
+ * RGB (4 channels -> 3 channels). The second parameter is not used.
*/
png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
- /* Flip BGR pixels to RGB */
+ /* Flip BGR pixels to RGB. */
png_set_bgr(png_ptr);
- /* Swap bytes of 16-bit files to most significant byte first */
+ /* Swap bytes of 16-bit files to most significant byte first. */
png_set_swap(png_ptr);
- /* Swap bits of 1-bit, 2-bit, 4-bit packed pixel formats */
+ /* Swap bits of 1-bit, 2-bit, 4-bit packed pixel formats. */
png_set_packswap(png_ptr);
- /* Turn on interlace handling if you are not using png_write_image() */
+ /* Turn on interlace handling if you are not using png_write_image(). */
if (interlacing != 0)
number_passes = png_set_interlace_handling(png_ptr);
-
else
number_passes = 1;
@@ -982,29 +957,28 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
png_uint_32 k, height, width;
- /* In this example, "image" is a one-dimensional array of bytes */
+ /* In this example, "image" is a one-dimensional array of bytes. */
- /* Guard against integer overflow */
- if (height > PNG_SIZE_MAX/(width*bytes_per_pixel)) {
- png_error(png_ptr, "Image_data buffer would be too large");
- }
- png_byte image[height*width*bytes_per_pixel];
+ /* Guard against integer overflow. */
+ if (height > PNG_SIZE_MAX / (width * bytes_per_pixel))
+ png_error(png_ptr, "Image data buffer would be too large");
+ png_byte image[height * width * bytes_per_pixel];
png_bytep row_pointers[height];
- if (height > PNG_UINT_32_MAX/(sizeof (png_bytep)))
- png_error (png_ptr, "Image is too tall to process in memory");
+ if (height > PNG_UINT_32_MAX / (sizeof (png_bytep)))
+ png_error(png_ptr, "Image is too tall to process in memory");
- /* Set up pointers into your "image" byte array */
+ /* Set up pointers into your "image" byte array. */
for (k = 0; k < height; k++)
- row_pointers[k] = image + k*width*bytes_per_pixel;
+ row_pointers[k] = image + k * width * bytes_per_pixel;
- /* One of the following output methods is REQUIRED */
+ /* One of the following output methods is REQUIRED. */
#ifdef entire /* Write out the entire image data in one call */
png_write_image(png_ptr, row_pointers);
- /* The other way to write the image - deal with interlacing */
+ /* The other way to write the image - deal with interlacing. */
#else no_entire /* Write out the image data by one or more scanlines */
@@ -1016,27 +990,27 @@ void write_png(char *file_name /* , ... other image information ... */)
/* Write a few rows at a time. */
png_write_rows(png_ptr, &row_pointers[first_row], number_of_rows);
- /* If you are only writing one row at a time, this works */
+ /* If you are only writing one row at a time, this works. */
for (y = 0; y < height; y++)
png_write_rows(png_ptr, &row_pointers[y], 1);
}
#endif no_entire /* Use only one output method */
/* You can write optional chunks like tEXt, zTXt, and tIME at the end
- * as well. Shouldn't be necessary in 1.2.0 and up as all the public
- * chunks are supported and you can use png_set_unknown_chunks() to
+ * as well. Shouldn't be necessary in 1.2.0 and up, as all the public
+ * chunks are supported, and you can use png_set_unknown_chunks() to
* register unknown chunks into the info structure to be written out.
*/
- /* It is REQUIRED to call this to finish writing the rest of the file */
+ /* It is REQUIRED to call this to finish writing the rest of the file. */
png_write_end(png_ptr, info_ptr);
#endif hilevel
- /* If you png_malloced a palette, free it here (don't free info_ptr->palette,
- * as recommended in versions 1.0.5m and earlier of this example; if
- * libpng mallocs info_ptr->palette, libpng will free it). If you
- * allocated it with malloc() instead of png_malloc(), use free() instead
- * of png_free().
+ /* If you png_malloced a palette, free it here.
+ * (Don't free info_ptr->palette, as shown in versions 1.0.5m and earlier of
+ * this example; if libpng mallocs info_ptr->palette, libpng will free it).
+ * If you allocated it with malloc() instead of png_malloc(), use free()
+ * instead of png_free().
*/
png_free(png_ptr, palette);
palette = NULL;
@@ -1047,19 +1021,20 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
png_free(png_ptr, trans);
trans = NULL;
- /* Whenever you use png_free() it is a good idea to set the pointer to
+
+ /* Whenever you use png_free(), it is a good idea to set the pointer to
* NULL in case your application inadvertently tries to png_free() it
- * again. When png_free() sees a NULL it returns without action, thus
- * avoiding the double-free security problem.
+ * again. When png_free() sees a NULL it returns without action, avoiding
+ * the double-free problem.
*/
- /* Clean up after the write, and free any memory allocated */
+ /* Clean up after the write, and free any allocated memory. */
png_destroy_write_struct(&png_ptr, &info_ptr);
- /* Close the file */
+ /* Close the file. */
fclose(fp);
- /* That's it */
+ /* That's it! */
return (OK);
}
diff --git a/install-sh b/install-sh
index 0b0fdcbba..ec298b537 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -69,6 +69,11 @@ posix_mkdir=
# Desired mode of installed file.
mode=0755
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -99,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve the last data modification time)
+ -C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
-s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@@ -137,8 +152,13 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
+ -p) cpprog="$cpprog -p";;
+
-s) stripcmd=$stripprog;;
+ -S) backupsuffix="$2"
+ shift;;
+
-t)
is_target_a_directory=always
dst_arg=$2
@@ -255,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -271,15 +295,18 @@ do
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@@ -288,27 +315,16 @@ do
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
@@ -318,43 +334,49 @@ do
fi
posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
esac
if
@@ -365,7 +387,7 @@ do
then :
else
- # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
@@ -394,7 +416,7 @@ do
prefixes=
else
if $posix_mkdir; then
- (umask=$mkdir_umask &&
+ (umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
@@ -427,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -460,6 +493,13 @@ do
then
rm -f "$dsttmp"
else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -474,9 +514,9 @@ do
# file should still install successfully.
{
test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
@@ -493,9 +533,9 @@ do
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/intel/filter_sse2_intrinsics.c b/intel/filter_sse2_intrinsics.c
index 5e8553fbb..d3c0fe9e2 100644
--- a/intel/filter_sse2_intrinsics.c
+++ b/intel/filter_sse2_intrinsics.c
@@ -1,12 +1,11 @@
/* filter_sse2_intrinsics.c - SSE2 optimized filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
* Written by Mike Klein and Matt Sarett
* Derived from arm/filter_neon_intrinsics.c
*
- * Last changed in libpng 1.6.31 [July 27, 2017]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -29,39 +28,25 @@
*/
static __m128i load4(const void* p) {
- return _mm_cvtsi32_si128(*(const int*)p);
+ int tmp;
+ memcpy(&tmp, p, sizeof(tmp));
+ return _mm_cvtsi32_si128(tmp);
}
static void store4(void* p, __m128i v) {
- *(int*)p = _mm_cvtsi128_si32(v);
+ int tmp = _mm_cvtsi128_si32(v);
+ memcpy(p, &tmp, sizeof(int));
}
static __m128i load3(const void* p) {
- /* We'll load 2 bytes, then 1 byte,
- * then mask them together, and finally load into SSE.
- */
- const png_uint_16* p01 = (png_const_uint_16p)p;
- const png_byte* p2 = (const png_byte*)(p01+1);
-
- png_uint_32 v012 = (png_uint_32)(*p01)
- | (png_uint_32)(*p2) << 16;
- return load4(&v012);
+ png_uint_32 tmp = 0;
+ memcpy(&tmp, p, 3);
+ return _mm_cvtsi32_si128(tmp);
}
static void store3(void* p, __m128i v) {
- /* We'll pull from SSE as a 32-bit int, then write
- * its bottom two bytes, then its third byte.
- */
- png_uint_32 v012;
- png_uint_16* p01;
- png_byte* p2;
-
- store4(&v012, v);
-
- p01 = (png_uint_16p)p;
- p2 = (png_byte*)(p01+1);
- *p01 = (png_uint_16)v012;
- *p2 = (png_byte)(v012 >> 16);
+ int tmp = _mm_cvtsi128_si32(v);
+ memcpy(p, &tmp, 3);
}
void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
@@ -71,7 +56,7 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
* There is no pixel to the left of the first pixel. It's encoded directly.
* That works with our main loop if we just say that left pixel was zero.
*/
- png_size_t rb;
+ size_t rb;
__m128i a, d = _mm_setzero_si128();
@@ -104,7 +89,7 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
* There is no pixel to the left of the first pixel. It's encoded directly.
* That works with our main loop if we just say that left pixel was zero.
*/
- png_size_t rb;
+ size_t rb;
__m128i a, d = _mm_setzero_si128();
@@ -131,7 +116,7 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
* perfectly with our loop if we make sure a starts at zero.
*/
- png_size_t rb;
+ size_t rb;
const __m128i zero = _mm_setzero_si128();
@@ -185,7 +170,7 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row,
* predicted to be half of the pixel above it. So again, this works
* perfectly with our loop if we make sure a starts at zero.
*/
- png_size_t rb;
+ size_t rb;
const __m128i zero = _mm_setzero_si128();
__m128i b;
__m128i a, d = zero;
@@ -257,7 +242,7 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
* Here we zero b and d, which become c and a respectively at the start of
* the loop.
*/
- png_size_t rb;
+ size_t rb;
const __m128i zero = _mm_setzero_si128();
__m128i c, b = zero,
a, d = zero;
@@ -274,7 +259,7 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
/* (p-a) == (a+b-c - a) == (b-c) */
-
+
pa = _mm_sub_epi16(b,c);
/* (p-b) == (a+b-c - b) == (a-c) */
@@ -356,7 +341,7 @@ void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row,
* Here we zero b and d, which become c and a respectively at the start of
* the loop.
*/
- png_size_t rb;
+ size_t rb;
const __m128i zero = _mm_setzero_si128();
__m128i pa,pb,pc,smallest,nearest;
__m128i c, b = zero,
diff --git a/intel/intel_init.c b/intel/intel_init.c
index 8f08baf8c..2f8168b7c 100644
--- a/intel/intel_init.c
+++ b/intel/intel_init.c
@@ -1,12 +1,11 @@
/* intel_init.c - SSE2 optimized filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
* Written by Mike Klein and Matt Sarett, Google, Inc.
* Derived from arm/arm_init.c
*
- * Last changed in libpng 1.6.29 [March 16, 2017]
- *
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
diff --git a/libpng-manual.txt b/libpng-manual.txt
index d4407ef2e..67b507882 100644
--- a/libpng-manual.txt
+++ b/libpng-manual.txt
@@ -1,9 +1,7 @@
libpng-manual.txt - A description on how to use and modify libpng
- libpng version 1.6.34 - September 29, 2017
- Updated and distributed by Glenn Randers-Pehrson
- <glennrp at users.sourceforge.net>
- Copyright (c) 1998-2017 Glenn Randers-Pehrson
+ Copyright (c) 2018-2023 Cosmin Truta
+ Copyright (c) 1998-2018 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer
@@ -11,9 +9,13 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
- libpng versions 0.97, January 1998, through 1.6.34 - September 29, 2017
+ libpng version 1.6.36, December 2018, through 1.6.40 - June 2023
+ Updated and distributed by Cosmin Truta
+ Copyright (c) 2018-2023 Cosmin Truta
+
+ libpng versions 0.97, January 1998, through 1.6.35 - July 2018
Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2017 Glenn Randers-Pehrson
+ Copyright (c) 1998-2018 Glenn Randers-Pehrson
libpng 1.0 beta 6 - version 0.96 - May 28, 1997
Updated and distributed by Andreas Dilger
@@ -45,7 +47,6 @@ libpng-manual.txt - A description on how to use and modify libpng
XIII. Detecting libpng
XIV. Source code repository
XV. Coding style
- XVI. Y2K Compliance in libpng
I. Introduction
@@ -66,7 +67,7 @@ file format in application programs.
The PNG specification (second edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
-<https://www.w3.org/TR/2003/REC-PNG-20031110/
+<https://www.w3.org/TR/2003/REC-PNG-20031110/>.
The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at
@@ -74,9 +75,9 @@ The PNG-1.2 specification is available at
It is technically equivalent
to the PNG specification (second edition) but has some additional material.
-The PNG-1.0 specification is available as RFC 2083
+The PNG-1.0 specification is available as RFC 2083 at
<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
-W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
+W3C Recommendation at <https://www.w3.org/TR/REC-png-961001>.
Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -348,18 +349,18 @@ Customizing libpng.
FILE *fp = fopen(file_name, "rb");
if (!fp)
{
- return (ERROR);
+ return ERROR;
}
if (fread(header, 1, number, fp) != number)
{
- return (ERROR);
+ return ERROR;
}
is_png = !png_sig_cmp(header, 0, number);
if (!is_png)
{
- return (NOT_PNG);
+ return NOT_PNG;
}
Next, png_struct and png_info need to be allocated and initialized. In
@@ -378,7 +379,7 @@ create the structure, so your application should check for that.
user_error_fn, user_warning_fn);
if (!png_ptr)
- return (ERROR);
+ return ERROR;
png_infop info_ptr = png_create_info_struct(png_ptr);
@@ -386,7 +387,7 @@ create the structure, so your application should check for that.
{
png_destroy_read_struct(&png_ptr,
(png_infopp)NULL, (png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
If you want to use your own memory allocation routines,
@@ -421,7 +422,7 @@ free any memory.
png_destroy_read_struct(&png_ptr, &info_ptr,
&end_info);
fclose(fp);
- return (ERROR);
+ return ERROR;
}
Pass (png_infopp)NULL instead of &end_info if you didn't create
@@ -503,7 +504,7 @@ input stream. You must supply the function
png_byte name[5];
png_byte *data;
- png_size_t size;
+ size_t size;
/* Note that libpng has already taken care of
the CRC handling */
@@ -512,9 +513,9 @@ input stream. You must supply the function
unknown chunk structure, process it, and return one
of the following: */
- return (-n); /* chunk had an error */
- return (0); /* did not recognize */
- return (n); /* success */
+ return -n; /* chunk had an error */
+ return 0; /* did not recognize */
+ return n; /* success */
}
(You can give your function another name that you like instead of
@@ -876,7 +877,7 @@ described below (the latter being the two common names for associated alpha
color channels). Note that PNG files always contain non-associated color
channels; png_set_alpha_mode() with one of the modes causes the decoder to
convert the pixels to an associated form before returning them to your
-application.
+application.
Since it is not necessary to perform arithmetic on opaque color values so
long as they are not to be resampled and are in the final color space it is
@@ -1003,7 +1004,7 @@ chunks to be assumed to be encoded using sRGB.
png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
In this case the output is assumed to be something like an sRGB conformant
-display preceeded by a power-law lookup table of power 1.45. This is how
+display preceded by a power-law lookup table of power 1.45. This is how
early Mac systems behaved.
png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);
@@ -1055,7 +1056,7 @@ faster.)
When the default gamma of PNG files doesn't match the output gamma.
If you have PNG files with no gamma information png_set_alpha_mode allows
-you to provide a default gamma, but it also sets the ouput gamma to the
+you to provide a default gamma, but it also sets the output gamma to the
matching value. If you know your PNG files have a gamma that doesn't
match the output you can take advantage of the fact that
png_set_alpha_mode always sets the output gamma but only sets the PNG
@@ -1791,7 +1792,7 @@ the information. If, instead, you want to convert the image to an opaque
version with no alpha channel use png_set_background; see below.
As of libpng version 1.5.2, almost all useful expansions are supported, the
-major ommissions are conversion of grayscale to indexed images (which can be
+major omissions are conversion of grayscale to indexed images (which can be
done trivially in the application) and conversion of indexed to grayscale (which
can be done by a trivial manipulation of the palette.)
@@ -2409,7 +2410,7 @@ separate.
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
png_read_end(png_ptr, end_info);
@@ -2549,7 +2550,7 @@ png_infop info_ptr;
user_error_fn, user_warning_fn);
if (!png_ptr)
- return (ERROR);
+ return ERROR;
info_ptr = png_create_info_struct(png_ptr);
@@ -2557,14 +2558,14 @@ png_infop info_ptr;
{
png_destroy_read_struct(&png_ptr,
(png_infopp)NULL, (png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
/* This one's new. You can provide functions
@@ -2598,7 +2599,7 @@ png_infop info_ptr;
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
/* This one's new also. Simply give it a chunk
@@ -2742,7 +2743,7 @@ custom writing functions. See the discussion under Customizing libpng.
FILE *fp = fopen(file_name, "wb");
if (!fp)
- return (ERROR);
+ return ERROR;
Next, png_struct and png_info need to be allocated and initialized.
As these can be both relatively large, you may not want to store these
@@ -2757,14 +2758,14 @@ both "png_ptr"; you can call them anything you like, such as
user_error_fn, user_warning_fn);
if (!png_ptr)
- return (ERROR);
+ return ERROR;
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_write_struct(&png_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
If you want to use your own memory allocation routines,
@@ -2791,7 +2792,7 @@ section below for more information on the libpng error handling.
{
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
- return (ERROR);
+ return ERROR;
}
...
return;
@@ -3779,7 +3780,7 @@ in-memory bitmap formats or to be written from the same formats. If these
formats do not accommodate your needs then you can, and should, use the more
sophisticated APIs above - these support a wide variety of in-memory formats
and a wide variety of sophisticated transformations to those formats as well
-as a wide variety of APIs to manipulate ancilliary information.
+as a wide variety of APIs to manipulate ancillary information.
To read a PNG file using the simplified API:
@@ -4055,7 +4056,7 @@ Flags containing additional information about the image are held in
the 'flags' field of png_image.
PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB == 0x01
- This indicates the the RGB values of the in-memory bitmap do not
+ This indicates that the RGB values of the in-memory bitmap do not
correspond to the red, green and blue end-points defined by sRGB.
PNG_IMAGE_FLAG_FAST == 0x02
@@ -4102,7 +4103,7 @@ READ APIs
The PNG header is read from the stdio FILE object.
int png_image_begin_read_from_memory(png_imagep image,
- png_const_voidp memory, png_size_t size)
+ png_const_voidp memory, size_t size)
The PNG header is read from the given memory buffer.
@@ -4255,10 +4256,10 @@ png_get_io_ptr(). For example:
The replacement I/O functions must have prototypes as follows:
void user_read_data(png_structp png_ptr,
- png_bytep data, png_size_t length);
+ png_bytep data, size_t length);
void user_write_data(png_structp png_ptr,
- png_bytep data, png_size_t length);
+ png_bytep data, size_t length);
void user_flush_data(png_structp png_ptr);
@@ -4521,7 +4522,7 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
having level = 0 will be printed. There aren't any such statements in
this version of libpng, but if you insert some they will be printed.
-VII. MNG support
+VII. MNG support
The MNG specification (available at http://www.libpng.org/pub/mng) allows
certain extensions to PNG for PNG images that are embedded in MNG datastreams.
@@ -4548,7 +4549,7 @@ or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at
https://www.libmng.com/) instead.
-VIII. Changes to Libpng from version 0.88
+VIII. Changes to Libpng from version 0.88
It should be noted that versions of libpng later than 0.96 are not
distributed by the original libpng author, Guy Schalnat, nor by
@@ -4603,7 +4604,7 @@ application:
png_uint_32 application_vn = PNG_LIBPNG_VER;
-IX. Changes to Libpng from version 1.0.x to 1.2.x
+IX. Changes to Libpng from version 1.0.x to 1.2.x
Support for user memory management was enabled by default. To
accomplish this, the functions png_create_read_struct_2(),
@@ -4700,7 +4701,7 @@ which also expands tRNS to alpha was replaced with
png_set_expand_gray_1_2_4_to_8()
which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
-X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
+X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
Private libpng prototypes and macro definitions were moved from
png.h and pngconf.h into a new pngpriv.h header file.
@@ -4784,7 +4785,7 @@ behavior in case the application runs out of memory part-way through
the process.
We changed the prototypes of png_get_compression_buffer_size() and
-png_set_compression_buffer_size() to work with png_size_t instead of
+png_set_compression_buffer_size() to work with size_t instead of
png_uint_32.
Support for numbered error messages was removed by default, since we
@@ -4810,7 +4811,7 @@ was renamed to PNG_READ_QUANTIZE_SUPPORTED.
We removed the trailing '.' from the warning and error messages.
-XI. Changes to Libpng from version 1.4.x to 1.5.x
+XI. Changes to Libpng from version 1.4.x to 1.5.x
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
function) incorrectly returned a value of type png_uint_32.
@@ -4873,7 +4874,7 @@ to png_bytepp, and in png_set_iCCP, from png_charp to png_const_bytep.
There are changes of form in png.h, including new and changed macros to
declare parts of the API. Some API functions with arguments that are
pointers to data not modified within the function have been corrected to
-declare these arguments with PNG_CONST.
+declare these arguments with const.
Much of the internal use of C macros to control the library build has also
changed and some of this is visible in the exported header files, in
@@ -5068,7 +5069,7 @@ even though the default is to use the macros - this allows applications
to choose at app buildtime whether or not to use macros (previously
impossible because the functions weren't in the default build.)
-XII. Changes to Libpng from version 1.5.x to 1.6.x
+XII. Changes to Libpng from version 1.5.x to 1.6.x
A "simplified API" has been added (see documentation in png.h and a simple
example in contrib/examples/pngtopng.c). The new publicly visible API
@@ -5231,7 +5232,7 @@ attempt to decode the Exif profile; it simply returns a byte array
containing the profile to the calling application which must do its own
decoding.
-XIII. Detecting libpng
+XIII. Detecting libpng
The png_get_io_ptr() function has been present since libpng-0.88, has never
changed, and is unaffected by conditional compilation macros. It is the
@@ -5255,9 +5256,8 @@ or you can browse it with a web browser at
https://github.com/glennrp/libpng or
https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
-Patches can be sent to glennrp at users.sourceforge.net or to
-png-mng-implement at lists.sourceforge.net or you can upload them to
-the libpng bug tracker at
+Patches can be sent to png-mng-implement at lists.sourceforge.net or
+uploaded to the libpng bug tracker at
https://libpng.sourceforge.io/
@@ -5266,9 +5266,9 @@ or as a "pull request" to
https://github.com/glennrp/libpng/pulls
We also accept patches built from the tar or zip distributions, and
-simple verbal discriptions of bug fixes, reported either to the
+simple verbal descriptions of bug fixes, reported either to the
SourceForge bug tracker, to the png-mng-implement at lists.sf.net
-mailing list, as github issues, or directly to glennrp.
+mailing list, as github issues.
XV. Coding style
@@ -5289,7 +5289,7 @@ braces on separate lines:
The braces can be omitted from simple one-line actions:
if (condition)
- return (0);
+ return 0;
We use 3-space indentation, except for continued statements which
are usually indented the same as the first line of the statement
@@ -5407,58 +5407,3 @@ We do not use the TAB character for indentation in the C sources.
Lines do not exceed 80 characters.
Other rules can be inferred by inspecting the libpng source.
-
-XVI. Y2K Compliance in libpng
-
-Since the PNG Development group is an ad-hoc body, we can't make
-an official declaration.
-
-This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.6.34 are Y2K compliant. It is my belief that earlier
-versions were also Y2K compliant.
-
-Libpng only has two year fields. One is a 2-byte unsigned integer
-that will hold years up to 65535. The other, which is deprecated,
-holds the date in text format, and will hold years up to 9999.
-
-The integer is
- "png_uint_16 year" in png_time_struct.
-
-The string is
- "char time_buffer[29]" in png_struct. This is no longer used
-in libpng-1.6.x and will be removed from libpng-1.7.0.
-
-There are seven time-related functions:
-
- png_convert_to_rfc_1123_buffer() in png.c
- (formerly png_convert_to_rfc_1152() in error, and
- also formerly png_convert_to_rfc_1123())
- png_convert_from_struct_tm() in pngwrite.c, called
- in pngwrite.c
- png_convert_from_time_t() in pngwrite.c
- png_get_tIME() in pngget.c
- png_handle_tIME() in pngrutil.c, called in pngread.c
- png_set_tIME() in pngset.c
- png_write_tIME() in pngwutil.c, called in pngwrite.c
-
-All appear to handle dates properly in a Y2K environment. The
-png_convert_from_time_t() function calls gmtime() to convert from system
-clock time, which returns (year - 1900), which we properly convert to
-the full 4-digit year. There is a possibility that applications using
-libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
-function, or that they are incorrectly passing only a 2-digit year
-instead of "year - 1900" into the png_convert_from_struct_tm() function,
-but this is not under our control. The libpng documentation has always
-stated that it works with 4-digit years, and the APIs have been
-documented as such.
-
-The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
-integer to hold the year, and can hold years as large as 65535.
-
-zlib, upon which libpng depends, is also Y2K compliant. It contains
-no date-related code.
-
-
- Glenn Randers-Pehrson
- libpng maintainer
- PNG Development Group
diff --git a/libpng.3 b/libpng.3
index 3c8d62ab2..003bfaf6c 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,11 +1,11 @@
-.TH LIBPNG 3 "September 29, 2017"
+.TH LIBPNG 3 "June 21, 2023"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.40
+
.SH SYNOPSIS
-\fB
-#include <png.h>\fP
+\fB#include <png.h>\fP
-\fBpng_uint_32 png_access_version_number \fI(void\fP\fB);\fP
+\fBpng_uint_32 png_access_version_number (void);\fP
\fBvoid png_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
@@ -35,7 +35,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBpng_structp png_create_write_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
-\fBvoid png_data_freer (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIfreer\fP\fB, png_uint_32 \fImask)\fP\fB);\fP
+\fBvoid png_data_freer (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIfreer\fP\fB, png_uint_32 \fImask\fP\fB);\fP
\fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP
@@ -225,7 +225,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE* \fIfile\fP\fB);\fP
-\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, png_size_t \fIsize\fP\fB);\fP
+\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, size_t \fIsize\fP\fB);\fP
\fBint png_image_finish_read (png_imagep \fP\fIimage\fP\fB, png_colorp \fP\fIbackground\fP\fB, void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
@@ -233,11 +233,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBint png_image_write_to_file (png_imagep \fP\fIimage\fP\fB, const char \fP\fI*file\fP\fB, int \fP\fIconvert_to_8bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
-\fBint png_image_write_to_memory (png_imagep \fP\fIimage\fP\fB, void \fP\fI*memory\fP\fB, png_alloc_size_t * PNG_RESTRICT \fP\fImemory_bytes\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, const void \fI*colormap)\fP\fB);\fP
+\fBint png_image_write_to_memory (png_imagep \fP\fIimage\fP\fB, void \fP\fI*memory\fP\fB, png_alloc_size_t * PNG_RESTRICT \fP\fImemory_bytes\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, const void \fI*colormap\fP\fB);\fP
-\fBint png_image_write_to_stdio (png_imagep \fP\fIimage\fP\fB, FILE \fP\fI*file\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap)\fP\fB);\fP
+\fBint png_image_write_to_stdio (png_imagep \fP\fIimage\fP\fB, FILE \fP\fI*file\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP
-\fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP
+\fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, size_t \fIpng_info_struct_size\fP\fB);\fP
\fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP
@@ -251,11 +251,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBpng_uint_32 png_permit_mng_features (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fImng_features_permitted\fP\fB);\fP
-\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_size\fP\fB);\fP
+\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, size_t \fIbuffer_size\fP\fB);\fP
-\fBpng_size_t png_process_data_pause \fP\fI(png_structp\fP\fB, int \fIsave\fP\fB);\fP
+\fBsize_t png_process_data_pause (png_structp \fP\fIpng_ptr\fP\fB, int \fIsave\fP\fB);\fP
-\fBpng_uint_32 png_process_data_skip \fI(png_structp\fP\fB);\fP
+\fBpng_uint_32 png_process_data_skip (png_structp \fP\fIpng_ptr\fP\fB);\fP
\fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP
@@ -297,7 +297,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP
-\fBvoid png_set_check_for_invalid_index(png_structrp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP
+\fBvoid png_set_check_for_invalid_index (png_structrp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP
\fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP
@@ -353,7 +353,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBvoid png_set_eXIf (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fIexif\fP\fB);\fP
-\fBvoid png_set_eXIf_1 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, const png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fIexif\fP\fB);\fP
+\fBvoid png_set_eXIf_1 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fIexif\fP\fB);\fP
\fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP
@@ -453,7 +453,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBvoid png_set_text_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP
-\fBvoid \fP\fIpng_set_text_compression_method\fP\fB, (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod)\fP\fB);\fP
+\fBvoid png_set_text_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP
\fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
@@ -475,15 +475,15 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
\fBvoid png_set_write_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIwrite_user_transform_fn\fP\fB);\fP
-\fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, png_size_t \fP\fIstart\fP\fB, png_size_t \fInum_to_check\fP\fB);\fP
+\fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, size_t \fP\fIstart\fP\fB, size_t \fInum_to_check\fP\fB);\fP
\fBvoid png_start_read_image (png_structp \fIpng_ptr\fP\fB);\fP
\fBvoid png_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP
-\fBvoid png_write_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
+\fBvoid png_write_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_bytep \fP\fIdata\fP\fB, size_t \fIlength\fP\fB);\fP
-\fBvoid png_write_chunk_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
+\fBvoid png_write_chunk_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, size_t \fIlength\fP\fB);\fP
\fBvoid png_write_chunk_end (png_structp \fIpng_ptr\fP\fB);\fP
@@ -515,13 +515,12 @@ the Portable Network Graphics (PNG) format image files. It uses the
.IR zlib(3)
compression library.
Following is a copy of the libpng-manual.txt file that accompanies libpng.
+
.SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng
- libpng version 1.6.34 - September 29, 2017
- Updated and distributed by Glenn Randers-Pehrson
- <glennrp at users.sourceforge.net>
- Copyright (c) 1998-2017 Glenn Randers-Pehrson
+ Copyright (c) 2018-2023 Cosmin Truta
+ Copyright (c) 1998-2018 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer
@@ -529,9 +528,13 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
- libpng versions 0.97, January 1998, through 1.6.34 - September 29, 2017
+ libpng version 1.6.36, December 2018, through 1.6.40 - June 2023
+ Updated and distributed by Cosmin Truta
+ Copyright (c) 2018-2023 Cosmin Truta
+
+ libpng versions 0.97, January 1998, through 1.6.35 - July 2018
Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2017 Glenn Randers-Pehrson
+ Copyright (c) 1998-2018 Glenn Randers-Pehrson
libpng 1.0 beta 6 - version 0.96 - May 28, 1997
Updated and distributed by Andreas Dilger
@@ -563,7 +566,6 @@ libpng-manual.txt - A description on how to use and modify libpng
XIII. Detecting libpng
XIV. Source code repository
XV. Coding style
- XVI. Y2K Compliance in libpng
.SH I. Introduction
@@ -584,7 +586,7 @@ file format in application programs.
The PNG specification (second edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
-<https://www.w3.org/TR/2003/REC-PNG-20031110/
+<https://www.w3.org/TR/2003/REC-PNG-20031110/>.
The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at
@@ -592,9 +594,9 @@ The PNG-1.2 specification is available at
It is technically equivalent
to the PNG specification (second edition) but has some additional material.
-The PNG-1.0 specification is available as RFC 2083
+The PNG-1.0 specification is available as RFC 2083 at
<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
-W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
+W3C Recommendation at <https://www.w3.org/TR/REC-png-961001>.
Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -866,18 +868,18 @@ Customizing libpng.
FILE *fp = fopen(file_name, "rb");
if (!fp)
{
- return (ERROR);
+ return ERROR;
}
if (fread(header, 1, number, fp) != number)
{
- return (ERROR);
+ return ERROR;
}
is_png = !png_sig_cmp(header, 0, number);
if (!is_png)
{
- return (NOT_PNG);
+ return NOT_PNG;
}
Next, png_struct and png_info need to be allocated and initialized. In
@@ -896,7 +898,7 @@ create the structure, so your application should check for that.
user_error_fn, user_warning_fn);
if (!png_ptr)
- return (ERROR);
+ return ERROR;
png_infop info_ptr = png_create_info_struct(png_ptr);
@@ -904,7 +906,7 @@ create the structure, so your application should check for that.
{
png_destroy_read_struct(&png_ptr,
(png_infopp)NULL, (png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
If you want to use your own memory allocation routines,
@@ -939,7 +941,7 @@ free any memory.
png_destroy_read_struct(&png_ptr, &info_ptr,
&end_info);
fclose(fp);
- return (ERROR);
+ return ERROR;
}
Pass (png_infopp)NULL instead of &end_info if you didn't create
@@ -1021,7 +1023,7 @@ input stream. You must supply the function
png_byte name[5];
png_byte *data;
- png_size_t size;
+ size_t size;
/* Note that libpng has already taken care of
the CRC handling */
@@ -1030,9 +1032,9 @@ input stream. You must supply the function
unknown chunk structure, process it, and return one
of the following: */
- return (\-n); /* chunk had an error */
- return (0); /* did not recognize */
- return (n); /* success */
+ return \-n; /* chunk had an error */
+ return 0; /* did not recognize */
+ return n; /* success */
}
(You can give your function another name that you like instead of
@@ -1394,7 +1396,7 @@ described below (the latter being the two common names for associated alpha
color channels). Note that PNG files always contain non-associated color
channels; png_set_alpha_mode() with one of the modes causes the decoder to
convert the pixels to an associated form before returning them to your
-application.
+application.
Since it is not necessary to perform arithmetic on opaque color values so
long as they are not to be resampled and are in the final color space it is
@@ -1521,7 +1523,7 @@ chunks to be assumed to be encoded using sRGB.
png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
In this case the output is assumed to be something like an sRGB conformant
-display preceeded by a power-law lookup table of power 1.45. This is how
+display preceded by a power-law lookup table of power 1.45. This is how
early Mac systems behaved.
png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);
@@ -1573,7 +1575,7 @@ faster.)
When the default gamma of PNG files doesn't match the output gamma.
If you have PNG files with no gamma information png_set_alpha_mode allows
-you to provide a default gamma, but it also sets the ouput gamma to the
+you to provide a default gamma, but it also sets the output gamma to the
matching value. If you know your PNG files have a gamma that doesn't
match the output you can take advantage of the fact that
png_set_alpha_mode always sets the output gamma but only sets the PNG
@@ -2309,7 +2311,7 @@ the information. If, instead, you want to convert the image to an opaque
version with no alpha channel use png_set_background; see below.
As of libpng version 1.5.2, almost all useful expansions are supported, the
-major ommissions are conversion of grayscale to indexed images (which can be
+major omissions are conversion of grayscale to indexed images (which can be
done trivially in the application) and conversion of indexed to grayscale (which
can be done by a trivial manipulation of the palette.)
@@ -2927,7 +2929,7 @@ separate.
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
png_read_end(png_ptr, end_info);
@@ -3067,7 +3069,7 @@ png_infop info_ptr;
user_error_fn, user_warning_fn);
if (!png_ptr)
- return (ERROR);
+ return ERROR;
info_ptr = png_create_info_struct(png_ptr);
@@ -3075,14 +3077,14 @@ png_infop info_ptr;
{
png_destroy_read_struct(&png_ptr,
(png_infopp)NULL, (png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
/* This one's new. You can provide functions
@@ -3116,7 +3118,7 @@ png_infop info_ptr;
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
/* This one's new also. Simply give it a chunk
@@ -3260,7 +3262,7 @@ custom writing functions. See the discussion under Customizing libpng.
FILE *fp = fopen(file_name, "wb");
if (!fp)
- return (ERROR);
+ return ERROR;
Next, png_struct and png_info need to be allocated and initialized.
As these can be both relatively large, you may not want to store these
@@ -3275,14 +3277,14 @@ both "png_ptr"; you can call them anything you like, such as
user_error_fn, user_warning_fn);
if (!png_ptr)
- return (ERROR);
+ return ERROR;
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_write_struct(&png_ptr,
(png_infopp)NULL);
- return (ERROR);
+ return ERROR;
}
If you want to use your own memory allocation routines,
@@ -3309,7 +3311,7 @@ section below for more information on the libpng error handling.
{
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
- return (ERROR);
+ return ERROR;
}
...
return;
@@ -4297,7 +4299,7 @@ in-memory bitmap formats or to be written from the same formats. If these
formats do not accommodate your needs then you can, and should, use the more
sophisticated APIs above - these support a wide variety of in-memory formats
and a wide variety of sophisticated transformations to those formats as well
-as a wide variety of APIs to manipulate ancilliary information.
+as a wide variety of APIs to manipulate ancillary information.
To read a PNG file using the simplified API:
@@ -4573,7 +4575,7 @@ Flags containing additional information about the image are held in
the 'flags' field of png_image.
PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB == 0x01
- This indicates the the RGB values of the in-memory bitmap do not
+ This indicates that the RGB values of the in-memory bitmap do not
correspond to the red, green and blue end-points defined by sRGB.
PNG_IMAGE_FLAG_FAST == 0x02
@@ -4620,7 +4622,7 @@ READ APIs
The PNG header is read from the stdio FILE object.
int png_image_begin_read_from_memory(png_imagep image,
- png_const_voidp memory, png_size_t size)
+ png_const_voidp memory, size_t size)
The PNG header is read from the given memory buffer.
@@ -4773,10 +4775,10 @@ png_get_io_ptr(). For example:
The replacement I/O functions must have prototypes as follows:
void user_read_data(png_structp png_ptr,
- png_bytep data, png_size_t length);
+ png_bytep data, size_t length);
void user_write_data(png_structp png_ptr,
- png_bytep data, png_size_t length);
+ png_bytep data, size_t length);
void user_flush_data(png_structp png_ptr);
@@ -5039,7 +5041,7 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
having level = 0 will be printed. There aren't any such statements in
this version of libpng, but if you insert some they will be printed.
-.SH VII. MNG support
+.SH VII. MNG support
The MNG specification (available at http://www.libpng.org/pub/mng) allows
certain extensions to PNG for PNG images that are embedded in MNG datastreams.
@@ -5066,7 +5068,7 @@ or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at
https://www.libmng.com/) instead.
-.SH VIII. Changes to Libpng from version 0.88
+.SH VIII. Changes to Libpng from version 0.88
It should be noted that versions of libpng later than 0.96 are not
distributed by the original libpng author, Guy Schalnat, nor by
@@ -5121,7 +5123,7 @@ application:
png_uint_32 application_vn = PNG_LIBPNG_VER;
-.SH IX. Changes to Libpng from version 1.0.x to 1.2.x
+.SH IX. Changes to Libpng from version 1.0.x to 1.2.x
Support for user memory management was enabled by default. To
accomplish this, the functions png_create_read_struct_2(),
@@ -5218,7 +5220,7 @@ which also expands tRNS to alpha was replaced with
png_set_expand_gray_1_2_4_to_8()
which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
-.SH X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
+.SH X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
Private libpng prototypes and macro definitions were moved from
png.h and pngconf.h into a new pngpriv.h header file.
@@ -5302,7 +5304,7 @@ behavior in case the application runs out of memory part-way through
the process.
We changed the prototypes of png_get_compression_buffer_size() and
-png_set_compression_buffer_size() to work with png_size_t instead of
+png_set_compression_buffer_size() to work with size_t instead of
png_uint_32.
Support for numbered error messages was removed by default, since we
@@ -5328,7 +5330,7 @@ was renamed to PNG_READ_QUANTIZE_SUPPORTED.
We removed the trailing '.' from the warning and error messages.
-.SH XI. Changes to Libpng from version 1.4.x to 1.5.x
+.SH XI. Changes to Libpng from version 1.4.x to 1.5.x
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
function) incorrectly returned a value of type png_uint_32.
@@ -5391,7 +5393,7 @@ to png_bytepp, and in png_set_iCCP, from png_charp to png_const_bytep.
There are changes of form in png.h, including new and changed macros to
declare parts of the API. Some API functions with arguments that are
pointers to data not modified within the function have been corrected to
-declare these arguments with PNG_CONST.
+declare these arguments with const.
Much of the internal use of C macros to control the library build has also
changed and some of this is visible in the exported header files, in
@@ -5586,7 +5588,7 @@ even though the default is to use the macros - this allows applications
to choose at app buildtime whether or not to use macros (previously
impossible because the functions weren't in the default build.)
-.SH XII. Changes to Libpng from version 1.5.x to 1.6.x
+.SH XII. Changes to Libpng from version 1.5.x to 1.6.x
A "simplified API" has been added (see documentation in png.h and a simple
example in contrib/examples/pngtopng.c). The new publicly visible API
@@ -5749,7 +5751,7 @@ attempt to decode the Exif profile; it simply returns a byte array
containing the profile to the calling application which must do its own
decoding.
-.SH XIII. Detecting libpng
+.SH XIII. Detecting libpng
The png_get_io_ptr() function has been present since libpng-0.88, has never
changed, and is unaffected by conditional compilation macros. It is the
@@ -5773,9 +5775,8 @@ or you can browse it with a web browser at
https://github.com/glennrp/libpng or
https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
-Patches can be sent to glennrp at users.sourceforge.net or to
-png-mng-implement at lists.sourceforge.net or you can upload them to
-the libpng bug tracker at
+Patches can be sent to png-mng-implement at lists.sourceforge.net or
+uploaded to the libpng bug tracker at
https://libpng.sourceforge.io/
@@ -5784,9 +5785,9 @@ or as a "pull request" to
https://github.com/glennrp/libpng/pulls
We also accept patches built from the tar or zip distributions, and
-simple verbal discriptions of bug fixes, reported either to the
+simple verbal descriptions of bug fixes, reported either to the
SourceForge bug tracker, to the png-mng-implement at lists.sf.net
-mailing list, as github issues, or directly to glennrp.
+mailing list, as github issues.
.SH XV. Coding style
@@ -5807,7 +5808,7 @@ braces on separate lines:
The braces can be omitted from simple one-line actions:
if (condition)
- return (0);
+ return 0;
We use 3-space indentation, except for continued statements which
are usually indented the same as the first line of the statement
@@ -5926,61 +5927,6 @@ Lines do not exceed 80 characters.
Other rules can be inferred by inspecting the libpng source.
-.SH XVI. Y2K Compliance in libpng
-
-Since the PNG Development group is an ad-hoc body, we can't make
-an official declaration.
-
-This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.6.34 are Y2K compliant. It is my belief that earlier
-versions were also Y2K compliant.
-
-Libpng only has two year fields. One is a 2-byte unsigned integer
-that will hold years up to 65535. The other, which is deprecated,
-holds the date in text format, and will hold years up to 9999.
-
-The integer is
- "png_uint_16 year" in png_time_struct.
-
-The string is
- "char time_buffer[29]" in png_struct. This is no longer used
-in libpng-1.6.x and will be removed from libpng-1.7.0.
-
-There are seven time-related functions:
-
- png_convert_to_rfc_1123_buffer() in png.c
- (formerly png_convert_to_rfc_1152() in error, and
- also formerly png_convert_to_rfc_1123())
- png_convert_from_struct_tm() in pngwrite.c, called
- in pngwrite.c
- png_convert_from_time_t() in pngwrite.c
- png_get_tIME() in pngget.c
- png_handle_tIME() in pngrutil.c, called in pngread.c
- png_set_tIME() in pngset.c
- png_write_tIME() in pngwutil.c, called in pngwrite.c
-
-All appear to handle dates properly in a Y2K environment. The
-png_convert_from_time_t() function calls gmtime() to convert from system
-clock time, which returns (year - 1900), which we properly convert to
-the full 4-digit year. There is a possibility that applications using
-libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
-function, or that they are incorrectly passing only a 2-digit year
-instead of "year - 1900" into the png_convert_from_struct_tm() function,
-but this is not under our control. The libpng documentation has always
-stated that it works with 4-digit years, and the APIs have been
-documented as such.
-
-The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
-integer to hold the year, and can hold years as large as 65535.
-
-zlib, upon which libpng depends, is also Y2K compliant. It contains
-no date-related code.
-
-
- Glenn Randers-Pehrson
- libpng maintainer
- PNG Development Group
-
.SH NOTE
Note about libpng version numbers:
@@ -5991,9 +5937,9 @@ on the library has not always been consistent and straightforward.
The following table summarizes matters since version 0.89c, which was
the first widely used release:
- source png.h png.h shared-lib
- version string int version
- ------- ------ ----- ----------
+ source png.h png.h shared-lib
+ version string int version
+ ------- ------ ----- ----------
0.89c "1.0 beta 3" 0.89 89 1.0.89
0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90]
0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95]
@@ -6028,61 +5974,54 @@ the first widely used release:
1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible)
1.0.7 1 10007 (still compatible)
...
- 1.0.19 10 10019 10.so.0.19[.0]
+ 1.0.69 10 10069 10.so.0.69[.0]
...
1.2.59 13 10259 12.so.0.59[.0]
...
+ 1.4.20 14 10420 14.so.0.20[.0]
+ ...
1.5.30 15 10530 15.so.15.30[.0]
...
- 1.6.34 16 10634 16.so.16.34[.0]
-
-Henceforth the source version will match the shared-library minor
-and patch numbers; the shared-library major version number will be
-used for changes in backward compatibility, as it is intended. The
-PNG_PNGLIB_VER macro, which is not used within libpng but is available
-for applications, is an unsigned integer of the form xyyzz corresponding
-to the source version x.y.z (leading zeros in y and z). Beta versions
-were given the previous public release number plus a letter, until
-version 1.0.6j; from then on they were given the upcoming public
-release number plus "betaNN" or "rcNN".
+ 1.6.35 16 10635 16.so.16.35[.0]
+
+Henceforth the source version will match the shared-library minor and
+patch numbers; the shared-library major version number will be used for
+changes in backward compatibility, as it is intended.
+The PNG_PNGLIB_VER macro, which is not used within libpng but is
+available for applications, is an unsigned integer of the form XYYZZ
+corresponding to the source version X.Y.Z (leading zeros in Y and Z).
+Beta versions were given the previous public release number plus a
+letter, until version 1.0.6j; from then on they were given the upcoming
+public release number plus "betaNN" or "rcNN".
.SH "SEE ALSO"
-.IR libpngpf(3) ", " png(5)
-.LP
-.IR libpng :
+.BR "png"(5)
.IP
-https://libpng.sourceforge.io/ (follow the [DOWNLOAD] link)
-http://www.libpng.org/pub/png
-
+The PNG (Portable Network Graphics) format specification.
.LP
-.IR zlib :
+.B libpng
.IP
-(generally) at the same location as
-.I libpng
-or at
+http://www.libpng.org/pub/png/libpng.html (canonical home page)
.br
-https://zlib.net/
-
+https://github.com/pnggroup/libpng (canonical Git repository)
+.br
+https://libpng.sourceforge.io (downloadable archives)
.LP
-.IR PNG specification: RFC 2083
+.B zlib
.IP
-(generally) at the same location as
-.I libpng
-or at
+https://zlib.net (canonical home page)
.br
-https://www.ietf.org/rfc/rfc2083.txt
+https://github.com/madler/zlib (canonical Git repository)
.br
-or (as a W3C Recommendation) at
-.br
-https://www.w3.org/TR/REC-png.html
-
+A copy of zlib may also be found at the same location as libpng.
.LP
In the case of any inconsistency between the PNG specification
and this library, the specification takes precedence.
.SH AUTHORS
-This man page: Glenn Randers-Pehrson
-<glennrp at users.sourceforge.net>
+This man page:
+Initially created by Glenn Randers-Pehrson.
+Maintained by Cosmin Truta.
The contributing authors would like to thank all those who helped
with testing, bug fixes, and patience. This wouldn't have been
@@ -6090,160 +6029,14 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
-Libpng version 1.6.34 - September 29, 2017:
+Libpng:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
-Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
+Maintained by Cosmin Truta.
-Supported by the PNG development group
+Supported by the PNG development group.
.br
-png-mng-implement at lists.sf.net
-(subscription required; visit
-png-mng-implement at lists.sourceforge.net (subscription required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-implement
-to subscribe).
-
-.SH NOTICES:
-
-This copy of the libpng notices is provided for your convenience. In case of
-any discrepancy between this copy and the notices in the file png.h that is
-included in the libpng distribution, the latter shall prevail.
-
-COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
-
-If you modify libpng you may insert additional notices immediately following
-this sentence.
-
-This code is released under the libpng license.
-
-libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
-Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
-derived from libpng-1.0.6, and are distributed according to the same
-disclaimer and license as libpng-1.0.6 with the following individuals
-added to the list of Contributing Authors:
-
- Simon-Pierre Cadieux
- Eric S. Raymond
- Mans Rullgard
- Cosmin Truta
- Gilles Vollant
- James Yu
- Mandar Sahastrabuddhe
- Google Inc.
- Vadim Barkov
-
-and with the following additions to the disclaimer:
-
- There is no warranty against interference with your enjoyment of the
- library or against infringement. There is no warranty that our
- efforts or the library will fulfill any of your particular purposes
- or needs. This library is provided with all faults, and the entire
- risk of satisfactory quality, performance, accuracy, and effort is with
- the user.
-
-Some files in the "contrib" directory and some configure-generated
-files that are distributed with libpng have other copyright owners and
-are released under other open source licenses.
-
-libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
-Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
-libpng-0.96, and are distributed according to the same disclaimer and
-license as libpng-0.96, with the following individuals added to the list
-of Contributing Authors:
-
- Tom Lane
- Glenn Randers-Pehrson
- Willem van Schaik
-
-libpng versions 0.89, June 1996, through 0.96, May 1997, are
-Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
-and are distributed according to the same disclaimer and license as
-libpng-0.88, with the following individuals added to the list of
-Contributing Authors:
-
- John Bowler
- Kevin Bracey
- Sam Bushell
- Magnus Holmgren
- Greg Roelofs
- Tom Tanner
-
-Some files in the "scripts" directory have other copyright owners
-but are released under this license.
-
-libpng versions 0.5, May 1995, through 0.88, January 1996, are
-Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
-
-For the purposes of this copyright and license, "Contributing Authors"
-is defined as the following set of individuals:
-
- Andreas Dilger
- Dave Martindale
- Guy Eric Schalnat
- Paul Schmidt
- Tim Wegner
-
-The PNG Reference Library is supplied "AS IS". The Contributing Authors
-and Group 42, Inc. disclaim all warranties, expressed or implied,
-including, without limitation, the warranties of merchantability and of
-fitness for any purpose. The Contributing Authors and Group 42, Inc.
-assume no liability for direct, indirect, incidental, special, exemplary,
-or consequential damages, which may result from the use of the PNG
-Reference Library, even if advised of the possibility of such damage.
-
-Permission is hereby granted to use, copy, modify, and distribute this
-source code, or portions hereof, for any purpose, without fee, subject
-to the following restrictions:
-
- 1. The origin of this source code must not be misrepresented.
-
- 2. Altered versions must be plainly marked as such and must not
- be misrepresented as being the original source.
-
- 3. This Copyright notice may not be removed or altered from any
- source or altered source distribution.
-
-The Contributing Authors and Group 42, Inc. specifically permit, without
-fee, and encourage the use of this source code as a component to
-supporting the PNG file format in commercial products. If you use this
-source code in a product, acknowledgment is not required but would be
-appreciated.
-
-END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
-
-TRADEMARK:
-
-The name "libpng" has not been registered by the Copyright owner
-as a trademark in any jurisdiction. However, because libpng has
-been distributed and maintained world-wide, continually since 1995,
-the Copyright owner claims "common-law trademark protection" in any
-jurisdiction where common-law trademark is recognized.
-
-OSI CERTIFICATION:
-
-Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
-a certification mark of the Open Source Initiative. OSI has not addressed
-the additional disclaimers inserted at version 1.0.7.
-
-EXPORT CONTROL:
-
-The Copyright owner believes that the Export Control Classification
-Number (ECCN) for libpng is EAR99, which means not subject to export
-controls or International Traffic in Arms Regulations (ITAR) because
-it is open source, publicly available software, that does not contain
-any encryption software. See the EAR, paragraphs 734.3(b)(3) and
-734.7(b).
-
-A "png_get_copyright" function is available, for convenient use in "about"
-boxes and the like:
-
- printf("%s", png_get_copyright(NULL));
-
-Also, the PNG logo (in PNG format, of course) is supplied in the
-files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
-
-Glenn Randers-Pehrson
-glennrp at users.sourceforge.net
-September 29, 2017
+png-mng-implement at lists.sourceforge.net. (Subscription is required;
+visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement
+to subscribe.)
.\" end of man page
-
diff --git a/libpng.pc.in b/libpng.pc.in
index 9708e9af2..de127d4f8 100644
--- a/libpng.pc.in
+++ b/libpng.pc.in
@@ -6,7 +6,7 @@ includedir=@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
Name: libpng
Description: Loads and saves PNG files
Version: @PNGLIB_VERSION@
-Requires: zlib
+Requires.private: zlib
Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
Libs.private: @LIBS@
Cflags: -I${includedir}
diff --git a/libpngpf.3 b/libpngpf.3
index 8cea87a71..43eeb9a31 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,18 +1,24 @@
-.TH LIBPNGPF 3 "April 1, 2017"
+.TH LIBPNGPF 3 "June 21, 2023"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.40
(private functions)
+
.SH SYNOPSIS
-\fB\fB#include \fI\fI"pngpriv.h"
+\fB#include \fI"pngpriv.h"
-\fB\fBAs of libpng version \fP\fI\fP\fI1.5.1\fP\fB\fP\fB, this section is no longer \fP\fI\fP\fImaintained\fP\fB\fP\fB, now that the private function prototypes are hidden in pngpriv.h and not accessible to applications. Look in pngpriv.h for the prototypes and a short description of each \fI\fIfunction.
+\fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer
+\fP\fImaintained\fP\fB, now that the private function prototypes are hidden in
+\fP\fIpngpriv.h\fP\fB and not accessible to applications. Look in
+\fP\fIpngpriv.h\fP\fB for the prototypes and a short description of each
+function.
.SH DESCRIPTION
The functions previously listed here are used privately by libpng and are not
available for use by applications. They are not "exported" to applications
using shared libraries.
-.SH SEE ALSO
+.SH "SEE ALSO"
.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
-.SH AUTHOR
-Glenn Randers-Pehrson
+
+.SH AUTHORS
+Cosmin Truta, Glenn Randers-Pehrson
diff --git a/ltmain.sh b/ltmain.sh
index 0f0a2da3f..2a50d7f6f 100755
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,12 +1,12 @@
-#! /bin/sh
+#! /usr/bin/env sh
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-## by inline-source v2014-01-03.01
+## by inline-source v2019-02-19.15
-# libtool (GNU libtool) 2.4.6
+# libtool (GNU libtool) 2.4.7
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.6
-package_revision=2.4.6
+VERSION=2.4.7
+package_revision=2.4.7
## ------ ##
@@ -64,34 +64,25 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
+scriptversion=2019-02-19.15; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
-# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# This is free software. There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2004-2019, 2021 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it. See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
-# Please report bugs or propose patches to gary@gnu.org.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
## ------ ##
@@ -139,9 +130,12 @@ do
_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi"
done
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# These NLS vars are set unconditionally (bootstrap issue #24). Unset those
+# in case the environment reset is needed later and the $save_* variant is not
+# defined (see the code above).
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
# Make sure IFS has a sensible default
sp=' '
@@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
+# func_unset VAR
+# --------------
+# Portably unset VAR.
+# In some shells, an 'unset VAR' statement leaves a non-zero return
+# status if VAR is already unset, which might be problematic if the
+# statement is used at the end of a function (thus poisoning its return
+# value) or when 'set -e' is active (causing even a spurious abort of
+# the script in this case).
+func_unset ()
+{
+ { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
+}
+
+
+# Make sure CDPATH doesn't cause `cd` commands to output the target dir.
+func_unset CDPATH
+
+# Make sure ${,E,F}GREP behave sanely.
+func_unset GREP_OPTIONS
+
## ------------------------- ##
## Locate command utilities. ##
@@ -259,7 +273,7 @@ test -z "$SED" && {
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
- func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+ func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
rm -f conftest.sed
SED=$func_path_progs_result
}
@@ -295,7 +309,7 @@ test -z "$GREP" && {
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
- func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+ func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
GREP=$func_path_progs_result
}
@@ -360,6 +374,35 @@ sed_double_backslash="\
s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
s/\n//g"
+# require_check_ifs_backslash
+# ---------------------------
+# Check if we can use backslash as IFS='\' separator, and set
+# $check_ifs_backshlash_broken to ':' or 'false'.
+require_check_ifs_backslash=func_require_check_ifs_backslash
+func_require_check_ifs_backslash ()
+{
+ _G_save_IFS=$IFS
+ IFS='\'
+ _G_check_ifs_backshlash='a\\b'
+ for _G_i in $_G_check_ifs_backshlash
+ do
+ case $_G_i in
+ a)
+ check_ifs_backshlash_broken=false
+ ;;
+ '')
+ break
+ ;;
+ *)
+ check_ifs_backshlash_broken=:
+ break
+ ;;
+ esac
+ done
+ IFS=$_G_save_IFS
+ require_check_ifs_backslash=:
+}
+
## ----------------- ##
## Global variables. ##
@@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
{
$debug_cmd
- func_quote_for_eval "$2"
- eval "$1+=\\ \$func_quote_for_eval_result"
+ func_quote_arg pretty "$2"
+ eval "$1+=\\ \$func_quote_arg_result"
}'
else
func_append_quoted ()
{
$debug_cmd
- func_quote_for_eval "$2"
- eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ func_quote_arg pretty "$2"
+ eval "$1=\$$1\\ \$func_quote_arg_result"
}
fi
@@ -1091,85 +1134,203 @@ func_relative_path ()
}
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-# i) func_quote_for_eval_result
-# double-quoted, suitable for a subsequent eval
-# ii) func_quote_for_eval_unquoted_result
-# has all characters that are still active within double
-# quotes backslashified.
-func_quote_for_eval ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg. Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
{
$debug_cmd
- func_quote_for_eval_unquoted_result=
- func_quote_for_eval_result=
- while test 0 -lt $#; do
- case $1 in
- *[\\\`\"\$]*)
- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
- *)
- _G_unquoted_arg=$1 ;;
- esac
- if test -n "$func_quote_for_eval_unquoted_result"; then
- func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
- else
- func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ $require_check_ifs_backslash
+
+ func_quote_portable_result=$2
+
+ # one-time-loop (easy break)
+ while true
+ do
+ if $1; then
+ func_quote_portable_result=`$ECHO "$2" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+ break
fi
- case $_G_unquoted_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and variable expansion
- # for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_quoted_arg=\"$_G_unquoted_arg\"
+ # Quote for eval.
+ case $func_quote_portable_result in
+ *[\\\`\"\$]*)
+ # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string
+ # contains the shell wildcard characters.
+ case $check_ifs_backshlash_broken$func_quote_portable_result in
+ :*|*[\[\*\?]*)
+ func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
+ | $SED "$sed_quote_subst"`
+ break
+ ;;
+ esac
+
+ func_quote_portable_old_IFS=$IFS
+ for _G_char in '\' '`' '"' '$'
+ do
+ # STATE($1) PREV($2) SEPARATOR($3)
+ set start "" ""
+ func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+ IFS=$_G_char
+ for _G_part in $func_quote_portable_result
+ do
+ case $1 in
+ quote)
+ func_append func_quote_portable_result "$3$2"
+ set quote "$_G_part" "\\$_G_char"
+ ;;
+ start)
+ set first "" ""
+ func_quote_portable_result=
+ ;;
+ first)
+ set quote "$_G_part" ""
+ ;;
+ esac
+ done
+ done
+ IFS=$func_quote_portable_old_IFS
;;
- *)
- _G_quoted_arg=$_G_unquoted_arg
- ;;
+ *) ;;
esac
-
- if test -n "$func_quote_for_eval_result"; then
- func_append func_quote_for_eval_result " $_G_quoted_arg"
- else
- func_append func_quote_for_eval_result "$_G_quoted_arg"
- fi
- shift
+ break
done
+
+ func_quote_portable_unquoted_result=$func_quote_portable_result
+ case $func_quote_portable_result in
+ # double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # many bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_portable_result=\"$func_quote_portable_result\"
+ ;;
+ esac
}
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- $debug_cmd
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed. Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+ printf -v _GL_test_printf_tilde %q '~'
+ if test '\~' = "$_GL_test_printf_tilde"; then
+ func_quotefast_eval ()
+ {
+ printf -v func_quotefast_eval_result %q "$1"
+ }
+ else
+ # Broken older Bash implementations. Make those faster too if possible.
+ func_quotefast_eval ()
+ {
+ case $1 in
+ '~'*)
+ func_quote_portable false "$1"
+ func_quotefast_eval_result=$func_quote_portable_result
+ ;;
+ *)
+ printf -v func_quotefast_eval_result %q "$1"
+ ;;
+ esac
+ }
+ fi
+else
+ func_quotefast_eval ()
+ {
+ func_quote_portable false "$1"
+ func_quotefast_eval_result=$func_quote_portable_result
+ }
+fi
- case $1 in
- *[\\\`\"]*)
- _G_arg=`$ECHO "$1" | $SED \
- -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- _G_arg=$1 ;;
+
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later. MODEs argument may contain zero or more
+# specifiers listed below separated by ',' character. This function returns two
+# values:
+# i) func_quote_arg_result
+# double-quoted (when needed), suitable for a subsequent eval
+# ii) func_quote_arg_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified. Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+# - escape shell special characters
+# 'expand'
+# - the same as 'eval'; but do not quote variable references
+# 'pretty'
+# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
+# be used later in func_quote to get output like: 'echo "a b"' instead
+# of 'echo a\ b'. This is slower than default on some shells.
+# 'unquoted'
+# - produce also $func_quote_arg_unquoted_result which does not contain
+# wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+# string | *_result | *_unquoted_result
+# ------------+-----------------------+-------------------
+# " | \" | \"
+# a b | "a b" | a b
+# "a b" | "\"a b\"" | \"a b\"
+# * | "*" | *
+# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+# string | *_result | *_unquoted_result
+# --------------+---------------------+--------------------
+# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
+func_quote_arg ()
+{
+ _G_quote_expand=false
+ case ,$1, in
+ *,expand,*)
+ _G_quote_expand=:
+ ;;
esac
- case $_G_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_arg=\"$_G_arg\"
+ case ,$1, in
+ *,pretty,*|*,expand,*|*,unquoted,*)
+ func_quote_portable $_G_quote_expand "$2"
+ func_quote_arg_result=$func_quote_portable_result
+ func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+ ;;
+ *)
+ # Faster quote-for-eval for some shells.
+ func_quotefast_eval "$2"
+ func_quote_arg_result=$func_quotefast_eval_result
;;
esac
+}
+
- func_quote_for_expand_result=$_G_arg
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command. See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+ $debug_cmd
+ _G_func_quote_mode=$1 ; shift
+ func_quote_result=
+ while test 0 -lt $#; do
+ func_quote_arg "$_G_func_quote_mode" "$1"
+ if test -n "$func_quote_result"; then
+ func_append func_quote_result " $func_quote_arg_result"
+ else
+ func_append func_quote_result "$func_quote_arg_result"
+ fi
+ shift
+ done
}
@@ -1215,8 +1376,8 @@ func_show_eval ()
_G_cmd=$1
_G_fail_exp=${2-':'}
- func_quote_for_expand "$_G_cmd"
- eval "func_notquiet $func_quote_for_expand_result"
+ func_quote_arg pretty,expand "$_G_cmd"
+ eval "func_notquiet $func_quote_arg_result"
$opt_dry_run || {
eval "$_G_cmd"
@@ -1241,8 +1402,8 @@ func_show_eval_locale ()
_G_fail_exp=${2-':'}
$opt_quiet || {
- func_quote_for_expand "$_G_cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$_G_cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || {
@@ -1369,30 +1530,26 @@ func_lt_ver ()
# End:
#! /bin/sh
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
-# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This is free software. There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2010-2019, 2021 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it. See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
-# Please report bugs or propose patches to gary@gnu.org.
+# Set a version string for this script.
+scriptversion=2019-02-19.15; # UTC
## ------ ##
@@ -1415,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC
#
# In order for the '--version' option to work, you will need to have a
# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
+# starting with '# Written by ' and ending with '# Copyright'.
#
# For '-h' and '--help' to work, you will also need a one line
# description of your script's purpose in a comment directly above the
@@ -1427,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC
# to display verbose messages only when your user has specified
# '--verbose'.
#
-# After sourcing this file, you can plug processing for additional
+# After sourcing this file, you can plug in processing for additional
# options by amending the variables from the 'Configuration' section
# below, and following the instructions in the 'Option parsing'
# section further down.
@@ -1476,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information."
## ------------------------- ##
# This section contains functions for adding, removing, and running hooks
-# to the main code. A hook is just a named list of of function, that can
-# be run in order later on.
+# in the main code. A hook is just a list of function names that can be
+# run in order later on.
# func_hookable FUNC_NAME
# -----------------------
@@ -1510,7 +1667,8 @@ func_add_hook ()
# func_remove_hook FUNC_NAME HOOK_FUNC
# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+# Remove HOOK_FUNC from the list of hook functions to be called by
+# FUNC_NAME.
func_remove_hook ()
{
$debug_cmd
@@ -1519,10 +1677,28 @@ func_remove_hook ()
}
+# func_propagate_result FUNC_NAME_A FUNC_NAME_B
+# ---------------------------------------------
+# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
+# *_result variable of FUNC_NAME_B.
+func_propagate_result ()
+{
+ $debug_cmd
+
+ func_propagate_result_result=:
+ if eval "test \"\${${1}_result+set}\" = set"
+ then
+ eval "${2}_result=\$${1}_result"
+ else
+ func_propagate_result_result=false
+ fi
+}
+
+
# func_run_hooks FUNC_NAME [ARG]...
# ---------------------------------
# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
+# It's assumed that the list of hook functions contains nothing more
# than a whitespace-delimited list of legal shell function names, and
# no effort is wasted trying to catch shell meta-characters or preserve
# whitespace.
@@ -1532,22 +1708,19 @@ func_run_hooks ()
case " $hookable_fns " in
*" $1 "*) ;;
- *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ *) func_fatal_error "'$1' does not support hook functions." ;;
esac
eval _G_hook_fns=\$$1_hooks; shift
for _G_hook in $_G_hook_fns; do
- eval $_G_hook '"$@"'
-
- # store returned options list back into positional
- # parameters for next 'cmd' execution.
- eval _G_hook_result=\$${_G_hook}_result
- eval set dummy "$_G_hook_result"; shift
+ func_unset "${_G_hook}_result"
+ eval $_G_hook '${1+"$@"}'
+ func_propagate_result $_G_hook func_run_hooks
+ if $func_propagate_result_result; then
+ eval set dummy "$func_run_hooks_result"; shift
+ fi
done
-
- func_quote_for_eval ${1+"$@"}
- func_run_hooks_result=$func_quote_for_eval_result
}
@@ -1557,10 +1730,18 @@ func_run_hooks ()
## --------------- ##
# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'. Like this:
+# full positional parameter list from your hook function. You may remove
+# or edit any options that you action, and then pass back the remaining
+# unprocessed options in '<hooked_function_name>_result', escaped
+# suitably for 'eval'.
+#
+# The '<hooked_function_name>_result' variable is automatically unset
+# before your hook gets called; for best performance, only set the
+# *_result variable when necessary (i.e. don't call the 'func_quote'
+# function unnecessarily because it can be an expensive operation on some
+# machines).
+#
+# Like this:
#
# my_options_prep ()
# {
@@ -1570,9 +1751,8 @@ func_run_hooks ()
# usage_message=$usage_message'
# -s, --silent don'\''t print informational messages
# '
-#
-# func_quote_for_eval ${1+"$@"}
-# my_options_prep_result=$func_quote_for_eval_result
+# # No change in '$@' (ignored completely by this hook). Leave
+# # my_options_prep_result variable intact.
# }
# func_add_hook func_options_prep my_options_prep
#
@@ -1581,25 +1761,36 @@ func_run_hooks ()
# {
# $debug_cmd
#
-# # Note that for efficiency, we parse as many options as we can
+# args_changed=false
+#
+# # Note that, for efficiency, we parse as many options as we can
# # recognise in a loop before passing the remainder back to the
# # caller on the first unrecognised argument we encounter.
# while test $# -gt 0; do
# opt=$1; shift
# case $opt in
-# --silent|-s) opt_silent=: ;;
+# --silent|-s) opt_silent=:
+# args_changed=:
+# ;;
# # Separate non-argument short options:
# -s*) func_split_short_opt "$_G_opt"
# set dummy "$func_split_short_opt_name" \
# "-$func_split_short_opt_arg" ${1+"$@"}
# shift
+# args_changed=:
# ;;
-# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# *) # Make sure the first unrecognised option "$_G_opt"
+# # is added back to "$@" in case we need it later,
+# # if $args_changed was set to 'true'.
+# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
# esac
# done
#
-# func_quote_for_eval ${1+"$@"}
-# my_silent_option_result=$func_quote_for_eval_result
+# # Only call 'func_quote' here if we processed at least one argument.
+# if $args_changed; then
+# func_quote eval ${1+"$@"}
+# my_silent_option_result=$func_quote_result
+# fi
# }
# func_add_hook func_parse_options my_silent_option
#
@@ -1610,17 +1801,26 @@ func_run_hooks ()
#
# $opt_silent && $opt_verbose && func_fatal_help "\
# '--silent' and '--verbose' options are mutually exclusive."
-#
-# func_quote_for_eval ${1+"$@"}
-# my_option_validation_result=$func_quote_for_eval_result
# }
# func_add_hook func_validate_options my_option_validation
#
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that
# multiple option parsing hooks can be added safely.
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+ $debug_cmd
+
+ func_run_hooks func_options ${1+"$@"}
+ func_propagate_result func_run_hooks func_options_finish
+}
+
+
# func_options [ARG]...
# ---------------------
# All the functions called inside func_options are hookable. See the
@@ -1630,17 +1830,27 @@ func_options ()
{
$debug_cmd
- func_options_prep ${1+"$@"}
- eval func_parse_options \
- ${func_options_prep_result+"$func_options_prep_result"}
- eval func_validate_options \
- ${func_parse_options_result+"$func_parse_options_result"}
+ _G_options_quoted=false
- eval func_run_hooks func_options \
- ${func_validate_options_result+"$func_validate_options_result"}
+ for my_func in options_prep parse_options validate_options options_finish
+ do
+ func_unset func_${my_func}_result
+ func_unset func_run_hooks_result
+ eval func_$my_func '${1+"$@"}'
+ func_propagate_result func_$my_func func_options
+ if $func_propagate_result_result; then
+ eval set dummy "$func_options_result"; shift
+ _G_options_quoted=:
+ fi
+ done
- # save modified positional parameters for caller
- func_options_result=$func_run_hooks_result
+ $_G_options_quoted || {
+ # As we (func_options) are top-level options-parser function and
+ # nobody quoted "$@" for us yet, we need to do it explicitly for
+ # caller.
+ func_quote eval ${1+"$@"}
+ func_options_result=$func_quote_result
+ }
}
@@ -1649,9 +1859,8 @@ func_options ()
# All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of
# positional parameters. If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
+# needs to propagate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before returning.
func_hookable func_options_prep
func_options_prep ()
{
@@ -1662,9 +1871,7 @@ func_options_prep ()
opt_warning_types=
func_run_hooks func_options_prep ${1+"$@"}
-
- # save modified positional parameters for caller
- func_options_prep_result=$func_run_hooks_result
+ func_propagate_result func_run_hooks func_options_prep
}
@@ -1676,25 +1883,32 @@ func_parse_options ()
{
$debug_cmd
- func_parse_options_result=
-
+ _G_parse_options_requote=false
# this just eases exit handling
while test $# -gt 0; do
# Defer to hook functions for initial option parsing, so they
# get priority in the event of reusing an option name.
func_run_hooks func_parse_options ${1+"$@"}
-
- # Adjust func_parse_options positional parameters to match
- eval set dummy "$func_run_hooks_result"; shift
+ func_propagate_result func_run_hooks func_parse_options
+ if $func_propagate_result_result; then
+ eval set dummy "$func_parse_options_result"; shift
+ # Even though we may have changed "$@", we passed the "$@" array
+ # down into the hook and it quoted it for us (because we are in
+ # this if-branch). No need to quote it again.
+ _G_parse_options_requote=false
+ fi
# Break out of the loop if we already parsed every option.
test $# -gt 0 || break
+ # We expect that one of the options parsed in this function matches
+ # and thus we remove _G_opt from "$@" and need to re-quote.
+ _G_match_parse_options=:
_G_opt=$1
shift
case $_G_opt in
--debug|-x) debug_cmd='set -x'
- func_echo "enabling shell trace mode"
+ func_echo "enabling shell trace mode" >&2
$debug_cmd
;;
@@ -1704,7 +1918,10 @@ func_parse_options ()
;;
--warnings|--warning|-W)
- test $# = 0 && func_missing_arg $_G_opt && break
+ if test $# = 0 && func_missing_arg $_G_opt; then
+ _G_parse_options_requote=:
+ break
+ fi
case " $warning_categories $1" in
*" $1 "*)
# trailing space prevents matching last $1 above
@@ -1757,15 +1974,24 @@ func_parse_options ()
shift
;;
- --) break ;;
+ --) _G_parse_options_requote=: ; break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift
+ _G_match_parse_options=false
+ break
+ ;;
esac
+
+ if $_G_match_parse_options; then
+ _G_parse_options_requote=:
+ fi
done
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- func_parse_options_result=$func_quote_for_eval_result
+ if $_G_parse_options_requote; then
+ # save modified positional parameters for caller
+ func_quote eval ${1+"$@"}
+ func_parse_options_result=$func_quote_result
+ fi
}
@@ -1782,12 +2008,10 @@ func_validate_options ()
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
func_run_hooks func_validate_options ${1+"$@"}
+ func_propagate_result func_run_hooks func_validate_options
# Bail if the options were screwed!
$exit_cmd $EXIT_FAILURE
-
- # save modified positional parameters for caller
- func_validate_options_result=$func_run_hooks_result
}
@@ -1843,8 +2067,8 @@ func_missing_arg ()
# func_split_equals STRING
# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables
+# after splitting STRING at the '=' sign.
test -z "$_G_HAVE_XSI_OPS" \
&& (eval 'x=a/b/c;
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
@@ -1859,8 +2083,9 @@ then
func_split_equals_lhs=${1%%=*}
func_split_equals_rhs=${1#*=}
- test "x$func_split_equals_lhs" = "x$1" \
- && func_split_equals_rhs=
+ if test "x$func_split_equals_lhs" = "x$1"; then
+ func_split_equals_rhs=
+ fi
}'
else
# ...otherwise fall back to using expr, which is often a shell builtin.
@@ -1870,7 +2095,7 @@ else
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
func_split_equals_rhs=
- test "x$func_split_equals_lhs" = "x$1" \
+ test "x$func_split_equals_lhs=" = "x$1" \
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
}
fi #func_split_equals
@@ -1896,7 +2121,7 @@ else
{
$debug_cmd
- func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
}
fi #func_split_short_opt
@@ -1938,31 +2163,44 @@ func_usage_message ()
# func_version
# ------------
# Echo version message to standard output and exit.
+# The version message is extracted from the calling file's header
+# comments, with leading '# ' stripped:
+# 1. First display the progname and version
+# 2. Followed by the header comment line matching /^# Written by /
+# 3. Then a blank line followed by the first following line matching
+# /^# Copyright /
+# 4. Immediately followed by any lines between the previous matches,
+# except lines preceding the intervening completely blank line.
+# For example, see the header comments of this file.
func_version ()
{
$debug_cmd
printf '%s\n' "$progname $scriptversion"
$SED -n '
- /(C)/!b go
- :more
- /\./!{
- N
- s|\n# | |
- b more
- }
- :go
- /^# Written by /,/# warranty; / {
- s|^# ||
- s|^# *$||
- s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
- p
+ /^# Written by /!b
+ s|^# ||; p; n
+
+ :fwd2blnk
+ /./ {
+ n
+ b fwd2blnk
}
- /^# Written by / {
- s|^# ||
- p
+ p; n
+
+ :holdwrnt
+ s|^# ||
+ s|^# *$||
+ /^Copyright /!{
+ /./H
+ n
+ b holdwrnt
}
- /^warranty; /q' < "$progpath"
+
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ G
+ s|\(\n\)\n*|\1|g
+ p; q' < "$progpath"
exit $?
}
@@ -1972,12 +2210,12 @@ func_version ()
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.6'
+scriptversion='(GNU libtool) 2.4.7'
# func_echo ARG...
@@ -2068,7 +2306,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.6
+ version: $progname (GNU libtool) 2.4.7
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
@@ -2124,7 +2362,7 @@ fi
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
- func__fatal_error ${1+"$@"} \
+ func_fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \
"Fatal configuration error."
}
@@ -2270,6 +2508,8 @@ libtool_options_prep ()
nonopt=
preserve_args=
+ _G_rc_lt_options_prep=:
+
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
@@ -2293,11 +2533,16 @@ libtool_options_prep ()
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift
;;
+ *)
+ _G_rc_lt_options_prep=false
+ ;;
esac
- # Pass back the list of options.
- func_quote_for_eval ${1+"$@"}
- libtool_options_prep_result=$func_quote_for_eval_result
+ if $_G_rc_lt_options_prep; then
+ # Pass back the list of options.
+ func_quote eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_result
+ fi
}
func_add_hook func_options_prep libtool_options_prep
@@ -2309,9 +2554,12 @@ libtool_parse_options ()
{
$debug_cmd
+ _G_rc_lt_parse_options=false
+
# Perform our own loop to consume as many options as possible in
# each iteration.
while test $# -gt 0; do
+ _G_match_lt_parse_options=:
_G_opt=$1
shift
case $_G_opt in
@@ -2386,15 +2634,20 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
- # An option not handled by this hook function:
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"} ; shift
+ _G_match_lt_parse_options=false
+ break
+ ;;
esac
+ $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
done
-
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- libtool_parse_options_result=$func_quote_for_eval_result
+ if $_G_rc_lt_parse_options; then
+ # save modified positional parameters for caller
+ func_quote eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_result
+ fi
}
func_add_hook func_parse_options libtool_parse_options
@@ -2451,8 +2704,8 @@ libtool_validate_options ()
}
# Pass back the unparsed argument list
- func_quote_for_eval ${1+"$@"}
- libtool_validate_options_result=$func_quote_for_eval_result
+ func_quote eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_result
}
func_add_hook func_validate_options libtool_validate_options
@@ -3418,8 +3671,8 @@ func_mode_compile ()
esac
done
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
+ func_quote_arg pretty "$libobj"
+ test "X$libobj" != "X$func_quote_arg_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
@@ -3492,8 +3745,8 @@ compiler."
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
+ func_quote_arg pretty "$srcfile"
+ qsrcfile=$func_quote_arg_result
# Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then
@@ -3648,7 +3901,8 @@ This mode accepts the following additional options:
-prefer-non-pic try to build non-PIC objects only
-shared do not build a '.o' file suitable for static linking
-static only build a '.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
+ -Wc,FLAG
+ -Xcompiler FLAG pass FLAG directly to the compiler
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
from the given SOURCEFILE.
@@ -3754,6 +4008,8 @@ The following components of LINK-COMMAND are treated specially:
-weak LIBNAME declare that the target provides the LIBNAME interface
-Wc,FLAG
-Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wa,FLAG
+ -Xassembler FLAG pass linker-specific FLAG directly to the assembler
-Wl,FLAG
-Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
@@ -4096,8 +4352,8 @@ func_mode_install ()
case $nonopt in *shtool*) :;; *) false;; esac
then
# Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
+ func_quote_arg pretty "$nonopt"
+ install_prog="$func_quote_arg_result "
arg=$1
shift
else
@@ -4107,8 +4363,8 @@ func_mode_install ()
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
+ func_quote_arg pretty "$arg"
+ func_append install_prog "$func_quote_arg_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
@@ -4165,12 +4421,12 @@ func_mode_install ()
esac
# Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
+ func_quote_arg pretty "$arg"
+ func_append install_prog " $func_quote_arg_result"
if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
+ func_quote_arg pretty "$arg2"
fi
- func_append install_shared_prog " $func_quote_for_eval_result"
+ func_append install_shared_prog " $func_quote_arg_result"
done
test -z "$install_prog" && \
@@ -4181,8 +4437,8 @@ func_mode_install ()
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
+ func_quote_arg pretty "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_arg_result"
fi
fi
@@ -4478,8 +4734,8 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_quiet || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$relink_command"
+ eval "func_echo $func_quote_arg_result"
}
if eval "$relink_command"; then :
else
@@ -5258,7 +5514,8 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ func_quote_arg pretty "$ECHO"
+ qECHO=$func_quote_arg_result
$ECHO "\
# A function that is used when there is no print builtin or printf.
@@ -5268,7 +5525,7 @@ func_fallback_echo ()
\$1
_LTECHO_EOF'
}
- ECHO=\"$qECHO\"
+ ECHO=$qECHO
fi
# Very basic option parsing. These options are (a) specific to
@@ -6611,9 +6868,9 @@ func_mode_link ()
while test "$#" -gt 0; do
arg=$1
shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
+ func_quote_arg pretty,unquoted "$arg"
+ qarg=$func_quote_arg_unquoted_result
+ func_append libtool_args " $func_quote_arg_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
@@ -6849,6 +7106,13 @@ func_mode_link ()
prev=
continue
;;
+ xassembler)
+ func_append compiler_flags " -Xassembler $qarg"
+ prev=
+ func_append compile_command " -Xassembler $qarg"
+ func_append finalize_command " -Xassembler $qarg"
+ continue
+ ;;
xcclinker)
func_append linker_flags " $qarg"
func_append compiler_flags " $qarg"
@@ -7019,7 +7283,7 @@ func_mode_link ()
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
@@ -7039,7 +7303,7 @@ func_mode_link ()
esac
elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
@@ -7069,8 +7333,20 @@ func_mode_link ()
prev=xcompiler
continue
;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
+ -pthread)
+ case $host in
+ *solaris2*) ;;
+ *)
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+ -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
@@ -7211,9 +7487,9 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
+ func_quote_arg pretty "$flag"
+ func_append arg " $func_quote_arg_result"
+ func_append compiler_flags " $func_quote_arg_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
@@ -7227,16 +7503,21 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
+ func_quote_arg pretty "$flag"
+ func_append arg " $wl$func_quote_arg_result"
+ func_append compiler_flags " $wl$func_quote_arg_result"
+ func_append linker_flags " $func_quote_arg_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
+ -Xassembler)
+ prev=xassembler
+ continue
+ ;;
+
-Xcompiler)
prev=xcompiler
continue
@@ -7254,8 +7535,8 @@ func_mode_link ()
# -msg_* for osf cc
-msg_*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
# Flags to be passed through unchanged, with rationale:
@@ -7272,12 +7553,17 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fuse-ld=* Linker select flags for GCC
+ # -Wa,* Pass flags directly to the assembler
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*)
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
@@ -7298,15 +7584,15 @@ func_mode_link ()
continue
else
# Otherwise treat like 'Some other compiler flag' below
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
fi
;;
# Some other compiler flag.
-* | +*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
*.$objext)
@@ -7426,8 +7712,8 @@ func_mode_link ()
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
esac # arg
@@ -8632,7 +8918,7 @@ func_mode_link ()
test CXX = "$tagname" && {
case $host_os in
linux*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C++ 5.9
func_suncc_cstd_abi
@@ -8805,7 +9091,7 @@ func_mode_link ()
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|freebsd-elf|linux|osf|windows|none)
+ darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
@@ -8896,7 +9182,7 @@ func_mode_link ()
versuffix=.$current.$revision
;;
- freebsd-elf)
+ freebsd-elf | midnightbsd-elf)
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
@@ -9122,7 +9408,7 @@ func_mode_link ()
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
;;
*-*-sco3.2v5* | *-*-sco5v6*)
@@ -9933,8 +10219,8 @@ EOF
for cmd in $concat_cmds; do
IFS=$save_ifs
$opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@@ -10027,8 +10313,8 @@ EOF
eval cmd=\"$cmd\"
IFS=$save_ifs
$opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@@ -10502,12 +10788,13 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ func_quote_arg pretty "$var_value"
+ relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
fi
done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ func_quote eval cd "`pwd`"
+ func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
+ relink_command=$func_quote_arg_unquoted_result
fi
# Only actually do things if not in dry run mode.
@@ -10747,13 +11034,15 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ func_quote_arg pretty,unquoted "$var_value"
+ relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ func_quote eval cd "`pwd`"
+ relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ func_quote_arg pretty,unquoted "$relink_command"
+ relink_command=$func_quote_arg_unquoted_result
if test yes = "$hardcode_automatic"; then
relink_command=
fi
diff --git a/mips/filter_msa_intrinsics.c b/mips/filter_msa_intrinsics.c
index 943bb3d05..a57917942 100644
--- a/mips/filter_msa_intrinsics.c
+++ b/mips/filter_msa_intrinsics.c
@@ -1,14 +1,15 @@
/* filter_msa_intrinsics.c - MSA optimised filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
* Written by Mandar Sahastrabuddhe, August 2016.
- * Last changed in libpng 1.6.25 [September 1, 2016]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
+
#include <stdio.h>
#include <stdint.h>
#include "../pngpriv.h"
@@ -366,8 +367,8 @@
void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t i, cnt, cnt16, cnt32;
- png_size_t istop = row_info->rowbytes;
+ size_t i, cnt, cnt16, cnt32;
+ size_t istop = row_info->rowbytes;
png_bytep rp = row;
png_const_bytep pp = prev_row;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
@@ -457,8 +458,8 @@ void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
void png_read_filter_row_sub4_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t count;
- png_size_t istop = row_info->rowbytes;
+ size_t count;
+ size_t istop = row_info->rowbytes;
png_bytep src = row;
png_bytep nxt = row + 4;
int32_t inp0;
@@ -496,8 +497,8 @@ void png_read_filter_row_sub4_msa(png_row_infop row_info, png_bytep row,
void png_read_filter_row_sub3_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t count;
- png_size_t istop = row_info->rowbytes;
+ size_t count;
+ size_t istop = row_info->rowbytes;
png_bytep src = row;
png_bytep nxt = row + 3;
int64_t out0;
@@ -541,11 +542,11 @@ void png_read_filter_row_sub3_msa(png_row_infop row_info, png_bytep row,
void png_read_filter_row_avg4_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t i;
+ size_t i;
png_bytep src = row;
png_bytep nxt = row;
png_const_bytep pp = prev_row;
- png_size_t istop = row_info->rowbytes - 4;
+ size_t istop = row_info->rowbytes - 4;
int32_t inp0, inp1, out0;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
v16u8 zero = { 0 };
@@ -592,11 +593,11 @@ void png_read_filter_row_avg4_msa(png_row_infop row_info, png_bytep row,
void png_read_filter_row_avg3_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t i;
+ size_t i;
png_bytep src = row;
png_bytep nxt = row;
png_const_bytep pp = prev_row;
- png_size_t istop = row_info->rowbytes - 3;
+ size_t istop = row_info->rowbytes - 3;
int64_t out0;
int32_t inp0, inp1, out1;
int16_t out2;
diff --git a/mips/mips_init.c b/mips/mips_init.c
index 0bfb7a32e..8dd283dee 100644
--- a/mips/mips_init.c
+++ b/mips/mips_init.c
@@ -1,14 +1,15 @@
/* mips_init.c - MSA optimised filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
* Written by Mandar Sahastrabuddhe, 2016.
- * Last changed in libpng 1.6.25 [September 1, 2016]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
+
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
diff --git a/missing b/missing
index f62bbae30..1fe1611f1 100755
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/png.5 b/png.5
index b0cbd2cfa..5442ea17f 100644
--- a/png.5
+++ b/png.5
@@ -1,47 +1,49 @@
-.TH PNG 5 "April 1, 2017"
+.TH PNG 5 "June 21, 2023"
.SH NAME
png \- Portable Network Graphics (PNG) format
+
.SH DESCRIPTION
PNG (Portable Network Graphics) is an extensible file format for the
-lossless, portable, well-compressed storage of raster images. PNG provides
-a patent-free replacement for GIF and can also replace many
+lossless, portable, well-compressed storage of raster images. PNG
+provides a patent-free replacement for GIF, and can also replace many
common uses of TIFF. Indexed-color, grayscale, and truecolor images are
-supported, plus an optional alpha channel. Sample depths range from
+supported, plus an optional alpha channel. Sample depths range from
1 to 16 bits.
.br
-
-PNG is designed to work well in online viewing applications, such as the
-World Wide Web, so it is fully streamable with a progressive display
-option. PNG is robust, providing both full file integrity checking and
-fast, simple detection of common transmission errors. Also, PNG can store
-gamma and chromaticity data for improved color matching on heterogeneous
-platforms.
+PNG is designed to work well in online viewing applications, such
+as the World Wide Web, so it is fully streamable with a progressive
+display option. PNG is robust, providing both full file integrity
+checking and fast, simple detection of common transmission errors.
+Also, PNG can store gamma and chromaticity data for improved color
+matching on heterogeneous platforms.
.SH "SEE ALSO"
-.BR "libpng"(3), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
+.BR "libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP
-PNG specification (second edition), November 2003:
+PNG Specification (Second Edition), November 2003:
.IP
.br
- <https://www.w3.org/TR/2003/REC-PNG-20031110/
-PNG 1.2 specification, July 1999:
+https://www.w3.org/TR/2003/REC-PNG-20031110/
+.LP
+PNG 1.2 Specification, July 1999:
.IP
.br
https://png-mng.sourceforge.io/pub/png/spec/1.2/
.LP
-PNG 1.0 specification, October 1996:
+PNG 1.0 Specification, October 1996:
.IP
.br
RFC 2083
-.IP
.br
https://www.ietf.org/rfc/rfc2083.txt
+.IP
.br
-or (as a W3C Recommendation) at
+or W3C Recommendation
.br
https://www.w3.org/TR/REC-png-961001
+
.SH AUTHORS
-This man page: Glenn Randers-Pehrson
+This man page: Glenn Randers-Pehrson, Cosmin Truta
.LP
Portable Network Graphics (PNG) Specification (Second Edition)
Information technology - Computer graphics and image processing -
@@ -49,26 +51,9 @@ Portable Network Graphics (PNG): Functional specification.
ISO/IEC 15948:2003 (E) (November 10, 2003): David Duce and others.
.LP
Portable Network Graphics (PNG) Specification Version 1.2 (July 8, 1999):
-Glenn Randers-Pehrson and others (png-list).
+Glenn Randers-Pehrson and others.
.LP
Portable Network Graphics (PNG) Specification Version 1.0 (October 1, 1996):
-Thomas Boutell and others (png-list).
-.LP
+Thomas Boutell and others.
-
-.SH COPYRIGHT NOTICE
-.LP
-This man page is Copyright (c) 1998-2006 Glenn Randers-Pehrson. See png.h
-for conditions of use and distribution.
-.LP
-The PNG Specification (Second Edition) is
-Copyright (c) 2003 W3C. (MIT, ERCIM, Keio), All Rights Reserved.
-.LP
-The PNG-1.2 specification is copyright (c) 1999 Glenn Randers-Pehrson.
-See the specification for conditions of use and distribution.
-.LP
-The PNG-1.0 specification is copyright (c) 1996 Massachusetts Institute of
-Technology. See the specification for conditions of use and distribution.
-.LP
.\" end of man page
-
diff --git a/png.c b/png.c
index ff02c5651..d6471b06c 100644
--- a/png.c
+++ b/png.c
@@ -1,10 +1,10 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.6.33 [September 28, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -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_34 Your_png_h_is_not_version_1_6_34;
+typedef png_libpng_version_1_6_40 Your_png_h_is_not_version_1_6_40;
#ifdef __GNUC__
/* The version tests may need to be added to, but the problem warning has
@@ -71,7 +71,7 @@ png_set_sig_bytes(png_structrp png_ptr, int num_bytes)
* PNG signature (this is the same behavior as strcmp, memcmp, etc).
*/
int PNGAPI
-png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check)
+png_sig_cmp(png_const_bytep sig, size_t start, size_t num_to_check)
{
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
@@ -136,7 +136,7 @@ png_reset_crc(png_structrp png_ptr)
* trouble of calculating it.
*/
void /* PRIVATE */
-png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
+png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, size_t length)
{
int need_crc = 1;
@@ -421,7 +421,7 @@ png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr)
* those cases where it does anything other than a memset.
*/
PNG_FUNCTION(void,PNGAPI
-png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size),
+png_info_init_3,(png_infopp ptr_ptr, size_t png_info_struct_size),
PNG_DEPRECATED)
{
png_inforp info_ptr = *ptr_ptr;
@@ -720,7 +720,7 @@ png_init_io(png_structrp png_ptr, png_FILE_p fp)
*
* Where UNSIGNED_MAX is the appropriate maximum unsigned value, so when the
* negative integral value is added the result will be an unsigned value
- * correspnding to the 2's complement representation.
+ * corresponding to the 2's complement representation.
*/
void PNGAPI
png_save_int_32(png_bytep buf, png_int_32 i)
@@ -736,7 +736,7 @@ png_save_int_32(png_bytep buf, png_int_32 i)
int PNGAPI
png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
{
- static PNG_CONST char short_months[12][4] =
+ static const char short_months[12][4] =
{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
@@ -814,20 +814,14 @@ png_get_copyright(png_const_structrp png_ptr)
#ifdef PNG_STRING_COPYRIGHT
return PNG_STRING_COPYRIGHT
#else
-# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.6.34 - September 29, 2017" PNG_STRING_NEWLINE \
- "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
+ "libpng version 1.6.40" PNG_STRING_NEWLINE \
+ "Copyright (c) 2018-2023 Cosmin Truta" PNG_STRING_NEWLINE \
+ "Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
-# else
- return "libpng version 1.6.34 - September 29, 2017\
- Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
- Copyright (c) 1996-1997 Andreas Dilger\
- Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
-# endif
#endif
}
@@ -942,7 +936,7 @@ png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name)
/* The code is the fifth byte after each four byte string. Historically this
* code was always searched from the end of the list, this is no longer
- * necessary because the 'set' routine handles duplicate entries correcty.
+ * necessary because the 'set' routine handles duplicate entries correctly.
*/
do /* num_chunk_list > 0, so at least one */
{
@@ -1121,7 +1115,7 @@ png_colorspace_set_gamma(png_const_structrp png_ptr,
png_colorspacerp colorspace, png_fixed_point gAMA)
{
/* Changed in libpng-1.5.4 to limit the values to ensure overflow can't
- * occur. Since the fixed point representation is asymetrical it is
+ * occur. Since the fixed point representation is asymmetrical it is
* possible for 1/gamma to overflow the limit of 21474 and this means the
* gamma value must be at least 5/100000 and hence at most 20000.0. For
* safety the limits here are a little narrower. The values are 0.00016 to
@@ -1849,12 +1843,12 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
# 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, "h: "); /* +2 = 116 */
}
# endif
/* The 'reason' is an arbitrary message, allow +79 maximum 195 */
@@ -2067,7 +2061,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
*/
/* Data checks (could be skipped). These checks must be independent of the
- * version number; however, the version number doesn't accomodate changes in
+ * version number; however, the version number doesn't accommodate changes in
* the header fields (just the known tags and the interpretation of the
* data.)
*/
@@ -2707,7 +2701,7 @@ png_check_IHDR(png_const_structrp png_ptr,
#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
/* ASCII to fp functions */
-/* Check an ASCII formated floating point value, see the more detailed
+/* Check an ASCII formatted floating point value, see the more detailed
* comments in pngpriv.h
*/
/* The following is used internally to preserve the sticky flags */
@@ -2715,11 +2709,11 @@ png_check_IHDR(png_const_structrp png_ptr,
#define png_fp_set(state, value) ((state) = (value) | ((state) & PNG_FP_STICKY))
int /* PRIVATE */
-png_check_fp_number(png_const_charp string, png_size_t size, int *statep,
- png_size_tp whereami)
+png_check_fp_number(png_const_charp string, size_t size, int *statep,
+ size_t *whereami)
{
int state = *statep;
- png_size_t i = *whereami;
+ size_t i = *whereami;
while (i < size)
{
@@ -2842,10 +2836,10 @@ PNG_FP_End:
/* The same but for a complete string. */
int
-png_check_fp_string(png_const_charp string, png_size_t size)
+png_check_fp_string(png_const_charp string, size_t size)
{
int state=0;
- png_size_t char_index=0;
+ size_t char_index=0;
if (png_check_fp_number(string, size, &state, &char_index) != 0 &&
(char_index == size || string[char_index] == 0))
@@ -2906,7 +2900,7 @@ png_pow10(int power)
#pragma GCC diagnostic warning "-Wstrict-overflow=2"
#endif /* GCC_STRICT_OVERFLOW */
void /* PRIVATE */
-png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
+png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, size_t size,
double fp, unsigned int precision)
{
/* We use standard functions from math.h, but not printf because
@@ -3134,11 +3128,11 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* The total output count (max) is now 4+precision */
/* Check for an exponent, if we don't need one we are
- * done and just need to terminate the string. At
- * this point exp_b10==(-1) is effectively a flag - it got
- * to '-1' because of the decrement after outputting
- * the decimal point above (the exponent required is
- * *not* -1!)
+ * done and just need to terminate the string. At this
+ * point, exp_b10==(-1) is effectively a flag: it got
+ * to '-1' because of the decrement, after outputting
+ * the decimal point above. (The exponent required is
+ * *not* -1.)
*/
if (exp_b10 >= (-1) && exp_b10 <= 2)
{
@@ -3237,7 +3231,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
void /* PRIVATE */
png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
- png_size_t size, png_fixed_point fp)
+ size_t size, png_fixed_point fp)
{
/* Require space for 10 decimal digits, a decimal point, a minus sign and a
* trailing \0, 13 characters:
@@ -3976,18 +3970,18 @@ png_gamma_correct(png_structrp png_ptr, unsigned int value,
*/
static void
png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
- PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
+ unsigned int shift, png_fixed_point gamma_val)
{
/* Various values derived from 'shift': */
- PNG_CONST unsigned int num = 1U << (8U - shift);
+ unsigned int num = 1U << (8U - shift);
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
/* CSE the division and work round wacky GCC warnings (see the comments
* in png_gamma_8bit_correct for where these come from.)
*/
- PNG_CONST double fmax = 1./(((png_int_32)1 << (16U - shift))-1);
+ double fmax = 1.0 / (((png_int_32)1 << (16U - shift)) - 1);
#endif
- PNG_CONST unsigned int max = (1U << (16U - shift))-1U;
- PNG_CONST unsigned int max_by_2 = 1U << (15U-shift);
+ unsigned int max = (1U << (16U - shift)) - 1U;
+ unsigned int max_by_2 = 1U << (15U - shift);
unsigned int i;
png_uint_16pp table = *ptable =
@@ -4053,10 +4047,10 @@ png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
*/
static void
png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
- PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
+ unsigned int shift, png_fixed_point gamma_val)
{
- PNG_CONST unsigned int num = 1U << (8U - shift);
- PNG_CONST unsigned int max = (1U << (16U - shift))-1U;
+ unsigned int num = 1U << (8U - shift);
+ unsigned int max = (1U << (16U - shift))-1U;
unsigned int i;
png_uint_32 last;
@@ -4121,7 +4115,7 @@ png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
*/
static void
png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable,
- PNG_CONST png_fixed_point gamma_val)
+ png_fixed_point gamma_val)
{
unsigned int i;
png_bytep table = *ptable = (png_bytep)png_malloc(png_ptr, 256);
@@ -4344,7 +4338,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
png_uint_32 setting = (2U + (onoff != 0)) << option;
png_uint_32 current = png_ptr->options;
- png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
+ png_ptr->options = (png_uint_32)((current & ~mask) | setting);
return (int)(current & mask) >> option;
}
@@ -4594,8 +4588,7 @@ png_image_free(png_imagep image)
if (image != NULL && image->opaque != NULL &&
image->opaque->error_buf == NULL)
{
- /* Ignore errors here: */
- (void)png_safe_execute(image, png_image_free_function, image);
+ png_image_free_function(image);
image->opaque = NULL;
}
}
diff --git a/png.h b/png.h
index 4c873f5c2..cfc484109 100644
--- a/png.h
+++ b/png.h
@@ -1,68 +1,105 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.34, September 29, 2017
+ * libpng version 1.6.40
*
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
- * This code is released under the libpng license (See LICENSE, below)
+ * This code is released under the libpng license. (See LICENSE, below.)
*
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
- * libpng versions 0.97, January 1998, through 1.6.34, September 29, 2017:
- * Glenn Randers-Pehrson.
+ * 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.40, June 2023:
+ * Cosmin Truta
* See also "Contributing Authors", below.
*/
/*
- * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+ * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
+ * =========================================
+ *
+ * PNG Reference Library License version 2
+ * ---------------------------------------
+ *
+ * * Copyright (c) 1995-2023 The PNG Reference Library Authors.
+ * * Copyright (c) 2018-2023 Cosmin Truta.
+ * * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
+ * * Copyright (c) 1996-1997 Andreas Dilger.
+ * * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
+ *
+ * The software is supplied "as is", without warranty of any kind,
+ * express or implied, including, without limitation, the warranties
+ * of merchantability, fitness for a particular purpose, title, and
+ * non-infringement. In no event shall the Copyright owners, or
+ * anyone distributing the software, be liable for any damages or
+ * other liability, whether in contract, tort or otherwise, arising
+ * from, out of, or in connection with the software, or the use or
+ * other dealings in the software, even if advised of the possibility
+ * of such damage.
+ *
+ * Permission is hereby granted to use, copy, modify, and distribute
+ * this software, or portions hereof, for any purpose, without fee,
+ * subject to the following restrictions:
*
- * If you modify libpng you may insert additional notices immediately following
- * this sentence.
+ * 1. The origin of this software must not be misrepresented; you
+ * must not claim that you wrote the original software. If you
+ * use this software in a product, an acknowledgment in the product
+ * documentation would be appreciated, but is not required.
*
- * This code is released under the libpng license.
+ * 2. Altered source versions must be plainly marked as such, and must
+ * not be misrepresented as being the original software.
*
- * libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
- * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
+ * 3. This Copyright notice may not be removed or altered from any
+ * source or altered source distribution.
+ *
+ *
+ * PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
+ * -----------------------------------------------------------------------
+ *
+ * libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
+ * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals
* added to the list of Contributing Authors:
*
- * Simon-Pierre Cadieux
- * Eric S. Raymond
- * Mans Rullgard
- * Cosmin Truta
- * Gilles Vollant
- * James Yu
- * Mandar Sahastrabuddhe
- * Google Inc.
- * Vadim Barkov
+ * Simon-Pierre Cadieux
+ * Eric S. Raymond
+ * Mans Rullgard
+ * Cosmin Truta
+ * Gilles Vollant
+ * James Yu
+ * Mandar Sahastrabuddhe
+ * Google Inc.
+ * Vadim Barkov
*
* and with the following additions to the disclaimer:
*
- * There is no warranty against interference with your enjoyment of the
- * library or against infringement. There is no warranty that our
- * efforts or the library will fulfill any of your particular purposes
- * or needs. This library is provided with all faults, and the entire
- * risk of satisfactory quality, performance, accuracy, and effort is with
- * the user.
+ * There is no warranty against interference with your enjoyment of
+ * the library or against infringement. There is no warranty that our
+ * efforts or the library will fulfill any of your particular purposes
+ * or needs. This library is provided with all faults, and the entire
+ * risk of satisfactory quality, performance, accuracy, and effort is
+ * with the user.
*
* Some files in the "contrib" directory and some configure-generated
- * files that are distributed with libpng have other copyright owners and
+ * files that are distributed with libpng have other copyright owners, and
* are released under other open source licenses.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
* libpng-0.96, and are distributed according to the same disclaimer and
- * license as libpng-0.96, with the following individuals added to the list
- * of Contributing Authors:
+ * license as libpng-0.96, with the following individuals added to the
+ * list of Contributing Authors:
*
- * Tom Lane
- * Glenn Randers-Pehrson
- * Willem van Schaik
+ * Tom Lane
+ * Glenn Randers-Pehrson
+ * Willem van Schaik
*
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
* Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
@@ -70,14 +107,14 @@
* libpng-0.88, with the following individuals added to the list of
* Contributing Authors:
*
- * John Bowler
- * Kevin Bracey
- * Sam Bushell
- * Magnus Holmgren
- * Greg Roelofs
- * Tom Tanner
+ * John Bowler
+ * Kevin Bracey
+ * Sam Bushell
+ * Magnus Holmgren
+ * Greg Roelofs
+ * Tom Tanner
*
- * Some files in the "scripts" directory have other copyright owners
+ * Some files in the "scripts" directory have other copyright owners,
* but are released under this license.
*
* libpng versions 0.5, May 1995, through 0.88, January 1996, are
@@ -86,62 +123,49 @@
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
*
- * Andreas Dilger
- * Dave Martindale
- * Guy Eric Schalnat
- * Paul Schmidt
- * Tim Wegner
- *
- * The PNG Reference Library is supplied "AS IS". The Contributing Authors
- * and Group 42, Inc. disclaim all warranties, expressed or implied,
- * including, without limitation, the warranties of merchantability and of
- * fitness for any purpose. The Contributing Authors and Group 42, Inc.
- * assume no liability for direct, indirect, incidental, special, exemplary,
- * or consequential damages, which may result from the use of the PNG
- * Reference Library, even if advised of the possibility of such damage.
+ * Andreas Dilger
+ * Dave Martindale
+ * Guy Eric Schalnat
+ * Paul Schmidt
+ * Tim Wegner
+ *
+ * The PNG Reference Library is supplied "AS IS". The Contributing
+ * Authors and Group 42, Inc. disclaim all warranties, expressed or
+ * implied, including, without limitation, the warranties of
+ * merchantability and of fitness for any purpose. The Contributing
+ * Authors and Group 42, Inc. assume no liability for direct, indirect,
+ * incidental, special, exemplary, or consequential damages, which may
+ * result from the use of the PNG Reference Library, even if advised of
+ * the possibility of such damage.
*
* Permission is hereby granted to use, copy, modify, and distribute this
* source code, or portions hereof, for any purpose, without fee, subject
* to the following restrictions:
*
- * 1. The origin of this source code must not be misrepresented.
+ * 1. The origin of this source code must not be misrepresented.
*
- * 2. Altered versions must be plainly marked as such and must not
- * be misrepresented as being the original source.
+ * 2. Altered versions must be plainly marked as such and must not
+ * be misrepresented as being the original source.
*
- * 3. This Copyright notice may not be removed or altered from any
- * source or altered source distribution.
+ * 3. This Copyright notice may not be removed or altered from any
+ * source or altered source distribution.
*
- * The Contributing Authors and Group 42, Inc. specifically permit, without
- * fee, and encourage the use of this source code as a component to
- * supporting the PNG file format in commercial products. If you use this
- * source code in a product, acknowledgment is not required but would be
- * appreciated.
+ * The Contributing Authors and Group 42, Inc. specifically permit,
+ * without fee, and encourage the use of this source code as a component
+ * to supporting the PNG file format in commercial products. If you use
+ * this source code in a product, acknowledgment is not required but would
+ * be appreciated.
*
* END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
*
- * TRADEMARK:
+ * TRADEMARK
+ * =========
*
- * The name "libpng" has not been registered by the Copyright owner
+ * The name "libpng" has not been registered by the Copyright owners
* as a trademark in any jurisdiction. However, because libpng has
* been distributed and maintained world-wide, continually since 1995,
- * the Copyright owner claims "common-law trademark protection" in any
+ * the Copyright owners claim "common-law trademark protection" in any
* jurisdiction where common-law trademark is recognized.
- *
- * OSI CERTIFICATION:
- *
- * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
- * a certification mark of the Open Source Initiative. OSI has not addressed
- * the additional disclaimers inserted at version 1.0.7.
- *
- * EXPORT CONTROL:
- *
- * The Copyright owner believes that the Export Control Classification
- * Number (ECCN) for libpng is EAR99, which means not subject to export
- * controls or International Traffic in Arms Regulations (ITAR) because
- * it is open source, publicly available software, that does not contain
- * any encryption software. See the EAR, paragraphs 734.3(b)(3) and
- * 734.7(b).
*/
/*
@@ -207,23 +231,25 @@
* 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible)
* 1.0.7 1 10007 (still compatible)
* ...
- * 1.0.19 10 10019 10.so.0.19[.0]
+ * 1.0.69 10 10069 10.so.0.69[.0]
+ * ...
+ * 1.2.59 13 10259 12.so.0.59[.0]
* ...
- * 1.2.59 13 10257 12.so.0.59[.0]
+ * 1.4.20 14 10420 14.so.0.20[.0]
* ...
- * 1.5.30 15 10527 15.so.15.30[.0]
+ * 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.34 16 10633 16.so.16.34[.0]
- *
- * Henceforth the source version will match the shared-library major
- * and minor numbers; the shared-library major version number will be
- * used for changes in backward compatibility, as it is intended. The
- * PNG_LIBPNG_VER macro, which is not used within libpng but is available
- * for applications, is an unsigned integer of the form xyyzz corresponding
- * to the source version x.y.z (leading zeros in y and z). Beta versions
- * were given the previous public release number plus a letter, until
- * version 1.0.6j; from then on they were given the upcoming public
- * release number plus "betaNN" or "rcNN".
+ * 1.6.40 16 10640 16.so.16.40[.0]
+ *
+ * Henceforth the source version will match the shared-library major and
+ * minor numbers; the shared-library major version number will be used for
+ * changes in backward compatibility, as it is intended.
+ * The PNG_LIBPNG_VER macro, which is not used within libpng but is
+ * available for applications, is an unsigned integer of the form XYYZZ
+ * corresponding to the source version X.Y.Z (leading zeros in Y and Z).
+ * Beta versions were given the previous public release number plus a
+ * letter, until version 1.0.6j; from then on they were given the upcoming
+ * public release number plus "betaNN" or "rcNN".
*
* Binary incompatibility exists only when applications make direct access
* to the info_ptr or png_ptr members through png.h, and the compiled
@@ -233,65 +259,8 @@
* 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 Specification,
- * <https://www.w3.org/TR/2003/REC-PNG-20031110/
- */
-
-/*
- * Y2K compliance in libpng:
- * =========================
- *
- * September 29, 2017
- *
- * Since the PNG Development group is an ad-hoc body, we can't make
- * an official declaration.
- *
- * This is your unofficial assurance that libpng from version 0.71 and
- * upward through 1.6.34 are Y2K compliant. It is my belief that
- * earlier versions were also Y2K compliant.
- *
- * Libpng only has two year fields. One is a 2-byte unsigned integer
- * that will hold years up to 65535. The other, which is deprecated,
- * holds the date in text format, and will hold years up to 9999.
- *
- * The integer is
- * "png_uint_16 year" in png_time_struct.
- *
- * The string is
- * "char time_buffer[29]" in png_struct. This is no longer used
- * in libpng-1.6.x and will be removed from libpng-1.7.0.
- *
- * There are seven time-related functions:
- * png.c: png_convert_to_rfc_1123_buffer() in png.c
- * (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and
- * png_convert_to_rfc_1152() in error prior to libpng-0.98)
- * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
- * png_convert_from_time_t() in pngwrite.c
- * png_get_tIME() in pngget.c
- * png_handle_tIME() in pngrutil.c, called in pngread.c
- * png_set_tIME() in pngset.c
- * png_write_tIME() in pngwutil.c, called in pngwrite.c
- *
- * All handle dates properly in a Y2K environment. The
- * png_convert_from_time_t() function calls gmtime() to convert from system
- * clock time, which returns (year - 1900), which we properly convert to
- * the full 4-digit year. There is a possibility that libpng applications
- * are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()
- * function, or that they are incorrectly passing only a 2-digit year
- * instead of "year - 1900" into the png_convert_from_struct_tm() function,
- * but this is not under our control. The libpng documentation has always
- * stated that it works with 4-digit years, and the APIs have been
- * documented as such.
- *
- * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
- * integer to hold the year, and can hold years as large as 65535.
- *
- * zlib, upon which libpng depends, is also Y2K compliant. It contains
- * no date-related code.
- *
- * Glenn Randers-Pehrson
- * libpng maintainer
- * PNG Development Group
+ * is available as a W3C Recommendation and as an ISO/IEC Standard; see
+ * <https://www.w3.org/TR/2003/REC-PNG-20031110/>
*/
#ifndef PNG_H
@@ -309,8 +278,8 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.34"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.34 - September 29, 2017\n"
+#define PNG_LIBPNG_VER_STRING "1.6.40"
+#define PNG_HEADER_VERSION_STRING " libpng version 1.6.40 - June 21, 2023\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@@ -318,12 +287,11 @@
/* 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 34
+#define PNG_LIBPNG_VER_RELEASE 40
-/* This should match the numeric part of the final component of
- * PNG_LIBPNG_VER_STRING, omitting any leading zero:
+/* This should be zero for a public release, or non-zero for a
+ * development version. [Deprecated]
*/
-
#define PNG_LIBPNG_VER_BUILD 0
/* Release Status */
@@ -343,13 +311,14 @@
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
-/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
- * We must not include leading zeros.
- * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
- * version 1.0.0 was mis-numbered 100 instead of 10000). From
- * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
+/* Careful here. At one time, Guy wanted to use 082, but that
+ * would be octal. We must not include leading zeros.
+ * Versions 0.7 through 1.0.0 were in the range 0 to 100 here
+ * (only version 1.0.0 was mis-numbered 100 instead of 10000).
+ * From version 1.0.1 it is:
+ * XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
-#define PNG_LIBPNG_VER 10634 /* 1.6.34 */
+#define PNG_LIBPNG_VER 10640 /* 1.6.40 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -459,7 +428,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_6_34;
+typedef char* png_libpng_version_1_6_40;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -600,8 +569,8 @@ typedef struct png_text_struct
png_charp key; /* keyword, 1-79 character description of "text" */
png_charp text; /* comment, may be an empty string (ie "")
or a NULL pointer */
- png_size_t text_length; /* length of the text string */
- png_size_t itxt_length; /* length of the itxt string */
+ size_t text_length; /* length of the text string */
+ size_t itxt_length; /* length of the itxt string */
png_charp lang; /* language code, 0-79 characters
or a NULL pointer */
png_charp lang_key; /* keyword translated UTF-8 string, 0 or more
@@ -654,7 +623,7 @@ typedef struct png_unknown_chunk_t
{
png_byte name[5]; /* Textual chunk name with '\0' terminator */
png_byte *data; /* Data, should not be modified on read! */
- png_size_t size;
+ size_t size;
/* On write 'location' must be set using the flag values listed below.
* Notice that on read it is set by libpng however the values stored have
@@ -679,7 +648,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
/* Maximum positive integer used in PNG is (2^31)-1 */
#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
#define PNG_UINT_32_MAX ((png_uint_32)(-1))
-#define PNG_SIZE_MAX ((png_size_t)(-1))
+#define PNG_SIZE_MAX ((size_t)(-1))
/* These are constants for fixed point values encoded in the
* PNG specification manner (x100000)
@@ -785,7 +754,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
typedef struct png_row_info_struct
{
png_uint_32 width; /* width of row */
- png_size_t rowbytes; /* number of bytes in row */
+ size_t rowbytes; /* number of bytes in row */
png_byte color_type; /* color type of row */
png_byte bit_depth; /* bit depth of row */
png_byte channels; /* number of channels (1, 2, 3, or 4) */
@@ -804,7 +773,7 @@ typedef png_row_info * * png_row_infopp;
* expected to return the read data in the buffer.
*/
typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));
-typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));
+typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, size_t));
typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));
typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,
int));
@@ -941,8 +910,8 @@ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
* signature, and non-zero otherwise. Having num_to_check == 0 or
* start > 7 will always fail (ie return non-zero).
*/
-PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,
- png_size_t num_to_check));
+PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start,
+ size_t num_to_check));
/* Simple signature checking function. This is the same as calling
* png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
@@ -961,11 +930,11 @@ PNG_EXPORTA(5, png_structp, png_create_write_struct,
png_error_ptr warn_fn),
PNG_ALLOCATED);
-PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,
+PNG_EXPORT(6, size_t, png_get_compression_buffer_size,
(png_const_structrp png_ptr));
PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,
- png_size_t size));
+ size_t size));
/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
* match up.
@@ -1018,7 +987,7 @@ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));
/* Write a PNG chunk - size, type, (optional) data, CRC. */
PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep
- chunk_name, png_const_bytep data, png_size_t length));
+ chunk_name, png_const_bytep data, size_t length));
/* Write the start of a PNG chunk - length and chunk name. */
PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,
@@ -1026,7 +995,7 @@ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,
/* Write the data of a PNG chunk started with png_write_chunk_start(). */
PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,
- png_const_bytep data, png_size_t length));
+ png_const_bytep data, size_t length));
/* Finish a chunk started with png_write_chunk_start() (includes CRC). */
PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));
@@ -1040,7 +1009,7 @@ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),
* the API will be removed in the future.
*/
PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,
- png_size_t png_info_struct_size), PNG_DEPRECATED);
+ size_t png_info_struct_size), PNG_DEPRECATED);
/* Writes all the PNG information before the image. */
PNG_EXPORT(20, void, png_write_info_before_PLTE,
@@ -1137,7 +1106,7 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
* corresponding composited pixel, and the color channels are unassociated
* (not premultiplied). The gamma encoded color channels must be scaled
* according to the contribution and to do this it is necessary to undo
- * the encoding, scale the color values, perform the composition and reencode
+ * the encoding, scale the color values, perform the composition and re-encode
* the values. This is the 'PNG' mode.
*
* The alternative is to 'associate' the alpha with the color information by
@@ -1193,7 +1162,7 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
*
* png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
* In this case the output is assumed to be something like an sRGB conformant
- * display preceeded by a power-law lookup table of power 1.45. This is how
+ * display preceded by a power-law lookup table of power 1.45. This is how
* early Mac systems behaved.
*
* png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);
@@ -1240,7 +1209,7 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
*
* When the default gamma of PNG files doesn't match the output gamma.
* If you have PNG files with no gamma information png_set_alpha_mode allows
- * you to provide a default gamma, but it also sets the ouput gamma to the
+ * you to provide a default gamma, but it also sets the output gamma to the
* matching value. If you know your PNG files have a gamma that doesn't
* match the output you can take advantage of the fact that
* png_set_alpha_mode always sets the output gamma but only sets the PNG
@@ -1477,7 +1446,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
* mainly useful for testing, as the defaults should work with most users.
* Those users who are tight on memory or want faster performance at the
* expense of compression can modify them. See the compression library
- * header file (zlib.h) for an explination of the compression functions.
+ * header file (zlib.h) for an explanation of the compression functions.
*/
/* Set the filtering method(s) used by libpng. Currently, the only valid
@@ -1532,7 +1501,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
* (0 - no compression, 9 - "maximal" compression). Note that tests have
* shown that zlib compression levels 3-6 usually perform as well as level 9
- * for PNG images, and do considerably fewer caclulations. In the future,
+ * for PNG images, and do considerably fewer calculations. In the future,
* these values may not correspond directly to the zlib compression levels.
*/
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
@@ -1691,7 +1660,7 @@ PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));
* chunk will cause an error at this point unless it is to be saved.
* positive: The chunk was handled, libpng will ignore/discard it.
*
- * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about
+ * See "INTERACTION WITH USER CHUNK CALLBACKS" below for important notes about
* how this behavior will change in libpng 1.7
*/
PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,
@@ -1716,7 +1685,7 @@ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr,
/* Function to be called when data becomes available */
PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,
- png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));
+ png_inforp info_ptr, png_bytep buffer, size_t buffer_size));
/* A function which may be called *only* within png_process_data to stop the
* processing of any more data. The function returns the number of bytes
@@ -1725,7 +1694,7 @@ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,
* 'save' is set to true the routine will first save all the pending data and
* will always return 0.
*/
-PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));
+PNG_EXPORT(219, size_t, png_process_data_pause, (png_structrp, int save));
/* A function which may be called *only* outside (after) a call to
* png_process_data. It returns the number of bytes of data to skip in the
@@ -1870,7 +1839,7 @@ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,
png_const_inforp info_ptr, png_uint_32 flag));
/* Returns number of bytes needed to hold a transformed row. */
-PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,
+PNG_EXPORT(111, size_t, png_get_rowbytes, (png_const_structrp png_ptr,
png_const_inforp info_ptr));
#ifdef PNG_INFO_IMAGE_SUPPORTED
@@ -2013,12 +1982,12 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
png_inforp info_ptr, png_bytep *exif));
PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
- png_inforp info_ptr, const png_bytep exif));
+ png_inforp info_ptr, png_bytep exif));
PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
- png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif));
+ png_inforp info_ptr, png_uint_32 num_exif, png_bytep exif));
#endif
#ifdef PNG_gAMA_SUPPORTED
@@ -2239,7 +2208,7 @@ PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,
* to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks
* it simply resets the behavior to the libpng default.
*
- * INTERACTION WTIH USER CHUNK CALLBACKS:
+ * INTERACTION WITH USER CHUNK CALLBACKS:
* The per-chunk handling is always used when there is a png_user_chunk_ptr
* callback and the callback returns 0; the chunk is then always stored *unless*
* it is critical and the per-chunk setting is other than ALWAYS. Notice that
@@ -2658,7 +2627,7 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
* The simplified API hides the details of both libpng and the PNG file format
* itself. It allows PNG files to be read into a very limited number of
* in-memory bitmap formats or to be written from the same formats. If these
- * formats do not accomodate your needs then you can, and should, use the more
+ * formats do not accommodate your needs then you can, and should, use the more
* sophisticated APIs above - these support a wide variety of in-memory formats
* and a wide variety of sophisticated transformations to those formats as well
* as a wide variety of APIs to manipulate ancillary information.
@@ -2764,7 +2733,7 @@ typedef struct
*
* When the simplified API needs to convert between sRGB and linear colorspaces,
* the actual sRGB transfer curve defined in the sRGB specification (see the
- * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+ * article at <https://en.wikipedia.org/wiki/SRGB>) is used, not the gamma=1/2.2
* approximation used elsewhere in libpng.
*
* When an alpha channel is present it is expected to denote pixel coverage
@@ -2967,7 +2936,7 @@ typedef struct
* 'flags' field of png_image.
*/
#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01
- /* This indicates the the RGB values of the in-memory bitmap do not
+ /* This indicates that the RGB values of the in-memory bitmap do not
* correspond to the red, green and blue end-points defined by sRGB.
*/
@@ -3020,7 +2989,7 @@ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
#endif /* STDIO */
PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,
- png_const_voidp memory, png_size_t size));
+ png_const_voidp memory, size_t size));
/* The PNG header is read from the given memory buffer. */
PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,
@@ -3133,7 +3102,7 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
* than or equal to the original value.
*
* If the function returns false and *memory_bytes was not changed an error
- * occured during write. If *memory_bytes was changed, or is not 0 if
+ * occurred during write. If *memory_bytes was changed, or is not 0 if
* 'memory' was NULL, the write would have succeeded but for the memory
* buffer being too small. *memory_bytes contains the required number of
* bytes and will be bigger that the original value.
@@ -3217,7 +3186,7 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
* option and 'onoff' is 0 (off) or non-0 (on). The value returned is given
* by the PNG_OPTION_ defines below.
*
- * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions,
+ * HARDWARE: normally hardware capabilities, such as the Intel SSE instructions,
* are detected at run time, however sometimes it may be impossible
* to do this in user mode, in which case it is necessary to discover
* the capabilities in an OS specific way. Such capabilities are
diff --git a/pngconf.h b/pngconf.h
index d13b13e57..6671e3c33 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,11 +1,12 @@
-/* pngconf.h - machine configurable file for libpng
+/* pngconf.h - machine-configurable file for libpng
*
- * libpng version 1.6.34, September 29, 2017
+ * libpng version 1.6.40
*
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -57,14 +58,13 @@
#endif /* PNG_BUILDING_SYMBOL_TABLE */
-/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
- * PNG_NO_CONST; this is no longer supported except for data declarations which
- * apparently still cause problems in 2011 on some compilers.
+/* Prior to 1.6.0, it was possible to turn off 'const' in declarations,
+ * using PNG_NO_CONST. This is no longer supported.
*/
#define PNG_CONST const /* backward compatibility only */
-/* This controls optimization of the reading of 16-bit and 32-bit values
- * from PNG files. It can be set on a per-app-file basis - it
+/* This controls optimization of the reading of 16-bit and 32-bit
+ * values from PNG files. It can be set on a per-app-file basis: it
* just changes whether a macro is used when the function is called.
* The library builder sets the default; if read functions are not
* built into the library the macro implementation is forced on.
@@ -127,7 +127,7 @@
*
* These cases only differ if the operating system does not use the C
* calling convention, at present this just means the above cases
- * (x86 DOS/Windows sytems) and, even then, this does not apply to
+ * (x86 DOS/Windows systems) and, even then, this does not apply to
* Cygwin running on those systems.
*
* Note that the value must be defined in pnglibconf.h so that what
@@ -180,8 +180,8 @@
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
-#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
- defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
+ defined(__CYGWIN__)
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
* MinGW on any architecture currently supported by Windows. Also includes
* Watcom builds but these need special treatment because they are not
@@ -515,8 +515,10 @@
# error "libpng requires an unsigned 32-bit (or more) type"
#endif
-/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
- * requires an ISOC90 compiler and relies on consistent behavior of sizeof.
+/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
+ * From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant
+ * behavior of sizeof and ptrdiff_t are required.
+ * The legacy typedefs are provided here for backwards compatibility.
*/
typedef size_t png_size_t;
typedef ptrdiff_t png_ptrdiff_t;
@@ -537,13 +539,12 @@ typedef ptrdiff_t png_ptrdiff_t;
# endif
#endif
-/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
- * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
- * png_alloc_size_t are not necessary; in fact, it is recommended not to use
- * them at all so that the compiler can complain when something turns out to be
- * problematic.
+/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller
+ * than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are
+ * not necessary; in fact, it is recommended not to use them at all, so that
+ * the compiler can complain when something turns out to be problematic.
*
- * Casts in the other direction (from png_alloc_size_t to png_size_t or
+ * Casts in the other direction (from png_alloc_size_t to size_t or
* png_uint_32) should be explicitly applied; however, we do not expect to
* encounter practical situations that require such conversions.
*
@@ -553,7 +554,7 @@ typedef ptrdiff_t png_ptrdiff_t;
#ifdef PNG_SMALL_SIZE_T
typedef png_uint_32 png_alloc_size_t;
#else
- typedef png_size_t png_alloc_size_t;
+ typedef size_t png_alloc_size_t;
#endif
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
@@ -589,8 +590,8 @@ typedef char * png_charp;
typedef const char * png_const_charp;
typedef png_fixed_point * png_fixed_point_p;
typedef const png_fixed_point * png_const_fixed_point_p;
-typedef png_size_t * png_size_tp;
-typedef const png_size_t * png_const_size_tp;
+typedef size_t * png_size_tp;
+typedef const size_t * png_const_size_tp;
#ifdef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;
diff --git a/pngdebug.h b/pngdebug.h
index 15a7ed0c9..00d5a4569 100644
--- a/pngdebug.h
+++ b/pngdebug.h
@@ -1,10 +1,10 @@
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
diff --git a/pngerror.c b/pngerror.c
index ad48bfb98..ec3a709b9 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,10 +1,10 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -425,7 +425,7 @@ png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
* if the character is invalid.
*/
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
-static PNG_CONST char png_digit[16] = {
+static const char png_digit[16] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'
};
@@ -885,7 +885,7 @@ PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI
png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
PNG_NORETURN)
{
- const png_const_structrp png_ptr = png_nonconst_ptr;
+ png_const_structrp png_ptr = png_nonconst_ptr;
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
/* An error is always logged here, overwriting anything (typically a warning)
@@ -920,7 +920,7 @@ png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
void /* PRIVATE */ PNGCBAPI
png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
{
- const png_const_structrp png_ptr = png_nonconst_ptr;
+ png_const_structrp png_ptr = png_nonconst_ptr;
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
/* A warning is only logged if there is no prior warning or error. */
diff --git a/pngget.c b/pngget.c
index 26e9fb1c3..1490a032e 100644
--- a/pngget.c
+++ b/pngget.c
@@ -1,10 +1,10 @@
/* pngget.c - retrieval of values from info struct
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -21,12 +21,23 @@ png_get_valid(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_uint_32 flag)
{
if (png_ptr != NULL && info_ptr != NULL)
+ {
+#ifdef PNG_READ_tRNS_SUPPORTED
+ /* png_handle_PLTE() may have canceled a valid tRNS chunk but left the
+ * 'valid' flag for the detection of duplicate chunks. Do not report a
+ * valid tRNS chunk in this case.
+ */
+ if (flag == PNG_INFO_tRNS && png_ptr->num_trans == 0)
+ return(0);
+#endif
+
return(info_ptr->valid & flag);
+ }
return(0);
}
-png_size_t PNGAPI
+size_t PNGAPI
png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
@@ -367,7 +378,7 @@ png_get_y_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
static png_fixed_point
png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns)
{
- /* Convert from metres * 1,000,000 to inches * 100,000, meters to
+ /* Convert from meters * 1,000,000 to inches * 100,000, meters to
* inches is simply *(100/2.54), so we want *(10/2.54) == 500/127.
* Notice that this can overflow - a warning is output and 0 is
* returned.
@@ -741,8 +752,7 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_iCCP) != 0 &&
- name != NULL && compression_type != NULL && profile != NULL &&
- proflen != NULL)
+ name != NULL && profile != NULL && proflen != NULL)
{
*name = info_ptr->iccp_name;
*profile = info_ptr->iccp_profile;
@@ -750,11 +760,13 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
/* This is somewhat irrelevant since the profile data returned has
* actually been uncompressed.
*/
- *compression_type = PNG_COMPRESSION_TYPE_BASE;
+ if (compression_type != NULL)
+ *compression_type = PNG_COMPRESSION_TYPE_BASE;
return (PNG_INFO_iCCP);
}
return (0);
+
}
#endif
@@ -1150,7 +1162,7 @@ png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr,
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
png_byte PNGAPI
-png_get_rgb_to_gray_status (png_const_structrp png_ptr)
+png_get_rgb_to_gray_status(png_const_structrp png_ptr)
{
return (png_byte)(png_ptr ? png_ptr->rgb_to_gray_status : 0);
}
@@ -1164,7 +1176,7 @@ png_get_user_chunk_ptr(png_const_structrp png_ptr)
}
#endif
-png_size_t PNGAPI
+size_t PNGAPI
png_get_compression_buffer_size(png_const_structrp png_ptr)
{
if (png_ptr == NULL)
@@ -1191,27 +1203,27 @@ png_get_compression_buffer_size(png_const_structrp png_ptr)
/* These functions were added to libpng 1.2.6 and were enabled
* by default in libpng-1.4.0 */
png_uint_32 PNGAPI
-png_get_user_width_max (png_const_structrp png_ptr)
+png_get_user_width_max(png_const_structrp png_ptr)
{
return (png_ptr ? png_ptr->user_width_max : 0);
}
png_uint_32 PNGAPI
-png_get_user_height_max (png_const_structrp png_ptr)
+png_get_user_height_max(png_const_structrp png_ptr)
{
return (png_ptr ? png_ptr->user_height_max : 0);
}
/* This function was added to libpng 1.4.0 */
png_uint_32 PNGAPI
-png_get_chunk_cache_max (png_const_structrp png_ptr)
+png_get_chunk_cache_max(png_const_structrp png_ptr)
{
return (png_ptr ? png_ptr->user_chunk_cache_max : 0);
}
/* This function was added to libpng 1.4.1 */
png_alloc_size_t PNGAPI
-png_get_chunk_malloc_max (png_const_structrp png_ptr)
+png_get_chunk_malloc_max(png_const_structrp png_ptr)
{
return (png_ptr ? png_ptr->user_chunk_malloc_max : 0);
}
@@ -1220,13 +1232,13 @@ png_get_chunk_malloc_max (png_const_structrp png_ptr)
/* These functions were added to libpng 1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
png_uint_32 PNGAPI
-png_get_io_state (png_const_structrp png_ptr)
+png_get_io_state(png_const_structrp png_ptr)
{
return png_ptr->io_state;
}
png_uint_32 PNGAPI
-png_get_io_chunk_type (png_const_structrp png_ptr)
+png_get_io_chunk_type(png_const_structrp png_ptr)
{
return png_ptr->chunk_name;
}
diff --git a/pnginfo.h b/pnginfo.h
index d5f6149db..1f98dedc4 100644
--- a/pnginfo.h
+++ b/pnginfo.h
@@ -1,10 +1,10 @@
/* pnginfo.h - header file for PNG reference library
*
- * Last changed in libpng 1.6.1 [March 28, 2013]
- * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -55,10 +55,10 @@
struct png_info_def
{
/* The following are necessary for every PNG file */
- png_uint_32 width; /* width of image in pixels (from IHDR) */
- png_uint_32 height; /* height of image in pixels (from IHDR) */
- png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
- png_size_t rowbytes; /* bytes needed to hold an untransformed row */
+ png_uint_32 width; /* width of image in pixels (from IHDR) */
+ png_uint_32 height; /* height of image in pixels (from IHDR) */
+ png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
+ size_t rowbytes; /* bytes needed to hold an untransformed row */
png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */
png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
png_uint_16 num_trans; /* number of transparent palette color (tRNS) */
@@ -247,7 +247,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
/* The sCAL chunk describes the actual physical dimensions of the
* subject matter of the graphic. The chunk contains a unit specification
* a byte value, and two ASCII strings representing floating-point
- * values. The values are width and height corresponsing to one pixel
+ * values. The values are width and height corresponding to one pixel
* in the image. Data values are valid if (valid & PNG_INFO_sCAL) is
* non-zero.
*/
diff --git a/pngmem.c b/pngmem.c
index ff3ef7e88..09ed9c1c9 100644
--- a/pngmem.c
+++ b/pngmem.c
@@ -1,10 +1,10 @@
/* pngmem.c - stub functions for memory allocation
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
diff --git a/pngpread.c b/pngpread.c
index fbe361dc3..e283627b7 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,10 +1,10 @@
/* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -34,7 +34,7 @@ if (png_ptr->buffer_size < N) \
void PNGAPI
png_process_data(png_structrp png_ptr, png_inforp info_ptr,
- png_bytep buffer, png_size_t buffer_size)
+ png_bytep buffer, size_t buffer_size)
{
if (png_ptr == NULL || info_ptr == NULL)
return;
@@ -47,7 +47,7 @@ png_process_data(png_structrp png_ptr, png_inforp info_ptr,
}
}
-png_size_t PNGAPI
+size_t PNGAPI
png_process_data_pause(png_structrp png_ptr, int save)
{
if (png_ptr != NULL)
@@ -60,7 +60,7 @@ png_process_data_pause(png_structrp png_ptr, int save)
else
{
/* This includes any pending saved bytes: */
- png_size_t remaining = png_ptr->buffer_size;
+ size_t remaining = png_ptr->buffer_size;
png_ptr->buffer_size = 0;
/* So subtract the saved buffer size, unless all the data
@@ -133,8 +133,8 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr)
void /* PRIVATE */
png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
{
- png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */
- num_to_check = 8 - num_checked;
+ size_t num_checked = png_ptr->sig_bytes; /* SAFE, does not exceed 8 */
+ size_t num_to_check = 8 - num_checked;
if (png_ptr->buffer_size < num_to_check)
{
@@ -418,7 +418,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
}
void PNGCBAPI
-png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
+png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, size_t length)
{
png_bytep ptr;
@@ -428,7 +428,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
ptr = buffer;
if (png_ptr->save_buffer_size != 0)
{
- png_size_t save_size;
+ size_t save_size;
if (length < png_ptr->save_buffer_size)
save_size = length;
@@ -445,7 +445,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
}
if (length != 0 && png_ptr->current_buffer_size != 0)
{
- png_size_t save_size;
+ size_t save_size;
if (length < png_ptr->current_buffer_size)
save_size = length;
@@ -467,7 +467,7 @@ png_push_save_buffer(png_structrp png_ptr)
{
if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
{
- png_size_t i, istop;
+ size_t i, istop;
png_bytep sp;
png_bytep dp;
@@ -482,7 +482,7 @@ png_push_save_buffer(png_structrp png_ptr)
if (png_ptr->save_buffer_size + png_ptr->current_buffer_size >
png_ptr->save_buffer_max)
{
- png_size_t new_max;
+ size_t new_max;
png_bytep old_buffer;
if (png_ptr->save_buffer_size > PNG_SIZE_MAX -
@@ -494,7 +494,7 @@ png_push_save_buffer(png_structrp png_ptr)
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
old_buffer = png_ptr->save_buffer;
png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr,
- (png_size_t)new_max);
+ (size_t)new_max);
if (png_ptr->save_buffer == NULL)
{
@@ -522,7 +522,7 @@ png_push_save_buffer(png_structrp png_ptr)
void /* PRIVATE */
png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer,
- png_size_t buffer_length)
+ size_t buffer_length)
{
png_ptr->current_buffer = buffer;
png_ptr->current_buffer_size = buffer_length;
@@ -562,7 +562,7 @@ png_push_read_IDAT(png_structrp png_ptr)
if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0)
{
- png_size_t save_size = png_ptr->save_buffer_size;
+ size_t save_size = png_ptr->save_buffer_size;
png_uint_32 idat_size = png_ptr->idat_size;
/* We want the smaller of 'idat_size' and 'current_buffer_size', but they
@@ -572,7 +572,7 @@ png_push_read_IDAT(png_structrp png_ptr)
* will break on either 16-bit or 64-bit platforms.
*/
if (idat_size < save_size)
- save_size = (png_size_t)idat_size;
+ save_size = (size_t)idat_size;
else
idat_size = (png_uint_32)save_size;
@@ -589,7 +589,7 @@ png_push_read_IDAT(png_structrp png_ptr)
if (png_ptr->idat_size != 0 && png_ptr->current_buffer_size != 0)
{
- png_size_t save_size = png_ptr->current_buffer_size;
+ size_t save_size = png_ptr->current_buffer_size;
png_uint_32 idat_size = png_ptr->idat_size;
/* We want the smaller of 'idat_size' and 'current_buffer_size', but they
@@ -598,7 +598,7 @@ png_push_read_IDAT(png_structrp png_ptr)
* larger - this cannot overflow.
*/
if (idat_size < save_size)
- save_size = (png_size_t)idat_size;
+ save_size = (size_t)idat_size;
else
idat_size = (png_uint_32)save_size;
@@ -625,7 +625,7 @@ png_push_read_IDAT(png_structrp png_ptr)
void /* PRIVATE */
png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
- png_size_t buffer_length)
+ size_t buffer_length)
{
/* The caller checks for a non-zero buffer length. */
if (!(buffer_length > 0) || buffer == NULL)
@@ -972,20 +972,20 @@ png_read_push_finish_row(png_structrp png_ptr)
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
- static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
+ static const png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
/* Offset to next interlace block */
- static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
/* Start of interlace block in the y direction */
- static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
+ static const png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
/* Offset to next interlace block in the y direction */
- static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
+ static const png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
/* Height of interlace block. This is not currently used - if you need
* it, uncomment it here and in png.h
- static PNG_CONST png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
*/
#endif
diff --git a/pngpriv.h b/pngpriv.h
index 1f2e90f2b..7c19373f0 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -1,10 +1,10 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -174,7 +174,10 @@
# else /* !defined __ARM_NEON__ */
/* The 'intrinsics' code simply won't compile without this -mfpu=neon:
*/
-# define PNG_ARM_NEON_IMPLEMENTATION 2
+# if !defined(__aarch64__) && !defined(_M_ARM64)
+ /* The assembler code currently does not work on ARM64 */
+# define PNG_ARM_NEON_IMPLEMENTATION 2
+# endif /* __aarch64__ */
# endif /* __ARM_NEON__ */
# endif /* !PNG_ARM_NEON_IMPLEMENTATION */
@@ -182,6 +185,8 @@
/* Use the intrinsics code by default. */
# define PNG_ARM_NEON_IMPLEMENTATION 1
# endif
+#else /* PNG_ARM_NEON_OPT == 0 */
+# define PNG_ARM_NEON_IMPLEMENTATION 0
#endif /* PNG_ARM_NEON_OPT > 0 */
#ifndef PNG_MIPS_MSA_OPT
@@ -210,7 +215,11 @@
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
# define PNG_INTEL_SSE_OPT 1
+# else
+# define PNG_INTEL_SSE_OPT 0
# endif
+# else
+# define PNG_INTEL_SSE_OPT 0
# endif
#endif
@@ -234,6 +243,8 @@
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
# endif
+#else
+# define PNG_INTEL_SSE_IMPLEMENTATION 0
#endif
#if PNG_MIPS_MSA_OPT > 0
@@ -254,11 +265,15 @@
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# define PNG_MIPS_MSA_IMPLEMENTATION 1
# endif
+#else
+# define PNG_MIPS_MSA_IMPLEMENTATION 0
#endif /* PNG_MIPS_MSA_OPT > 0 */
#if PNG_POWERPC_VSX_OPT > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
# define PNG_POWERPC_VSX_IMPLEMENTATION 1
+#else
+# define PNG_POWERPC_VSX_IMPLEMENTATION 0
#endif
@@ -483,16 +498,7 @@
static_cast<type>(static_cast<const void*>(value))
#else
# define png_voidcast(type, value) (value)
-# ifdef _WIN64
-# ifdef __GNUC__
- typedef unsigned long long png_ptruint;
-# else
- typedef unsigned __int64 png_ptruint;
-# endif
-# else
- typedef unsigned long png_ptruint;
-# endif
-# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value))
+# define png_constcast(type, value) ((type)(void*)(const void*)(value))
# define png_aligncast(type, value) ((void*)(value))
# define png_aligncastconst(type, value) ((const void*)(value))
#endif /* __cplusplus */
@@ -534,9 +540,8 @@
# include <alloc.h>
#endif
-#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
- defined(_WIN32) || defined(__WIN32__)
-# include <windows.h> /* defines _WINDOWS_ macro */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
+# include <windows.h>
#endif
#endif /* PNG_VERSION_INFO_ONLY */
@@ -545,24 +550,20 @@
* functions that are passed far data must be model-independent.
*/
-/* Memory model/platform independent fns */
+/* Platform-independent functions */
#ifndef PNG_ABORT
-# ifdef _WINDOWS_
-# define PNG_ABORT() ExitProcess(0)
-# else
-# define PNG_ABORT() abort()
-# endif
+# define PNG_ABORT() abort()
#endif
/* These macros may need to be architecture dependent. */
-#define PNG_ALIGN_NONE 0 /* do not use data alignment */
-#define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */
+#define PNG_ALIGN_NONE 0 /* do not use data alignment */
+#define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */
#ifdef offsetof
-# define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */
+# define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */
#else
# define PNG_ALIGN_OFFSET -1 /* prevent the use of this */
#endif
-#define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */
+#define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */
#ifndef PNG_ALIGN_TYPE
/* Default to using aligned access optimizations and requiring alignment to a
@@ -576,26 +577,25 @@
/* This is used because in some compiler implementations non-aligned
* structure members are supported, so the offsetof approach below fails.
* Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access
- * is good for performance. Do not do this unless you have tested the result
- * and understand it.
+ * is good for performance. Do not do this unless you have tested the
+ * result and understand it.
*/
-# define png_alignof(type) (sizeof (type))
+# define png_alignof(type) (sizeof(type))
#else
# if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET
-# define png_alignof(type) offsetof(struct{char c; type t;}, t)
+# define png_alignof(type) offsetof(struct{char c; type t;}, t)
# else
-# if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS
-# define png_alignof(type) (1)
-# endif
- /* Else leave png_alignof undefined to prevent use thereof */
+# if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS
+# define png_alignof(type) 1
+# endif
+ /* Else leave png_alignof undefined to prevent use thereof */
# endif
#endif
-/* This implicitly assumes alignment is always to a power of 2. */
+/* This implicitly assumes alignment is always a multiple of 2. */
#ifdef png_alignof
-# define png_isaligned(ptr, type)\
- (((type)((const char*)ptr-(const char*)0) & \
- (type)(png_alignof(type)-1)) == 0)
+# define png_isaligned(ptr, type) \
+ (((type)(size_t)((const void*)(ptr)) & (type)(png_alignof(type)-1)) == 0)
#else
# define png_isaligned(ptr, type) 0
#endif
@@ -626,7 +626,7 @@
#define PNG_BACKGROUND_IS_GRAY 0x800U
#define PNG_HAVE_PNG_SIGNATURE 0x1000U
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */
- /* 0x4000U (unused) */
+#define PNG_WROTE_eXIf 0x4000U
#define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */
/* Flags for the transformations the PNG library does on the image data */
@@ -728,8 +728,8 @@
/* Added to libpng-1.2.6 JB */
#define PNG_ROWBYTES(pixel_bits, width) \
((pixel_bits) >= 8 ? \
- ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
- (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
+ ((size_t)(width) * (((size_t)(pixel_bits)) >> 3)) : \
+ (( ((size_t)(width) * ((size_t)(pixel_bits))) + 7) >> 3) )
/* This returns the number of trailing bits in the last byte of a row, 0 if the
* last byte is completely full of pixels. It is, in principle, (pixel_bits x
@@ -917,7 +917,7 @@
* PNG files the -I directives must match.
*
* The most likely explanation is that you passed a -I in CFLAGS. This will
- * not work; all the preprocessor directories and in particular all the -I
+ * not work; all the preprocessor directives and in particular all the -I
* directives must be in CPPFLAGS.
*/
#endif
@@ -1046,15 +1046,15 @@ PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY);
*/
PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr,
- png_bytep data, png_size_t length),PNG_EMPTY);
+ png_bytep data, size_t length),PNG_EMPTY);
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr,
- png_bytep buffer, png_size_t length),PNG_EMPTY);
+ png_bytep buffer, size_t length),PNG_EMPTY);
#endif
PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr,
- png_bytep data, png_size_t length),PNG_EMPTY);
+ png_bytep data, size_t length),PNG_EMPTY);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
# ifdef PNG_STDIO_SUPPORTED
@@ -1068,7 +1068,7 @@ PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY);
/* Write the "data" buffer to whatever output you are using */
PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr,
- png_const_bytep data, png_size_t length),PNG_EMPTY);
+ png_const_bytep data, size_t length),PNG_EMPTY);
/* Read and check the PNG file signature */
PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr,
@@ -1080,7 +1080,7 @@ PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr),
/* Read data from whatever input you are using into the "data" buffer */
PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data,
- png_size_t length),PNG_EMPTY);
+ size_t length),PNG_EMPTY);
/* Read bytes into buf, and update png_ptr->crc */
PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf,
@@ -1098,7 +1098,7 @@ PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY);
* since this is the maximum buffer size we can specify.
*/
PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr,
- png_const_bytep ptr, png_size_t length),PNG_EMPTY);
+ png_const_bytep ptr, size_t length),PNG_EMPTY);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY);
@@ -1181,7 +1181,7 @@ PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr,
/* Chunks that have keywords */
#ifdef PNG_WRITE_tEXt_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr,
- png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY);
+ png_const_charp key, png_const_charp text, size_t text_len),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_zTXt_SUPPORTED
@@ -1528,10 +1528,10 @@ PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
#endif
PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
- const png_uint_32 chunk_name),PNG_EMPTY);
+ png_uint_32 chunk_name),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
- const png_uint_32 chunk_length),PNG_EMPTY);
+ png_uint_32 chunk_length),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
@@ -1574,10 +1574,10 @@ PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr),
PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr,
- png_bytep buffer, png_size_t buffer_length),PNG_EMPTY);
+ png_bytep buffer, size_t buffer_length),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr,
- png_bytep buffer, png_size_t buffer_length),PNG_EMPTY);
+ png_bytep buffer, size_t buffer_length),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr),
PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr,
@@ -1847,13 +1847,13 @@ PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr,
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr,
- png_charp ascii, png_size_t size, double fp, unsigned int precision),
+ png_charp ascii, size_t size, double fp, unsigned int precision),
PNG_EMPTY);
#endif /* FLOATING_POINT */
#ifdef PNG_FIXED_POINT_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
- png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY);
+ png_charp ascii, size_t size, png_fixed_point fp),PNG_EMPTY);
#endif /* FIXED_POINT */
#endif /* sCAL */
@@ -1910,7 +1910,7 @@ PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
*/
#define PNG_FP_INVALID 512 /* Available for callers as a distinct value */
-/* Result codes for the parser (boolean - true meants ok, false means
+/* Result codes for the parser (boolean - true means ok, false means
* not ok yet.)
*/
#define PNG_FP_MAYBE 0 /* The number may be valid in the future */
@@ -1946,7 +1946,7 @@ PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
* the problem character.) This has not been tested within libpng.
*/
PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string,
- png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY);
+ size_t size, int *statep, size_t *whereami),PNG_EMPTY);
/* This is the same but it checks a complete string and returns true
* only if it just contains a floating point number. As of 1.5.4 this
@@ -1955,7 +1955,7 @@ PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string,
* for negative or zero values using the sticky flag.
*/
PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string,
- png_size_t size),PNG_EMPTY);
+ size_t size),PNG_EMPTY);
#endif /* pCAL || sCAL */
#if defined(PNG_GAMMA_SUPPORTED) ||\
@@ -2030,7 +2030,7 @@ typedef struct png_control
png_voidp error_buf; /* Always a jmp_buf at present. */
png_const_bytep memory; /* Memory buffer. */
- png_size_t size; /* Size of the memory buffer. */
+ size_t size; /* Size of the memory buffer. */
unsigned int for_write :1; /* Otherwise it is a read structure */
unsigned int owned_file :1; /* We own the file in io_ptr */
@@ -2108,6 +2108,29 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
png_const_charp key, png_bytep new_key), PNG_EMPTY);
+#if PNG_ARM_NEON_IMPLEMENTATION == 1
+PNG_INTERNAL_FUNCTION(void,
+ png_riffle_palette_neon,
+ (png_structrp),
+ PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,
+ png_do_expand_palette_rgba8_neon,
+ (png_structrp,
+ png_row_infop,
+ png_const_bytep,
+ const png_bytepp,
+ const png_bytepp),
+ PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,
+ png_do_expand_palette_rgb8_neon,
+ (png_structrp,
+ png_row_infop,
+ png_const_bytep,
+ const png_bytepp,
+ const png_bytepp),
+ PNG_EMPTY);
+#endif
+
/* Maintainer: Put new private prototypes here ^ */
#include "pngdebug.h"
diff --git a/pngread.c b/pngread.c
index da32e9ad9..96996ced5 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,10 +1,10 @@
/* pngread.c - read a PNG file
*
- * Last changed in libpng 1.6.33 [September 28, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -994,6 +994,12 @@ png_read_destroy(png_structrp png_ptr)
png_ptr->chunk_list = NULL;
#endif
+#if defined(PNG_READ_EXPAND_SUPPORTED) && \
+ defined(PNG_ARM_NEON_IMPLEMENTATION)
+ png_free(png_ptr, png_ptr->riffled_palette);
+ png_ptr->riffled_palette = NULL;
+#endif
+
/* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
* callbacks are still set at this point. They are required to complete the
* destruction of the png_struct itself.
@@ -1532,7 +1538,7 @@ png_image_begin_read_from_file(png_imagep image, const char *file_name)
#endif /* STDIO */
static void PNGCBAPI
-png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
+png_image_memory_read(png_structp png_ptr, png_bytep out, size_t need)
{
if (png_ptr != NULL)
{
@@ -1543,7 +1549,7 @@ png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
if (cp != NULL)
{
png_const_bytep memory = cp->memory;
- png_size_t size = cp->size;
+ size_t size = cp->size;
if (memory != NULL && size >= need)
{
@@ -1562,7 +1568,7 @@ png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
}
int PNGAPI png_image_begin_read_from_memory(png_imagep image,
- png_const_voidp memory, png_size_t size)
+ png_const_voidp memory, size_t size)
{
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
@@ -1621,7 +1627,7 @@ png_image_skip_unused_chunks(png_structrp png_ptr)
* errors (which are unfortunately quite common.)
*/
{
- static PNG_CONST png_byte chunks_to_process[] = {
+ static const png_byte chunks_to_process[] = {
98, 75, 71, 68, '\0', /* bKGD */
99, 72, 82, 77, '\0', /* cHRM */
103, 65, 77, 65, '\0', /* gAMA */
@@ -1758,9 +1764,9 @@ png_create_colormap_entry(png_image_read_control *display,
png_uint_32 alpha, int encoding)
{
png_imagep image = display->image;
- const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
+ int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
P_LINEAR : P_sRGB;
- const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 &&
+ int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 &&
(red != green || green != blue);
if (ip > 255)
@@ -1869,13 +1875,13 @@ png_create_colormap_entry(png_image_read_control *display,
/* Store the value. */
{
# ifdef PNG_FORMAT_AFIRST_SUPPORTED
- const int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
+ int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
(image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
# else
# define afirst 0
# endif
# ifdef PNG_FORMAT_BGR_SUPPORTED
- const int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
+ int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
# else
# define bgr 0
# endif
@@ -2085,11 +2091,11 @@ png_image_read_colormap(png_voidp argument)
{
png_image_read_control *display =
png_voidcast(png_image_read_control*, argument);
- const png_imagep image = display->image;
+ png_imagep image = display->image;
- const png_structrp png_ptr = image->opaque->png_ptr;
- const png_uint_32 output_format = image->format;
- const int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
+ png_structrp png_ptr = image->opaque->png_ptr;
+ png_uint_32 output_format = image->format;
+ int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ?
P_LINEAR : P_sRGB;
unsigned int cmap_entries;
@@ -2802,7 +2808,7 @@ png_image_read_colormap(png_voidp argument)
unsigned int num_trans = png_ptr->num_trans;
png_const_bytep trans = num_trans > 0 ? png_ptr->trans_alpha : NULL;
png_const_colorp colormap = png_ptr->palette;
- const int do_background = trans != NULL &&
+ int do_background = trans != NULL &&
(output_format & PNG_FORMAT_FLAG_ALPHA) == 0;
unsigned int i;
@@ -3446,7 +3452,6 @@ png_image_read_background(png_voidp argument)
for (pass = 0; pass < passes; ++pass)
{
- png_bytep row = png_voidcast(png_bytep, display->first_row);
unsigned int startx, stepx, stepy;
png_uint_32 y;
@@ -3551,8 +3556,6 @@ png_image_read_background(png_voidp argument)
inrow += 2; /* gray and alpha channel */
}
-
- row += display->row_bytes;
}
}
}
@@ -3759,13 +3762,13 @@ png_image_read_direct(png_voidp argument)
mode = PNG_ALPHA_PNG;
output_gamma = PNG_DEFAULT_sRGB;
}
-
+
if ((change & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0)
{
mode = PNG_ALPHA_OPTIMIZED;
change &= ~PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
}
-
+
/* If 'do_local_background' is set check for the presence of gamma
* correction; this is part of the work-round for the libpng bug
* described above.
@@ -3946,7 +3949,7 @@ png_image_read_direct(png_voidp argument)
*/
if (linear != 0)
{
- PNG_CONST png_uint_16 le = 0x0001;
+ png_uint_16 le = 0x0001;
if ((*(png_const_bytep) & le) != 0)
png_set_swap(png_ptr);
@@ -4108,7 +4111,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
* original PNG format because it may not occur in the output PNG format
* and libpng deals with the issues of reading the original.
*/
- const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
+ unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
/* The following checks just the 'row_stride' calculation to ensure it
* fits in a signed 32-bit value. Because channels/components can be
@@ -4119,7 +4122,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
if (image->width <= 0x7fffffffU/channels) /* no overflow */
{
png_uint_32 check;
- const png_uint_32 png_row_stride = image->width * channels;
+ png_uint_32 png_row_stride = image->width * channels;
if (row_stride == 0)
row_stride = (png_int_32)/*SAFE*/png_row_stride;
@@ -4150,7 +4153,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
*
* NOTE: this will be changed in 1.7 because PNG_IMAGE_BUFFER_SIZE
* will be changed to use png_alloc_size_t; bigger images can be
- * accomodated on 64-bit systems.
+ * accommodated on 64-bit systems.
*/
if (image->height <=
0xffffffffU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check)
diff --git a/pngrio.c b/pngrio.c
index 7e26e855c..794635810 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -1,10 +1,10 @@
/* pngrio.c - functions for data input
*
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -29,7 +29,7 @@
* to read more than 64K on a 16-bit machine.
*/
void /* PRIVATE */
-png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
+png_read_data(png_structrp png_ptr, png_bytep data, size_t length)
{
png_debug1(4, "reading %d bytes", (int)length);
@@ -47,14 +47,14 @@ png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
* than changing the library.
*/
void PNGCBAPI
-png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
+png_default_read_data(png_structp png_ptr, png_bytep data, size_t length)
{
- png_size_t check;
+ size_t check;
if (png_ptr == NULL)
return;
- /* fread() returns 0 on error, so it is OK to store this in a png_size_t
+ /* 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.
*/
check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
diff --git a/pngrtran.c b/pngrtran.c
index c18965031..238f5afe7 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,10 +1,10 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.6.33 [September 28, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -18,6 +18,17 @@
#include "pngpriv.h"
+#ifdef PNG_ARM_NEON_IMPLEMENTATION
+# if PNG_ARM_NEON_IMPLEMENTATION == 1
+# define PNG_ARM_NEON_INTRINSICS_AVAILABLE
+# if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+# include <arm64_neon.h>
+# else
+# include <arm_neon.h>
+# endif
+# endif
+#endif
+
#ifdef PNG_READ_SUPPORTED
/* Set the action on getting a CRC error for an ancillary or critical chunk. */
@@ -292,7 +303,7 @@ png_set_alpha_mode_fixed(png_structrp png_ptr, int mode,
* who use the inverse of the gamma value accidentally! Since some of these
* values are reasonable this may have to be changed:
*
- * 1.6.x: changed from 0.07..3 to 0.01..100 (to accomodate the optimal 16-bit
+ * 1.6.x: 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)
@@ -747,7 +758,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
int num_red = (1 << PNG_QUANTIZE_RED_BITS);
int num_green = (1 << PNG_QUANTIZE_GREEN_BITS);
int num_blue = (1 << PNG_QUANTIZE_BLUE_BITS);
- png_size_t num_entries = ((png_size_t)1 << total_bits);
+ 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))));
@@ -1171,20 +1182,20 @@ png_init_palette_transformations(png_structrp png_ptr)
png_ptr->palette[png_ptr->background.index].blue;
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
- if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
- {
- if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
- {
- /* Invert the alpha channel (in tRNS) unless the pixels are
- * going to be expanded, in which case leave it for later
- */
- int i, istop = png_ptr->num_trans;
-
- for (i=0; i<istop; i++)
- png_ptr->trans_alpha[i] = (png_byte)(255 -
- png_ptr->trans_alpha[i]);
- }
- }
+ if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
+ {
+ if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
+ {
+ /* Invert the alpha channel (in tRNS) unless the pixels are
+ * going to be expanded, in which case leave it for later
+ */
+ int i, istop = png_ptr->num_trans;
+
+ for (i = 0; i < istop; i++)
+ png_ptr->trans_alpha[i] =
+ (png_byte)(255 - png_ptr->trans_alpha[i]);
+ }
+ }
#endif /* READ_INVERT_ALPHA */
}
} /* background expand and (therefore) no alpha association. */
@@ -1317,7 +1328,7 @@ png_init_read_transformations(png_structrp png_ptr)
else if (png_ptr->screen_gamma != 0)
/* The converse - assume the file matches the screen, note that this
- * perhaps undesireable default can (from 1.5.4) be changed by calling
+ * perhaps undesirable default can (from 1.5.4) be changed by calling
* png_set_alpha_mode (even if the alpha handling mode isn't required
* or isn't changed from the default.)
*/
@@ -1885,7 +1896,7 @@ png_init_read_transformations(png_structrp png_ptr)
png_ptr->transformations &= ~PNG_SHIFT;
- /* significant bits can be in the range 1 to 7 for a meaninful result, if
+ /* significant bits can be in the range 1 to 7 for a meaningful result, if
* the number of significant bits is 0 then no shift is done (this is an
* error condition which is silently ignored.)
*/
@@ -2151,8 +2162,8 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
{
case 1:
{
- png_bytep sp = row + (png_size_t)((row_width - 1) >> 3);
- png_bytep dp = row + (png_size_t)row_width - 1;
+ png_bytep sp = row + (size_t)((row_width - 1) >> 3);
+ png_bytep dp = row + (size_t)row_width - 1;
png_uint_32 shift = 7U - ((row_width + 7U) & 0x07);
for (i = 0; i < row_width; i++)
{
@@ -2175,8 +2186,8 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
case 2:
{
- png_bytep sp = row + (png_size_t)((row_width - 1) >> 2);
- png_bytep dp = row + (png_size_t)row_width - 1;
+ png_bytep sp = row + (size_t)((row_width - 1) >> 2);
+ png_bytep dp = row + (size_t)row_width - 1;
png_uint_32 shift = ((3U - ((row_width + 3U) & 0x03)) << 1);
for (i = 0; i < row_width; i++)
{
@@ -2198,8 +2209,8 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
case 4:
{
- png_bytep sp = row + (png_size_t)((row_width - 1) >> 1);
- png_bytep dp = row + (png_size_t)row_width - 1;
+ png_bytep sp = row + (size_t)((row_width - 1) >> 1);
+ png_bytep dp = row + (size_t)row_width - 1;
png_uint_32 shift = ((1U - ((row_width + 1U) & 0x01)) << 2);
for (i = 0; i < row_width; i++)
{
@@ -2463,95 +2474,94 @@ png_do_chop(png_row_infop row_info, png_bytep row)
static void
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
{
+ png_uint_32 row_width = row_info->width;
+
png_debug(1, "in png_do_read_swap_alpha");
+ if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
{
- png_uint_32 row_width = row_info->width;
- if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ /* This converts from RGBA to ARGB */
+ if (row_info->bit_depth == 8)
{
- /* This converts from RGBA to ARGB */
- if (row_info->bit_depth == 8)
- {
- png_bytep sp = row + row_info->rowbytes;
- png_bytep dp = sp;
- png_byte save;
- png_uint_32 i;
+ png_bytep sp = row + row_info->rowbytes;
+ png_bytep dp = sp;
+ png_byte save;
+ png_uint_32 i;
- for (i = 0; i < row_width; i++)
- {
- save = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = save;
- }
+ for (i = 0; i < row_width; i++)
+ {
+ save = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = save;
}
+ }
#ifdef PNG_READ_16BIT_SUPPORTED
- /* This converts from RRGGBBAA to AARRGGBB */
- else
- {
- png_bytep sp = row + row_info->rowbytes;
- png_bytep dp = sp;
- png_byte save[2];
- png_uint_32 i;
+ /* This converts from RRGGBBAA to AARRGGBB */
+ else
+ {
+ png_bytep sp = row + row_info->rowbytes;
+ png_bytep dp = sp;
+ png_byte save[2];
+ png_uint_32 i;
- for (i = 0; i < row_width; i++)
- {
- save[0] = *(--sp);
- save[1] = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = save[0];
- *(--dp) = save[1];
- }
+ for (i = 0; i < row_width; i++)
+ {
+ save[0] = *(--sp);
+ save[1] = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = save[0];
+ *(--dp) = save[1];
}
-#endif
}
+#endif
+ }
- else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ {
+ /* This converts from GA to AG */
+ if (row_info->bit_depth == 8)
{
- /* This converts from GA to AG */
- if (row_info->bit_depth == 8)
- {
- png_bytep sp = row + row_info->rowbytes;
- png_bytep dp = sp;
- png_byte save;
- png_uint_32 i;
+ png_bytep sp = row + row_info->rowbytes;
+ png_bytep dp = sp;
+ png_byte save;
+ png_uint_32 i;
- for (i = 0; i < row_width; i++)
- {
- save = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = save;
- }
+ for (i = 0; i < row_width; i++)
+ {
+ save = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = save;
}
+ }
#ifdef PNG_READ_16BIT_SUPPORTED
- /* This converts from GGAA to AAGG */
- else
- {
- png_bytep sp = row + row_info->rowbytes;
- png_bytep dp = sp;
- png_byte save[2];
- png_uint_32 i;
+ /* This converts from GGAA to AAGG */
+ else
+ {
+ png_bytep sp = row + row_info->rowbytes;
+ png_bytep dp = sp;
+ png_byte save[2];
+ png_uint_32 i;
- for (i = 0; i < row_width; i++)
- {
- save[0] = *(--sp);
- save[1] = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = *(--sp);
- *(--dp) = save[0];
- *(--dp) = save[1];
- }
+ for (i = 0; i < row_width; i++)
+ {
+ save[0] = *(--sp);
+ save[1] = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = *(--sp);
+ *(--dp) = save[0];
+ *(--dp) = save[1];
}
-#endif
}
+#endif
}
}
#endif
@@ -2681,8 +2691,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
if ((flags & PNG_FLAG_FILLER_AFTER) != 0)
{
/* This changes the data from G to GX */
- png_bytep sp = row + (png_size_t)row_width;
- png_bytep dp = sp + (png_size_t)row_width;
+ png_bytep sp = row + (size_t)row_width;
+ png_bytep dp = sp + (size_t)row_width;
for (i = 1; i < row_width; i++)
{
*(--dp) = lo_filler;
@@ -2697,8 +2707,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
else
{
/* This changes the data from G to XG */
- png_bytep sp = row + (png_size_t)row_width;
- png_bytep dp = sp + (png_size_t)row_width;
+ png_bytep sp = row + (size_t)row_width;
+ png_bytep dp = sp + (size_t)row_width;
for (i = 0; i < row_width; i++)
{
*(--dp) = *(--sp);
@@ -2716,8 +2726,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
if ((flags & PNG_FLAG_FILLER_AFTER) != 0)
{
/* This changes the data from GG to GGXX */
- png_bytep sp = row + (png_size_t)row_width * 2;
- png_bytep dp = sp + (png_size_t)row_width * 2;
+ png_bytep sp = row + (size_t)row_width * 2;
+ png_bytep dp = sp + (size_t)row_width * 2;
for (i = 1; i < row_width; i++)
{
*(--dp) = lo_filler;
@@ -2735,8 +2745,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
else
{
/* This changes the data from GG to XXGG */
- png_bytep sp = row + (png_size_t)row_width * 2;
- png_bytep dp = sp + (png_size_t)row_width * 2;
+ png_bytep sp = row + (size_t)row_width * 2;
+ png_bytep dp = sp + (size_t)row_width * 2;
for (i = 0; i < row_width; i++)
{
*(--dp) = *(--sp);
@@ -2758,8 +2768,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
if ((flags & PNG_FLAG_FILLER_AFTER) != 0)
{
/* This changes the data from RGB to RGBX */
- png_bytep sp = row + (png_size_t)row_width * 3;
- png_bytep dp = sp + (png_size_t)row_width;
+ png_bytep sp = row + (size_t)row_width * 3;
+ png_bytep dp = sp + (size_t)row_width;
for (i = 1; i < row_width; i++)
{
*(--dp) = lo_filler;
@@ -2776,8 +2786,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
else
{
/* This changes the data from RGB to XRGB */
- png_bytep sp = row + (png_size_t)row_width * 3;
- png_bytep dp = sp + (png_size_t)row_width;
+ png_bytep sp = row + (size_t)row_width * 3;
+ png_bytep dp = sp + (size_t)row_width;
for (i = 0; i < row_width; i++)
{
*(--dp) = *(--sp);
@@ -2797,8 +2807,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
if ((flags & PNG_FLAG_FILLER_AFTER) != 0)
{
/* This changes the data from RRGGBB to RRGGBBXX */
- png_bytep sp = row + (png_size_t)row_width * 6;
- png_bytep dp = sp + (png_size_t)row_width * 2;
+ png_bytep sp = row + (size_t)row_width * 6;
+ png_bytep dp = sp + (size_t)row_width * 2;
for (i = 1; i < row_width; i++)
{
*(--dp) = lo_filler;
@@ -2820,8 +2830,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
else
{
/* This changes the data from RRGGBB to XXRRGGBB */
- png_bytep sp = row + (png_size_t)row_width * 6;
- png_bytep dp = sp + (png_size_t)row_width * 2;
+ png_bytep sp = row + (size_t)row_width * 6;
+ png_bytep dp = sp + (size_t)row_width * 2;
for (i = 0; i < row_width; i++)
{
*(--dp) = *(--sp);
@@ -2862,8 +2872,8 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
if (row_info->bit_depth == 8)
{
/* This changes G to RGB */
- png_bytep sp = row + (png_size_t)row_width - 1;
- png_bytep dp = sp + (png_size_t)row_width * 2;
+ png_bytep sp = row + (size_t)row_width - 1;
+ png_bytep dp = sp + (size_t)row_width * 2;
for (i = 0; i < row_width; i++)
{
*(dp--) = *sp;
@@ -2875,8 +2885,8 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
else
{
/* This changes GG to RRGGBB */
- png_bytep sp = row + (png_size_t)row_width * 2 - 1;
- png_bytep dp = sp + (png_size_t)row_width * 4;
+ png_bytep sp = row + (size_t)row_width * 2 - 1;
+ png_bytep dp = sp + (size_t)row_width * 4;
for (i = 0; i < row_width; i++)
{
*(dp--) = *sp;
@@ -2894,8 +2904,8 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
if (row_info->bit_depth == 8)
{
/* This changes GA to RGBA */
- png_bytep sp = row + (png_size_t)row_width * 2 - 1;
- png_bytep dp = sp + (png_size_t)row_width * 2;
+ png_bytep sp = row + (size_t)row_width * 2 - 1;
+ png_bytep dp = sp + (size_t)row_width * 2;
for (i = 0; i < row_width; i++)
{
*(dp--) = *(sp--);
@@ -2908,8 +2918,8 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
else
{
/* This changes GGAA to RRGGBBAA */
- png_bytep sp = row + (png_size_t)row_width * 4 - 1;
- png_bytep dp = sp + (png_size_t)row_width * 4;
+ png_bytep sp = row + (size_t)row_width * 4 - 1;
+ png_bytep dp = sp + (size_t)row_width * 4;
for (i = 0; i < row_width; i++)
{
*(dp--) = *(sp--);
@@ -2980,14 +2990,13 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
* values this results in an implicit assumption that the original PNG RGB
* values were linear.
*
- * Other integer coefficents can be used via png_set_rgb_to_gray(). Because
+ * Other integer coefficients can be used via png_set_rgb_to_gray(). Because
* the API takes just red and green coefficients the blue coefficient is
* calculated to make the sum 32768. This will result in different rounding
* to that used above.
*/
static int
png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
-
{
int rgb_error = 0;
@@ -2996,12 +3005,11 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
if ((row_info->color_type & PNG_COLOR_MASK_PALETTE) == 0 &&
(row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
{
- PNG_CONST png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
- PNG_CONST png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
- PNG_CONST png_uint_32 bc = 32768 - rc - gc;
- PNG_CONST png_uint_32 row_width = row_info->width;
- PNG_CONST int have_alpha =
- (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0;
+ png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
+ png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
+ png_uint_32 bc = 32768 - rc - gc;
+ png_uint_32 row_width = row_info->width;
+ int have_alpha = (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0;
if (row_info->bit_depth == 8)
{
@@ -3209,720 +3217,718 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
png_debug(1, "in png_do_compose");
+ switch (row_info->color_type)
{
- switch (row_info->color_type)
+ case PNG_COLOR_TYPE_GRAY:
{
- case PNG_COLOR_TYPE_GRAY:
+ switch (row_info->bit_depth)
{
- switch (row_info->bit_depth)
+ case 1:
+ {
+ sp = row;
+ shift = 7;
+ for (i = 0; i < row_width; i++)
+ {
+ if ((png_uint_16)((*sp >> shift) & 0x01)
+ == png_ptr->trans_color.gray)
+ {
+ unsigned int tmp = *sp & (0x7f7f >> (7 - shift));
+ tmp |=
+ (unsigned int)(png_ptr->background.gray << shift);
+ *sp = (png_byte)(tmp & 0xff);
+ }
+
+ if (shift == 0)
+ {
+ shift = 7;
+ sp++;
+ }
+
+ else
+ shift--;
+ }
+ break;
+ }
+
+ case 2:
{
- case 1:
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ if (gamma_table != NULL)
{
sp = row;
- shift = 7;
+ shift = 6;
for (i = 0; i < row_width; i++)
{
- if ((png_uint_16)((*sp >> shift) & 0x01)
- == png_ptr->trans_color.gray)
+ if ((png_uint_16)((*sp >> shift) & 0x03)
+ == png_ptr->trans_color.gray)
{
- unsigned int tmp = *sp & (0x7f7f >> (7 - shift));
+ unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
tmp |=
- (unsigned int)(png_ptr->background.gray << shift);
+ (unsigned int)png_ptr->background.gray << shift;
+ *sp = (png_byte)(tmp & 0xff);
+ }
+
+ else
+ {
+ unsigned int p = (*sp >> shift) & 0x03;
+ unsigned int g = (gamma_table [p | (p << 2) |
+ (p << 4) | (p << 6)] >> 6) & 0x03;
+ unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
+ tmp |= (unsigned int)(g << shift);
*sp = (png_byte)(tmp & 0xff);
}
if (shift == 0)
{
- shift = 7;
+ shift = 6;
sp++;
}
else
- shift--;
+ shift -= 2;
}
- break;
}
- case 2:
+ else
+#endif
{
-#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_table != NULL)
+ sp = row;
+ shift = 6;
+ for (i = 0; i < row_width; i++)
{
- sp = row;
- shift = 6;
- for (i = 0; i < row_width; i++)
+ if ((png_uint_16)((*sp >> shift) & 0x03)
+ == png_ptr->trans_color.gray)
{
- if ((png_uint_16)((*sp >> shift) & 0x03)
- == png_ptr->trans_color.gray)
- {
- unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
- tmp |=
- (unsigned int)png_ptr->background.gray << shift;
- *sp = (png_byte)(tmp & 0xff);
- }
-
- else
- {
- unsigned int p = (*sp >> shift) & 0x03;
- unsigned int g = (gamma_table [p | (p << 2) |
- (p << 4) | (p << 6)] >> 6) & 0x03;
- unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
- tmp |= (unsigned int)(g << shift);
- *sp = (png_byte)(tmp & 0xff);
- }
-
- if (shift == 0)
- {
- shift = 6;
- sp++;
- }
-
- else
- shift -= 2;
+ unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
+ tmp |=
+ (unsigned int)png_ptr->background.gray << shift;
+ *sp = (png_byte)(tmp & 0xff);
}
- }
- else
-#endif
- {
- sp = row;
- shift = 6;
- for (i = 0; i < row_width; i++)
+ if (shift == 0)
{
- if ((png_uint_16)((*sp >> shift) & 0x03)
- == png_ptr->trans_color.gray)
- {
- unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
- tmp |=
- (unsigned int)png_ptr->background.gray << shift;
- *sp = (png_byte)(tmp & 0xff);
- }
-
- if (shift == 0)
- {
- shift = 6;
- sp++;
- }
-
- else
- shift -= 2;
+ shift = 6;
+ sp++;
}
+
+ else
+ shift -= 2;
}
- break;
}
+ break;
+ }
- case 4:
- {
+ case 4:
+ {
#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_table != NULL)
+ if (gamma_table != NULL)
+ {
+ sp = row;
+ shift = 4;
+ for (i = 0; i < row_width; i++)
{
- sp = row;
- shift = 4;
- for (i = 0; i < row_width; i++)
+ if ((png_uint_16)((*sp >> shift) & 0x0f)
+ == png_ptr->trans_color.gray)
{
- if ((png_uint_16)((*sp >> shift) & 0x0f)
- == png_ptr->trans_color.gray)
- {
- unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
- tmp |=
- (unsigned int)(png_ptr->background.gray << shift);
- *sp = (png_byte)(tmp & 0xff);
- }
-
- else
- {
- unsigned int p = (*sp >> shift) & 0x0f;
- unsigned int g = (gamma_table[p | (p << 4)] >> 4) &
- 0x0f;
- unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
- tmp |= (unsigned int)(g << shift);
- *sp = (png_byte)(tmp & 0xff);
- }
-
- if (shift == 0)
- {
- shift = 4;
- sp++;
- }
-
- else
- shift -= 4;
+ unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
+ tmp |=
+ (unsigned int)(png_ptr->background.gray << shift);
+ *sp = (png_byte)(tmp & 0xff);
}
- }
- else
-#endif
- {
- sp = row;
- shift = 4;
- for (i = 0; i < row_width; i++)
+ else
{
- if ((png_uint_16)((*sp >> shift) & 0x0f)
- == png_ptr->trans_color.gray)
- {
- unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
- tmp |=
- (unsigned int)(png_ptr->background.gray << shift);
- *sp = (png_byte)(tmp & 0xff);
- }
-
- if (shift == 0)
- {
- shift = 4;
- sp++;
- }
-
- else
- shift -= 4;
+ unsigned int p = (*sp >> shift) & 0x0f;
+ unsigned int g = (gamma_table[p | (p << 4)] >> 4) &
+ 0x0f;
+ unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
+ tmp |= (unsigned int)(g << shift);
+ *sp = (png_byte)(tmp & 0xff);
}
- }
- break;
- }
-
- case 8:
- {
-#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_table != NULL)
- {
- sp = row;
- for (i = 0; i < row_width; i++, sp++)
- {
- if (*sp == png_ptr->trans_color.gray)
- *sp = (png_byte)png_ptr->background.gray;
- else
- *sp = gamma_table[*sp];
- }
- }
- else
-#endif
- {
- sp = row;
- for (i = 0; i < row_width; i++, sp++)
+ if (shift == 0)
{
- if (*sp == png_ptr->trans_color.gray)
- *sp = (png_byte)png_ptr->background.gray;
+ shift = 4;
+ sp++;
}
+
+ else
+ shift -= 4;
}
- break;
}
- case 16:
+ else
+#endif
{
-#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_16 != NULL)
+ sp = row;
+ shift = 4;
+ for (i = 0; i < row_width; i++)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 2)
+ if ((png_uint_16)((*sp >> shift) & 0x0f)
+ == png_ptr->trans_color.gray)
{
- png_uint_16 v;
-
- v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
-
- if (v == png_ptr->trans_color.gray)
- {
- /* Background is already in screen gamma */
- *sp = (png_byte)((png_ptr->background.gray >> 8)
- & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.gray
- & 0xff);
- }
-
- else
- {
- v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
- *sp = (png_byte)((v >> 8) & 0xff);
- *(sp + 1) = (png_byte)(v & 0xff);
- }
+ unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
+ tmp |=
+ (unsigned int)(png_ptr->background.gray << shift);
+ *sp = (png_byte)(tmp & 0xff);
}
- }
- else
-#endif
- {
- sp = row;
- for (i = 0; i < row_width; i++, sp += 2)
- {
- png_uint_16 v;
-
- v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
- if (v == png_ptr->trans_color.gray)
- {
- *sp = (png_byte)((png_ptr->background.gray >> 8)
- & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.gray
- & 0xff);
- }
+ if (shift == 0)
+ {
+ shift = 4;
+ sp++;
}
+
+ else
+ shift -= 4;
}
- break;
}
-
- default:
- break;
+ break;
}
- break;
- }
- case PNG_COLOR_TYPE_RGB:
- {
- if (row_info->bit_depth == 8)
+ case 8:
{
#ifdef PNG_READ_GAMMA_SUPPORTED
if (gamma_table != NULL)
{
sp = row;
- for (i = 0; i < row_width; i++, sp += 3)
+ for (i = 0; i < row_width; i++, sp++)
{
- if (*sp == png_ptr->trans_color.red &&
- *(sp + 1) == png_ptr->trans_color.green &&
- *(sp + 2) == png_ptr->trans_color.blue)
- {
- *sp = (png_byte)png_ptr->background.red;
- *(sp + 1) = (png_byte)png_ptr->background.green;
- *(sp + 2) = (png_byte)png_ptr->background.blue;
- }
+ if (*sp == png_ptr->trans_color.gray)
+ *sp = (png_byte)png_ptr->background.gray;
else
- {
*sp = gamma_table[*sp];
- *(sp + 1) = gamma_table[*(sp + 1)];
- *(sp + 2) = gamma_table[*(sp + 2)];
- }
}
}
else
#endif
{
sp = row;
- for (i = 0; i < row_width; i++, sp += 3)
+ for (i = 0; i < row_width; i++, sp++)
{
- if (*sp == png_ptr->trans_color.red &&
- *(sp + 1) == png_ptr->trans_color.green &&
- *(sp + 2) == png_ptr->trans_color.blue)
- {
- *sp = (png_byte)png_ptr->background.red;
- *(sp + 1) = (png_byte)png_ptr->background.green;
- *(sp + 2) = (png_byte)png_ptr->background.blue;
- }
+ if (*sp == png_ptr->trans_color.gray)
+ *sp = (png_byte)png_ptr->background.gray;
}
}
+ break;
}
- else /* if (row_info->bit_depth == 16) */
+
+ case 16:
{
#ifdef PNG_READ_GAMMA_SUPPORTED
if (gamma_16 != NULL)
{
sp = row;
- for (i = 0; i < row_width; i++, sp += 6)
+ for (i = 0; i < row_width; i++, sp += 2)
{
- png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
+ png_uint_16 v;
- png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
- + *(sp + 3));
+ v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
- png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
- + *(sp + 5));
-
- if (r == png_ptr->trans_color.red &&
- g == png_ptr->trans_color.green &&
- b == png_ptr->trans_color.blue)
+ if (v == png_ptr->trans_color.gray)
{
/* Background is already in screen gamma */
- *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
- *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
- & 0xff);
- *(sp + 3) = (png_byte)(png_ptr->background.green
- & 0xff);
- *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
- & 0xff);
- *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
+ *sp = (png_byte)((png_ptr->background.gray >> 8)
+ & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.gray
+ & 0xff);
}
else
{
- png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
+ v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
*sp = (png_byte)((v >> 8) & 0xff);
*(sp + 1) = (png_byte)(v & 0xff);
-
- v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)];
- *(sp + 2) = (png_byte)((v >> 8) & 0xff);
- *(sp + 3) = (png_byte)(v & 0xff);
-
- v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)];
- *(sp + 4) = (png_byte)((v >> 8) & 0xff);
- *(sp + 5) = (png_byte)(v & 0xff);
}
}
}
-
else
#endif
{
sp = row;
- for (i = 0; i < row_width; i++, sp += 6)
+ for (i = 0; i < row_width; i++, sp += 2)
{
- png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
-
- png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
- + *(sp + 3));
+ png_uint_16 v;
- png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
- + *(sp + 5));
+ v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
- if (r == png_ptr->trans_color.red &&
- g == png_ptr->trans_color.green &&
- b == png_ptr->trans_color.blue)
+ if (v == png_ptr->trans_color.gray)
{
- *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
- *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
- & 0xff);
- *(sp + 3) = (png_byte)(png_ptr->background.green
- & 0xff);
- *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
- & 0xff);
- *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
+ *sp = (png_byte)((png_ptr->background.gray >> 8)
+ & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.gray
+ & 0xff);
}
}
}
+ break;
}
- break;
+
+ default:
+ break;
}
+ break;
+ }
- case PNG_COLOR_TYPE_GRAY_ALPHA:
+ case PNG_COLOR_TYPE_RGB:
+ {
+ if (row_info->bit_depth == 8)
{
- if (row_info->bit_depth == 8)
- {
#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_to_1 != NULL && gamma_from_1 != NULL &&
- gamma_table != NULL)
+ if (gamma_table != NULL)
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 3)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 2)
+ if (*sp == png_ptr->trans_color.red &&
+ *(sp + 1) == png_ptr->trans_color.green &&
+ *(sp + 2) == png_ptr->trans_color.blue)
{
- png_uint_16 a = *(sp + 1);
+ *sp = (png_byte)png_ptr->background.red;
+ *(sp + 1) = (png_byte)png_ptr->background.green;
+ *(sp + 2) = (png_byte)png_ptr->background.blue;
+ }
- if (a == 0xff)
- *sp = gamma_table[*sp];
+ else
+ {
+ *sp = gamma_table[*sp];
+ *(sp + 1) = gamma_table[*(sp + 1)];
+ *(sp + 2) = gamma_table[*(sp + 2)];
+ }
+ }
+ }
+ else
+#endif
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 3)
+ {
+ if (*sp == png_ptr->trans_color.red &&
+ *(sp + 1) == png_ptr->trans_color.green &&
+ *(sp + 2) == png_ptr->trans_color.blue)
+ {
+ *sp = (png_byte)png_ptr->background.red;
+ *(sp + 1) = (png_byte)png_ptr->background.green;
+ *(sp + 2) = (png_byte)png_ptr->background.blue;
+ }
+ }
+ }
+ }
+ else /* if (row_info->bit_depth == 16) */
+ {
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ if (gamma_16 != NULL)
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 6)
+ {
+ png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
- else if (a == 0)
- {
- /* Background is already in screen gamma */
- *sp = (png_byte)png_ptr->background.gray;
- }
+ png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
+ + *(sp + 3));
- else
- {
- png_byte v, w;
+ png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
+ + *(sp + 5));
- v = gamma_to_1[*sp];
- png_composite(w, v, a, png_ptr->background_1.gray);
- if (optimize == 0)
- w = gamma_from_1[w];
- *sp = w;
- }
+ if (r == png_ptr->trans_color.red &&
+ g == png_ptr->trans_color.green &&
+ b == png_ptr->trans_color.blue)
+ {
+ /* Background is already in screen gamma */
+ *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
+ *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
+ & 0xff);
+ *(sp + 3) = (png_byte)(png_ptr->background.green
+ & 0xff);
+ *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
+ & 0xff);
+ *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
+ }
+
+ else
+ {
+ png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
+ *sp = (png_byte)((v >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(v & 0xff);
+
+ v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)];
+ *(sp + 2) = (png_byte)((v >> 8) & 0xff);
+ *(sp + 3) = (png_byte)(v & 0xff);
+
+ v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)];
+ *(sp + 4) = (png_byte)((v >> 8) & 0xff);
+ *(sp + 5) = (png_byte)(v & 0xff);
}
}
- else
+ }
+
+ else
#endif
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 6)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 2)
+ png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
+
+ png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
+ + *(sp + 3));
+
+ png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
+ + *(sp + 5));
+
+ if (r == png_ptr->trans_color.red &&
+ g == png_ptr->trans_color.green &&
+ b == png_ptr->trans_color.blue)
{
- png_byte a = *(sp + 1);
+ *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
+ *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
+ & 0xff);
+ *(sp + 3) = (png_byte)(png_ptr->background.green
+ & 0xff);
+ *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
+ & 0xff);
+ *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
+ }
+ }
+ }
+ }
+ break;
+ }
- if (a == 0)
- *sp = (png_byte)png_ptr->background.gray;
+ case PNG_COLOR_TYPE_GRAY_ALPHA:
+ {
+ if (row_info->bit_depth == 8)
+ {
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ if (gamma_to_1 != NULL && gamma_from_1 != NULL &&
+ gamma_table != NULL)
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 2)
+ {
+ png_uint_16 a = *(sp + 1);
+
+ if (a == 0xff)
+ *sp = gamma_table[*sp];
+
+ else if (a == 0)
+ {
+ /* Background is already in screen gamma */
+ *sp = (png_byte)png_ptr->background.gray;
+ }
+
+ else
+ {
+ png_byte v, w;
- else if (a < 0xff)
- png_composite(*sp, *sp, a, png_ptr->background.gray);
+ v = gamma_to_1[*sp];
+ png_composite(w, v, a, png_ptr->background_1.gray);
+ if (optimize == 0)
+ w = gamma_from_1[w];
+ *sp = w;
}
}
}
- else /* if (png_ptr->bit_depth == 16) */
+ else
+#endif
{
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 2)
+ {
+ png_byte a = *(sp + 1);
+
+ if (a == 0)
+ *sp = (png_byte)png_ptr->background.gray;
+
+ else if (a < 0xff)
+ png_composite(*sp, *sp, a, png_ptr->background.gray);
+ }
+ }
+ }
+ else /* if (png_ptr->bit_depth == 16) */
+ {
#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_16 != NULL && gamma_16_from_1 != NULL &&
- gamma_16_to_1 != NULL)
+ if (gamma_16 != NULL && gamma_16_from_1 != NULL &&
+ gamma_16_to_1 != NULL)
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 4)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 4)
+ png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8)
+ + *(sp + 3));
+
+ if (a == (png_uint_16)0xffff)
{
- png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8)
- + *(sp + 3));
+ png_uint_16 v;
- if (a == (png_uint_16)0xffff)
- {
- png_uint_16 v;
+ v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
+ *sp = (png_byte)((v >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(v & 0xff);
+ }
- v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
- *sp = (png_byte)((v >> 8) & 0xff);
- *(sp + 1) = (png_byte)(v & 0xff);
- }
+ else if (a == 0)
+ {
+ /* Background is already in screen gamma */
+ *sp = (png_byte)((png_ptr->background.gray >> 8)
+ & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
+ }
- else if (a == 0)
- {
- /* Background is already in screen gamma */
- *sp = (png_byte)((png_ptr->background.gray >> 8)
- & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
- }
+ else
+ {
+ png_uint_16 g, v, w;
+ g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
+ png_composite_16(v, g, a, png_ptr->background_1.gray);
+ if (optimize != 0)
+ w = v;
else
- {
- png_uint_16 g, v, w;
-
- g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
- png_composite_16(v, g, a, png_ptr->background_1.gray);
- if (optimize != 0)
- w = v;
- else
- w = gamma_16_from_1[(v & 0xff) >>
- gamma_shift][v >> 8];
- *sp = (png_byte)((w >> 8) & 0xff);
- *(sp + 1) = (png_byte)(w & 0xff);
- }
+ w = gamma_16_from_1[(v & 0xff) >>
+ gamma_shift][v >> 8];
+ *sp = (png_byte)((w >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(w & 0xff);
}
}
- else
+ }
+ else
#endif
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 4)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 4)
- {
- png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8)
- + *(sp + 3));
+ png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8)
+ + *(sp + 3));
- if (a == 0)
- {
- *sp = (png_byte)((png_ptr->background.gray >> 8)
- & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
- }
+ if (a == 0)
+ {
+ *sp = (png_byte)((png_ptr->background.gray >> 8)
+ & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
+ }
- else if (a < 0xffff)
- {
- png_uint_16 g, v;
+ else if (a < 0xffff)
+ {
+ png_uint_16 g, v;
- g = (png_uint_16)(((*sp) << 8) + *(sp + 1));
- png_composite_16(v, g, a, png_ptr->background.gray);
- *sp = (png_byte)((v >> 8) & 0xff);
- *(sp + 1) = (png_byte)(v & 0xff);
- }
+ g = (png_uint_16)(((*sp) << 8) + *(sp + 1));
+ png_composite_16(v, g, a, png_ptr->background.gray);
+ *sp = (png_byte)((v >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(v & 0xff);
}
}
}
- break;
}
+ break;
+ }
- case PNG_COLOR_TYPE_RGB_ALPHA:
+ case PNG_COLOR_TYPE_RGB_ALPHA:
+ {
+ if (row_info->bit_depth == 8)
{
- if (row_info->bit_depth == 8)
- {
#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_to_1 != NULL && gamma_from_1 != NULL &&
- gamma_table != NULL)
+ if (gamma_to_1 != NULL && gamma_from_1 != NULL &&
+ gamma_table != NULL)
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 4)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 4)
+ png_byte a = *(sp + 3);
+
+ if (a == 0xff)
{
- png_byte a = *(sp + 3);
+ *sp = gamma_table[*sp];
+ *(sp + 1) = gamma_table[*(sp + 1)];
+ *(sp + 2) = gamma_table[*(sp + 2)];
+ }
- if (a == 0xff)
- {
- *sp = gamma_table[*sp];
- *(sp + 1) = gamma_table[*(sp + 1)];
- *(sp + 2) = gamma_table[*(sp + 2)];
- }
+ else if (a == 0)
+ {
+ /* Background is already in screen gamma */
+ *sp = (png_byte)png_ptr->background.red;
+ *(sp + 1) = (png_byte)png_ptr->background.green;
+ *(sp + 2) = (png_byte)png_ptr->background.blue;
+ }
- else if (a == 0)
- {
- /* Background is already in screen gamma */
- *sp = (png_byte)png_ptr->background.red;
- *(sp + 1) = (png_byte)png_ptr->background.green;
- *(sp + 2) = (png_byte)png_ptr->background.blue;
- }
+ else
+ {
+ png_byte v, w;
- else
- {
- png_byte v, w;
-
- v = gamma_to_1[*sp];
- png_composite(w, v, a, png_ptr->background_1.red);
- if (optimize == 0) w = gamma_from_1[w];
- *sp = w;
-
- v = gamma_to_1[*(sp + 1)];
- png_composite(w, v, a, png_ptr->background_1.green);
- if (optimize == 0) w = gamma_from_1[w];
- *(sp + 1) = w;
-
- v = gamma_to_1[*(sp + 2)];
- png_composite(w, v, a, png_ptr->background_1.blue);
- if (optimize == 0) w = gamma_from_1[w];
- *(sp + 2) = w;
- }
+ v = gamma_to_1[*sp];
+ png_composite(w, v, a, png_ptr->background_1.red);
+ if (optimize == 0) w = gamma_from_1[w];
+ *sp = w;
+
+ v = gamma_to_1[*(sp + 1)];
+ png_composite(w, v, a, png_ptr->background_1.green);
+ if (optimize == 0) w = gamma_from_1[w];
+ *(sp + 1) = w;
+
+ v = gamma_to_1[*(sp + 2)];
+ png_composite(w, v, a, png_ptr->background_1.blue);
+ if (optimize == 0) w = gamma_from_1[w];
+ *(sp + 2) = w;
}
}
- else
+ }
+ else
#endif
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 4)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 4)
- {
- png_byte a = *(sp + 3);
+ png_byte a = *(sp + 3);
- if (a == 0)
- {
- *sp = (png_byte)png_ptr->background.red;
- *(sp + 1) = (png_byte)png_ptr->background.green;
- *(sp + 2) = (png_byte)png_ptr->background.blue;
- }
+ if (a == 0)
+ {
+ *sp = (png_byte)png_ptr->background.red;
+ *(sp + 1) = (png_byte)png_ptr->background.green;
+ *(sp + 2) = (png_byte)png_ptr->background.blue;
+ }
- else if (a < 0xff)
- {
- png_composite(*sp, *sp, a, png_ptr->background.red);
+ else if (a < 0xff)
+ {
+ png_composite(*sp, *sp, a, png_ptr->background.red);
- png_composite(*(sp + 1), *(sp + 1), a,
- png_ptr->background.green);
+ png_composite(*(sp + 1), *(sp + 1), a,
+ png_ptr->background.green);
- png_composite(*(sp + 2), *(sp + 2), a,
- png_ptr->background.blue);
- }
+ png_composite(*(sp + 2), *(sp + 2), a,
+ png_ptr->background.blue);
}
}
}
- else /* if (row_info->bit_depth == 16) */
- {
+ }
+ else /* if (row_info->bit_depth == 16) */
+ {
#ifdef PNG_READ_GAMMA_SUPPORTED
- if (gamma_16 != NULL && gamma_16_from_1 != NULL &&
- gamma_16_to_1 != NULL)
+ if (gamma_16 != NULL && gamma_16_from_1 != NULL &&
+ gamma_16_to_1 != NULL)
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 8)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 8)
+ png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6))
+ << 8) + (png_uint_16)(*(sp + 7)));
+
+ if (a == (png_uint_16)0xffff)
{
- png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6))
- << 8) + (png_uint_16)(*(sp + 7)));
+ png_uint_16 v;
- if (a == (png_uint_16)0xffff)
- {
- png_uint_16 v;
+ v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
+ *sp = (png_byte)((v >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(v & 0xff);
- v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
- *sp = (png_byte)((v >> 8) & 0xff);
- *(sp + 1) = (png_byte)(v & 0xff);
-
- v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)];
- *(sp + 2) = (png_byte)((v >> 8) & 0xff);
- *(sp + 3) = (png_byte)(v & 0xff);
+ v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)];
+ *(sp + 2) = (png_byte)((v >> 8) & 0xff);
+ *(sp + 3) = (png_byte)(v & 0xff);
- v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)];
- *(sp + 4) = (png_byte)((v >> 8) & 0xff);
- *(sp + 5) = (png_byte)(v & 0xff);
- }
+ v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)];
+ *(sp + 4) = (png_byte)((v >> 8) & 0xff);
+ *(sp + 5) = (png_byte)(v & 0xff);
+ }
- else if (a == 0)
- {
- /* Background is already in screen gamma */
- *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
- *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
- & 0xff);
- *(sp + 3) = (png_byte)(png_ptr->background.green
- & 0xff);
- *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
- & 0xff);
- *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
- }
+ else if (a == 0)
+ {
+ /* Background is already in screen gamma */
+ *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
+ *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
+ & 0xff);
+ *(sp + 3) = (png_byte)(png_ptr->background.green
+ & 0xff);
+ *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
+ & 0xff);
+ *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
+ }
- else
- {
- png_uint_16 v, w;
-
- v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
- png_composite_16(w, v, a, png_ptr->background_1.red);
- if (optimize == 0)
- w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >>
- 8];
- *sp = (png_byte)((w >> 8) & 0xff);
- *(sp + 1) = (png_byte)(w & 0xff);
-
- v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)];
- png_composite_16(w, v, a, png_ptr->background_1.green);
- if (optimize == 0)
- w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >>
- 8];
-
- *(sp + 2) = (png_byte)((w >> 8) & 0xff);
- *(sp + 3) = (png_byte)(w & 0xff);
-
- v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)];
- png_composite_16(w, v, a, png_ptr->background_1.blue);
- if (optimize == 0)
- w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >>
- 8];
-
- *(sp + 4) = (png_byte)((w >> 8) & 0xff);
- *(sp + 5) = (png_byte)(w & 0xff);
- }
+ else
+ {
+ png_uint_16 v, w;
+
+ v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
+ png_composite_16(w, v, a, png_ptr->background_1.red);
+ if (optimize == 0)
+ w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >>
+ 8];
+ *sp = (png_byte)((w >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(w & 0xff);
+
+ v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)];
+ png_composite_16(w, v, a, png_ptr->background_1.green);
+ if (optimize == 0)
+ w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >>
+ 8];
+
+ *(sp + 2) = (png_byte)((w >> 8) & 0xff);
+ *(sp + 3) = (png_byte)(w & 0xff);
+
+ v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)];
+ png_composite_16(w, v, a, png_ptr->background_1.blue);
+ if (optimize == 0)
+ w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >>
+ 8];
+
+ *(sp + 4) = (png_byte)((w >> 8) & 0xff);
+ *(sp + 5) = (png_byte)(w & 0xff);
}
}
+ }
- else
+ else
#endif
+ {
+ sp = row;
+ for (i = 0; i < row_width; i++, sp += 8)
{
- sp = row;
- for (i = 0; i < row_width; i++, sp += 8)
- {
- png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6))
- << 8) + (png_uint_16)(*(sp + 7)));
+ png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6))
+ << 8) + (png_uint_16)(*(sp + 7)));
- if (a == 0)
- {
- *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
- *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
- *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
- & 0xff);
- *(sp + 3) = (png_byte)(png_ptr->background.green
- & 0xff);
- *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
- & 0xff);
- *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
- }
+ if (a == 0)
+ {
+ *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
+ *(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
+ & 0xff);
+ *(sp + 3) = (png_byte)(png_ptr->background.green
+ & 0xff);
+ *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
+ & 0xff);
+ *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
+ }
- else if (a < 0xffff)
- {
- png_uint_16 v;
+ else if (a < 0xffff)
+ {
+ png_uint_16 v;
- png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
- png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
- + *(sp + 3));
- png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
- + *(sp + 5));
+ png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
+ png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
+ + *(sp + 3));
+ png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
+ + *(sp + 5));
- png_composite_16(v, r, a, png_ptr->background.red);
- *sp = (png_byte)((v >> 8) & 0xff);
- *(sp + 1) = (png_byte)(v & 0xff);
+ png_composite_16(v, r, a, png_ptr->background.red);
+ *sp = (png_byte)((v >> 8) & 0xff);
+ *(sp + 1) = (png_byte)(v & 0xff);
- png_composite_16(v, g, a, png_ptr->background.green);
- *(sp + 2) = (png_byte)((v >> 8) & 0xff);
- *(sp + 3) = (png_byte)(v & 0xff);
+ png_composite_16(v, g, a, png_ptr->background.green);
+ *(sp + 2) = (png_byte)((v >> 8) & 0xff);
+ *(sp + 3) = (png_byte)(v & 0xff);
- png_composite_16(v, b, a, png_ptr->background.blue);
- *(sp + 4) = (png_byte)((v >> 8) & 0xff);
- *(sp + 5) = (png_byte)(v & 0xff);
- }
+ png_composite_16(v, b, a, png_ptr->background.blue);
+ *(sp + 4) = (png_byte)((v >> 8) & 0xff);
+ *(sp + 5) = (png_byte)(v & 0xff);
}
}
}
- break;
}
-
- default:
- break;
+ break;
}
+
+ default:
+ break;
}
}
#endif /* READ_BACKGROUND || READ_ALPHA_MODE */
@@ -4146,12 +4152,11 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
{
if (row_info->bit_depth == 8)
{
- PNG_CONST png_bytep table = png_ptr->gamma_from_1;
+ png_bytep table = png_ptr->gamma_from_1;
if (table != NULL)
{
- PNG_CONST int step =
- (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2;
+ int step = (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2;
/* The alpha channel is the last component: */
row += step - 1;
@@ -4165,13 +4170,12 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
else if (row_info->bit_depth == 16)
{
- PNG_CONST png_uint_16pp table = png_ptr->gamma_16_from_1;
- PNG_CONST int gamma_shift = png_ptr->gamma_shift;
+ png_uint_16pp table = png_ptr->gamma_16_from_1;
+ int gamma_shift = png_ptr->gamma_shift;
if (table != NULL)
{
- PNG_CONST int step =
- (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4;
+ int step = (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4;
/* The alpha channel is the last component: */
row += step - 2;
@@ -4202,8 +4206,9 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
* upon whether you supply trans and num_trans.
*/
static void
-png_do_expand_palette(png_row_infop row_info, png_bytep row,
- png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
+png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
+ png_bytep row, png_const_colorp palette, png_const_bytep trans_alpha,
+ int num_trans)
{
int shift, value;
png_bytep sp, dp;
@@ -4220,8 +4225,8 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
{
case 1:
{
- sp = row + (png_size_t)((row_width - 1) >> 3);
- dp = row + (png_size_t)row_width - 1;
+ sp = row + (size_t)((row_width - 1) >> 3);
+ dp = row + (size_t)row_width - 1;
shift = 7 - (int)((row_width + 7) & 0x07);
for (i = 0; i < row_width; i++)
{
@@ -4247,8 +4252,8 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
case 2:
{
- sp = row + (png_size_t)((row_width - 1) >> 2);
- dp = row + (png_size_t)row_width - 1;
+ sp = row + (size_t)((row_width - 1) >> 2);
+ dp = row + (size_t)row_width - 1;
shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
for (i = 0; i < row_width; i++)
{
@@ -4270,8 +4275,8 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
case 4:
{
- sp = row + (png_size_t)((row_width - 1) >> 1);
- dp = row + (png_size_t)row_width - 1;
+ sp = row + (size_t)((row_width - 1) >> 1);
+ dp = row + (size_t)row_width - 1;
shift = (int)((row_width & 0x01) << 2);
for (i = 0; i < row_width; i++)
{
@@ -4304,17 +4309,30 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
{
if (num_trans > 0)
{
- sp = row + (png_size_t)row_width - 1;
- dp = row + ((png_size_t)row_width << 2) - 1;
+ sp = row + (size_t)row_width - 1;
+ dp = row + ((size_t)row_width << 2) - 1;
- for (i = 0; i < row_width; i++)
+ i = 0;
+#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
+ if (png_ptr->riffled_palette != NULL)
+ {
+ /* The RGBA optimization works with png_ptr->bit_depth == 8
+ * but sometimes row_info->bit_depth has been changed to 8.
+ * In these cases, the palette hasn't been riffled.
+ */
+ i = png_do_expand_palette_rgba8_neon(png_ptr, row_info, row,
+ &sp, &dp);
+ }
+#else
+ PNG_UNUSED(png_ptr)
+#endif
+
+ for (; i < row_width; i++)
{
if ((int)(*sp) >= num_trans)
*dp-- = 0xff;
-
else
*dp-- = trans_alpha[*sp];
-
*dp-- = palette[*sp].blue;
*dp-- = palette[*sp].green;
*dp-- = palette[*sp].red;
@@ -4329,10 +4347,17 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
else
{
- sp = row + (png_size_t)row_width - 1;
- dp = row + (png_size_t)(row_width * 3) - 1;
+ sp = row + (size_t)row_width - 1;
+ dp = row + (size_t)(row_width * 3) - 1;
+ i = 0;
+#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
+ i = png_do_expand_palette_rgb8_neon(png_ptr, row_info, row,
+ &sp, &dp);
+#else
+ PNG_UNUSED(png_ptr)
+#endif
- for (i = 0; i < row_width; i++)
+ for (; i < row_width; i++)
{
*dp-- = palette[*sp].blue;
*dp-- = palette[*sp].green;
@@ -4365,195 +4390,130 @@ png_do_expand(png_row_infop row_info, png_bytep row,
png_debug(1, "in png_do_expand");
+ if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
{
- if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
- {
- unsigned int gray = trans_color != NULL ? trans_color->gray : 0;
+ unsigned int gray = trans_color != NULL ? trans_color->gray : 0;
- if (row_info->bit_depth < 8)
+ if (row_info->bit_depth < 8)
+ {
+ switch (row_info->bit_depth)
{
- switch (row_info->bit_depth)
+ case 1:
{
- case 1:
+ gray = (gray & 0x01) * 0xff;
+ sp = row + (size_t)((row_width - 1) >> 3);
+ dp = row + (size_t)row_width - 1;
+ shift = 7 - (int)((row_width + 7) & 0x07);
+ for (i = 0; i < row_width; i++)
{
- gray = (gray & 0x01) * 0xff;
- sp = row + (png_size_t)((row_width - 1) >> 3);
- dp = row + (png_size_t)row_width - 1;
- shift = 7 - (int)((row_width + 7) & 0x07);
- for (i = 0; i < row_width; i++)
- {
- if ((*sp >> shift) & 0x01)
- *dp = 0xff;
-
- else
- *dp = 0;
-
- if (shift == 7)
- {
- shift = 0;
- sp--;
- }
-
- else
- shift++;
+ if ((*sp >> shift) & 0x01)
+ *dp = 0xff;
- dp--;
- }
- break;
- }
+ else
+ *dp = 0;
- case 2:
- {
- gray = (gray & 0x03) * 0x55;
- sp = row + (png_size_t)((row_width - 1) >> 2);
- dp = row + (png_size_t)row_width - 1;
- shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
- for (i = 0; i < row_width; i++)
+ if (shift == 7)
{
- value = (*sp >> shift) & 0x03;
- *dp = (png_byte)(value | (value << 2) | (value << 4) |
- (value << 6));
- if (shift == 6)
- {
- shift = 0;
- sp--;
- }
-
- else
- shift += 2;
-
- dp--;
+ shift = 0;
+ sp--;
}
- break;
- }
- case 4:
- {
- gray = (gray & 0x0f) * 0x11;
- sp = row + (png_size_t)((row_width - 1) >> 1);
- dp = row + (png_size_t)row_width - 1;
- shift = (int)((1 - ((row_width + 1) & 0x01)) << 2);
- for (i = 0; i < row_width; i++)
- {
- value = (*sp >> shift) & 0x0f;
- *dp = (png_byte)(value | (value << 4));
- if (shift == 4)
- {
- shift = 0;
- sp--;
- }
-
- else
- shift = 4;
+ else
+ shift++;
- dp--;
- }
- break;
+ dp--;
}
-
- default:
- break;
+ break;
}
- row_info->bit_depth = 8;
- row_info->pixel_depth = 8;
- row_info->rowbytes = row_width;
- }
-
- if (trans_color != NULL)
- {
- if (row_info->bit_depth == 8)
+ case 2:
{
- gray = gray & 0xff;
- sp = row + (png_size_t)row_width - 1;
- dp = row + ((png_size_t)row_width << 1) - 1;
-
+ gray = (gray & 0x03) * 0x55;
+ sp = row + (size_t)((row_width - 1) >> 2);
+ dp = row + (size_t)row_width - 1;
+ shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
for (i = 0; i < row_width; i++)
{
- if ((*sp & 0xffU) == gray)
- *dp-- = 0;
+ value = (*sp >> shift) & 0x03;
+ *dp = (png_byte)(value | (value << 2) | (value << 4) |
+ (value << 6));
+ if (shift == 6)
+ {
+ shift = 0;
+ sp--;
+ }
else
- *dp-- = 0xff;
+ shift += 2;
- *dp-- = *sp--;
+ dp--;
}
+ break;
}
- else if (row_info->bit_depth == 16)
+ case 4:
{
- unsigned int gray_high = (gray >> 8) & 0xff;
- unsigned int gray_low = gray & 0xff;
- sp = row + row_info->rowbytes - 1;
- dp = row + (row_info->rowbytes << 1) - 1;
+ gray = (gray & 0x0f) * 0x11;
+ sp = row + (size_t)((row_width - 1) >> 1);
+ dp = row + (size_t)row_width - 1;
+ shift = (int)((1 - ((row_width + 1) & 0x01)) << 2);
for (i = 0; i < row_width; i++)
{
- if ((*(sp - 1) & 0xffU) == gray_high &&
- (*(sp) & 0xffU) == gray_low)
+ value = (*sp >> shift) & 0x0f;
+ *dp = (png_byte)(value | (value << 4));
+ if (shift == 4)
{
- *dp-- = 0;
- *dp-- = 0;
+ shift = 0;
+ sp--;
}
else
- {
- *dp-- = 0xff;
- *dp-- = 0xff;
- }
+ shift = 4;
- *dp-- = *sp--;
- *dp-- = *sp--;
+ dp--;
}
+ break;
}
- row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
- row_info->channels = 2;
- row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1);
- row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
- row_width);
+ default:
+ break;
}
+
+ row_info->bit_depth = 8;
+ row_info->pixel_depth = 8;
+ row_info->rowbytes = row_width;
}
- else if (row_info->color_type == PNG_COLOR_TYPE_RGB &&
- trans_color != NULL)
+
+ if (trans_color != NULL)
{
if (row_info->bit_depth == 8)
{
- png_byte red = (png_byte)(trans_color->red & 0xff);
- png_byte green = (png_byte)(trans_color->green & 0xff);
- png_byte blue = (png_byte)(trans_color->blue & 0xff);
- sp = row + (png_size_t)row_info->rowbytes - 1;
- dp = row + ((png_size_t)row_width << 2) - 1;
+ gray = gray & 0xff;
+ sp = row + (size_t)row_width - 1;
+ dp = row + ((size_t)row_width << 1) - 1;
+
for (i = 0; i < row_width; i++)
{
- if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
+ if ((*sp & 0xffU) == gray)
*dp-- = 0;
else
*dp-- = 0xff;
*dp-- = *sp--;
- *dp-- = *sp--;
- *dp-- = *sp--;
}
}
+
else if (row_info->bit_depth == 16)
{
- png_byte red_high = (png_byte)((trans_color->red >> 8) & 0xff);
- png_byte green_high = (png_byte)((trans_color->green >> 8) & 0xff);
- png_byte blue_high = (png_byte)((trans_color->blue >> 8) & 0xff);
- png_byte red_low = (png_byte)(trans_color->red & 0xff);
- png_byte green_low = (png_byte)(trans_color->green & 0xff);
- png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
+ unsigned int gray_high = (gray >> 8) & 0xff;
+ unsigned int gray_low = gray & 0xff;
sp = row + row_info->rowbytes - 1;
- dp = row + ((png_size_t)row_width << 3) - 1;
+ dp = row + (row_info->rowbytes << 1) - 1;
for (i = 0; i < row_width; i++)
{
- if (*(sp - 5) == red_high &&
- *(sp - 4) == red_low &&
- *(sp - 3) == green_high &&
- *(sp - 2) == green_low &&
- *(sp - 1) == blue_high &&
- *(sp ) == blue_low)
+ if ((*(sp - 1) & 0xffU) == gray_high &&
+ (*(sp) & 0xffU) == gray_low)
{
*dp-- = 0;
*dp-- = 0;
@@ -4567,18 +4527,81 @@ png_do_expand(png_row_infop row_info, png_bytep row,
*dp-- = *sp--;
*dp-- = *sp--;
- *dp-- = *sp--;
- *dp-- = *sp--;
- *dp-- = *sp--;
- *dp-- = *sp--;
}
}
- row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
- row_info->channels = 4;
- row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2);
- row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
+
+ row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
+ row_info->channels = 2;
+ row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1);
+ row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
+ row_width);
}
}
+ else if (row_info->color_type == PNG_COLOR_TYPE_RGB &&
+ trans_color != NULL)
+ {
+ if (row_info->bit_depth == 8)
+ {
+ png_byte red = (png_byte)(trans_color->red & 0xff);
+ png_byte green = (png_byte)(trans_color->green & 0xff);
+ png_byte blue = (png_byte)(trans_color->blue & 0xff);
+ sp = row + (size_t)row_info->rowbytes - 1;
+ dp = row + ((size_t)row_width << 2) - 1;
+ for (i = 0; i < row_width; i++)
+ {
+ if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
+ *dp-- = 0;
+
+ else
+ *dp-- = 0xff;
+
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ }
+ }
+ else if (row_info->bit_depth == 16)
+ {
+ png_byte red_high = (png_byte)((trans_color->red >> 8) & 0xff);
+ png_byte green_high = (png_byte)((trans_color->green >> 8) & 0xff);
+ png_byte blue_high = (png_byte)((trans_color->blue >> 8) & 0xff);
+ png_byte red_low = (png_byte)(trans_color->red & 0xff);
+ png_byte green_low = (png_byte)(trans_color->green & 0xff);
+ png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
+ sp = row + row_info->rowbytes - 1;
+ dp = row + ((size_t)row_width << 3) - 1;
+ for (i = 0; i < row_width; i++)
+ {
+ if (*(sp - 5) == red_high &&
+ *(sp - 4) == red_low &&
+ *(sp - 3) == green_high &&
+ *(sp - 2) == green_low &&
+ *(sp - 1) == blue_high &&
+ *(sp ) == blue_low)
+ {
+ *dp-- = 0;
+ *dp-- = 0;
+ }
+
+ else
+ {
+ *dp-- = 0xff;
+ *dp-- = 0xff;
+ }
+
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ *dp-- = *sp--;
+ }
+ }
+ row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+ row_info->channels = 4;
+ row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2);
+ row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
+ }
}
#endif
@@ -4748,7 +4771,19 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
{
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
{
- png_do_expand_palette(row_info, png_ptr->row_buf + 1,
+#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
+ if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
+ {
+ if (png_ptr->riffled_palette == NULL)
+ {
+ /* Initialize the accelerated palette expansion. */
+ png_ptr->riffled_palette =
+ (png_bytep)png_malloc(png_ptr, 256 * 4);
+ png_riffle_palette_neon(png_ptr);
+ }
+ }
+#endif
+ png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1,
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
}
@@ -4760,8 +4795,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
&(png_ptr->trans_color));
else
- png_do_expand(row_info, png_ptr->row_buf + 1,
- NULL);
+ png_do_expand(row_info, png_ptr->row_buf + 1, NULL);
}
}
#endif
@@ -4985,7 +5019,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
(png_ptr, /* png_ptr */
row_info, /* row_info: */
/* png_uint_32 width; width of row */
- /* png_size_t rowbytes; number of bytes in row */
+ /* size_t rowbytes; number of bytes in row */
/* png_byte color_type; color type of pixels */
/* png_byte bit_depth; bit depth of samples */
/* png_byte channels; number of channels (1-4) */
diff --git a/pngrutil.c b/pngrutil.c
index 8692933bd..068ab193a 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,10 +1,10 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.6.33 [September 28, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -102,7 +102,7 @@ png_get_int_32)(png_const_bytep buf)
png_uint_16 (PNGAPI
png_get_uint_16)(png_const_bytep buf)
{
- /* ANSI-C requires an int value to accomodate at least 16 bits so this
+ /* ANSI-C requires an int value to accommodate at least 16 bits so this
* works and allows the compiler not to worry about possible narrowing
* on 32-bit systems. (Pre-ANSI systems did not make integers smaller
* than 16 bits either.)
@@ -120,7 +120,7 @@ png_get_uint_16)(png_const_bytep buf)
void /* PRIVATE */
png_read_sig(png_structrp png_ptr, png_inforp info_ptr)
{
- png_size_t num_checked, num_to_check;
+ size_t num_checked, num_to_check;
/* Exit if the user application does not expect a signature. */
if (png_ptr->sig_bytes >= 8)
@@ -302,7 +302,6 @@ png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
if (buffer != NULL && new_size > png_ptr->read_buffer_size)
{
png_ptr->read_buffer = NULL;
- png_ptr->read_buffer = NULL;
png_ptr->read_buffer_size = 0;
png_free(png_ptr, buffer);
buffer = NULL;
@@ -1461,8 +1460,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
/* We have the ICC profile header; do the basic header checks.
*/
- const png_uint_32 profile_length =
- png_get_uint_32(profile_header);
+ png_uint_32 profile_length = png_get_uint_32(profile_header);
if (png_icc_check_length(png_ptr, &png_ptr->colorspace,
keyword, profile_length) != 0)
@@ -1479,8 +1477,8 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
* profile. The header check has already validated
* that none of this stuff will overflow.
*/
- const png_uint_32 tag_count = png_get_uint_32(
- profile_header+128);
+ png_uint_32 tag_count =
+ png_get_uint_32(profile_header + 128);
png_bytep profile = png_read_buffer(png_ptr,
profile_length, 2/*silent*/);
@@ -1648,7 +1646,7 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
int entry_size, i;
png_uint_32 skip = 0;
png_uint_32 dl;
- png_size_t max_dl;
+ size_t max_dl;
png_debug(1, "in png_handle_sPLT");
@@ -1997,6 +1995,15 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) /* GRAY */
{
+ if (png_ptr->bit_depth <= 8)
+ {
+ if (buf[0] != 0 || buf[1] >= (unsigned int)(1 << png_ptr->bit_depth))
+ {
+ png_chunk_benign_error(png_ptr, "invalid gray level");
+ return;
+ }
+ }
+
background.index = 0;
background.red =
background.green =
@@ -2006,6 +2013,15 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
else
{
+ if (png_ptr->bit_depth <= 8)
+ {
+ if (buf[0] != 0 || buf[2] != 0 || buf[4] != 0)
+ {
+ png_chunk_benign_error(png_ptr, "invalid color");
+ return;
+ }
+ }
+
background.index = 0;
background.red = png_get_uint_16(buf);
background.green = png_get_uint_16(buf + 2);
@@ -2059,21 +2075,22 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
png_byte buf[1];
png_crc_read(png_ptr, buf, 1);
info_ptr->eXIf_buf[i] = buf[0];
- if (i == 1 && buf[0] != 'M' && buf[0] != 'I'
- && info_ptr->eXIf_buf[0] != buf[0])
+ if (i == 1)
{
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "incorrect byte-order specifier");
- png_free(png_ptr, info_ptr->eXIf_buf);
- info_ptr->eXIf_buf = NULL;
- return;
+ if ((buf[0] != 'M' && buf[0] != 'I') ||
+ (info_ptr->eXIf_buf[0] != buf[0]))
+ {
+ png_crc_finish(png_ptr, length - 2);
+ png_chunk_benign_error(png_ptr, "incorrect byte-order specifier");
+ png_free(png_ptr, info_ptr->eXIf_buf);
+ info_ptr->eXIf_buf = NULL;
+ return;
+ }
}
}
- if (png_crc_finish(png_ptr, 0) != 0)
- return;
-
- png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
+ if (png_crc_finish(png_ptr, 0) == 0)
+ png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
png_free(png_ptr, info_ptr->eXIf_buf);
info_ptr->eXIf_buf = NULL;
@@ -2109,8 +2126,9 @@ png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
num = length / 2 ;
- if (num != (unsigned int) png_ptr->num_palette ||
- num > (unsigned int) PNG_MAX_PALETTE_LENGTH)
+ if (length != num * 2 ||
+ num != (unsigned int)png_ptr->num_palette ||
+ num > (unsigned int)PNG_MAX_PALETTE_LENGTH)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
@@ -2359,7 +2377,7 @@ void /* PRIVATE */
png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_bytep buffer;
- png_size_t i;
+ size_t i;
int state;
png_debug(1, "in png_handle_sCAL");
@@ -2429,7 +2447,7 @@ png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
else
{
- png_size_t heighti = i;
+ size_t heighti = i;
state = 0;
if (png_check_fp_number((png_const_charp)buffer, length,
@@ -2867,7 +2885,7 @@ png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length)
{
PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name);
/* The following is safe because of the PNG_SIZE_MAX init above */
- png_ptr->unknown_chunk.size = (png_size_t)length/*SAFE*/;
+ png_ptr->unknown_chunk.size = (size_t)length/*SAFE*/;
/* 'mode' is a flag array, only the bottom four bits matter here */
png_ptr->unknown_chunk.location = (png_byte)png_ptr->mode/*SAFE*/;
@@ -3114,7 +3132,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
*/
void /* PRIVATE */
-png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
+png_check_chunk_name(png_const_structrp png_ptr, png_uint_32 chunk_name)
{
int i;
png_uint_32 cn=chunk_name;
@@ -3133,7 +3151,7 @@ png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
}
void /* PRIVATE */
-png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
+png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length)
{
png_alloc_size_t limit = PNG_UINT_31_MAX;
@@ -3149,10 +3167,13 @@ png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
{
png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
size_t row_factor =
- (png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1)
- + 1 + (png_ptr->interlaced? 6: 0));
+ (size_t)png_ptr->width
+ * (size_t)png_ptr->channels
+ * (png_ptr->bit_depth > 8? 2: 1)
+ + 1
+ + (png_ptr->interlaced? 6: 0);
if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
- idat_limit=PNG_UINT_31_MAX;
+ idat_limit = PNG_UINT_31_MAX;
else
idat_limit = png_ptr->height * row_factor;
row_factor = row_factor > 32566? 32566 : row_factor;
@@ -3165,7 +3186,7 @@ png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
{
png_debug2(0," length = %lu, limit = %lu",
(unsigned long)length,(unsigned long)limit);
- png_chunk_error(png_ptr, "chunk data is too large");
+ png_benign_error(png_ptr, "chunk data is too large");
}
}
@@ -3342,7 +3363,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
/* Hence the pre-compiled masks indexed by PACKSWAP (or not), depth and
* then pass:
*/
- static PNG_CONST png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] =
+ static const png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] =
{
/* Little-endian byte masks for PACKSWAP */
{ S_MASKS(1,0), S_MASKS(2,0), S_MASKS(4,0) },
@@ -3353,7 +3374,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
/* display_mask has only three entries for the odd passes, so index by
* pass>>1.
*/
- static PNG_CONST png_uint_32 display_mask[2][3][3] =
+ static const png_uint_32 display_mask[2][3][3] =
{
/* Little-endian byte masks for PACKSWAP */
{ B_MASKS(1,0), B_MASKS(2,0), B_MASKS(4,0) },
@@ -3666,7 +3687,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
{
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Offset to next interlace block */
- static PNG_CONST unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
+ static const unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
png_debug(1, "in png_do_read_interlace");
if (row != NULL && row_info != NULL)
@@ -3679,8 +3700,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
{
case 1:
{
- png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3);
- png_bytep dp = row + (png_size_t)((final_width - 1) >> 3);
+ png_bytep sp = row + (size_t)((row_info->width - 1) >> 3);
+ png_bytep dp = row + (size_t)((final_width - 1) >> 3);
unsigned int sshift, dshift;
unsigned int s_start, s_end;
int s_inc;
@@ -3806,8 +3827,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case 4:
{
- png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1);
- png_bytep dp = row + (png_size_t)((final_width - 1) >> 1);
+ png_bytep sp = row + (size_t)((row_info->width - 1) >> 1);
+ png_bytep dp = row + (size_t)((final_width - 1) >> 1);
unsigned int sshift, dshift;
unsigned int s_start, s_end;
int s_inc;
@@ -3869,12 +3890,12 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
default:
{
- png_size_t pixel_bytes = (row_info->pixel_depth >> 3);
+ size_t pixel_bytes = (row_info->pixel_depth >> 3);
- png_bytep sp = row + (png_size_t)(row_info->width - 1)
+ png_bytep sp = row + (size_t)(row_info->width - 1)
* pixel_bytes;
- png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes;
+ png_bytep dp = row + (size_t)(final_width - 1) * pixel_bytes;
int jstop = (int)png_pass_inc[pass];
png_uint_32 i;
@@ -3911,8 +3932,8 @@ static void
png_read_filter_row_sub(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t i;
- png_size_t istop = row_info->rowbytes;
+ size_t i;
+ size_t istop = row_info->rowbytes;
unsigned int bpp = (row_info->pixel_depth + 7) >> 3;
png_bytep rp = row + bpp;
@@ -3929,8 +3950,8 @@ static void
png_read_filter_row_up(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t i;
- png_size_t istop = row_info->rowbytes;
+ size_t i;
+ size_t istop = row_info->rowbytes;
png_bytep rp = row;
png_const_bytep pp = prev_row;
@@ -3945,11 +3966,11 @@ static void
png_read_filter_row_avg(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- png_size_t i;
+ size_t i;
png_bytep rp = row;
png_const_bytep pp = prev_row;
unsigned int bpp = (row_info->pixel_depth + 7) >> 3;
- png_size_t istop = row_info->rowbytes - bpp;
+ size_t istop = row_info->rowbytes - bpp;
for (i = 0; i < bpp; i++)
{
@@ -4308,16 +4329,16 @@ png_read_finish_row(png_structrp png_ptr)
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
- static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
+ static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
/* Offset to next interlace block */
- static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
/* Start of interlace block in the y direction */
- static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
+ static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
/* Offset to next interlace block in the y direction */
- static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
+ static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
png_debug(1, "in png_read_finish_row");
png_ptr->row_number++;
@@ -4373,19 +4394,19 @@ png_read_start_row(png_structrp png_ptr)
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
- static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
+ static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
/* Offset to next interlace block */
- static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
/* Start of interlace block in the y direction */
- static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
+ static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
/* Offset to next interlace block in the y direction */
- static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
+ static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
unsigned int max_pixel_depth;
- png_size_t row_bytes;
+ size_t row_bytes;
png_debug(1, "in png_read_start_row");
@@ -4601,14 +4622,13 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
*/
{
png_bytep temp = png_ptr->big_row_buf + 32;
- int extra = (int)((temp - (png_bytep)0) & 0x0f);
+ size_t extra = (size_t)temp & 0x0f;
png_ptr->row_buf = temp - extra - 1/*filter byte*/;
temp = png_ptr->big_prev_row + 32;
- extra = (int)((temp - (png_bytep)0) & 0x0f);
+ extra = (size_t)temp & 0x0f;
png_ptr->prev_row = temp - extra - 1/*filter byte*/;
}
-
#else
/* Use 31 bytes of padding before and 17 bytes after row_buf. */
png_ptr->row_buf = png_ptr->big_row_buf + 31;
diff --git a/pngset.c b/pngset.c
index 6f3a1ee11..3fc31feb0 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,10 +1,10 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 1998-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -137,46 +137,40 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
#ifdef PNG_eXIf_SUPPORTED
void PNGAPI
png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
- const png_bytep eXIf_buf)
+ png_bytep exif)
{
png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1");
PNG_UNUSED(info_ptr)
- PNG_UNUSED(eXIf_buf)
+ PNG_UNUSED(exif)
}
void PNGAPI
png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
- const png_uint_32 num_exif, const png_bytep eXIf_buf)
+ png_uint_32 num_exif, png_bytep exif)
{
- int i;
+ png_bytep new_exif;
png_debug1(1, "in %s storage function", "eXIf");
- if (png_ptr == NULL || info_ptr == NULL)
+ if (png_ptr == NULL || info_ptr == NULL ||
+ (png_ptr->mode & PNG_WROTE_eXIf) != 0)
return;
- if (info_ptr->exif)
- {
- png_free(png_ptr, info_ptr->exif);
- info_ptr->exif = NULL;
- }
+ new_exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr, num_exif));
- info_ptr->num_exif = num_exif;
-
- info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
- info_ptr->num_exif));
-
- if (info_ptr->exif == NULL)
+ if (new_exif == NULL)
{
png_warning(png_ptr, "Insufficient memory for eXIf chunk data");
return;
}
- info_ptr->free_me |= PNG_FREE_EXIF;
+ memcpy(new_exif, exif, (size_t)num_exif);
- for (i = 0; i < (int) info_ptr->num_exif; i++)
- info_ptr->exif[i] = eXIf_buf[i];
+ png_free_data(png_ptr, info_ptr, PNG_FREE_EXIF, 0);
+ info_ptr->num_exif = num_exif;
+ info_ptr->exif = new_exif;
+ info_ptr->free_me |= PNG_FREE_EXIF;
info_ptr->valid |= PNG_INFO_eXIf;
}
#endif /* eXIf */
@@ -237,15 +231,13 @@ png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->hist == NULL)
{
png_warning(png_ptr, "Insufficient memory for hIST chunk data");
-
return;
}
- info_ptr->free_me |= PNG_FREE_HIST;
-
for (i = 0; i < info_ptr->num_palette; i++)
info_ptr->hist[i] = hist[i];
+ info_ptr->free_me |= PNG_FREE_HIST;
info_ptr->valid |= PNG_INFO_hIST;
}
#endif
@@ -313,7 +305,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type,
int nparams, png_const_charp units, png_charpp params)
{
- png_size_t length;
+ size_t length;
int i;
png_debug1(1, "in %s storage function", "pCAL");
@@ -367,6 +359,8 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
memcpy(info_ptr->pcal_purpose, purpose, length);
+ info_ptr->free_me |= PNG_FREE_PCAL;
+
png_debug(3, "storing X0, X1, type, and nparams in info");
info_ptr->pcal_X0 = X0;
info_ptr->pcal_X1 = X1;
@@ -383,19 +377,17 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->pcal_units == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL units");
-
return;
}
memcpy(info_ptr->pcal_units, units, length);
info_ptr->pcal_params = png_voidcast(png_charpp, png_malloc_warn(png_ptr,
- (png_size_t)(((unsigned int)nparams + 1) * (sizeof (png_charp)))));
+ (size_t)(((unsigned int)nparams + 1) * (sizeof (png_charp)))));
if (info_ptr->pcal_params == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL params");
-
return;
}
@@ -413,7 +405,6 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->pcal_params[i] == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL parameter");
-
return;
}
@@ -421,7 +412,6 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
}
info_ptr->valid |= PNG_INFO_pCAL;
- info_ptr->free_me |= PNG_FREE_PCAL;
}
#endif
@@ -430,7 +420,7 @@ void PNGAPI
png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr,
int unit, png_const_charp swidth, png_const_charp sheight)
{
- png_size_t lengthw = 0, lengthh = 0;
+ size_t lengthw = 0, lengthh = 0;
png_debug1(1, "in %s storage function", "sCAL");
@@ -478,18 +468,17 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->scal_s_height == NULL)
{
- png_free (png_ptr, info_ptr->scal_s_width);
+ png_free(png_ptr, info_ptr->scal_s_width);
info_ptr->scal_s_width = NULL;
png_warning(png_ptr, "Memory allocation failed while processing sCAL");
-
return;
}
memcpy(info_ptr->scal_s_height, sheight, lengthh);
- info_ptr->valid |= PNG_INFO_sCAL;
info_ptr->free_me |= PNG_FREE_SCAL;
+ info_ptr->valid |= PNG_INFO_sCAL;
}
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -625,11 +614,10 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
if (num_palette > 0)
memcpy(png_ptr->palette, palette, (unsigned int)num_palette *
(sizeof (png_color)));
+
info_ptr->palette = png_ptr->palette;
info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
-
info_ptr->free_me |= PNG_FREE_PLTE;
-
info_ptr->valid |= PNG_INFO_PLTE;
}
@@ -691,7 +679,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_charp new_iccp_name;
png_bytep new_iccp_profile;
- png_size_t length;
+ size_t length;
png_debug1(1, "in %s storage function", "iCCP");
@@ -1018,7 +1006,10 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
/* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
info_ptr->trans_alpha = png_voidcast(png_bytep,
png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
- memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
+ memcpy(info_ptr->trans_alpha, trans_alpha, (size_t)num_trans);
+
+ info_ptr->free_me |= PNG_FREE_TRNS;
+ info_ptr->valid |= PNG_INFO_tRNS;
}
png_ptr->trans_alpha = info_ptr->trans_alpha;
}
@@ -1051,8 +1042,8 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
if (num_trans != 0)
{
- info_ptr->valid |= PNG_INFO_tRNS;
info_ptr->free_me |= PNG_FREE_TRNS;
+ info_ptr->valid |= PNG_INFO_tRNS;
}
}
#endif
@@ -1086,11 +1077,11 @@ png_set_sPLT(png_const_structrp png_ptr,
{
/* Out of memory or too many chunks */
png_chunk_report(png_ptr, "too many sPLT chunks", PNG_CHUNK_WRITE_ERROR);
-
return;
}
png_free(png_ptr, info_ptr->splt_palettes);
+
info_ptr->splt_palettes = np;
info_ptr->free_me |= PNG_FREE_SPLT;
@@ -1098,7 +1089,7 @@ png_set_sPLT(png_const_structrp png_ptr,
do
{
- png_size_t length;
+ size_t length;
/* Skip invalid input entries */
if (entries->name == NULL || entries->entries == NULL)
@@ -1244,11 +1235,11 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
{
png_chunk_report(png_ptr, "too many unknown chunks",
PNG_CHUNK_WRITE_ERROR);
-
return;
}
png_free(png_ptr, info_ptr->unknown_chunks);
+
info_ptr->unknown_chunks = np; /* safe because it is initialized */
info_ptr->free_me |= PNG_FREE_UNKN;
@@ -1326,7 +1317,7 @@ png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr,
#ifdef PNG_MNG_FEATURES_SUPPORTED
png_uint_32 PNGAPI
-png_permit_mng_features (png_structrp png_ptr, png_uint_32 mng_features)
+png_permit_mng_features(png_structrp png_ptr, png_uint_32 mng_features)
{
png_debug(1, "in png_permit_mng_features");
@@ -1399,7 +1390,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
/* Ignore all unknown chunks and all chunks recognized by
* libpng except for IHDR, PLTE, tRNS, IDAT, and IEND
*/
- static PNG_CONST png_byte chunks_to_ignore[] = {
+ static const png_byte chunks_to_ignore[] = {
98, 75, 71, 68, '\0', /* bKGD */
99, 72, 82, 77, '\0', /* cHRM */
101, 88, 73, 102, '\0', /* eXIf */
@@ -1563,7 +1554,7 @@ png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr,
#endif
void PNGAPI
-png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
+png_set_compression_buffer_size(png_structrp png_ptr, size_t size)
{
if (png_ptr == NULL)
return;
@@ -1633,7 +1624,7 @@ png_set_invalid(png_const_structrp png_ptr, png_inforp info_ptr, int mask)
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* This function was added to libpng 1.2.6 */
void PNGAPI
-png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max,
+png_set_user_limits(png_structrp png_ptr, png_uint_32 user_width_max,
png_uint_32 user_height_max)
{
/* Images with dimensions larger than these limits will be
@@ -1649,7 +1640,7 @@ png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max,
/* This function was added to libpng 1.4.0 */
void PNGAPI
-png_set_chunk_cache_max (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)
+png_set_chunk_cache_max(png_structrp png_ptr, png_uint_32 user_chunk_cache_max)
{
if (png_ptr != NULL)
png_ptr->user_chunk_cache_max = user_chunk_cache_max;
@@ -1657,7 +1648,7 @@ png_set_chunk_cache_max (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)
/* This function was added to libpng 1.4.1 */
void PNGAPI
-png_set_chunk_malloc_max (png_structrp png_ptr,
+png_set_chunk_malloc_max(png_structrp png_ptr,
png_alloc_size_t user_chunk_malloc_max)
{
if (png_ptr != NULL)
diff --git a/pngstruct.h b/pngstruct.h
index d83f97125..e591d94d5 100644
--- a/pngstruct.h
+++ b/pngstruct.h
@@ -1,10 +1,10 @@
/* pngstruct.h - header file for PNG reference library
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -47,7 +47,7 @@
/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
* can handle at once. This type need be no larger than 16 bits (so maximum of
* 65535), this define allows us to discover how big it is, but limited by the
- * maximuum for png_size_t. The value can be overriden in a library build
+ * maximum for size_t. The value can be overridden in a library build
* (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
* lower value (e.g. 255 works). A lower value may help memory usage (slightly)
* and may even improve performance on some systems (and degrade it on others.)
@@ -214,7 +214,7 @@ struct png_struct_def
png_uint_32 height; /* height of image in pixels */
png_uint_32 num_rows; /* number of rows in current pass */
png_uint_32 usr_width; /* width of row at start of write */
- png_size_t rowbytes; /* size of row in bytes */
+ size_t rowbytes; /* size of row in bytes */
png_uint_32 iwidth; /* width of current interlaced row in pixels */
png_uint_32 row_number; /* current row in interlace pass */
png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */
@@ -232,7 +232,7 @@ struct png_struct_def
png_bytep try_row; /* buffer to save trial row when filtering */
png_bytep tst_row; /* buffer to save best trial row when filtering */
#endif
- png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
+ size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
png_uint_32 idat_size; /* current IDAT size for read */
png_uint_32 crc; /* current chunk CRC value */
@@ -307,7 +307,7 @@ struct png_struct_def
#endif
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
- png_color_8 shift; /* shift for significant bit tranformation */
+ png_color_8 shift; /* shift for significant bit transformation */
#endif
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
@@ -328,24 +328,14 @@ struct png_struct_def
png_bytep current_buffer; /* buffer for recently used data */
png_uint_32 push_length; /* size of current input chunk */
png_uint_32 skip_length; /* bytes to skip in input data */
- png_size_t save_buffer_size; /* amount of data now in save_buffer */
- png_size_t save_buffer_max; /* total size of save_buffer */
- png_size_t buffer_size; /* total amount of available input data */
- png_size_t current_buffer_size; /* amount of data now in current_buffer */
+ size_t save_buffer_size; /* amount of data now in save_buffer */
+ size_t save_buffer_max; /* total size of save_buffer */
+ size_t buffer_size; /* total amount of available input data */
+ size_t current_buffer_size; /* amount of data now in current_buffer */
int process_mode; /* what push library is currently doing */
int cur_palette; /* current push library palette index */
-
#endif /* PROGRESSIVE_READ */
-#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
-/* For the Borland special 64K segment handler */
- png_bytepp offset_table_ptr;
- png_bytep offset_table;
- png_uint_16 offset_table_number;
- png_uint_16 offset_table_count;
- png_uint_16 offset_table_count_free;
-#endif
-
#ifdef PNG_READ_QUANTIZE_SUPPORTED
png_bytep palette_lookup; /* lookup table for quantizing */
png_bytep quantize_index; /* index translation for palette files */
@@ -392,6 +382,12 @@ struct png_struct_def
/* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
#endif
+/* New member added in libpng-1.6.36 */
+#if defined(PNG_READ_EXPAND_SUPPORTED) && \
+ defined(PNG_ARM_NEON_IMPLEMENTATION)
+ png_bytep riffled_palette; /* buffer for accelerated palette expansion */
+#endif
+
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
#if defined(PNG_MNG_FEATURES_SUPPORTED)
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
@@ -451,7 +447,7 @@ struct png_struct_def
#endif
/* New member added in libpng-1.2.26 */
- png_size_t old_big_row_buf_size;
+ size_t old_big_row_buf_size;
#ifdef PNG_READ_SUPPORTED
/* New member added in libpng-1.2.30 */
diff --git a/pngtest.c b/pngtest.c
index 9d5075791..37b42bb34 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,10 +1,10 @@
/* pngtest.c - a simple test program to test libpng
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -345,10 +345,10 @@ count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
#ifdef PNG_IO_STATE_SUPPORTED
void
-pngtest_check_io_state(png_structp png_ptr, png_size_t data_length,
+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, png_size_t data_length,
+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);
@@ -386,12 +386,12 @@ pngtest_check_io_state(png_structp png_ptr, png_size_t data_length,
#endif
static void PNGCBAPI
-pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
+pngtest_read_data(png_structp png_ptr, png_bytep data, size_t length)
{
- png_size_t check = 0;
+ size_t check = 0;
png_voidp io_ptr;
- /* fread() returns 0 on error, so it is OK to store this in a png_size_t
+ /* 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);
@@ -425,9 +425,9 @@ pngtest_flush(png_structp png_ptr)
* than changing the library.
*/
static void PNGCBAPI
-pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
+pngtest_write_data(png_structp png_ptr, png_bytep data, size_t length)
{
- png_size_t check;
+ size_t check;
check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
@@ -449,13 +449,13 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
*/
typedef struct
{
- PNG_CONST char *file_name;
+ const char *file_name;
} pngtest_error_parameters;
static void PNGCBAPI
pngtest_warning(png_structp png_ptr, png_const_charp message)
{
- PNG_CONST char *name = "UNKNOWN (ERROR!)";
+ const char *name = "UNKNOWN (ERROR!)";
pngtest_error_parameters *test =
(pngtest_error_parameters*)png_get_error_ptr(png_ptr);
@@ -705,7 +705,7 @@ read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk)
* The unknown chunk structure contains the chunk data:
* png_byte name[5];
* png_byte *data;
- * png_size_t size;
+ * size_t size;
*
* Note that libpng has already taken care of the CRC handling.
*/
@@ -850,7 +850,7 @@ pngtest_check_text_support(png_structp png_ptr, png_textp text_ptr,
/* Test one file */
static int
-test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
+test_one_file(const char *inname, const char *outname)
{
static png_FILE_p fpin;
static png_FILE_p fpout; /* "static" prevents setjmp corruption */
@@ -957,6 +957,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if (setjmp(png_jmpbuf(write_ptr)))
{
fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname);
+ png_free(read_ptr, row_buf);
+ row_buf = NULL;
if (verbose != 0)
fprintf(STDERR, " destroying read structs\n");
png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
@@ -1436,7 +1438,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
row_buf = (png_bytep)png_malloc(read_ptr,
png_get_rowbytes(read_ptr, read_info_ptr));
- pngtest_debug1("\t0x%08lx", (unsigned long)row_buf);
+ pngtest_debug1("\t%p", row_buf);
#endif /* SINGLE_ROWBUF_ALLOC */
pngtest_debug("Writing row data");
@@ -1490,7 +1492,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
row_buf = (png_bytep)png_malloc(read_ptr,
png_get_rowbytes(read_ptr, read_info_ptr));
- pngtest_debug2("\t0x%08lx (%lu bytes)", (unsigned long)row_buf,
+ pngtest_debug2("\t%p (%lu bytes)", row_buf,
(unsigned long)png_get_rowbytes(read_ptr, read_info_ptr));
#endif /* !SINGLE_ROWBUF_ALLOC */
@@ -1726,7 +1728,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
for (;;)
{
static int wrote_question = 0;
- png_size_t num_in, num_out;
+ size_t num_in, num_out;
char inbuf[256], outbuf[256];
num_in = fread(inbuf, 1, sizeof inbuf, fpin);
@@ -1809,11 +1811,11 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
/* Input and output filenames */
#ifdef RISCOS
-static PNG_CONST char *inname = "pngtest/png";
-static PNG_CONST char *outname = "pngout/png";
+static const char *inname = "pngtest/png";
+static const char *outname = "pngout/png";
#else
-static PNG_CONST char *inname = "pngtest.png";
-static PNG_CONST char *outname = "pngout.png";
+static const char *inname = "pngtest.png";
+static const char *outname = "pngout.png";
#endif
int
@@ -2153,4 +2155,4 @@ main(void)
#endif
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_34 Your_png_h_is_not_version_1_6_34;
+typedef png_libpng_version_1_6_40 Your_png_h_is_not_version_1_6_40;
diff --git a/pngtrans.c b/pngtrans.c
index 6882f0fd7..1100f46eb 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -1,10 +1,10 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Last changed in libpng 1.6.33 [September 28, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -269,8 +269,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
{
png_bytep rp = row;
- png_size_t i;
- png_size_t istop = row_info->rowbytes;
+ size_t i;
+ size_t istop = row_info->rowbytes;
for (i = 0; i < istop; i++)
{
@@ -283,8 +283,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
row_info->bit_depth == 8)
{
png_bytep rp = row;
- png_size_t i;
- png_size_t istop = row_info->rowbytes;
+ size_t i;
+ size_t istop = row_info->rowbytes;
for (i = 0; i < istop; i += 2)
{
@@ -298,8 +298,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
row_info->bit_depth == 16)
{
png_bytep rp = row;
- png_size_t i;
- png_size_t istop = row_info->rowbytes;
+ size_t i;
+ size_t istop = row_info->rowbytes;
for (i = 0; i < istop; i += 4)
{
@@ -345,7 +345,7 @@ png_do_swap(png_row_infop row_info, png_bytep row)
#endif
#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)
-static PNG_CONST png_byte onebppswaptable[256] = {
+static const png_byte onebppswaptable[256] = {
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
@@ -380,7 +380,7 @@ static PNG_CONST png_byte onebppswaptable[256] = {
0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
};
-static PNG_CONST png_byte twobppswaptable[256] = {
+static const png_byte twobppswaptable[256] = {
0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0,
0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0,
0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4,
@@ -415,7 +415,7 @@ static PNG_CONST png_byte twobppswaptable[256] = {
0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF
};
-static PNG_CONST png_byte fourbppswaptable[256] = {
+static const png_byte fourbppswaptable[256] = {
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71,
@@ -609,7 +609,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
return; /* The filler channel has gone already */
/* Fix the rowbytes value. */
- row_info->rowbytes = (png_size_t)(dp-row);
+ row_info->rowbytes = (size_t)(dp-row);
}
#endif
diff --git a/pngwio.c b/pngwio.c
index 37c7c3a7f..10e919dd0 100644
--- a/pngwio.c
+++ b/pngwio.c
@@ -1,10 +1,10 @@
/* pngwio.c - functions for data output
*
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -30,7 +30,7 @@
*/
void /* PRIVATE */
-png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
+png_write_data(png_structrp png_ptr, png_const_bytep data, size_t length)
{
/* NOTE: write_data_fn must not change the buffer! */
if (png_ptr->write_data_fn != NULL )
@@ -48,9 +48,9 @@ png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
* than changing the library.
*/
void PNGCBAPI
-png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
+png_default_write_data(png_structp png_ptr, png_bytep data, size_t length)
{
- png_size_t check;
+ size_t check;
if (png_ptr == NULL)
return;
diff --git a/pngwrite.c b/pngwrite.c
index a16d77ce0..32f4bfbe7 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,10 +1,10 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -75,10 +75,10 @@ write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr,
* library. If you have a new chunk to add, make a function to write it,
* and put it in the correct location here. If you want the chunk written
* after the image data, put it in png_write_end(). I strongly encourage
- * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing
- * the chunk, as that will keep the code from breaking if you want to just
- * write a plain PNG file. If you have long comments, I suggest writing
- * them in png_write_end(), and compressing them.
+ * you to supply a PNG_INFO_<chunk> flag, and check info_ptr->valid before
+ * writing the chunk, as that will keep the code from breaking if you want
+ * to just write a plain PNG file. If you have long comments, I suggest
+ * writing them in png_write_end(), and compressing them.
*/
void PNGAPI
png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr)
@@ -239,7 +239,10 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
#ifdef PNG_WRITE_eXIf_SUPPORTED
if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
+ {
png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+ png_ptr->mode |= PNG_WROTE_eXIf;
+ }
#endif
#ifdef PNG_WRITE_hIST_SUPPORTED
@@ -439,8 +442,9 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
#endif
#ifdef PNG_WRITE_eXIf_SUPPORTED
- if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
- png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+ if ((info_ptr->valid & PNG_INFO_eXIf) != 0 &&
+ (png_ptr->mode & PNG_WROTE_eXIf) == 0)
+ png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
#endif
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
@@ -469,7 +473,7 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_CONVERT_tIME_SUPPORTED
void PNGAPI
-png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm * ttime)
+png_convert_from_struct_tm(png_timep ptime, const struct tm * ttime)
{
png_debug(1, "in png_convert_from_struct_tm");
@@ -489,6 +493,16 @@ png_convert_from_time_t(png_timep ptime, time_t ttime)
png_debug(1, "in png_convert_from_time_t");
tbuf = gmtime(&ttime);
+ if (tbuf == NULL)
+ {
+ /* TODO: add a safe function which takes a png_ptr argument and raises
+ * a png_error if the ttime argument is invalid and the call to gmtime
+ * fails as a consequence.
+ */
+ memset(ptime, 0, sizeof(*ptime));
+ return;
+ }
+
png_convert_from_struct_tm(ptime, tbuf);
}
#endif
@@ -1536,7 +1550,7 @@ png_write_image_16bit(png_voidp argument)
display->first_row);
png_uint_16p output_row = png_voidcast(png_uint_16p, display->local_row);
png_uint_16p row_end;
- const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
+ unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
3 : 1;
int aindex = 0;
png_uint_32 y = image->height;
@@ -1573,7 +1587,7 @@ png_write_image_16bit(png_voidp argument)
while (out_ptr < row_end)
{
- const png_uint_16 alpha = in_ptr[aindex];
+ png_uint_16 alpha = in_ptr[aindex];
png_uint_32 reciprocal = 0;
int c;
@@ -1636,7 +1650,7 @@ png_write_image_16bit(png_voidp argument)
* calculation can be done to 15 bits of accuracy; however, the output needs to
* be scaled in the range 0..255*65535, so include that scaling here.
*/
-# define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha)
+# define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+((alpha)>>1))/(alpha))
static png_byte
png_unpremultiply(png_uint_32 component, png_uint_32 alpha,
@@ -1695,7 +1709,7 @@ png_write_image_8bit(png_voidp argument)
display->first_row);
png_bytep output_row = png_voidcast(png_bytep, display->local_row);
png_uint_32 y = image->height;
- const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
+ unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ?
3 : 1;
if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0)
@@ -1783,25 +1797,25 @@ png_write_image_8bit(png_voidp argument)
static void
png_image_set_PLTE(png_image_write_control *display)
{
- const png_imagep image = display->image;
+ png_imagep image = display->image;
const void *cmap = display->colormap;
- const int entries = image->colormap_entries > 256 ? 256 :
+ int entries = image->colormap_entries > 256 ? 256 :
(int)image->colormap_entries;
/* NOTE: the caller must check for cmap != NULL and entries != 0 */
- const png_uint_32 format = image->format;
- const unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format);
+ png_uint_32 format = image->format;
+ unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format);
# if defined(PNG_FORMAT_BGR_SUPPORTED) &&\
defined(PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED)
- const int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
+ int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
(format & PNG_FORMAT_FLAG_ALPHA) != 0;
# else
# define afirst 0
# endif
# ifdef PNG_FORMAT_BGR_SUPPORTED
- const int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
+ int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0;
# else
# define bgr 0
# endif
@@ -1951,12 +1965,12 @@ png_image_write_main(png_voidp argument)
* and total image size to ensure that they are within the system limits.
*/
{
- const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
+ unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
if (image->width <= 0x7fffffffU/channels) /* no overflow */
{
png_uint_32 check;
- const png_uint_32 png_row_stride = image->width * channels;
+ png_uint_32 png_row_stride = image->width * channels;
if (display->row_stride == 0)
display->row_stride = (png_int_32)/*SAFE*/png_row_stride;
@@ -2052,7 +2066,7 @@ png_image_write_main(png_voidp argument)
*/
if (write_16bit != 0)
{
- PNG_CONST png_uint_16 le = 0x0001;
+ png_uint_16 le = 0x0001;
if ((*(png_const_bytep) & le) != 0)
png_set_swap(png_ptr);
@@ -2162,12 +2176,11 @@ png_image_write_main(png_voidp argument)
static void (PNGCBAPI
-image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data,
- png_size_t size)
+image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data, size_t size)
{
png_image_write_control *display = png_voidcast(png_image_write_control*,
png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/);
- const png_alloc_size_t ob = display->output_bytes;
+ png_alloc_size_t ob = display->output_bytes;
/* Check for overflow; this should never happen: */
if (size <= ((png_alloc_size_t)-1) - ob)
diff --git a/pngwtran.c b/pngwtran.c
index 377b43e5c..49a13c1e9 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -1,10 +1,10 @@
/* pngwtran.c - transforms the data in a row for PNG writers
*
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -212,9 +212,9 @@ png_do_shift(png_row_infop row_info, png_bytep row,
if (row_info->bit_depth < 8)
{
png_bytep bp = row;
- png_size_t i;
+ size_t i;
unsigned int mask;
- png_size_t row_bytes = row_info->rowbytes;
+ size_t row_bytes = row_info->rowbytes;
if (bit_depth->gray == 1 && row_info->bit_depth == 2)
mask = 0x55;
@@ -254,8 +254,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
for (i = 0; i < istop; i++, bp++)
{
-
- const unsigned int c = i%channels;
+ unsigned int c = i%channels;
int j;
unsigned int v, out;
@@ -283,7 +282,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
for (bp = row, i = 0; i < istop; i++)
{
- const unsigned int c = i%channels;
+ unsigned int c = i%channels;
int j;
unsigned int value, v;
@@ -514,7 +513,7 @@ png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
(png_ptr, /* png_ptr */
row_info, /* row_info: */
/* png_uint_32 width; width of row */
- /* png_size_t rowbytes; number of bytes in row */
+ /* size_t rowbytes; number of bytes in row */
/* png_byte color_type; color type of pixels */
/* png_byte bit_depth; bit depth of samples */
/* png_byte channels; number of channels (1-4) */
diff --git a/pngwutil.c b/pngwutil.c
index 0d4fb1336..01f0607c7 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1,10 +1,10 @@
/* pngwutil.c - utilities to write a PNG file
*
- * Last changed in libpng 1.6.32 [August 24, 2017]
- * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
- * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
- * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
+ * Copyright (c) 1996-1997 Andreas Dilger
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -59,7 +59,7 @@ png_write_sig(png_structrp png_ptr)
/* Write the rest of the 8 byte signature */
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
- (png_size_t)(8 - png_ptr->sig_bytes));
+ (size_t)(8 - png_ptr->sig_bytes));
if (png_ptr->sig_bytes < 3)
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
@@ -124,8 +124,7 @@ png_write_chunk_start(png_structrp png_ptr, png_const_bytep chunk_string,
* given to png_write_chunk_header().
*/
void PNGAPI
-png_write_chunk_data(png_structrp png_ptr, png_const_bytep data,
- png_size_t length)
+png_write_chunk_data(png_structrp png_ptr, png_const_bytep data, size_t length)
{
/* Write the data, and run the CRC over it */
if (png_ptr == NULL)
@@ -160,7 +159,7 @@ png_write_chunk_end(png_structrp png_ptr)
/* Write the crc in a single operation */
png_save_uint_32(buf, png_ptr->crc);
- png_write_data(png_ptr, buf, (png_size_t)4);
+ png_write_data(png_ptr, buf, 4);
}
/* Write a PNG chunk all at once. The type is an array of ASCII characters
@@ -174,7 +173,7 @@ png_write_chunk_end(png_structrp png_ptr)
*/
static void
png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
- png_const_bytep data, png_size_t length)
+ png_const_bytep data, size_t length)
{
if (png_ptr == NULL)
return;
@@ -191,7 +190,7 @@ png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
/* This is the API that calls the internal function above. */
void PNGAPI
png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string,
- png_const_bytep data, png_size_t length)
+ png_const_bytep data, size_t length)
{
png_write_complete_chunk(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), data,
length);
@@ -820,7 +819,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
buf[12] = (png_byte)interlace_type;
/* Write the chunk */
- png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13);
+ png_write_complete_chunk(png_ptr, png_IHDR, buf, 13);
if ((png_ptr->do_filter) == PNG_NO_FILTERS)
{
@@ -889,7 +888,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
buf[0] = pal_ptr->red;
buf[1] = pal_ptr->green;
buf[2] = pal_ptr->blue;
- png_write_chunk_data(png_ptr, buf, (png_size_t)3);
+ png_write_chunk_data(png_ptr, buf, 3);
}
#else
@@ -903,7 +902,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
buf[0] = pal_ptr[i].red;
buf[1] = pal_ptr[i].green;
buf[2] = pal_ptr[i].blue;
- png_write_chunk_data(png_ptr, buf, (png_size_t)3);
+ png_write_chunk_data(png_ptr, buf, 3);
}
#endif
@@ -1075,7 +1074,7 @@ png_write_IEND(png_structrp png_ptr)
{
png_debug(1, "in png_write_IEND");
- png_write_complete_chunk(png_ptr, png_IEND, NULL, (png_size_t)0);
+ png_write_complete_chunk(png_ptr, png_IEND, NULL, 0);
png_ptr->mode |= PNG_HAVE_IEND;
}
@@ -1090,7 +1089,7 @@ png_write_gAMA_fixed(png_structrp png_ptr, png_fixed_point file_gamma)
/* file_gamma is saved in 1/100,000ths */
png_save_uint_32(buf, (png_uint_32)file_gamma);
- png_write_complete_chunk(png_ptr, png_gAMA, buf, (png_size_t)4);
+ png_write_complete_chunk(png_ptr, png_gAMA, buf, 4);
}
#endif
@@ -1108,7 +1107,7 @@ png_write_sRGB(png_structrp png_ptr, int srgb_intent)
"Invalid sRGB rendering intent specified");
buf[0]=(png_byte)srgb_intent;
- png_write_complete_chunk(png_ptr, png_sRGB, buf, (png_size_t)1);
+ png_write_complete_chunk(png_ptr, png_sRGB, buf, 1);
}
#endif
@@ -1182,8 +1181,8 @@ png_write_sPLT(png_structrp png_ptr, png_const_sPLT_tp spalette)
png_uint_32 name_len;
png_byte new_name[80];
png_byte entrybuf[10];
- png_size_t entry_size = (spalette->depth == 8 ? 6 : 10);
- png_size_t palette_size = entry_size * (png_size_t)spalette->nentries;
+ size_t entry_size = (spalette->depth == 8 ? 6 : 10);
+ size_t palette_size = entry_size * (size_t)spalette->nentries;
png_sPLT_entryp ep;
#ifndef PNG_POINTER_INDEXING_SUPPORTED
int i;
@@ -1200,10 +1199,9 @@ png_write_sPLT(png_structrp png_ptr, png_const_sPLT_tp spalette)
png_write_chunk_header(png_ptr, png_sPLT,
(png_uint_32)(name_len + 2 + palette_size));
- png_write_chunk_data(png_ptr, (png_bytep)new_name,
- (png_size_t)(name_len + 1));
+ png_write_chunk_data(png_ptr, (png_bytep)new_name, (size_t)(name_len + 1));
- png_write_chunk_data(png_ptr, &spalette->depth, (png_size_t)1);
+ png_write_chunk_data(png_ptr, &spalette->depth, 1);
/* Loop through each palette entry, writing appropriately */
#ifdef PNG_POINTER_INDEXING_SUPPORTED
@@ -1265,7 +1263,7 @@ void /* PRIVATE */
png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type)
{
png_byte buf[4];
- png_size_t size;
+ size_t size;
png_debug(1, "in png_write_sBIT");
@@ -1365,7 +1363,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
/* Write the chunk out as it is */
png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha,
- (png_size_t)num_trans);
+ (size_t)num_trans);
}
else if (color_type == PNG_COLOR_TYPE_GRAY)
@@ -1380,7 +1378,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
}
png_save_uint_16(buf, tran->gray);
- png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)2);
+ png_write_complete_chunk(png_ptr, png_tRNS, buf, 2);
}
else if (color_type == PNG_COLOR_TYPE_RGB)
@@ -1400,7 +1398,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
return;
}
- png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)6);
+ png_write_complete_chunk(png_ptr, png_tRNS, buf, 6);
}
else
@@ -1433,7 +1431,7 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
}
buf[0] = back->index;
- png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)1);
+ png_write_complete_chunk(png_ptr, png_bKGD, buf, 1);
}
else if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
@@ -1454,7 +1452,7 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
return;
}
- png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)6);
+ png_write_complete_chunk(png_ptr, png_bKGD, buf, 6);
}
else
@@ -1468,7 +1466,7 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
}
png_save_uint_16(buf, back->gray);
- png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)2);
+ png_write_complete_chunk(png_ptr, png_bKGD, buf, 2);
}
}
#endif
@@ -1488,7 +1486,7 @@ png_write_eXIf(png_structrp png_ptr, png_bytep exif, int num_exif)
for (i = 0; i < num_exif; i++)
{
buf[0] = exif[i];
- png_write_chunk_data(png_ptr, buf, (png_size_t)1);
+ png_write_chunk_data(png_ptr, buf, 1);
}
png_write_chunk_end(png_ptr);
@@ -1519,7 +1517,7 @@ png_write_hIST(png_structrp png_ptr, png_const_uint_16p hist, int num_hist)
for (i = 0; i < num_hist; i++)
{
png_save_uint_16(buf, hist[i]);
- png_write_chunk_data(png_ptr, buf, (png_size_t)2);
+ png_write_chunk_data(png_ptr, buf, 2);
}
png_write_chunk_end(png_ptr);
@@ -1530,7 +1528,7 @@ png_write_hIST(png_structrp png_ptr, png_const_uint_16p hist, int num_hist)
/* Write a tEXt chunk */
void /* PRIVATE */
png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
- png_size_t text_len)
+ size_t text_len)
{
png_uint_32 key_len;
png_byte new_key[80];
@@ -1627,7 +1625,7 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
png_const_charp lang, png_const_charp lang_key, png_const_charp text)
{
png_uint_32 key_len, prefix_len;
- png_size_t lang_len, lang_key_len;
+ size_t lang_len, lang_key_len;
png_byte new_key[82];
compression_state comp;
@@ -1737,7 +1735,7 @@ png_write_oFFs(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
png_save_int_32(buf + 4, y_offset);
buf[8] = (png_byte)unit_type;
- png_write_complete_chunk(png_ptr, png_oFFs, buf, (png_size_t)9);
+ png_write_complete_chunk(png_ptr, png_oFFs, buf, 9);
}
#endif
#ifdef PNG_WRITE_pCAL_SUPPORTED
@@ -1748,8 +1746,8 @@ png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
png_charpp params)
{
png_uint_32 purpose_len;
- png_size_t units_len, total_len;
- png_size_tp params_len;
+ size_t units_len, total_len;
+ size_t *params_len;
png_byte buf[10];
png_byte new_purpose[80];
int i;
@@ -1771,8 +1769,8 @@ png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
png_debug1(3, "pCAL units length = %d", (int)units_len);
total_len = purpose_len + units_len + 10;
- params_len = (png_size_tp)png_malloc(png_ptr,
- (png_alloc_size_t)((png_alloc_size_t)nparams * (sizeof (png_size_t))));
+ params_len = (size_t *)png_malloc(png_ptr,
+ (png_alloc_size_t)((png_alloc_size_t)nparams * (sizeof (size_t))));
/* Find the length of each parameter, making sure we don't count the
* null terminator for the last parameter.
@@ -1792,8 +1790,8 @@ png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
png_save_int_32(buf + 4, X1);
buf[8] = (png_byte)type;
buf[9] = (png_byte)nparams;
- png_write_chunk_data(png_ptr, buf, (png_size_t)10);
- png_write_chunk_data(png_ptr, (png_const_bytep)units, (png_size_t)units_len);
+ png_write_chunk_data(png_ptr, buf, 10);
+ png_write_chunk_data(png_ptr, (png_const_bytep)units, (size_t)units_len);
for (i = 0; i < nparams; i++)
{
@@ -1812,7 +1810,7 @@ png_write_sCAL_s(png_structrp png_ptr, int unit, png_const_charp width,
png_const_charp height)
{
png_byte buf[64];
- png_size_t wlen, hlen, total_len;
+ size_t wlen, hlen, total_len;
png_debug(1, "in png_write_sCAL_s");
@@ -1853,7 +1851,7 @@ png_write_pHYs(png_structrp png_ptr, png_uint_32 x_pixels_per_unit,
png_save_uint_32(buf + 4, y_pixels_per_unit);
buf[8] = (png_byte)unit_type;
- png_write_complete_chunk(png_ptr, png_pHYs, buf, (png_size_t)9);
+ png_write_complete_chunk(png_ptr, png_pHYs, buf, 9);
}
#endif
@@ -1883,7 +1881,7 @@ png_write_tIME(png_structrp png_ptr, png_const_timep mod_time)
buf[5] = mod_time->minute;
buf[6] = mod_time->second;
- png_write_complete_chunk(png_ptr, png_tIME, buf, (png_size_t)7);
+ png_write_complete_chunk(png_ptr, png_tIME, buf, 7);
}
#endif
@@ -1895,16 +1893,16 @@ png_write_start_row(png_structrp png_ptr)
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
- static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
+ static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
/* Offset to next interlace block */
- static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
/* Start of interlace block in the y direction */
- static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
+ static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
/* Offset to next interlace block in the y direction */
- static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
+ static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
#endif
png_alloc_size_t buf_size;
@@ -2010,16 +2008,16 @@ png_write_finish_row(png_structrp png_ptr)
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
- static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
+ static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
/* Offset to next interlace block */
- static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
/* Start of interlace block in the y direction */
- static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
+ static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
/* Offset to next interlace block in the y direction */
- static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
+ static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
#endif
png_debug(1, "in png_write_finish_row");
@@ -2073,8 +2071,8 @@ png_write_finish_row(png_structrp png_ptr)
{
if (png_ptr->prev_row != NULL)
memset(png_ptr->prev_row, 0,
- (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels*
- png_ptr->usr_bit_depth, png_ptr->width)) + 1);
+ PNG_ROWBYTES(png_ptr->usr_channels *
+ png_ptr->usr_bit_depth, png_ptr->width) + 1);
return;
}
@@ -2100,10 +2098,10 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
- static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
+ static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
/* Offset to next interlace block */
- static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
+ static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
png_debug(1, "in png_do_write_interlace");
@@ -2130,7 +2128,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
for (i = png_pass_start[pass]; i < row_width;
i += png_pass_inc[pass])
{
- sp = row + (png_size_t)(i >> 3);
+ sp = row + (size_t)(i >> 3);
value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01;
d |= (value << shift);
@@ -2168,7 +2166,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
for (i = png_pass_start[pass]; i < row_width;
i += png_pass_inc[pass])
{
- sp = row + (png_size_t)(i >> 2);
+ sp = row + (size_t)(i >> 2);
value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03;
d |= (value << shift);
@@ -2204,7 +2202,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
for (i = png_pass_start[pass]; i < row_width;
i += png_pass_inc[pass])
{
- sp = row + (png_size_t)(i >> 1);
+ sp = row + (size_t)(i >> 1);
value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f;
d |= (value << shift);
@@ -2230,7 +2228,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
png_bytep dp;
png_uint_32 i;
png_uint_32 row_width = row_info->width;
- png_size_t pixel_bytes;
+ size_t pixel_bytes;
/* Start at the beginning */
dp = row;
@@ -2243,7 +2241,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
i += png_pass_inc[pass])
{
/* Find out where the original pixel is */
- sp = row + (png_size_t)i * pixel_bytes;
+ sp = row + (size_t)i * pixel_bytes;
/* Move the pixel */
if (dp != sp)
@@ -2274,16 +2272,16 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
*/
static void /* PRIVATE */
png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
- png_size_t row_bytes);
+ size_t row_bytes);
#ifdef PNG_WRITE_FILTER_SUPPORTED
-static png_size_t /* PRIVATE */
-png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp,
- const png_size_t row_bytes, const png_size_t lmins)
+static size_t /* PRIVATE */
+png_setup_sub_row(png_structrp png_ptr, png_uint_32 bpp,
+ size_t row_bytes, size_t lmins)
{
png_bytep rp, dp, lp;
- png_size_t i;
- png_size_t sum = 0;
+ size_t i;
+ size_t sum = 0;
unsigned int v;
png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB;
@@ -2317,11 +2315,11 @@ png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp,
}
static void /* PRIVATE */
-png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp,
- const png_size_t row_bytes)
+png_setup_sub_row_only(png_structrp png_ptr, png_uint_32 bpp,
+ size_t row_bytes)
{
png_bytep rp, dp, lp;
- png_size_t i;
+ size_t i;
png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB;
@@ -2338,13 +2336,12 @@ png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp,
}
}
-static png_size_t /* PRIVATE */
-png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes,
- const png_size_t lmins)
+static size_t /* PRIVATE */
+png_setup_up_row(png_structrp png_ptr, size_t row_bytes, size_t lmins)
{
png_bytep rp, dp, pp;
- png_size_t i;
- png_size_t sum = 0;
+ size_t i;
+ size_t sum = 0;
unsigned int v;
png_ptr->try_row[0] = PNG_FILTER_VALUE_UP;
@@ -2367,10 +2364,10 @@ png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes,
return (sum);
}
static void /* PRIVATE */
-png_setup_up_row_only(png_structrp png_ptr, const png_size_t row_bytes)
+png_setup_up_row_only(png_structrp png_ptr, size_t row_bytes)
{
png_bytep rp, dp, pp;
- png_size_t i;
+ size_t i;
png_ptr->try_row[0] = PNG_FILTER_VALUE_UP;
@@ -2382,13 +2379,13 @@ png_setup_up_row_only(png_structrp png_ptr, const png_size_t row_bytes)
}
}
-static png_size_t /* PRIVATE */
-png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp,
- const png_size_t row_bytes, const png_size_t lmins)
+static size_t /* PRIVATE */
+png_setup_avg_row(png_structrp png_ptr, png_uint_32 bpp,
+ size_t row_bytes, size_t lmins)
{
png_bytep rp, dp, pp, lp;
png_uint_32 i;
- png_size_t sum = 0;
+ size_t sum = 0;
unsigned int v;
png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG;
@@ -2423,8 +2420,8 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp,
return (sum);
}
static void /* PRIVATE */
-png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp,
- const png_size_t row_bytes)
+png_setup_avg_row_only(png_structrp png_ptr, png_uint_32 bpp,
+ size_t row_bytes)
{
png_bytep rp, dp, pp, lp;
png_uint_32 i;
@@ -2444,13 +2441,13 @@ png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp,
}
}
-static png_size_t /* PRIVATE */
-png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp,
- const png_size_t row_bytes, const png_size_t lmins)
+static size_t /* PRIVATE */
+png_setup_paeth_row(png_structrp png_ptr, png_uint_32 bpp,
+ size_t row_bytes, size_t lmins)
{
png_bytep rp, dp, pp, cp, lp;
- png_size_t i;
- png_size_t sum = 0;
+ size_t i;
+ size_t sum = 0;
unsigned int v;
png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH;
@@ -2506,11 +2503,11 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp,
return (sum);
}
static void /* PRIVATE */
-png_setup_paeth_row_only(png_structrp png_ptr, const png_uint_32 bpp,
- const png_size_t row_bytes)
+png_setup_paeth_row_only(png_structrp png_ptr, png_uint_32 bpp,
+ size_t row_bytes)
{
png_bytep rp, dp, pp, cp, lp;
- png_size_t i;
+ size_t i;
png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH;
@@ -2559,8 +2556,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
png_bytep row_buf;
png_bytep best_row;
png_uint_32 bpp;
- png_size_t mins;
- png_size_t row_bytes = row_info->rowbytes;
+ size_t mins;
+ size_t row_bytes = row_info->rowbytes;
png_debug(1, "in png_write_find_filter");
@@ -2615,8 +2612,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
* 'none' filter.
*/
png_bytep rp;
- png_size_t sum = 0;
- png_size_t i;
+ size_t sum = 0;
+ size_t i;
unsigned int v;
{
@@ -2644,8 +2641,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
else if ((filter_to_do & PNG_FILTER_SUB) != 0)
{
- png_size_t sum;
- png_size_t lmins = mins;
+ size_t sum;
+ size_t lmins = mins;
sum = png_setup_sub_row(png_ptr, bpp, row_bytes, lmins);
@@ -2670,8 +2667,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
else if ((filter_to_do & PNG_FILTER_UP) != 0)
{
- png_size_t sum;
- png_size_t lmins = mins;
+ size_t sum;
+ size_t lmins = mins;
sum = png_setup_up_row(png_ptr, row_bytes, lmins);
@@ -2696,8 +2693,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
else if ((filter_to_do & PNG_FILTER_AVG) != 0)
{
- png_size_t sum;
- png_size_t lmins = mins;
+ size_t sum;
+ size_t lmins = mins;
sum= png_setup_avg_row(png_ptr, bpp, row_bytes, lmins);
@@ -2722,8 +2719,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
else if ((filter_to_do & PNG_FILTER_PAETH) != 0)
{
- png_size_t sum;
- png_size_t lmins = mins;
+ size_t sum;
+ size_t lmins = mins;
sum = png_setup_paeth_row(png_ptr, bpp, row_bytes, lmins);
@@ -2748,7 +2745,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
/* Do the actual writing of a previously filtered row. */
static void
png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
- png_size_t full_row_length/*includes filter byte*/)
+ size_t full_row_length/*includes filter byte*/)
{
png_debug(1, "in png_write_filtered_row");
diff --git a/powerpc/filter_vsx_intrinsics.c b/powerpc/filter_vsx_intrinsics.c
index e3de496bd..01cf8800d 100644
--- a/powerpc/filter_vsx_intrinsics.c
+++ b/powerpc/filter_vsx_intrinsics.c
@@ -1,13 +1,14 @@
/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2017 Glenn Randers-Pehrson
* Written by Vadim Barkov, 2017.
- * Last changed in libpng 1.6.29 [March 16, 2017]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
+
#include <stdio.h>
#include <stdint.h>
#include "../pngpriv.h"
@@ -42,8 +43,8 @@
png_byte i;\
png_bytep rp = row + offset;\
png_const_bytep pp = prev_row;\
- png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
- png_size_t istop;\
+ size_t unaligned_top = 16 - (((size_t)rp % 16));\
+ size_t istop;\
if(unaligned_top == 16)\
unaligned_top = 0;\
istop = row_info->rowbytes;\
@@ -173,7 +174,7 @@ static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,1
void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- const png_byte bpp = 4;
+ png_byte bpp = 4;
vector unsigned char rp_vec;
vector unsigned char part_vec;
@@ -230,7 +231,7 @@ void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- const png_byte bpp = 3;
+ png_byte bpp = 3;
vector unsigned char rp_vec;
vector unsigned char part_vec;
@@ -294,7 +295,7 @@ void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- const png_byte bpp = 4;
+ png_byte bpp = 4;
vector unsigned char rp_vec;
vector unsigned char pp_vec;
@@ -381,7 +382,7 @@ void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- const png_byte bpp = 3;
+ png_byte bpp = 3;
vector unsigned char rp_vec;
vector unsigned char pp_vec;
@@ -499,7 +500,7 @@ void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- const png_byte bpp = 4;
+ png_byte bpp = 4;
int a, b, c, pa, pb, pc, p;
vector unsigned char rp_vec;
@@ -619,7 +620,7 @@ void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
- const png_byte bpp = 3;
+ png_byte bpp = 3;
int a, b, c, pa, pb, pc, p;
vector unsigned char rp_vec;
diff --git a/powerpc/powerpc_init.c b/powerpc/powerpc_init.c
index 07016177c..54426c558 100644
--- a/powerpc/powerpc_init.c
+++ b/powerpc/powerpc_init.c
@@ -1,14 +1,15 @@
/* powerpc_init.c - POWERPC optimised filter functions
*
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2017 Glenn Randers-Pehrson
* Written by Vadim Barkov, 2017.
- * Last changed in libpng 1.6.29 [March 16, 2017]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
+
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
diff --git a/projects/owatcom/pngconfig.mak b/projects/owatcom/pngconfig.mak
index 3ef2948ca..11f1aa72b 100644
--- a/projects/owatcom/pngconfig.mak
+++ b/projects/owatcom/pngconfig.mak
@@ -117,7 +117,7 @@ $# 3) Delete this file (config.inf).
<<
@$(COPY) << pngconfig.dfa
$# pngconfig.dfa: this file contains configuration options for libpng.
-$# If emtpy the standard configuration will be built. For this file to be
+$# If empty the standard configuration will be built. For this file to be
$# used a working version of the program 'awk' is required and the program
$# must be identified in the 'before' rule of the project.
$#
@@ -144,7 +144,7 @@ $# dependency on pnglibconf.h correctly.
$#
$# If awk isn't set then this file is bypassed. If you just want the standard
$# configuration it is automatically produced from the distributed version
-$# (scripts\pnglibconf.h.prebuilt) by editting PNG_API_RULE to 2 (to force use
+$# (scripts\pnglibconf.h.prebuilt) by editing PNG_API_RULE to 2 (to force use
$# of the OpenWatcom library calling convention.)
$#
<<
diff --git a/projects/visualc71/README.txt b/projects/visualc71/README.txt
index 34565e4d0..4e1c8fa1c 100644
--- a/projects/visualc71/README.txt
+++ b/projects/visualc71/README.txt
@@ -12,7 +12,7 @@ Assumptions:
* The libpng source files are in ..\..
* The zlib source files are in ..\..\..\zlib
* The zlib project file is in . /* Warning: This is until the zlib project
- files get intergrated into the next zlib release. The final zlib project
+ files get integrated into the next zlib release. The final zlib project
directory will then be ..\..\..\zlib\projects\visualc71. */
To use:
diff --git a/projects/vstudio/README.txt b/projects/vstudio/README.txt
index 71d3ba239..53f6b592e 100644
--- a/projects/vstudio/README.txt
+++ b/projects/vstudio/README.txt
@@ -1,76 +1,77 @@
+Instructions for building libpng using Microsoft Visual Studio
+==============================================================
-VisualStudio instructions
-
-libpng version 1.6.34 - September 29, 2017
-
+Copyright (c) 2018,2022 Cosmin Truta
Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson
This code is released under the libpng license.
-For conditions of distribution and use, see the disclaimer
-and license in png.h
+For conditions of distribution and use, see the disclaimer and license
+in png.h
-This directory contains support for building libpng under MicroSoft
-VisualStudio 2010. It may also work under later versions of VisualStudio.
-You should be familiar with VisualStudio before using this directory.
+This directory contains a solution for building libpng under Microsoft
+Visual Studio 2019. It may also work under earlier or later versions
+of Visual Studio. You should be familiar with Visual Studio before
+using this solution.
Initial preparations
-====================
-You must enter some information in zlib.props before attempting to build
-with this 'solution'. Please read and edit zlib.props first. You will
-probably not be familiar with the contents of zlib.props - do not worry,
-it is mostly harmless.
+--------------------
+You must enter some information in zlib.props before attempting to
+build with this 'solution'. Please read and edit zlib.props first.
+You will probably not be familiar with the contents of zlib.props -
+do not worry, it is mostly harmless.
This is all you need to do to build the 'release' and 'release library'
configurations.
Debugging
-=========
+---------
The release configurations default to /Ox optimization. Full debugging
-information is produced (in the .pdb), but if you encounter a problem the
-optimization may make it difficult to debug. Simply rebuild with a lower
-optimization level (e.g. /Od.)
+information is produced (in the .pdb), but if you encounter a problem
+the optimization may make it difficult to debug. Simply rebuild with a
+lower optimization level (e.g. /Od.)
Linking your application
-========================
-Normally you should link against the 'release' configuration. This builds a
-DLL for libpng with the default runtime options used by Visual Studio 2010.
-In particular the runtime library is the "MultiThreaded DLL" version.
-If you use Visual Studio defaults to build your application you will have no
-problems.
-
-If you don't use the Visual Studio defaults your application must still be
-built with the default runtime option (/MD). If, for some reason, it is not
-then your application will crash inside libpng16.dll as soon as libpng
-tries to read from a file handle you pass in.
-
-If you do not want to use the DLL, for example for a very small application,
-the 'release library' configuration may be more appropriate. This is built
-with a non-standard runtime library - the "MultiThreaded" version. When you
-build your application it must be compiled with this option (/MT), otherwise
-it will not build (if you are lucky) or crash (if you are not.) See the
-WARNING file that is distributed along with this readme.txt.
+------------------------
+Normally you should link against the 'release' configuration. This
+builds a DLL for libpng with the default runtime options used by Visual
+Studio. In particular the runtime library is the "MultiThreaded DLL"
+version. If you use Visual Studio defaults to build your application,
+you should have no problems.
+
+If you don't use the Visual Studio defaults your application must still
+be built with the default runtime option (/MD). If, for some reason,
+it is not then your application will crash inside libpng16.dll as soon
+as libpng tries to read from a file handle you pass in.
+
+If you do not want to use the DLL, and prefer static linking instead,
+you may choose the 'release library' configuration. This is built with
+a non-standard runtime library - the "MultiThreaded" version. When you
+build your application, it must be compiled with this option (/MT),
+otherwise it will not build (if you are lucky) or it will crash (if you
+are not.) See the WARNING file that is distributed with this README.
Stop reading here
-=================
+-----------------
You have enough information to build a working application.
Debug versions have limited support
-===================================
-This solution includes limited support for debug versions of libpng. You
-do not need these unless your own solution itself uses debug builds (it is
-far more effective to debug on the release builds, there is no point building
-a special debug build unless you have heap corruption problems that you can't
-track down.)
+-----------------------------------
+This solution includes limited support for debug versions of libpng.
+You do not need these unless your own solution itself uses debug builds
+(it is far more effective to debug on the release builds, there is no
+point building a special debug build unless you have heap corruption
+problems that you can't track down.)
-The debug build of libpng is minimally supported. Support for debug builds of
-zlib is also minimal. You really don't want to do this.
+The debug build of libpng is minimally supported. Support for debug
+builds of zlib is also minimal. Please keep this in mind, if you want
+to use it.
WARNING
-=======
-Libpng 1.6.x does not use the default run-time library when building static
-library builds of libpng; instead of the shared DLL runtime it uses a static
-runtime. If you need to change this make sure to change the setting on all the
-relevant projects:
+-------
+Libpng 1.6.x does not use the default run-time library when building
+static library builds of libpng; instead of the shared DLL runtime, it
+uses a static runtime. If you need to change this, make sure to change
+the setting on all the relevant projects:
libpng
zlib
@@ -82,16 +83,5 @@ The runtime library settings for each build are as follows:
DLL /MD /MDd
Library /MT /MTd
-NOTICE that libpng 1.5.x erroneously used /MD for Debug DLL builds; if you used
-the debug builds in your app and you changed your app to use /MD you will need
-to change it back to /MDd for libpng 1.6.0 and later.
-
-The Visual Studio 2010 defaults for a Win32 DLL or Static Library project are
-as follows:
-
- Release Debug
- DLL /MD /MDd
- Static Library /MD /MDd
-
-Also, be sure to build libpng, zlib, and your project all for the same
+Also, be sure to build libpng, zlib, and your project, all for the same
platform (e.g., 32-bit or 64-bit).
diff --git a/projects/vstudio/libpng/libpng.vcxproj b/projects/vstudio/libpng/libpng.vcxproj
index 9bfb718a4..e10f4ff8b 100644
--- a/projects/vstudio/libpng/libpng.vcxproj
+++ b/projects/vstudio/libpng/libpng.vcxproj
@@ -1,18 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Library|ARM64">
+ <Configuration>Debug Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug Library|Win32">
<Configuration>Debug Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release Library|ARM64">
+ <Configuration>Release Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release Library|Win32">
<Configuration>Release Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -29,19 +45,45 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -49,15 +91,27 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
@@ -65,22 +119,42 @@
</CustomBuildBeforeTargets>
<TargetName>$(ProjectName)16</TargetName>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildBeforeTargets />
+ <TargetName>$(ProjectName)16</TargetName>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildBeforeTargets />
<TargetName>$(ProjectName)16</TargetName>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildBeforeTargets />
+ <TargetName>$(ProjectName)16</TargetName>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildBeforeTargets>
</CustomBuildBeforeTargets>
<TargetName>$(ProjectName)16</TargetName>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildBeforeTargets />
+ <TargetName>$(ProjectName)16</TargetName>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildBeforeTargets />
<TargetName>$(ProjectName)16</TargetName>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildBeforeTargets />
+ <TargetName>$(ProjectName)16</TargetName>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -88,7 +162,7 @@
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointExceptions>false</FloatingPointExceptions>
@@ -111,15 +185,14 @@
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>$(WarningLevel)</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <Optimization>Disabled</Optimization>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointExceptions>false</FloatingPointExceptions>
@@ -131,6 +204,64 @@
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <Optimization>Disabled</Optimization>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>zlib.lib</AdditionalDependencies>
+ <Version>16</Version>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
+ <BrowseInformation>true</BrowseInformation>
+ <CompileAs>CompileAsC</CompileAs>
+ <StringPooling>true</StringPooling>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
+ <BrowseInformation>true</BrowseInformation>
+ <CompileAs>CompileAsC</CompileAs>
+ <StringPooling>true</StringPooling>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TreatWarningAsError>false</TreatWarningAsError>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
@@ -145,7 +276,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointExceptions>false</FloatingPointExceptions>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
@@ -168,15 +299,14 @@
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointExceptions>false</FloatingPointExceptions>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
@@ -188,6 +318,69 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
<Optimization>Full</Optimization>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>zlib.lib</AdditionalDependencies>
+ <Version>16</Version>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
+ <BrowseInformation>true</BrowseInformation>
+ <CompileAs>CompileAsC</CompileAs>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <Optimization>Full</Optimization>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <Lib>
+ <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
+ <BrowseInformation>true</BrowseInformation>
+ <CompileAs>CompileAsC</CompileAs>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <Optimization>Full</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
<Link>
@@ -201,11 +394,40 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="..\..\..\arm\arm_init.c">
+ <DeploymentContent>true</DeploymentContent>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">WIN32;_DEBUG;PNG_ARM_NEON_OPT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="..\..\..\arm\filter_neon_intrinsics.c">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">NotUsing</PrecompiledHeader>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">WIN32;_DEBUG;PNG_ARM_NEON_OPT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="..\..\..\arm\palette_neon_intrinsics.c">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">NotUsing</PrecompiledHeader>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">WIN32;_DEBUG;PNG_ARM_NEON_OPT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ </ClCompile>
<ClCompile Include="..\..\..\png.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\pngerror.c" />
<ClCompile Include="..\..\..\pngget.c" />
@@ -225,7 +447,9 @@
<ItemGroup>
<ResourceCompile Include="..\..\..\scripts\pngwin.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">true</ExcludedFromBuild>
</ResourceCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/projects/vstudio/pnglibconf/pnglibconf.vcxproj b/projects/vstudio/pnglibconf/pnglibconf.vcxproj
index efcc440ba..e0a3887a4 100644
--- a/projects/vstudio/pnglibconf/pnglibconf.vcxproj
+++ b/projects/vstudio/pnglibconf/pnglibconf.vcxproj
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -16,6 +20,14 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(SolutionDir)\zlib.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -24,10 +36,16 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
@@ -53,6 +71,31 @@
<Inputs>..\..\..\scripts\pnglibconf.h.prebuilt</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>$(WarningLevel)</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <CustomBuildStep>
+ <Command>copy ..\..\..\scripts\pnglibconf.h.prebuilt ..\..\..\pnglibconf.h</Command>
+ </CustomBuildStep>
+ <CustomBuildStep>
+ <Message>Generating pnglibconf.h</Message>
+ </CustomBuildStep>
+ <CustomBuildStep>
+ <Outputs>..\..\..\pnglibconf.h</Outputs>
+ </CustomBuildStep>
+ <CustomBuildStep>
+ <Inputs>..\..\..\scripts\pnglibconf.h.prebuilt</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
<ItemGroup>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/projects/vstudio/pngstest/pngstest.vcxproj b/projects/vstudio/pngstest/pngstest.vcxproj
index 21810e32a..3937cb41d 100644
--- a/projects/vstudio/pngstest/pngstest.vcxproj
+++ b/projects/vstudio/pngstest/pngstest.vcxproj
@@ -1,18 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Library|ARM64">
+ <Configuration>Debug Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug Library|Win32">
<Configuration>Debug Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release Library|ARM64">
+ <Configuration>Release Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release Library|Win32">
<Configuration>Release Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -28,18 +44,42 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -47,36 +87,64 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -85,7 +153,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing libpng simplified API test program</Message>
+ <Command>"$(OutDir)pngstest.exe" --strict --log --touch "$(IntDir)pngstest.out" ../../../contrib/pngsuite/basn0g01.png ../../../contrib/pngsuite/basn0g02.png ../../../contrib/pngsuite/basn0g04.png ../../../contrib/pngsuite/basn0g08.png ../../../contrib/pngsuite/basn0g16.png ../../../contrib/pngsuite/basn2c08.png ../../../contrib/pngsuite/basn2c16.png ../../../contrib/pngsuite/basn3p01.png ../../../contrib/pngsuite/basn3p02.png ../../../contrib/pngsuite/basn3p04.png ../../../contrib/pngsuite/basn3p08.png ../../../contrib/pngsuite/basn4a08.png ../../../contrib/pngsuite/basn4a16.png ../../../contrib/pngsuite/basn6a08.png ../../../contrib/pngsuite/basn6a16.png ../../../contrib/pngsuite/ftbbn0g01.png ../../../contrib/pngsuite/ftbbn0g02.png ../../../contrib/pngsuite/ftbbn0g04.png ../../../contrib/pngsuite/ftbbn2c16.png ../../../contrib/pngsuite/ftbbn3p08.png ../../../contrib/pngsuite/ftbgn2c16.png ../../../contrib/pngsuite/ftbgn3p08.png ../../../contrib/pngsuite/ftbrn2c08.png ../../../contrib/pngsuite/ftbwn0g16.png ../../../contrib/pngsuite/ftbwn3p08.png ../../../contrib/pngsuite/ftbyn3p08.png ../../../contrib/pngsuite/ftp0n0g08.png ../../../contrib/pngsuite/ftp0n2c08.png ../../../contrib/pngsuite/ftp0n3p08.png ../../../contrib/pngsuite/ftp1n3p08.png</Command>
+ <Outputs>$(IntDir)pngstest.out</Outputs>
+ <Inputs>$(OutDir)pngstest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -109,7 +210,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -119,7 +220,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing libpng simplified API test program</Message>
+ <Command>"$(OutDir)pngstest.exe" --strict --log --touch "$(IntDir)pngstest.out" ../../../contrib/pngsuite/basn0g01.png ../../../contrib/pngsuite/basn0g02.png ../../../contrib/pngsuite/basn0g04.png ../../../contrib/pngsuite/basn0g08.png ../../../contrib/pngsuite/basn0g16.png ../../../contrib/pngsuite/basn2c08.png ../../../contrib/pngsuite/basn2c16.png ../../../contrib/pngsuite/basn3p01.png ../../../contrib/pngsuite/basn3p02.png ../../../contrib/pngsuite/basn3p04.png ../../../contrib/pngsuite/basn3p08.png ../../../contrib/pngsuite/basn4a08.png ../../../contrib/pngsuite/basn4a16.png ../../../contrib/pngsuite/basn6a08.png ../../../contrib/pngsuite/basn6a16.png ../../../contrib/pngsuite/ftbbn0g01.png ../../../contrib/pngsuite/ftbbn0g02.png ../../../contrib/pngsuite/ftbbn0g04.png ../../../contrib/pngsuite/ftbbn2c16.png ../../../contrib/pngsuite/ftbbn3p08.png ../../../contrib/pngsuite/ftbgn2c16.png ../../../contrib/pngsuite/ftbgn3p08.png ../../../contrib/pngsuite/ftbrn2c08.png ../../../contrib/pngsuite/ftbwn0g16.png ../../../contrib/pngsuite/ftbwn3p08.png ../../../contrib/pngsuite/ftbyn3p08.png ../../../contrib/pngsuite/ftp0n0g08.png ../../../contrib/pngsuite/ftp0n2c08.png ../../../contrib/pngsuite/ftp0n3p08.png ../../../contrib/pngsuite/ftp1n3p08.png</Command>
+ <Outputs>$(IntDir)pngstest.out</Outputs>
+ <Inputs>$(OutDir)pngstest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -174,12 +308,47 @@
<Inputs>$(OutDir)pngstest.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Full</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing libpng simplified API test program</Message>
+ <Command>"$(OutDir)pngstest.exe" --strict --log --touch "$(IntDir)pngstest.out" ../../../contrib/pngsuite/basn0g01.png ../../../contrib/pngsuite/basn0g02.png ../../../contrib/pngsuite/basn0g04.png ../../../contrib/pngsuite/basn0g08.png ../../../contrib/pngsuite/basn0g16.png ../../../contrib/pngsuite/basn2c08.png ../../../contrib/pngsuite/basn2c16.png ../../../contrib/pngsuite/basn3p01.png ../../../contrib/pngsuite/basn3p02.png ../../../contrib/pngsuite/basn3p04.png ../../../contrib/pngsuite/basn3p08.png ../../../contrib/pngsuite/basn4a08.png ../../../contrib/pngsuite/basn4a16.png ../../../contrib/pngsuite/basn6a08.png ../../../contrib/pngsuite/basn6a16.png ../../../contrib/pngsuite/ftbbn0g01.png ../../../contrib/pngsuite/ftbbn0g02.png ../../../contrib/pngsuite/ftbbn0g04.png ../../../contrib/pngsuite/ftbbn2c16.png ../../../contrib/pngsuite/ftbbn3p08.png ../../../contrib/pngsuite/ftbgn2c16.png ../../../contrib/pngsuite/ftbgn3p08.png ../../../contrib/pngsuite/ftbrn2c08.png ../../../contrib/pngsuite/ftbwn0g16.png ../../../contrib/pngsuite/ftbwn3p08.png ../../../contrib/pngsuite/ftbyn3p08.png ../../../contrib/pngsuite/ftp0n0g08.png ../../../contrib/pngsuite/ftp0n2c08.png ../../../contrib/pngsuite/ftp0n3p08.png ../../../contrib/pngsuite/ftp1n3p08.png</Command>
+ <Outputs>$(IntDir)pngstest.out</Outputs>
+ <Inputs>$(OutDir)pngstest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -187,7 +356,43 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing libpng simplified API test program</Message>
+ <Command>"$(OutDir)pngstest.exe" --strict --log --touch "$(IntDir)pngstest.out" ../../../contrib/pngsuite/basn0g01.png ../../../contrib/pngsuite/basn0g02.png ../../../contrib/pngsuite/basn0g04.png ../../../contrib/pngsuite/basn0g08.png ../../../contrib/pngsuite/basn0g16.png ../../../contrib/pngsuite/basn2c08.png ../../../contrib/pngsuite/basn2c16.png ../../../contrib/pngsuite/basn3p01.png ../../../contrib/pngsuite/basn3p02.png ../../../contrib/pngsuite/basn3p04.png ../../../contrib/pngsuite/basn3p08.png ../../../contrib/pngsuite/basn4a08.png ../../../contrib/pngsuite/basn4a16.png ../../../contrib/pngsuite/basn6a08.png ../../../contrib/pngsuite/basn6a16.png ../../../contrib/pngsuite/ftbbn0g01.png ../../../contrib/pngsuite/ftbbn0g02.png ../../../contrib/pngsuite/ftbbn0g04.png ../../../contrib/pngsuite/ftbbn2c16.png ../../../contrib/pngsuite/ftbbn3p08.png ../../../contrib/pngsuite/ftbgn2c16.png ../../../contrib/pngsuite/ftbgn3p08.png ../../../contrib/pngsuite/ftbrn2c08.png ../../../contrib/pngsuite/ftbwn0g16.png ../../../contrib/pngsuite/ftbwn3p08.png ../../../contrib/pngsuite/ftbyn3p08.png ../../../contrib/pngsuite/ftp0n0g08.png ../../../contrib/pngsuite/ftp0n2c08.png ../../../contrib/pngsuite/ftp0n3p08.png ../../../contrib/pngsuite/ftp1n3p08.png</Command>
+ <Outputs>$(IntDir)pngstest.out</Outputs>
+ <Inputs>$(OutDir)pngstest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BrowseInformation>true</BrowseInformation>
diff --git a/projects/vstudio/pngtest/pngtest.vcxproj b/projects/vstudio/pngtest/pngtest.vcxproj
index f1df07d5c..72beced2b 100644
--- a/projects/vstudio/pngtest/pngtest.vcxproj
+++ b/projects/vstudio/pngtest/pngtest.vcxproj
@@ -1,18 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Library|ARM64">
+ <Configuration>Debug Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug Library|Win32">
<Configuration>Debug Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release Library|ARM64">
+ <Configuration>Release Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release Library|Win32">
<Configuration>Release Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -28,18 +44,42 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -47,36 +87,64 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -85,7 +153,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG test program</Message>
+ <Command>"$(OutDir)pngtest.exe" ..\..\..\pngtest.png "$(IntDir)pngout.png"</Command>
+ <Outputs>$(IntDir)pngout.png</Outputs>
+ <Inputs>..\..\..\pngtest.png;$(OutDir)pngtest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -109,7 +210,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -119,7 +220,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG test program</Message>
+ <Command>"$(OutDir)pngtest.exe" ..\..\..\pngtest.png "$(IntDir)pngout.png"</Command>
+ <Outputs>$(IntDir)pngout.png</Outputs>
+ <Inputs>..\..\..\pngtest.png;$(OutDir)pngtest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -174,13 +308,12 @@
<Inputs>..\..\..\pngtest.png;$(OutDir)pngtest.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Full</Optimization>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -199,6 +332,79 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <AdditionalDependencies>libpng16.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG test program</Message>
+ <Command>"$(OutDir)pngtest.exe" ..\..\..\pngtest.png "$(IntDir)pngout.png"</Command>
+ <Outputs>$(IntDir)pngout.png</Outputs>
+ <Inputs>..\..\..\pngtest.png;$(OutDir)pngtest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG test program</Message>
+ <Command>$(OutDir)pngtest.exe ..\..\..\pngtest.png $(IntDir)pngout.png</Command>
+ <Command>"$(OutDir)pngtest.exe" ..\..\..\pngtest.png "$(IntDir)pngout.png"</Command>
+ <Outputs>$(IntDir)pngout.png</Outputs>
+ <Inputs>..\..\..\pngtest.png;$(OutDir)pngtest.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
diff --git a/projects/vstudio/pngunknown/pngunknown.vcxproj b/projects/vstudio/pngunknown/pngunknown.vcxproj
index 409d6621d..f4d130d0b 100644
--- a/projects/vstudio/pngunknown/pngunknown.vcxproj
+++ b/projects/vstudio/pngunknown/pngunknown.vcxproj
@@ -1,18 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Library|ARM64">
+ <Configuration>Debug Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug Library|Win32">
<Configuration>Debug Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release Library|ARM64">
+ <Configuration>Release Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release Library|Win32">
<Configuration>Release Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -28,18 +44,42 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -47,36 +87,64 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -85,7 +153,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+ <Outputs>$(IntDir)pngunknown.out</Outputs>
+ <Inputs>$(OutDir)pngunknown.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -109,7 +210,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -119,7 +220,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+ <Outputs>$(IntDir)pngunknown.out</Outputs>
+ <Inputs>$(OutDir)pngunknown.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -174,12 +308,47 @@
<Inputs>$(OutDir)pngunknown.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Full</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+ <Outputs>$(IntDir)pngunknown.out</Outputs>
+ <Inputs>$(OutDir)pngunknown.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -187,7 +356,43 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+ <Outputs>$(IntDir)pngunknown.out</Outputs>
+ <Inputs>$(OutDir)pngunknown.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BrowseInformation>true</BrowseInformation>
diff --git a/projects/vstudio/pngvalid/pngvalid.vcxproj b/projects/vstudio/pngvalid/pngvalid.vcxproj
index c117d2910..3726193bf 100644
--- a/projects/vstudio/pngvalid/pngvalid.vcxproj
+++ b/projects/vstudio/pngvalid/pngvalid.vcxproj
@@ -1,18 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Library|ARM64">
+ <Configuration>Debug Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug Library|Win32">
<Configuration>Debug Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release Library|ARM64">
+ <Configuration>Release Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release Library|Win32">
<Configuration>Release Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -28,18 +44,42 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -47,36 +87,64 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <CustomBuildAfterTargets />
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -85,7 +153,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
+ <Outputs>$(IntDir)pngvalid.out</Outputs>
+ <Inputs>$(OutDir)pngvalid.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -109,7 +210,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
@@ -119,7 +220,40 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <StringPooling>true</StringPooling>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
+ <Outputs>$(IntDir)pngvalid.out</Outputs>
+ <Inputs>$(OutDir)pngvalid.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
@@ -174,12 +308,47 @@
<Inputs>$(OutDir)pngvalid.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Full</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
+ <Outputs>$(IntDir)pngvalid.out</Outputs>
+ <Inputs>$(OutDir)pngvalid.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -187,7 +356,43 @@
<AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAsManaged>false</CompileAsManaged>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BrowseInformation>true</BrowseInformation>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <FloatingPointExceptions>false</FloatingPointExceptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libpng16.lib;zlib.lib</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ <CustomBuildStep>
+ <Message>Executing PNG validation program</Message>
+ <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
+ <Outputs>$(IntDir)pngvalid.out</Outputs>
+ <Inputs>$(OutDir)pngvalid.exe</Inputs>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <CompileAsManaged>false</CompileAsManaged>
+ <TreatWarningAsError>false</TreatWarningAsError>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BrowseInformation>true</BrowseInformation>
diff --git a/projects/vstudio/vstudio.sln b/projects/vstudio/vstudio.sln
index af0b1bab5..5fc1c292b 100644
--- a/projects/vstudio/vstudio.sln
+++ b/projects/vstudio/vstudio.sln
@@ -1,5 +1,7 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31515.178
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{60F89955-91C6-3A36-8000-13C592FEC2DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pnglibconf", "pnglibconf\pnglibconf.vcxproj", "{EB33566E-DA7F-4D28-9077-88C0B7C77E35}"
@@ -40,70 +42,133 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngunknown", "pngunknown\pn
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug Library|ARM64 = Debug Library|ARM64
Debug Library|Win32 = Debug Library|Win32
+ Debug|ARM64 = Debug|ARM64
Debug|Win32 = Debug|Win32
+ Release Library|ARM64 = Release Library|ARM64
Release Library|Win32 = Release Library|Win32
+ Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|ARM64.ActiveCfg = Debug Library|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|ARM64.Build.0 = Debug Library|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|Win32.Build.0 = Debug Library|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|ARM64.Build.0 = Debug|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.Build.0 = Debug|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|ARM64.ActiveCfg = Release Library|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|ARM64.Build.0 = Release Library|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|Win32.ActiveCfg = Release Library|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|Win32.Build.0 = Release Library|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|ARM64.ActiveCfg = Release|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|ARM64.Build.0 = Release|ARM64
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.ActiveCfg = Release|Win32
+ {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.Build.0 = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug Library|ARM64.ActiveCfg = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug Library|ARM64.Build.0 = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug Library|Win32.ActiveCfg = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug Library|Win32.Build.0 = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug|ARM64.ActiveCfg = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug|ARM64.Build.0 = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug|Win32.ActiveCfg = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug|Win32.Build.0 = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|ARM64.ActiveCfg = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|ARM64.Build.0 = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|Win32.ActiveCfg = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|Win32.Build.0 = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|ARM64.ActiveCfg = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|ARM64.Build.0 = Release|ARM64
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|Win32.ActiveCfg = Release|Win32
+ {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|Win32.Build.0 = Release|Win32
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Library|ARM64.ActiveCfg = Debug Library|ARM64
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Library|ARM64.Build.0 = Debug Library|ARM64
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Library|Win32.Build.0 = Debug Library|Win32
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|ARM64.Build.0 = Debug|ARM64
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|Win32.ActiveCfg = Debug|Win32
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|Win32.Build.0 = Debug|Win32
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Library|ARM64.ActiveCfg = Release Library|ARM64
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Library|ARM64.Build.0 = Release Library|ARM64
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Library|Win32.ActiveCfg = Release Library|Win32
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Library|Win32.Build.0 = Release Library|Win32
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|ARM64.ActiveCfg = Release|ARM64
+ {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|ARM64.Build.0 = Release|ARM64
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.ActiveCfg = Release|Win32
{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.Build.0 = Release|Win32
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug Library|ARM64.ActiveCfg = Debug Library|ARM64
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug Library|ARM64.Build.0 = Debug Library|ARM64
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug Library|Win32.Build.0 = Debug Library|Win32
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug|ARM64.Build.0 = Debug|ARM64
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug|Win32.ActiveCfg = Debug|Win32
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Debug|Win32.Build.0 = Debug|Win32
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|ARM64.ActiveCfg = Release Library|ARM64
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|ARM64.Build.0 = Release Library|ARM64
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|Win32.ActiveCfg = Release Library|Win32
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|Win32.Build.0 = Release Library|Win32
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|ARM64.ActiveCfg = Release|ARM64
+ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|ARM64.Build.0 = Release|ARM64
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|Win32.ActiveCfg = Release|Win32
{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|Win32.Build.0 = Release|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|Win32.Build.0 = Debug Library|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.ActiveCfg = Debug|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.Build.0 = Debug|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|Win32.ActiveCfg = Release Library|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|Win32.Build.0 = Release Library|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.ActiveCfg = Release|Win32
- {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.Build.0 = Release|Win32
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug Library|ARM64.ActiveCfg = Debug Library|ARM64
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug Library|ARM64.Build.0 = Debug Library|ARM64
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug Library|Win32.Build.0 = Debug Library|Win32
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug|ARM64.Build.0 = Debug|ARM64
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug|Win32.ActiveCfg = Debug|Win32
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug|Win32.Build.0 = Debug|Win32
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release Library|ARM64.ActiveCfg = Release Library|ARM64
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release Library|ARM64.Build.0 = Release Library|ARM64
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release Library|Win32.ActiveCfg = Release Library|Win32
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release Library|Win32.Build.0 = Release Library|Win32
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release|ARM64.ActiveCfg = Release|ARM64
+ {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release|ARM64.Build.0 = Release|ARM64
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release|Win32.ActiveCfg = Release|Win32
{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Release|Win32.Build.0 = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug Library|Win32.ActiveCfg = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug Library|Win32.Build.0 = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug|Win32.ActiveCfg = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Debug|Win32.Build.0 = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|Win32.ActiveCfg = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|Win32.Build.0 = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|Win32.ActiveCfg = Release|Win32
- {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|Win32.Build.0 = Release|Win32
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug Library|ARM64.ActiveCfg = Debug Library|ARM64
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug Library|ARM64.Build.0 = Debug Library|ARM64
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug Library|Win32.Build.0 = Debug Library|Win32
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug|ARM64.Build.0 = Debug|ARM64
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug|Win32.ActiveCfg = Debug|Win32
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug|Win32.Build.0 = Debug|Win32
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|ARM64.ActiveCfg = Release Library|ARM64
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|ARM64.Build.0 = Release Library|ARM64
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|Win32.ActiveCfg = Release Library|Win32
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|Win32.Build.0 = Release Library|Win32
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|ARM64.ActiveCfg = Release|ARM64
+ {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|ARM64.Build.0 = Release|ARM64
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|Win32.ActiveCfg = Release|Win32
{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|Win32.Build.0 = Release|Win32
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug Library|ARM64.ActiveCfg = Debug Library|ARM64
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug Library|ARM64.Build.0 = Debug Library|ARM64
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug Library|Win32.Build.0 = Debug Library|Win32
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug|ARM64.Build.0 = Debug|ARM64
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug|Win32.ActiveCfg = Debug|Win32
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug|Win32.Build.0 = Debug|Win32
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release Library|ARM64.ActiveCfg = Release Library|ARM64
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release Library|ARM64.Build.0 = Release Library|ARM64
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release Library|Win32.ActiveCfg = Release Library|Win32
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release Library|Win32.Build.0 = Release Library|Win32
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release|ARM64.Build.0 = Release|ARM64
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release|Win32.ActiveCfg = Release|Win32
{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {785775C5-509E-4727-A290-F1B65E1B68B2}
+ EndGlobalSection
EndGlobal
diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props
index 8e3682a26..878627966 100644
--- a/projects/vstudio/zlib.props
+++ b/projects/vstudio/zlib.props
@@ -2,16 +2,15 @@
<!--
* zlib.props - location of zlib source
*
- * libpng version 1.6.34 - September 29, 2017
- *
+ * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
- * You must edit this file to record the location of the zlib
- * source code.
+ * You may need to edit this file in order to update the location
+ * of the zlib source code.
-->
<Project ToolsVersion="4.0"
@@ -32,7 +31,7 @@
versions do not match. The zlib version used in this build is recorded
below:
-->
- <ZLibSrcDir>..\..\..\..\zlib-1.2.8</ZLibSrcDir>
+ <ZLibSrcDir>..\..\..\..\zlib</ZLibSrcDir>
<!-- The following line allows compilation for an ARM target with Visual
Studio 2012. Notice that this is not supported by the Visual Studio
diff --git a/projects/vstudio/zlib/zlib.vcxproj b/projects/vstudio/zlib/zlib.vcxproj
index 0df16db34..23e606517 100644
--- a/projects/vstudio/zlib/zlib.vcxproj
+++ b/projects/vstudio/zlib/zlib.vcxproj
@@ -1,18 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Library|ARM64">
+ <Configuration>Debug Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug Library|Win32">
<Configuration>Debug Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release Library|ARM64">
+ <Configuration>Release Library</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release Library|Win32">
<Configuration>Release Library</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -40,18 +56,41 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -59,42 +98,69 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
<ClCompile>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<BrowseInformation>true</BrowseInformation>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
@@ -102,16 +168,33 @@
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|ARM64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN32;_DEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BrowseInformation>true</BrowseInformation>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <PreprocessorDefinitions>WIN32;_DEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<BrowseInformation>true</BrowseInformation>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
@@ -120,9 +203,26 @@
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN32;_DEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <BrowseInformation>true</BrowseInformation>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
<ClCompile>
- <WarningLevel>$(WarningLevel)</WarningLevel>
+ <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Full</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -131,9 +231,9 @@
<BrowseInformation>true</BrowseInformation>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
- <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <TreatWarningAsError>false</TreatWarningAsError>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
@@ -144,6 +244,29 @@
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <BrowseInformation>true</BrowseInformation>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PreprocessorDefinitions>WIN32;NDEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ </Link>
+ <Lib>
+ <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
+ </Lib>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
@@ -156,7 +279,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
<TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
@@ -169,6 +292,30 @@
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>$(WarningLevel)</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <BrowseInformation>true</BrowseInformation>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <DisableSpecificWarnings>$(DisableSpecificWarnings);4127;4131;4242;4244</DisableSpecificWarnings>
+ <TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
+ <PreprocessorDefinitions>WIN32;NDEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <Lib>
+ <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
+ </Lib>
+ </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/scripts/README.txt b/scripts/README.txt
index 793506e41..326160cbb 100644
--- a/scripts/README.txt
+++ b/scripts/README.txt
@@ -1,24 +1,20 @@
-Makefiles for libpng version 1.6.34 - September 29, 2017
+Makefiles for libpng
-pnglibconf.h.prebuilt => Stores configuration settings
+pnglibconf.h.prebuilt => Configuration settings
makefile.linux => Linux/ELF makefile
- (gcc, creates libpng16.so.16.1.6.34)
+ (gcc, creates shared libpng16.so.16.1.6.*)
makefile.linux-opt=> Linux/ELF makefile with hardware optimizations on
- (gcc, creates libpng16.so.16.1.6.34)
+ (gcc, creates shared libpng16.so.16.1.6.*)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
- makefile.knr => Archaic UNIX Makefile that converts files with
- ansi2knr (Requires ansi2knr.c from
- ftp://ftp.cs.wisc.edu/ghost)
makefile.acorn => Acorn makefile
makefile.aix => AIX/gcc makefile
makefile.amiga => Amiga makefile
makefile.atari => Atari makefile
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
- makefile.beos => beos makefile
- makefile.bor => Borland makefile (uses bcc)
- makefile.cegcc => minge32ce for Windows CE makefile
- makefile.darwin => Darwin makefile, can use on MacosX
+ makefile.beos => BeOS makefile
+ makefile.clang => Generic clang makefile
+ makefile.darwin => Darwin makefile, for macOS (formerly Mac OS X)
makefile.dec => DEC Alpha UNIX makefile
makefile.dj2 => DJGPP 2 makefile
makefile.freebsd => FreeBSD makefile
@@ -29,23 +25,20 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
makefile.intel => Intel C/C++ version 4.0 and later
makefile.mips => MIPS makefile
- makefile.msc => Microsoft C makefile
- makefile.netbsd => NetBSD/cc makefile, makes libpng.so.
+ makefile.netbsd => NetBSD/cc makefile, makes shared libpng.so
makefile.openbsd => OpenBSD makefile
- makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
- makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
- makefile.sggcc => Silicon Graphics (gcc,
- creates libpng16.so.16.1.6.34)
+ makefile.sco => SCO OSr5 ELF and Unixware 7 with Native cc
+ makefile.sggcc => Silicon Graphics makefile
+ (gcc, creates shared libpng16.so.16.1.6.*)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
- makefile.solaris => Solaris 2.X makefile (gcc,
- creates libpng16.so.16.1.6.34)
- makefile.so9 => Solaris 9 makefile (gcc,
- creates libpng16.so.16.1.6.34)
+ makefile.solaris => Solaris 2.X makefile
+ (gcc, creates shared libpng16.so.16.1.6.*)
+ makefile.so9 => Solaris 9 makefile
+ (gcc, creates shared libpng16.so.16.1.6.*)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
- makefile.tc3 => Turbo C 3.0 makefile
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later
makevms.com => VMS build script
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
@@ -57,20 +50,20 @@ Other supporting scripts:
libpng-config-body.in => used by several makefiles to create libpng-config
libpng-config-head.in => used by several makefiles to create libpng-config
libpng.pc.in => Used by several makefiles to create libpng.pc
- pngwin.rc => Used by the visualc71 project.
+ pngwin.rc => Used by the visualc71 project
pngwin.def => Used by makefile.os2
pngwin.dfn => Used to maintain pngwin.def
SCOPTIONS.ppc => Used with smakefile.ppc
- checksym.awk => Used for maintaining pnglibconf.h
- def.dfn => Used for maintaining pnglibconf.h
- options.awk => Used for maintaining pnglibconf.h
- pnglibconf.dfa => Used for maintaining pnglibconf.h
- pnglibconf.mak => Used for maintaining pnglibconf.h
- sym.dfn => Used for symbol versioning
- symbols.def => Used for symbol versioning
- symbols.dfn => Used for symbol versioning
- vers.dfn => Used for symbol versioning
+ checksym.awk => Used for maintaining pnglibconf.h
+ def.dfn => Used for maintaining pnglibconf.h
+ options.awk => Used for maintaining pnglibconf.h
+ pnglibconf.dfa => Used for maintaining pnglibconf.h
+ pnglibconf.mak => Used for maintaining pnglibconf.h
+ sym.dfn => Used for symbol versioning
+ symbols.def => Used for symbol versioning
+ symbols.dfn => Used for symbol versioning
+ vers.dfn => Used for symbol versioning
libtool.m4 => Used by autoconf tools
ltoptions.m4 => Used by autoconf tools
@@ -82,5 +75,5 @@ Other supporting scripts:
macro.lst => Used by autoconf tools
prefix.dfn => Used by autoconf tools
-
-Further information can be found in comments in the individual makefiles.
+Further information can be found in comments in the individual scripts and
+makefiles.
diff --git a/scripts/checksym.awk b/scripts/checksym.awk
index fe3af55e0..48e55e60e 100755
--- a/scripts/checksym.awk
+++ b/scripts/checksym.awk
@@ -1,4 +1,5 @@
#!/bin/awk -f
+
# Check a list of symbols against the master definition
# (official) list. Arguments:
#
diff --git a/scripts/def.c b/scripts/def.c
deleted file mode 100644
index 23bdbad4e..000000000
--- a/scripts/def.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* def.c - define format of libpng.def
- *
- * Last changed in libpng version 1.6.16 [December 22, 2014]
- * Copyright (c) 2011-2014 Glenn Randers-Pehrson
- *
- * This code is released under the libpng license.
- * For conditions of distribution and use, see the disclaimer
- * and license in png.h
- */
-
-/* Write the export file header: */
-PNG_DFN ";--------------------------------------------------------------"
-PNG_DFN "; LIBPNG module definition file for OS/2"
-PNG_DFN ";--------------------------------------------------------------"
-PNG_DFN ""
-PNG_DFN "; If you give the library an explicit name one or other files"
-PNG_DFN "; may need modifying to support the new name on one or more"
-PNG_DFN "; systems."
-PNG_DFN "LIBRARY"
-PNG_DFN "OS2 DESCRIPTION "PNG image compression library""
-PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
-PNG_DFN ""
-PNG_DFN "EXPORTS"
-PNG_DFN ";Version 1.6.34"
-
-#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
- PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"
-
-#include "../png.h"
diff --git a/scripts/descrip.mms b/scripts/descrip.mms
index 463c4251e..c440fc350 100644
--- a/scripts/descrip.mms
+++ b/scripts/descrip.mms
@@ -6,47 +6,42 @@ c_deb =
pref = /prefix=all
.endif
+OBJS = png.obj, pngerror.obj, pngget.obj, pngmem.obj, pngpread.obj,\
+ pngread.obj, pngrio.obj, pngrtran.obj, pngrutil.obj, pngset.obj,\
+ pngtrans.obj, pngwio.obj, pngwrite.obj, pngwtran.obj, pngwutil.obj
-
-OBJS = png.obj, pngset.obj, pngget.obj, pngrutil.obj, pngtrans.obj,\
- pngwutil.obj, pngread.obj, pngmem.obj, pngwrite.obj, pngrtran.obj,\
- pngwtran.obj, pngrio.obj, pngwio.obj, pngerror.obj, pngpread.obj
-
-
-CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF)
+CFLAGS = $(C_DEB) $(CC_DEFS) $(PREF)
all : pngtest.exe libpng.olb
- @ write sys$output " pngtest available"
+ @ write sys$output " pngtest available"
libpng.olb : libpng.olb($(OBJS))
- @ write sys$output " Libpng available"
-
+ @ write sys$output " libpng available"
pngtest.exe : pngtest.obj libpng.olb
- link pngtest,libpng.olb/lib,$(ZLIBSRC)libz.olb/lib
+ link pngtest,libpng.olb/lib,$(ZLIBSRC)libz.olb/lib
test : pngtest.exe
- run pngtest
+ run pngtest
clean :
delete *.obj;*,*.exe;
-
# Other dependencies.
-png.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+png.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngerror.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngget.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngmem.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngpread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngset.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngget.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngrio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngrtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngrutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngerror.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngmem.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngrio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngwio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngset.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngtrans.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
+pngwio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwrite.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
-pngtest.obj : png.h, pngconf.h, pnglibconf.h
+pngtest.obj : png.h, pngconf.h, pnglibconf.h
diff --git a/scripts/dfn.awk b/scripts/dfn.awk
index 346b9db7d..0b25c8a37 100755
--- a/scripts/dfn.awk
+++ b/scripts/dfn.awk
@@ -1,8 +1,7 @@
#!/bin/awk -f
+
# scripts/dfn.awk - process a .dfn file
#
-# last changed in libpng version 1.5.19 - August 21, 2014
-#
# Copyright (c) 2013-2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
@@ -125,7 +124,7 @@ $1 ~ /^PNG_DFN_END_SORT/{
# There is no matching "@. Assume a split line
else while (1) {
if (getline nextline) {
- # If the line starts with '#' it is a preprocesor line directive
+ # If the line starts with '#' it is a preprocessor line directive
# from cc -E; skip it:
if (nextline !~ /^#/) {
line = line " " nextline
diff --git a/scripts/genchk.cmake.in b/scripts/genchk.cmake.in
index ab3b9d746..1b6aa84ae 100644
--- a/scripts/genchk.cmake.in
+++ b/scripts/genchk.cmake.in
@@ -10,6 +10,7 @@
# Variables substituted from CMakeLists.txt
set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
+set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(AWK "@AWK@")
@@ -23,7 +24,7 @@ get_filename_component(OUTPUTDIR "${OUTPUT}" PATH)
if("${INPUTEXT}" STREQUAL ".out" AND "${OUTPUTEXT}" STREQUAL ".chk")
# Generate .chk from .out with awk (generic)
file(REMOVE "${OUTPUT}" "${OUTPUTDIR}/${OUTPUTBASE}.new")
- execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/checksym.awk"
+ execute_process(COMMAND "${AWK}" -f "${BINDIR}/scripts/checksym.awk"
"${SRCDIR}/scripts/${INPUTBASE}.def"
"of=${OUTPUTDIR}/${OUTPUTBASE}.new"
"${INPUT}"
diff --git a/scripts/genout.cmake.in b/scripts/genout.cmake.in
index 01f12de2f..ec685d900 100644
--- a/scripts/genout.cmake.in
+++ b/scripts/genout.cmake.in
@@ -20,14 +20,14 @@ set(PNG_PREFIX "@PNG_PREFIX@")
set(PNGLIB_MAJOR "@PNGLIB_MAJOR@")
set(PNGLIB_MINOR "@PNGLIB_MINOR@")
set(PNGLIB_VERSION "@PNGLIB_VERSION@")
-set(ZLIBINCDIR "@ZLIB_INCLUDE_DIR@")
+set(ZLIBINCDIR "@ZLIB_INCLUDE_DIRS@")
set(PLATFORM_C_FLAGS)
if(APPLE)
- set(CMAKE_OSX_ARCHITECTURES "@CMAKE_OSX_ARCHITECTURES@")
+ set(CMAKE_OSX_INTERNAL_ARCHITECTURES "@CMAKE_OSX_INTERNAL_ARCHITECTURES@")
set(CMAKE_OSX_SYSROOT "@CMAKE_OSX_SYSROOT@")
- if(CMAKE_OSX_ARCHITECTURES)
- set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -arch ${CMAKE_OSX_ARCHITECTURES})
+ if(CMAKE_OSX_INTERNAL_ARCHITECTURES)
+ set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -arch ${CMAKE_OSX_INTERNAL_ARCHITECTURES})
endif()
if(CMAKE_OSX_SYSROOT)
set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT})
diff --git a/scripts/gensrc.cmake.in b/scripts/gensrc.cmake.in
index f28a62266..e97fada20 100644
--- a/scripts/gensrc.cmake.in
+++ b/scripts/gensrc.cmake.in
@@ -128,7 +128,7 @@ elseif("${OUTPUT}" STREQUAL "scripts/pnglibconf.h.prebuilt")
message(STATUS "Attempting to build scripts/pnglibconf.h.prebuilt")
message(STATUS "This is a machine generated file, but if you want to make")
- message(STATUS "a new one simply build the 'genfiles' target, and copy")
+ message(STATUS "a new one simply build the 'png_genfiles' target, and copy")
message(STATUS "scripts/pnglibconf.out to scripts/pnglibconf.h.prebuilt")
message(STATUS "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)")
message(FATAL_ERROR "Stopping build")
diff --git a/scripts/intprefix.c b/scripts/intprefix.c
index 254f8e94b..4085e5401 100644
--- a/scripts/intprefix.c
+++ b/scripts/intprefix.c
@@ -1,7 +1,6 @@
/* intprefix.c - generate an unprefixed internal symbol list
*
- * Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2013-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
diff --git a/scripts/libpng-config-head.in b/scripts/libpng-config-head.in
index 64dd3987d..b3e45a4b5 100644
--- a/scripts/libpng-config-head.in
+++ b/scripts/libpng-config-head.in
@@ -11,7 +11,7 @@
# Modeled after libxml-config.
-version=1.6.34
+version=1.6.40
prefix=""
libdir=""
libs=""
diff --git a/scripts/libpng.pc.in b/scripts/libpng.pc.in
index 33c65767b..142b1b51f 100644
--- a/scripts/libpng.pc.in
+++ b/scripts/libpng.pc.in
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
Name: libpng
Description: Loads and saves PNG files
-Version: 1.6.34
+Version: 1.6.40
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}
diff --git a/scripts/libtool.m4 b/scripts/libtool.m4
index a3bc337b7..79a2451ef 100644
--- a/scripts/libtool.m4
+++ b/scripts/libtool.m4
@@ -1,6 +1,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see <http://www.gnu.org/licenses/>.
])
-# serial 58 LT_INIT
+# serial 59 LT_INIT
# LT_PREREQ(VERSION)
@@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_DECL_FILECMD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
@@ -219,8 +221,8 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -778,7 +780,7 @@ _LT_EOF
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
+ $SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
@@ -1042,8 +1044,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
@@ -1067,17 +1069,12 @@ _LT_EOF
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]][[,.]]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ darwin*)
+ case $MACOSX_DEPLOYMENT_TARGET,$host in
+ 10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
@@ -1126,12 +1123,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
[ if test yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
],[])
else
@@ -1245,7 +1242,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
# _LT_WITH_SYSROOT
# ----------------
AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
+[m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
[Search for dependent libraries within DIR (or the compiler's sysroot
@@ -1262,7 +1260,7 @@ case $with_sysroot in #(
fi
;; #(
/*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
@@ -1292,7 +1290,7 @@ ia64-*-hpux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@@ -1309,7 +1307,7 @@ ia64-*-hpux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@@ -1321,7 +1319,7 @@ ia64-*-hpux*)
;;
esac
else
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -1343,7 +1341,7 @@ mips64*-*linux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@@ -1351,7 +1349,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@@ -1359,7 +1357,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@@ -1379,14 +1377,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# not appear in the list.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@@ -1454,7 +1452,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@@ -1493,9 +1491,22 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
-: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
+# higher priority because thats what people were doing historically (setting
+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
+# variable obsoleted/removed.
+
+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
+lt_ar_flags=$AR_FLAGS
+_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
+
+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
+_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
+ [Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no
@@ -1714,7 +1725,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1757,7 +1768,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@@ -2207,26 +2218,35 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
+if test -z "$STRIP"; then
+ AC_MSG_RESULT([no])
else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
+ if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ case $host_os in
+ darwin*)
+ # FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
- else
+ ;;
+ freebsd*)
+ if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
+ ;;
+ esac
+ fi
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
@@ -2549,7 +2569,7 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
@@ -2559,14 +2579,14 @@ m4_if([$1], [],[
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
- *,cl*)
- # Native MSVC
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@@ -2585,7 +2605,7 @@ m4_if([$1], [],[
done
IFS=$lt_save_ifs
# Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@@ -2622,7 +2642,7 @@ m4_if([$1], [],[
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@@ -2655,7 +2675,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@@ -3454,7 +3474,7 @@ beos*)
bsdi[[45]]*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -3488,14 +3508,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -3509,7 +3529,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
@@ -3556,7 +3576,7 @@ netbsd*)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@@ -3683,13 +3703,13 @@ else
mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
- case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@@ -3715,7 +3735,7 @@ else
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@@ -3955,7 +3975,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@@ -3973,20 +3993,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@@ -4010,7 +4030,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
+ # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
@@ -4028,9 +4048,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -4317,7 +4337,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -4400,7 +4420,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4736,7 +4756,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4919,7 +4939,7 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@@ -4927,7 +4947,7 @@ m4_if([$1], [CXX], [
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
- cl*)
+ cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@@ -4984,15 +5004,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
+ # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@@ -5044,7 +5064,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
- case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+ case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -5156,6 +5176,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
interix[[3-9]]*)
@@ -5170,7 +5191,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@@ -5213,7 +5234,7 @@ _LT_EOF
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
@@ -5225,7 +5246,7 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
@@ -5241,7 +5262,7 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@@ -5373,7 +5394,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -5556,12 +5577,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
- cl*)
- # Native MSVC
+ cl* | icl*)
+ # Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
@@ -5602,7 +5623,7 @@ _LT_EOF
fi'
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
@@ -5650,7 +5671,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
@@ -5861,6 +5882,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
osf3*)
@@ -6631,8 +6653,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
+ ,cl* | no,cl* | ,icl* | no,icl*)
+ # Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@@ -6730,6 +6752,7 @@ if test yes != "$_lt_caught_CXX_error"; then
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
dgux*)
@@ -6760,7 +6783,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -6897,7 +6920,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
@@ -7037,13 +7060,13 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -8189,6 +8212,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
AC_SUBST([DLLTOOL])
])
+# _LT_DECL_FILECMD
+# ----------------
+# Check for a file(cmd) program that can be used to detect file type and magic
+m4_defun([_LT_DECL_FILECMD],
+[AC_CHECK_TOOL([FILECMD], [file], [:])
+_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
+])# _LD_DECL_FILECMD
+
# _LT_DECL_SED
# ------------
# Check for a fully-functional sed program, that truncates
diff --git a/scripts/ltoptions.m4 b/scripts/ltoptions.m4
index 94b082976..b0b5e9c21 100644
--- a/scripts/ltoptions.m4
+++ b/scripts/ltoptions.m4
@@ -1,7 +1,7 @@
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
diff --git a/scripts/ltsugar.m4 b/scripts/ltsugar.m4
index 48bc9344a..902508bd9 100644
--- a/scripts/ltsugar.m4
+++ b/scripts/ltsugar.m4
@@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
diff --git a/scripts/ltversion.m4 b/scripts/ltversion.m4
index fa04b52a3..b155d0ace 100644
--- a/scripts/ltversion.m4
+++ b/scripts/ltversion.m4
@@ -1,6 +1,7 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
+# Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -9,15 +10,15 @@
# @configure_input@
-# serial 4179 ltversion.m4
+# serial 4245 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.6])
-m4_define([LT_PACKAGE_REVISION], [2.4.6])
+m4_define([LT_PACKAGE_VERSION], [2.4.7])
+m4_define([LT_PACKAGE_REVISION], [2.4.7])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.6'
-macro_revision='2.4.6'
+[macro_version='2.4.7'
+macro_revision='2.4.7'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/scripts/lt~obsolete.m4 b/scripts/lt~obsolete.m4
index c6b26f88f..0f7a8759d 100644
--- a/scripts/lt~obsolete.m4
+++ b/scripts/lt~obsolete.m4
@@ -1,7 +1,7 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu
index 7d4b7c53a..ea4894e74 100644
--- a/scripts/makefile.32sunu
+++ b/scripts/makefile.32sunu
@@ -1,38 +1,33 @@
# 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) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
-
+#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# Library name:
LIBNAME=libpng16
-PNGMAJ = 16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
CC=cc
AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir -p
LN_SF=ln -f -s
-RANLIB=echo
RM_F=/bin/rm -f
SUN_CC_FLAGS=-fast -xtarget=ultra
SUN_LD_FLAGS=-fast -xtarget=ultra
-# where make install puts libpng.a, libpng16.so and libpng16/png.h
-prefix=/a
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..".
@@ -44,34 +39,14 @@ ZLIBINC=/usr/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -83,7 +58,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
include scripts/pnglibconf.mak
DELETE = $(RM_F)
@@ -93,26 +68,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo libdir=\"$(LIBPATH)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-R$(LIBPATH)\"; \
- echo ccopts=\"-fast -xtarget=ultra\"; \
- echo ldopts=\"-fast -xtarget=ultra\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -138,107 +93,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)*
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu
index 341fce969..3f603d3f1 100644
--- a/scripts/makefile.64sunu
+++ b/scripts/makefile.64sunu
@@ -1,38 +1,33 @@
# 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) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
-
+#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# Library name:
LIBNAME=libpng16
-PNGMAJ = 16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
CC=cc
AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir -p
LN_SF=ln -f -s
-RANLIB=echo
RM_F=/bin/rm -f
SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
-# where make install puts libpng.a, libpng16.so and libpng16/png.h
-prefix=/a
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..".
@@ -44,34 +39,14 @@ ZLIBINC=/usr/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -83,7 +58,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
include scripts/pnglibconf.mak
DELETE = $(RM_F)
@@ -93,26 +68,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo libdir=\"$(LIBPATH)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-R$(LIBPATH)\"; \
- echo ccopts=\"-fast -xtarget=ultra -xarch=v9\"; \
- echo ldopts=\"-fast -xtarget=ultra -xarch=v9\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -138,107 +93,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)*
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.aix b/scripts/makefile.aix
index 5f62d50af..f00734e90 100644
--- a/scripts/makefile.aix
+++ b/scripts/makefile.aix
@@ -1,6 +1,6 @@
# makefile for libpng using gcc (generic, static library)
+# Copyright (C) 2000, 2022 Cosmin Truta
# Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
-# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -16,46 +16,28 @@ ZLIBLIB = ../zlib
CC = gcc
LD = $(CC)
AR_RC = ar rcs
-MKDIR_P = mkdir -p
RANLIB = ranlib
+MKDIR_P = mkdir -p
RM_F = rm -f
-LN_SF = ln -f -s
LIBNAME = libpng16
PNGMAJ = 16
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-
WARNMORE =
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
-LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm
+CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
-# Variables
-OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
- pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
- pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-all: $(LIBNAME).a pngtest$(E)
+all: $(LIBNAME).a pngtest
include scripts/pnglibconf.mak
REMOVE = $(RM_F)
@@ -65,34 +47,15 @@ $(LIBNAME).a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-test: pngtest$(E)
- ./pngtest$(E)
+test: pngtest
+ ./pngtest
-pngtest$(E): pngtest.o $(LIBNAME).a
+pngtest: pngtest.o $(LIBNAME).a
$(LD) -o $@ pngtest.o $(LDFLAGS)
-install: $(LIBNAME).a
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DI)/$(LIBNAME)/png.h
- -@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h
- -@$(RM_F) $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h
- -@$(RM_F) $(DI)/pngconf.h
- -@$(RM_F) $(DI)/pnglibconf.h
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h \
- $(DI)/$(LIBNAME)/pngconf.h \
- $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) -r $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
- -@$(RM_F) $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- cp $(LIBNAME).a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
- (cd $(DI); $(LN_SF) libpng/* .;)
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
clean:
$(RM_F) *.o $(LIBNAME).a pngtest pngout.png pnglibconf.h
diff --git a/scripts/makefile.amiga b/scripts/makefile.amiga
index 16a4bd5d3..2dae9af99 100644
--- a/scripts/makefile.amiga
+++ b/scripts/makefile.amiga
@@ -33,9 +33,9 @@ MKDIR= makedir
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
all: libpng.lib pngtest
diff --git a/scripts/makefile.atari b/scripts/makefile.atari
index b5dbd4934..6ed1f7990 100644
--- a/scripts/makefile.atari
+++ b/scripts/makefile.atari
@@ -1,4 +1,5 @@
# makefile for libpng
+# Copyright (C) 2022 Cosmin Truta
# Copyright (C) 2002, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -9,35 +10,20 @@
# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
# rules for library management
#
-CPPFLAGS = -I..\zlib
+CPPFLAGS = -I../zlib
CFLAGS = -O
LBR = png.lib
-LDFLAGS = -L. -L..\zlib -lpng -lz -lm
-
-# where make install puts libpng.a and png.h
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
+LDFLAGS = -L. -L../zlib -lpng -lz -lm
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
- $(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
- $(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\
- $(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\
- $(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o)
+OBJS = $(LBR)(png.o) $(LBR)(pngerror.o) $(LBR)(pngget.o) $(LBR)(pngmem.o) \
+ $(LBR)(pngpread.o) $(LBR)(pngread.o) $(LBR)(pngrio.o) \
+ $(LBR)(pngrtran.o) $(LBR)(pngrutil.o) $(LBR)(pngset.o) \
+ $(LBR)(pngtrans.o) $(LBR)(pngwio.o) $(LBR)(pngwrite.o) \
+ $(LBR)(pngwtran.o) $(LBR)(pngwutil.o)
all: $(LBR) pngtest.ttp
@@ -54,18 +40,6 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
pngtest.ttp: pngtest.o $(LBR)
$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
-install: libpng.a
- -@mkdir $(DESTDIR)$(INCPATH)
- -@mkdir $(DESTDIR)$(INCPATH)/libpng
- -@mkdir $(DESTDIR)$(LIBPATH)
- -@rm -f $(DESTDIR)$(INCPATH)/png.h
- -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
- -@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
- cp png.h $(DESTDIR)$(INCPATH)/libpng
- cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
- cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
- (cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
- ln -f -s $(LIBNAME)/* .)
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
diff --git a/scripts/makefile.bc32 b/scripts/makefile.bc32
index bdbc4cb2f..7e8f5e13c 100644
--- a/scripts/makefile.bc32
+++ b/scripts/makefile.bc32
@@ -50,13 +50,13 @@ CFLAGS=-O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)
# -M generate map file
LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG)
-# Pre-built configuration
+## Pre-built configuration
# See scripts\pnglibconf.mak for more options
!ifndef PNGLIBCONF_H_PREBUILT
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
!endif
-## Variables
+## File lists
OBJS = \
png.obj \
pngerror.obj \
@@ -121,22 +121,22 @@ test: pngtest.exe
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
-png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.obj: pngtest.c png.h pngconf.h pnglibconf.h
+pngtest.obj: pngtest.c png.h pngconf.h pnglibconf.h
$(LIBNAME): $(OBJS)
-del $(LIBNAME)
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index 01346f190..e02bdc3f4 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -1,5 +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) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1999 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -10,20 +11,18 @@
# Library name:
LIBNAME=libpng16
-PNGMAJ = 16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
CC=gcc
AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
@@ -37,45 +36,22 @@ ALIGN=
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
# still here in R4.5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O1 -funroll-loops $(ALIGN) # $(WARNMORE) -g
+CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
-LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
-
-# where make install puts libpng.a, libpng16.so*, and png.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
+LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS)
@@ -84,7 +60,7 @@ OBJSDLL = $(OBJS)
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -93,28 +69,13 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo libs=\"-lpng16 -lz \"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
cp $(LIBSO)* /boot/home/config/lib
$(LIBSOMAJ): $(OBJSDLL)
- $(CC) -nostart -Wl,-soname,$(LIBSOMAJ) -o \
- $(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS)
+ $(CC) -nostart -Wl,-soname,$(LIBSOMAJ) \
+ -o $(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS)
pngtest: pngtest.o $(LIBSO)
$(CC) -L$(ZLIBLIB) -L. -lz -lpng16 -o pngtest pngtest.o
@@ -122,101 +83,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) $(CFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) -Wl,-rpath $(ZLIBLIB):$(DL) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- $(CC) $(CPPFLAGS) $(CFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
clean:
- $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
- $(LIBSO) $(LIBSOMAJ)* pngtesti \
- pnglibconf.h libpng.pc
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.bor b/scripts/makefile.bor
deleted file mode 100644
index 6693772db..000000000
--- a/scripts/makefile.bor
+++ /dev/null
@@ -1,170 +0,0 @@
-# Makefile for libpng
-# 16-bit Borland C++ (Note: All modules are compiled in C mode)
-# To build the library, do:
-# "make -fmakefile.bor -DMODEL=c"
-# or: "make -fmakefile.bor -DMODEL=l"
-#
-# ------------ Borland C++ ------------
-
-### Absolutely necessary for this makefile to work
-.AUTODEPEND
-
-## Where zlib.h, zconf.h and zlib_MODEL.lib are
-ZLIB_DIR=..\zlib
-
-## Compiler, linker, librarian and other tools
-CC=bcc
-LD=bcc
-LIB=tlib
-CP=copy
-
-!ifndef MODEL
-MODEL=l
-!endif
-
-MODEL_ARG=-m$(MODEL)
-
-#TARGET_CPU=3
-# 2 = 286, 3 = 386, etc.
-!ifndef TARGET_CPU
-TARGET_CPU=2
-!endif
-
-# Use this if you don't want Borland's fancy exception handling
-# (for Borland C++ 4.0 or later)
-#NOEHLIB=noeh$(MODEL).lib
-
-!ifdef DEBUG
-CDEBUG=-v
-LDEBUG=-v
-!else
-CDEBUG=
-LDEBUG=
-!endif
-
-# STACKOFLOW=1
-!ifdef STACKOFLOW
-CDEBUG=$(CDEBUG) -N
-LDEBUG=$(LDEBUG) -N
-!endif
-
-# -X- turn on dependency generation in the object file
-# -w set all warnings on
-# -O2 optimize for speed
-# -Z global optimization
-CPPFLAGS=-I$(ZLIB_DIR)
-CFLAGS=-O2 -Z -X- -w -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
-
-# -M generate map file
-LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
-
-# Pre-built configuration
-# See scripts\pnglibconf.mak for more options
-!ifndef PNGLIBCONF_H_PREBUILT
-PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
-!endif
-
-## Variables
-
-OBJS = \
- png.obj \
- pngerror.obj \
- pngget.obj \
- pngmem.obj \
- pngpread.obj \
- pngread.obj \
- pngrio.obj \
- pngrtran.obj \
- pngrutil.obj \
- pngset.obj \
- pngtrans.obj \
- pngwio.obj \
- pngwrite.obj \
- pngwtran.obj \
- pngwutil.obj
-
-LIBOBJS = \
- +png.obj \
- +pngerror.obj \
- +pngget.obj \
- +pngmem.obj \
- +pngpread.obj \
- +pngread.obj \
- +pngrio.obj \
- +pngrtran.obj \
- +pngrutil.obj \
- +pngset.obj \
- +pngtrans.obj \
- +pngwio.obj \
- +pngwrite.obj \
- +pngwtran.obj \
- +pngwutil.obj
-
-LIBNAME=libpng$(MODEL).lib
-
-## Implicit rules
-
-# Braces let make "batch" calls to the compiler,
-# 2 calls instead of 12; space is important.
-.c.obj:
- $(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c }
-
-.c.exe:
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \
- $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
-
-## Major targets
-
-all: libpng pngtest
-
-# try !include scripts\pnglibconf.mak for more options
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- $(CP) $(PNGLIBCONF_H_PREBUILT) $@
-
-libpng: $(LIBNAME)
-
-pngtest: pngtest$(MODEL).exe
-
-test: pngtest$(MODEL).exe
- pngtest$(MODEL)
-
-## Minor Targets
-
-png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-
-$(LIBNAME): $(OBJS)
- -del $(LIBNAME)
- $(LIB) $(LIBNAME) @&&|
-$(LIBOBJS), libpng$(MODEL)
-|
-
-pngtest$(MODEL).obj: pngtest.c png.h pngconf.h pnglibconf.h
- $(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c
-
-pngtest$(MODEL).exe: pngtest$(MODEL).obj
- $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
-
-# Clean up anything else you want
-clean:
- -del pnglibconf.h
- -del *.obj
- -del *.exe
- -del *.lib
- -del *.lst
- -del *.map
-
-# End of makefile for libpng
diff --git a/scripts/makefile.cegcc b/scripts/makefile.cegcc
deleted file mode 100644
index d85bed9ad..000000000
--- a/scripts/makefile.cegcc
+++ /dev/null
@@ -1,116 +0,0 @@
-# Makefile for creating Windows CE release archives, with the
-# mingw32ce compiler.
-
-# Last updated: 22-Jul-2008
-
-# Copyright (C) 2008 Vincent Torri
-
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-
-# To get some help, type
-#
-# make help
-#
-# To create the archives
-#
-# make
-#
-# To remove everything, type:
-#
-# make clean
-
-VERMAJ = 1
-VERMIN = 6
-VERMIC = 34
-VER = $(VERMAJ).$(VERMIN).$(VERMIC)
-NAME = libpng
-PACKAGE = $(NAME)-$(VER)
-
-BIN = libpng16-0.dll
-LIB = libpng16.a libpng16.dll.a libpng.a libpng.dll.a
-INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-PC = libpng16.pc libpng.pc
-
-MANIFESTVERBIN = "Libpng-$(VER): Binary files"
-MANIFESTVERDEV = "Libpng-$(VER): Developer files"
-MANIFESTVERDESC = "Libpng: the official PNG reference library"
-
-all: $(NAME)
-
-$(NAME): remove-old copy-src compilation copy manifest archive
- @echo " * Removal of the directories"
- @rm -rf $(PACKAGE)/ $(PACKAGE)-bin/ $(PACKAGE)-dev/
-
-remove-old:
- @echo " * Removal of the old files"
- @rm -rf $(PACKAGE)-bin*
- @rm -rf $(PACKAGE)-dev*
-
-copy-src:
- @echo " * Copy of source files"
- @cp -R ../src/$(PACKAGE) .
- @echo " * Creation of directories and files"
- @mkdir -p $(PACKAGE)-bin/bin
- @mkdir -p $(PACKAGE)-bin/manifest
- @mkdir -p $(PACKAGE)-dev/lib/pkgconfig
- @mkdir -p $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN)
- @mkdir -p $(PACKAGE)-dev/manifest
- @touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.mft
- @touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.ver
- @touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.mft
- @touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.ver
-
-compilation:
- @echo " * Compilation of $(PACKAGE)"
- cd $(PACKAGE) && CPPFLAGS="$(CPPFLAGS) -DPNG_CONSOLE_IO_SUPPORTED -D_WIN32_WCE=0x0420" \
- CFLAGS="$(CFLAGS) -mms-bitfields -O3 -pipe -fomit-frame-pointer" \
- LDFLAGS="$(LDFLAGS) -Wl,--enable-auto-import -Wl,-s" \
- ./configure --prefix=/opt/wince --host=arm-mingw32ce && make
-
-copy:
- @echo " * Copy of binary and development files"
- @for i in $(BIN); do \
- cp $(PACKAGE)/.libs/$$i $(PACKAGE)-bin/bin; \
- done
- @for i in $(LIB); do \
- cp $(PACKAGE)/.libs/$$i $(PACKAGE)-dev/lib; \
- done
- @for i in $(INCLUDE); do \
- cp $(PACKAGE)/$$i $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN); \
- done
- @for i in $(PC); do \
- cp $(PACKAGE)/$$i $(PACKAGE)-dev/lib/pkgconfig; \
- done
-
-manifest:
- @echo " * Creation of the manifest"
- @cd $(PACKAGE)-bin && find * >> manifest/$(PACKAGE)-bin.mft
- @cd $(PACKAGE)-bin && \
- echo $(MANIFESTVERBIN) >> manifest/$(PACKAGE)-bin.ver && \
- echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-bin.ver
- @cd $(PACKAGE)-dev && find * >> manifest/$(PACKAGE)-dev.mft
- @cd $(PACKAGE)-dev && \
- echo $(MANIFESTVERDEV) >> manifest/$(PACKAGE)-dev.ver && \
- echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-dev.ver
-
-archive:
- @echo " * Creation of the archives"
- @tar cf $(PACKAGE)-bin.tar $(PACKAGE)-bin
- @bzip2 -9 $(PACKAGE)-bin.tar
- @tar cf $(PACKAGE)-dev.tar $(PACKAGE)-dev
- @bzip2 -9 $(PACKAGE)-dev.tar
-
-clean:
- @echo " * Cleaning"
- @rm -rf $(PACKAGE)*
-
-help:
- @echo
- @echo "To create the archives, type:"
- @echo " make"
- @echo
- @echo "To remove everything, type:"
- @echo " make clean"
- @echo
diff --git a/scripts/makefile.clang b/scripts/makefile.clang
new file mode 100644
index 000000000..2e154236f
--- /dev/null
+++ b/scripts/makefile.clang
@@ -0,0 +1,91 @@
+# makefile for libpng using clang (generic, static library)
+# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
+# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
+# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
+#
+# This code is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h
+
+# Location of the zlib library and include files
+ZLIBINC = ../zlib
+ZLIBLIB = ../zlib
+
+# Compiler, linker, lib and other tools
+CC = clang
+LD = $(CC)
+AR_RC = ar rcs
+RANLIB = ranlib
+CP = cp
+RM_F = rm -f
+
+# Compiler and linker flags
+NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
+ -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
+WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
+ -Wmissing-declarations -Wtraditional -Wcast-align \
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
+DEFS = $(NOHWOPT)
+CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
+CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS = -L$(ZLIBLIB) # -g
+LIBS = -lz -lm
+
+# File extensions
+EXEEXT =
+
+# Pre-built configuration
+# See scripts/pnglibconf.mak for more options
+PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
+
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
+
+# Targets
+all: static
+
+pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
+ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+static: libpng.a pngtest$(EXEEXT)
+
+shared:
+ @echo This is a generic makefile that cannot create shared libraries.
+ @echo Please use a configuration that is specific to your platform.
+ @false
+
+libpng.a: $(OBJS)
+ $(AR_RC) $@ $(OBJS)
+ $(RANLIB) $@
+
+test: pngtest$(EXEEXT)
+ ./pngtest$(EXEEXT)
+
+pngtest$(EXEEXT): pngtest.o libpng.a
+ $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
+
+clean:
+ $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
+
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin
index be3f92c54..0c50b57e6 100644
--- a/scripts/makefile.darwin
+++ b/scripts/makefile.darwin
@@ -1,4 +1,5 @@
-# makefile for libpng on Darwin / Mac OS X
+# makefile for libpng on Darwin / macOS
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 2001 Christoph Pfisterer
# derived from makefile.linux:
@@ -9,66 +10,42 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# where "make install" puts libpng.a, libpng16.dylib, png.h, pngconf.h,
-# and pnglibconf.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
ZLIBLIB=/usr/lib
ZLIBINC=/usr/include
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).dylib
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
-LIBSOREL=$(LIBNAME).$(PNGMAJ).$(RELEASE).dylib
-OLDSO=libpng.dylib
# Utilities:
CC=cc
AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=ranlib
CP=cp
-RM_F=/bin/rm -f
+RM_F=rm -f
-CPPFLAGS=-I$(ZLIBINC)
-# CFLAGS=-W -Wall -O3 -funroll-loops
-CFLAGS=-W -Wall -O -funroll-loops
+NOHWOPT=-DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
+ -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
+DEFS=$(NOHWOPT)
+CPPFLAGS=-I$(ZLIBINC) $(DEFS)
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -80,7 +57,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fno-common -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -89,28 +66,11 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
$(LIBSOMAJ): $(OBJSDLL)
$(CC) -dynamiclib \
- -install_name $(LIBPATH)/$(LIBSOMAJ) \
-current_version 16 -compatibility_version 16 \
-o $(LIBSOMAJ) \
$(OBJSDLL) -L$(ZLIBLIB) -lz
@@ -121,105 +81,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- $(RANLIB) $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOMAJ)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)
- chmod 755 $(DL)/$(LIBSOMAJ)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- $(CC) $(CPPFLAGS) $(CFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
- libpng.pc $(LIBNAME).*dylib pngtesti pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBNAME).*dylib pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index 8566a0297..b788b5aa3 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -1,4 +1,5 @@
# makefile for libpng on DEC Alpha Unix
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -7,47 +8,22 @@
# and license in png.h
# Library name:
-PNGMAJ = 16
-LIBNAME = libpng16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
-AR_RC=ar rc
CC=cc
+AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir
LN_SF=ln -f -s
-RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
-# where make install puts libpng.a and png.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
@@ -62,45 +38,27 @@ LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-all: $(LIBSO) libpng.a pngtest libpng.pc libpng-config
+all: $(LIBSO) libpng.a pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo ccopts=\"-std\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
$(LIBSOMAJ): $(OBJS)
- $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \
- -soname $(LIBSOMAJ)
+ $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) -soname $(LIBSOMAJ)
pngtest: pngtest.o libpng.a
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
@@ -108,103 +66,38 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@/bin/rm -f $(DI)/libpng
- (cd $(DI); $(LN_SF)(LIBNAME) libpng; $(LN_SF)(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@/bin/rm -f $(DL)/libpng.a
- (cd $(DL); $(LN_SF)(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@/bin/rm -f $(DM)/man3/libpng.3
- -@/bin/rm -f $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@/bin/rm -f $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@/bin/rm -f $(DB)/libpng-config
- -@/bin/rm -f $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF)(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -w1 -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) -w1 $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) -R$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.dj2 b/scripts/makefile.dj2
index e59c432b4..ff0d33286 100644
--- a/scripts/makefile.dj2
+++ b/scripts/makefile.dj2
@@ -1,4 +1,5 @@
# DJGPP (DOS gcc) makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2002, 2006, 2009-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -6,19 +7,11 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# where make install will put libpng.a and png.h
-#prefix=/usr/local
-prefix=.
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
CC=gcc
CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF
CFLAGS=-O
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
-RANLIB=ranlib
-
CP=cp
RM_F=rm -f
@@ -26,9 +19,9 @@ RM_F=rm -f
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o pngwtran.o \
- pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
@@ -39,8 +32,8 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
- $(RANLIB) $@
+ ar rc $@ $(OBJS)
+ ranlib $@
pngtest: pngtest.o libpng.a
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
@@ -48,19 +41,24 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
+
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
@@ -69,4 +67,4 @@ pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebu
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.emcc b/scripts/makefile.emcc
new file mode 100644
index 000000000..5d27621c0
--- /dev/null
+++ b/scripts/makefile.emcc
@@ -0,0 +1,83 @@
+# makefile for libpng using emscripten
+# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
+# Copyright (C) 2021 Kirk Roerig
+# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
+# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
+#
+# This code is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h
+
+# Location of the zlib library and include files
+ZLIBINC = ../zlib
+ZLIBLIB = ../zlib
+
+# Compiler, linker, lib and other tools
+CC = emcc
+LD = $(CC)
+AR_RC = emar rcs
+RANLIB = emranlib
+CP = cp
+RM_F = rm -f
+
+CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
+CFLAGS = -O2 -Wall -Wextra -Wundef
+LDFLAGS = -L$(ZLIBLIB)
+PNGTEST_LDFLAGS = --preload-file=pngtest.png
+LIBS = -lz -lm
+
+# Pre-built configuration
+# See scripts/pnglibconf.mak for more options
+PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
+
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
+
+# Targets
+all: static
+
+pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
+ $(CP) $(PNGLIBCONF_H_PREBUILT) $@
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+static: libpng.a pngtest
+
+shared:
+ @echo This makefile cannot create shared libraries.
+ @false
+
+libpng.a: $(OBJS)
+ $(AR_RC) $@ $(OBJS)
+ $(RANLIB) $@
+
+test: pngtest
+ node ./pngtest
+
+pngtest: pngtest.o libpng.a
+ $(LD) $(LDFLAGS) $(PNGTEST_LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
+ $(RM_F) pngtest.data pngtest.wasm
+
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.freebsd b/scripts/makefile.freebsd
index cad1a5aa8..e4e96a14b 100644
--- a/scripts/makefile.freebsd
+++ b/scripts/makefile.freebsd
@@ -1,4 +1,5 @@
# makefile for libpng under FreeBSD
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
#
@@ -6,28 +7,11 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-PREFIX?= /usr/local
-SHLIB_VER?= 16
-
LIB= png
+SHLIB_VER= 16
SHLIB_MAJOR= ${SHLIB_VER}
SHLIB_MINOR= 0
-NO_PROFILE= YES
-NO_OBJ= YES
-
-# where make install puts libpng.a and png.h
-DESTDIR= ${PREFIX}
-LIBDIR= /lib
-INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-INCSDIR= /include/libpng
-INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
-MAN= libpng.3 libpngpf.3 png.5
-MANDIR= /man/man
-SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
- libpng/pngconf.h ${INCSDIR}/../pngconf.h \
- libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h
-# where make install finds libz.a and zlib.h
ZLIBLIB= /usr/lib
ZLIBINC= /usr/include
@@ -37,33 +21,33 @@ LDADD+= -lm -lz
DPADD+= ${LIBM} ${LIBZ}
CPPFLAGS+= -I. -I${ZLIBINC}
-CFLAGS+= -W -Wall
+CFLAGS+= -Wall -Wextra -Wundef
+LDFLAGS+= -L. -L${ZLIBLIB}
+
+CLEANFILES+= pngtest pngtest.o pngout.png
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
-SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
- pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
- pngwtran.c pngmem.c pngerror.c pngpread.c
+SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
+ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
+ pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
.c.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+ ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
-pngtest: pngtest.o libpng.a
- ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \
- -lpng ${LDADD}
+pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
+ cp ${PNGLIBCONF_H_PREBUILT} $@
-CLEANFILES= pngtest pngtest.o pngout.png
+pngtest: pngtest.o libpng.a
+ ${CC} ${LDFLAGS} -static -o pngtest pngtest.o -lpng ${LDADD}
-test: pngtest
+test: pngtest
./pngtest
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- cp $(PNGLIBCONF_H_PREBUILT) $@
-
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
.include <bsd.lib.mk>
diff --git a/scripts/makefile.gcc b/scripts/makefile.gcc
index ba92d1509..b215a70fb 100644
--- a/scripts/makefile.gcc
+++ b/scripts/makefile.gcc
@@ -1,6 +1,6 @@
# makefile for libpng using gcc (generic, static library)
+# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
-# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@@ -19,12 +19,16 @@ RANLIB = ranlib
CP = cp
RM_F = rm -f
+# Compiler and linker flags
+NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
+ -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
-CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
-LDFLAGS =
+DEFS = $(NOHWOPT)
+CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
+CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS = -L$(ZLIBLIB) # -g
LIBS = -lz -lm
# File extensions
@@ -34,10 +38,10 @@ EXEEXT =
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-# Variables
-OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
- pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
- pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
all: static
@@ -63,7 +67,7 @@ test: pngtest$(EXEEXT)
./pngtest$(EXEEXT)
pngtest$(EXEEXT): pngtest.o libpng.a
- $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
+ $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
clean:
$(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
diff --git a/scripts/makefile.hp64 b/scripts/makefile.hp64
index 5948be8ec..e9c0a6938 100644
--- a/scripts/makefile.hp64
+++ b/scripts/makefile.hp64
@@ -1,7 +1,8 @@
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
+# Copyright (C) 2020-2022 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
+# Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -19,21 +20,19 @@ ZLIBINC=/opt/zlib/include
# SHAREDLIB=libz.sl
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).sl
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.sl
# Utilities:
-AR_RC=ar rc
CC=cc
+AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
@@ -45,36 +44,13 @@ CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
-# where make install puts libpng.a, libpng16.sl, and png.h
-prefix=/opt/libpng
-exec_prefix=$(prefix)
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -86,7 +62,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -95,23 +71,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo ccopts=\"-O -Ae -Wl,+vnocompatwarnings +DD64 +Z\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -125,107 +84,38 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) $(CCFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc
index 5c8791b13..3686bd0ae 100644
--- a/scripts/makefile.hpgcc
+++ b/scripts/makefile.hpgcc
@@ -1,4 +1,5 @@
# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 2001, Laurent faillie
# Copyright (C) 1998, 1999 Greg Roelofs
@@ -9,30 +10,23 @@
# and license in png.h
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).sl
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.sl
# Utilities:
CC=gcc
LD=ld
AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
-# where "make install" puts libpng.a, $(OLDSO)*, png.h, pngconf.h
-# and pnglibconf.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
ZLIBLIB=/opt/zlib/lib
ZLIBINC=/opt/zlib/include
@@ -44,44 +38,18 @@ ZLIBINC=/opt/zlib/include
# LDSHARED=ld -b
# SHAREDLIB=libz.sl
-ALIGN=
-# for i386:
-#ALIGN=-malign-loops=2 -malign-functions=2
-
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
-
-# for pgcc version 2.95.1, -O3 is buggy; don't use it.
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O3 -funroll-loops $(ALIGN) # $(WARNMORE) -g
-#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
-
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
+LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -93,27 +61,12 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -127,108 +80,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) -Wl,-rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index b07612dc7..59041f02a 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -1,7 +1,8 @@
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
+# Copyright (C) 2020-2022 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
+# Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -20,59 +21,34 @@ ZLIBINC=/opt/zlib/include
# SHAREDLIB=libz.sl
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).sl
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.sl
# Utilities:
-AR_RC=ar rc
CC=cc
+AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=ranlib
RM_F=/bin/rm -f
-# where make install puts libpng.a, libpng16.sl, and png.h
-prefix=/opt/libpng
-exec_prefix=$(prefix)
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
CPPFLAGS=-I$(ZLIBINC)
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
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -84,7 +60,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -93,23 +69,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo ccopts=\"-O -Ae +DA1.1 +DS2.0\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -123,107 +82,38 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) $(CCFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.ibmc b/scripts/makefile.ibmc
index 89b11966b..95cd0d8b7 100644
--- a/scripts/makefile.ibmc
+++ b/scripts/makefile.ibmc
@@ -1,7 +1,7 @@
# Makefile for libpng (static)
# IBM C version 3.x for Win32 and OS/2
# Copyright (C) 2006, 2014 Glenn Randers-Pehrson
-# Copyright (C) 2000 Cosmin Truta
+# Copyright (C) 2000, 2020 Cosmin Truta
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -37,10 +37,10 @@ O=.obj
A=.lib
E=.exe
-# Variables
+# File lists
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
- pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
- pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
+ pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
+ pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
LIBS = libpng$(A) $(ZLIBLIB)/zlib$(A)
@@ -65,11 +65,11 @@ pngtest$(E): pngtest$(O) libpng$(A)
$(LD) $(LDFLAGS) pngtest$(O) $(LIBS)
clean:
- $(RM) *$(O)
- $(RM) libpng$(A)
- $(RM) pnglibconf.h
- $(RM) pngtest$(E)
- $(RM) pngout.png
+ -$(RM) *$(O)
+ -$(RM) libpng$(A)
+ -$(RM) pnglibconf.h
+ -$(RM) pngtest$(E)
+ -$(RM) pngout.png
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
diff --git a/scripts/makefile.intel b/scripts/makefile.intel
index 418726159..d996011f8 100644
--- a/scripts/makefile.intel
+++ b/scripts/makefile.intel
@@ -31,7 +31,7 @@ CALLING=r # __fastcall
# --------------------------------------------------------------------------
-CC=icl -c
+CC=icl
CPPFLAGS=-I$(ZLIBINC)
CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -nologo
LD=link
@@ -42,61 +42,65 @@ CP=cp
# See scripts\pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
+# File extensions
O=.obj
-OBJS=png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) \
-pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) \
-pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
+# File lists
+OBJS1=png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O)
+OBJS2=pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O)
+OBJS3=pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
+OBJS=$(OBJS1) $(OBJS2) $(OBJS3)
+# Targets
all: test
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
libpng.lib: $(OBJS)
if exist libpng.lib del libpng.lib
@@ -106,10 +110,9 @@ pngtest.exe: pngtest.obj libpng.lib
$(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib
pngtest$(O): png.h pngconf.h pnglibconf.h
- $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
test: pngtest.exe
pngtest.exe
-
# End of makefile for libpng
diff --git a/scripts/makefile.knr b/scripts/makefile.knr
deleted file mode 100644
index d8de064c4..000000000
--- a/scripts/makefile.knr
+++ /dev/null
@@ -1,116 +0,0 @@
-# makefile for libpng
-# Copyright (C) 2002, 2006, 2009, 2014 Glenn Randers-Pehrson
-# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
-#
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-#
-# This makefile requires the file ansi2knr.c, which you can get
-# from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/
-# If you have libjpeg, you probably already have ansi2knr.c in the jpeg
-# source distribution.
-
-# where make install puts libpng.a and png.h
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-CC = cc
-CPPFLAGS = -I../zlib
-CFLAGS = -O
-LDFLAGS = -L. -L../zlib/ -lpng -lz -lm
-# flags for ansi2knr
-ANSI2KNRFLAGS=
-
-RANLIB = ranlib
-#RANLIB = echo
-
-CP = cp
-RM_F = rm -f
-
-# Pre-built configuration
-# See scripts/pnglibconf.mak for more options
-PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
-
-all: ansi2knr libpng.a pngtest
-
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- $(CP) $(PNGLIBCONF_H_PREBUILT) $@
-
-# general rule to allow ansi2knr to work
-.c.o:
- ./ansi2knr $*.c T$*.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c T$*.c
- rm -f T$*.c $*.o
- mv T$*.o $*.o
-
-ansi2knr: ansi2knr.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
-
-libpng.a: ansi2knr $(OBJS)
- ar rc $@ $(OBJS)
- $(RANLIB) $@
-
-pngtest: pngtest.o libpng.a
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
-
-test: pngtest
- ./pngtest
-
-install: libpng.a png.h pngconf.h pnglibconf.h
- -@mkdir $(DESTDIR)$(INCPATH)
- -@mkdir $(DESTDIR)$(INCPATH)/libpng
- -@mkdir $(DESTDIR)$(LIBPATH)
- -@rm -f $(DESTDIR)$(INCPATH)/png.h
- -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
- cp png.h $(DESTDIR)$(INCPATH)/libpng
- cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
- cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
- (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
- cp libpng.a $(DESTDIR)$(LIBPATH)
- chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
-
-clean:
- $(RM_F) *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
-
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-
-pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index f61087ccf..3fece3d6c 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -1,4 +1,5 @@
# makefile for libpng.a and libpng16.so on Linux ELF with gcc
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
# Glenn Randers-Pehrson
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -8,30 +9,21 @@
# and license in png.h
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
-RELEASE = 34
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
-AR_RC=ar rc
CC=gcc
+AR_RC=ar rc
+RANLIB=ranlib
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=ranlib
CP=cp
-RM_F=/bin/rm -f
-
-# where "make install" puts libpng16.a, libpng16.so*,
-# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
-# Prefix must be a full pathname.
-prefix=/usr/local
-exec_prefix=$(prefix)
+RM_F=rm -f
# Where the zlib library and include files are located.
#ZLIBLIB=/usr/local/lib
@@ -39,50 +31,26 @@ exec_prefix=$(prefix)
ZLIBLIB=../zlib
ZLIBINC=../zlib
-ALIGN=
-# for i386:
-#ALIGN=-malign-loops=2 -malign-functions=2
-
+# Compiler and linker flags
+NOHWOPT=-DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
+ -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
-
-# for pgcc version 2.95.1, -O3 is buggy; don't use it.
-
-CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS= -W -Wall -O3 -funroll-loops \
- $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
-
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
-
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
+DEFS=$(NOHWOPT)
+CPPFLAGS=-I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+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
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -94,7 +62,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest pngtest-static
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -103,23 +71,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -142,106 +93,39 @@ test: pngtest pngtest-static
@echo ""
./pngtest-static
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
-
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
- $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
- libpng.pc pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+clean:
+ $(RM_F) $(OBJS) $(OBJSDLL) libpng.a
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
+ $(RM_F) pngtest*.o pngtest pngtest-static pngout.png
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.linux-opt b/scripts/makefile.linux-opt
deleted file mode 100644
index 017656c6e..000000000
--- a/scripts/makefile.linux-opt
+++ /dev/null
@@ -1,265 +0,0 @@
-# makefile for libpng.a and libpng16.so on Linux ELF with gcc
-# Copyright (C) 1998,1999,2002,2006,2008,2010-2014,2017 Greg Roelofs and
-# Glenn Randers-Pehrson
-# Copyright (C) 1996,1997 Andreas Dilger
-#
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-
-# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
-RELEASE = 34
-
-# Shared library names:
-LIBSO=$(LIBNAME).so
-LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
-
-# Utilities:
-AR_RC=ar rc
-CC=gcc
-MKDIR_P=mkdir -p
-LN_SF=ln -sf
-RANLIB=ranlib
-CP=cp
-RM_F=/bin/rm -f
-
-# where "make install" puts libpng16.a, libpng16.so*,
-# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
-# Prefix must be a full pathname.
-prefix=/usr/local
-exec_prefix=$(prefix)
-
-# Where the zlib library and include files are located.
-#ZLIBLIB=/usr/local/lib
-#ZLIBINC=/usr/local/include
-ZLIBLIB=../zlib
-ZLIBINC=../zlib
-
-ALIGN=
-# for i386:
-#ALIGN=-malign-loops=2 -malign-functions=2
-
-#WARNMORE=-Wwrite-strings -Wpointer-arith \
-# -Wmissing-declarations -Wtraditional -Wcast-align \
-# -Wstrict-prototypes -Wmissing-prototypes
-
-# for pgcc version 2.95.1, -O3 is buggy; don't use it.
-
-CPPFLAGS=-I$(ZLIBINC)
-CPPFLAGS += -DPNG_ARM_NEON
-CPPFLAGS += -DPNG_MIPS_MSA
-CPPFLAGS += -DPNG_INTEL_SSE
-CPPFLAGS += -DPNG_POWERPC_VSX
-CPPFLAGS+=-ansi -pedantic -Wextra -Wall -Wshadow -Wno-sign-conversion
-CPPFLAGS+=-W -Wall -Wconversion $(ALIGN)
-# CPPFLAGS+=$(WARNMORE)
-CFLAGS= -O3 -funroll-loops
-
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
-
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
-# Pre-built configuration
-# See scripts/pnglibconf.mak for more options
-PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o \
- arm/arm_init.o arm/filter_neon_intrinsics.o \
- mips/mips_init.o mips/filter_msa_intrinsics.o \
- intel/intel_init.o intel/filter_sse2_intrinsics.o\
- powerpc/powerpc_init.o powerpc/filter_vsx_intrinsics.o
-
-OBJSDLL = $(OBJS:.o=.pic.o)
-
-.SUFFIXES: .c .o .pic.o
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-
-.c.pic.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
-
-all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
-
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- $(CP) $(PNGLIBCONF_H_PREBUILT) $@
-
-libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
- $(RANLIB) $@
-
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
-$(LIBSO): $(LIBSOMAJ)
- $(LN_SF) $(LIBSOMAJ) $(LIBSO)
-
-$(LIBSOMAJ): $(OBJSDLL)
- $(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
-
-pngtest: pngtest.o $(LIBSO)
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
-
-pngtest-static: pngtest.o libpng.a
- $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
-
-test: pngtest pngtest-static
- @echo ""
- @echo " Running pngtest dynamically linked with $(LIBSO):"
- @echo ""
- ./pngtest
- @echo ""
- @echo " Running pngtest statically linked with libpng.a:"
- @echo ""
- ./pngtest-static
-
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
-
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
-
-clean:
- $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
- $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
- libpng.pc pnglibconf.h
-
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-arm/arm_init.o arm/arm_init.o: pngpriv.h
-arm/filter_neon_intrinsics.o arm/filter_neon_intrinsics.pic.o: pngpriv.h
-mips/mips_init.o mips/mips_init.pic.o: pngpriv.h
-mips/filter_msa_intrinsics.o mips/filter_msa_intrinsics.pic.: pngpriv.h
-intel/intel_init.o intel/intel_init.pic.: pngpriv.h
-intel/filter_sse2_intrinsics.o intel/filter_sse2_intrinsics.pic.: pngpriv.h
-powerpc/powerpc_init.o powerpc/powerpc_init.pic.: pngpriv.h
-powerpc/filter_vsx_intrinsics.o powerpc/filter_vsx_intrinsics.pic.: pngpriv.h
-
-pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.mips b/scripts/makefile.mips
index 5633608c8..ca50f6077 100644
--- a/scripts/makefile.mips
+++ b/scripts/makefile.mips
@@ -1,4 +1,5 @@
# makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 1998-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -6,39 +7,23 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# where make install puts libpng.a and png.h
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
CC=cc
CPPFLAGS=-I../zlib -DSYSV -Dmips
CFLAGS=-O -systype sysv -w
#CFLAGS=-O
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
+AR_RC=ar rc
#RANLIB=ranlib
RANLIB=echo
-CP=cp
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
@@ -46,10 +31,10 @@ OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
all: libpng.a pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- $(CP) $(PNGLIBCONF_H_PREBUILT) $@
+ cp $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
+ $(AR_RC) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o libpng.a
@@ -58,46 +43,29 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
-install: libpng.a
- -@mkdir $(DESTDIR)$(INCPATH)
- -@mkdir $(DESTDIR)$(INCPATH)/libpng
- -@mkdir $(DESTDIR)$(LIBPATH)
- -@rm -f $(DESTDIR)$(INCPATH)/png.h
- -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
- -@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
- cp png.h $(DESTDIR)$(INCPATH)/libpng
- cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
- cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
- (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
- cp libpng.a $(DESTDIR)$(LIBPATH)
- chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
clean:
rm -f *.o libpng.a pngtest pngout.png pnglibconf.h
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
-
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.msys b/scripts/makefile.msys
index 33b7721d4..e2878233c 100644
--- a/scripts/makefile.msys
+++ b/scripts/makefile.msys
@@ -1,30 +1,25 @@
# makefile for libpng using MSYS/gcc (shared, static library)
+# Copyright (C) 2019-2022 Cosmin Truta
# Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
#
-# Portions taken from makefile.linux:
+# Portions taken from makefile.linux and makefile.gcc:
+# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
# Glenn Randers-Pehrson
-# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1996, 1997 Andreas Dilger
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# # # # # # # # # # # # # # # # #
-prefix=/usr/local
-exec_prefix=$(prefix)
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
-RELEASE = 34
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).dll
LIBSOMAJ=$(LIBNAME).dll.$(PNGMAJ)
-LIBSOREL=$(PNGMAJ).$(RELEASE)
-OLDSO=libpng.dll
# Where the zlib library and include files are located.
#ZLIBLIB=../zlib
@@ -42,46 +37,22 @@ RM_F = rm -rf
MKDIR_P=mkdir -p
LN_SF=ln -sf
-#ARCH = -march=pentium3
-#ARCH = -march=i686
-ARCH =
CPPFLAGS = # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 $(ARCH) # -g
-LDFLAGS =
+CFLAGS = -O2 -Wall -Wextra -Wundef # -g
+LDFLAGS = # -g
LIBS = -lz -lm
# File extensions
EXEEXT=.exe
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-# Variables
-OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
- pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
- pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
+# File lists
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
all: static shared
@@ -107,80 +78,28 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSO) $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
-
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
test: pngtest$(EXEEXT)
./pngtest$(EXEEXT)
pngtest$(EXEEXT): pngtest.o libpng.a
- $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
+ $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
clean:
- $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h $(LIBSO) \
- $(LIBSOMAJ) libpng-config
+ $(RM_F) $(OBJS) libpng.a
+ $(RM_F) $(LIBSO) $(LIBSOMAJ) pnglibconf.h
+ $(RM_F) pngtest*.o pngtest$(EXEEXT) pngout.png
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
diff --git a/scripts/makefile.ne12bsd b/scripts/makefile.ne12bsd
deleted file mode 100644
index bc8dd8ba4..000000000
--- a/scripts/makefile.ne12bsd
+++ /dev/null
@@ -1,56 +0,0 @@
-# makefile for libpng for NetBSD for the standard
-# make obj && make depend && make && make test
-# make includes && make install
-# Copyright (C) 2002 Patrick R.L. Welche
-# Copyright (C) 2007, 2009, 2014 Glenn Randers-Pehrson
-#
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-
-# You should also run makefile.netbsd
-
-LOCALBASE?=/usr/local
-LIBDIR= ${LOCALBASE}/lib
-MANDIR= ${LOCALBASE}/man
-INCSDIR=${LOCALBASE}/include/libpng16
-
-LIB= png16
-SHLIB_MAJOR= 0
-SHLIB_MINOR= 1.6.34
-SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
- pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
- pngwtran.c pngmem.c pngerror.c pngpread.c
-INCS= png.h pngconf.h pnglibconf.h
-MAN= libpng.3 libpngpf.3 png.5
-
-CPPFLAGS+=-I${.CURDIR}
-
-# Pre-built configuration
-# See scripts/pnglibconf.mak for more options
-PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
-
-# We should be able to do something like this instead of the manual
-# uncommenting, but it core dumps for me at the moment:
-# .if ${MACHINE_ARCH} == "i386"
-# MKLINT= no
-# .endif
-
-CLEANFILES+=pngtest.o pngtest pnglibconf.h
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- cp $(PNGLIBCONF_H_PREBUILT) $@
-
-pngtest.o: pngtest.c
- ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
-
-pngtest: pngtest.o libpng.a
- ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm
-
-test: pngtest
- cd ${.CURDIR} && ${.OBJDIR}/pngtest
-
-.include <bsd.lib.mk>
diff --git a/scripts/makefile.netbsd b/scripts/makefile.netbsd
index ab1cedda7..d3419f29b 100644
--- a/scripts/makefile.netbsd
+++ b/scripts/makefile.netbsd
@@ -1,30 +1,25 @@
-# makefile for libpng for NetBSD for the standard
-# make obj && make depend && make && make test
-# make includes && make install
-# Copyright (C) 2002 Patrick R.L. Welche
+# makefile for libpng on NetBSD
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
+# Copyright (C) 2002 Patrick R.L. Welche
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# You should also run makefile.ne16bsd
-
-LOCALBASE?=/usr/local
-LIBDIR= ${LOCALBASE}/lib
-MANDIR= ${LOCALBASE}/man
-INCSDIR=${LOCALBASE}/include
+SHLIB_MAJOR= 16
+SHLIB_MINOR= 0
LIB= png
-SHLIB_MAJOR= 16
-SHLIB_MINOR= 1.6.34
-SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
- pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
- pngwtran.c pngmem.c pngerror.c pngpread.c
+SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
+ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
+ pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
INCS= png.h pngconf.h pnglibconf.h
-MAN= libpng.3 libpngpf.3 png.5
-CPPFLAGS+=-I${.CURDIR}
+CPPFLAGS+= -I${.CURDIR}
+CFLAGS+= -Wall -Wextra -Wundef
+
+CLEANFILES+= pngtest.o pngtest pnglibconf.h
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
@@ -36,21 +31,23 @@ PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
# MKLINT= no
# .endif
-CLEANFILES+=pngtest.o pngtest pnglibconf.h
-
.c.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+ ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- cp $(PNGLIBCONF_H_PREBUILT) $@
+pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
+ cp ${PNGLIBCONF_H_PREBUILT} $@
pngtest.o: pngtest.c
${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
pngtest: pngtest.o libpng.a
- ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm
+ ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -lz -lm
test: pngtest
- cd ${.CURDIR} && ${.OBJDIR}/pngtest
+ ./pngtest
+
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
.include <bsd.lib.mk>
diff --git a/scripts/makefile.openbsd b/scripts/makefile.openbsd
index b32ea61a2..6bfeab779 100644
--- a/scripts/makefile.openbsd
+++ b/scripts/makefile.openbsd
@@ -1,4 +1,5 @@
# makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -6,83 +7,41 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-PREFIX?= /usr/local
-LIBDIR= ${PREFIX}/lib
-MANDIR= ${PREFIX}/man/cat
-
SHLIB_MAJOR= 16
-SHLIB_MINOR= 1.6.34
+SHLIB_MINOR= 0
LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
- pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
- pngwio.c pngwrite.c pngwtran.c pngwutil.c
-
+ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c \
+ pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
HDRS= png.h pngconf.h pnglibconf.h
-CFLAGS+= -W -Wall
-CPPFLAGS+= -I${.CURDIR}
-
-NOPROFILE= Yes
+CPPFLAGS+= -I${.CURDIR}
+CFLAGS+= -Wall -Wextra -Wundef
-CLEANFILES+= pngtest.o pngtest pnglibconf.h
-
-MAN= libpng.3 libpngpf.3 png.5
-DOCS= ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
- libpng-manual.txt
+CLEANFILES+= pngtest.o pngtest pnglibconf.h
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
.c.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+ ${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- cp $(PNGLIBCONF_H_PREBUILT) $@
+pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
+ cp ${PNGLIBCONF_H_PREBUILT} $@
pngtest.o: pngtest.c
- ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
+ ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}
pngtest: pngtest.o
${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
test: pngtest
- cd ${.OBJDIR} && env \
- LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
-
-beforeinstall:
- if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
- fi
- if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
- fi
- if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
- fi
- if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
- fi
- if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
- fi
- if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
- ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
- fi
+ env LD_LIBRARY_PATH="${.OBJDIR}" ./pngtest
-afterinstall:
- @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
- @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
- @rm -f ${DESTDIR}${PREFIX}/include/png.h
- @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h
- @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h
- @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
- ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
- -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
- ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
- -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
- ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
- -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
.include <bsd.lib.mk>
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index 67d84aaac..002cd3f9b 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -1,6 +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) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -10,28 +11,22 @@
# and license in png.h
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
CC=cc
AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir
LN_SF=ln -f -s
-RANLIB=echo
CP=cp
RM_F=/bin/rm -f
-# where make install puts libpng.a, $(OLDSO)*, and png.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
@@ -42,33 +37,13 @@ CPPFLAGS=-I$(ZLIBINC)
CFLAGS= -dy -belf -O3
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -80,7 +55,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -89,23 +64,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo ccopts=\"-belf\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -119,108 +77,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- -@$(RM_F) $(DI)/png.h
- -@$(RM_F) $(DI)/pngconf.h
- -@$(RM_F) $(DI)/pnglibconf.h
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- $(CC) $(CPPFLAGS) $(CFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
- $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
- pnglibconf.h libpng.pc
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pngtest-static pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index a0d051dbd..e017916ef 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -1,4 +1,5 @@
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -8,29 +9,21 @@
# Library name:
LIBNAME=libpng16
-PNGMAJ = 16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
-AR_RC=ar rc
CC=gcc
+AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=echo
CP=cp
RM_F=/bin/rm -f
-# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
-# Prefix must be a full pathname.
-
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib32
#ZLIBINC=/usr/local/include
@@ -46,44 +39,23 @@ ABI=
WARNMORE=
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g
-LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
+LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
-set_version sgi$(PNGMAJ).0
# See "man dso" for info about shared objects
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-#LIBPATH=$(exec_prefix)/lib32
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-all: libpng.a pngtest shared libpng.pc libpng-config
+all: libpng.a pngtest shared
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -94,26 +66,6 @@ libpng.a: $(OBJS)
shared: $(LIBSOMAJ)
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo ccopts=\"$(ABI)\"; \
- echo cppflags=\"\"; \
- echo ldopts=\"$(ABI)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libdir=\"$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -129,108 +81,38 @@ test: pngtest
echo Testing local static library.
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) \
- -rpath $(ZLIBLIB):$(DL) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) \
- -rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) libpng.a pngtest pngtesti pngout.png libpng.pc \
- so_locations libpng-config $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) libpng.a pngtest pngout.png
+ $(RM_F) so_locations $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi
index 7df090222..c7f8720e5 100644
--- a/scripts/makefile.sgi
+++ b/scripts/makefile.sgi
@@ -1,4 +1,5 @@
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -8,29 +9,21 @@
# Library name:
LIBNAME=libpng16
-PNGMAJ = 16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
-AR_RC=ar rc
CC=cc
+AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir -p
LN_SF=ln -sf
-RANLIB=echo
CP=cp
RM_F=/bin/rm -f
-# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
-# Prefix must be a full pathname.
-
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib32
#ZLIBINC=/usr/local/include
@@ -47,46 +40,25 @@ WARNMORE=-fullwarn
# Note: -KPIC is the default anyhow
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
#CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g
-CFLAGS=$(ABI) -O $(WARNMORE)
-LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
+CFLAGS=$(ABI) -O $(WARNMORE) # -g
+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) \
-set_version sgi$(PNGMAJ).0
# See "man dso" for info about shared objects
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-#LIBPATH=$(exec_prefix)/lib32
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-all: libpng.a pngtest shared libpng.pc libpng-config
+all: libpng.a pngtest shared
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -95,25 +67,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo ccopts=\"$(ABI)\"; \
- echo ldopts=\"$(ABI)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo libdir=\"$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -129,109 +82,38 @@ test: pngtest
echo Testing local static library.
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(DL) -L$(ZLIBLIB) \
- -rpath $(ZLIBLIB):$(DL) \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -L$(ZLIBLIB) \
- -rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
- $(LIBSO) $(LIBSOMAJ)* \
- so_locations pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* so_locations pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.so9 b/scripts/makefile.so9
index ba9308c8a..2fd8e7017 100644
--- a/scripts/makefile.so9
+++ b/scripts/makefile.so9
@@ -1,6 +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) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998-2001 Greg Roelofs
# Copyright (C) 1996-1997 Andreas Dilger
@@ -10,29 +11,23 @@
# and license in png.h
# Library name:
-PNGMAJ = 16
-LIBNAME = libpng16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
# gcc 2.95 doesn't work.
CC=cc
AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir -p
LN_SF=ln -f -s
-RANLIB=echo
CP=cp
RM_F=/bin/rm -f
-# Where make install puts libpng.a, $(OLDSO)*, and png.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..".
@@ -44,41 +39,17 @@ exec_prefix=$(prefix)
ZLIBLIB=/usr/lib
ZLIBINC=/usr/include
-#WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
- -Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-#CFLAGS=-W -Wall -O3 $(WARNMORE) -g
CFLAGS=-O3
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -90,7 +61,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -99,23 +70,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-R$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -141,107 +95,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index 8a450d371..4aa672deb 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -1,4 +1,5 @@
# makefile for libpng on Solaris 2.x with gcc
+# Copyright (C) 2020-2022 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
@@ -9,28 +10,22 @@
# and license in png.h
# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
+LIBNAME=libpng16
+PNGMAJ=16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
# Utilities:
-AR_RC=ar rc
CC=gcc
+AR_RC=ar rc
+RANLIB=echo
MKDIR_P=mkdir -p
LN_SF=ln -f -s
-RANLIB=echo
CP=cp
RM_F=/bin/rm -f
-# Where make install puts libpng.a, libpng16.so*, and png.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-
# Where the zlib library and include files are located
# Changing these to ../zlib poses a security risk. If you want
# to have zlib in an adjacent directory, specify the full path instead of "..".
@@ -42,39 +37,18 @@ ZLIBINC=/usr/local/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS= -W -Wall -O \
- # $(WARNMORE) -g -DPNG_DEBUG=5
-LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
-
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
+CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
OBJSDLL = $(OBJS:.o=.pic.o)
@@ -86,7 +60,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.c.pic.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
+all: libpng.a $(LIBSO) pngtest
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
@@ -95,24 +69,6 @@ libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo cppflags=\"\"; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-R$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
@@ -138,107 +94,38 @@ pngtest: pngtest.o $(LIBSO)
test: pngtest
./pngtest
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtesti pngtest.png
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
+install-static:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+install-shared:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
+
+clean:
+ $(RM_F) *.o libpng.a pngtest pngout.png
+ $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.solaris-x86 b/scripts/makefile.solaris-x86
deleted file mode 100644
index 2ee3c14a5..000000000
--- a/scripts/makefile.solaris-x86
+++ /dev/null
@@ -1,243 +0,0 @@
-# makefile for libpng on Solaris 2.x with gcc
-# Copyright (C) 2004, 2006-2008, 2010-2014 Glenn Randers-Pehrson
-# Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 1998 Greg Roelofs
-# Copyright (C) 1996, 1997 Andreas Dilger
-
-# This code is released under the libpng license.
-# For conditions of distribution and use, see the disclaimer
-# and license in png.h
-
-# Library name:
-LIBNAME = libpng16
-PNGMAJ = 16
-
-# Shared library names:
-LIBSO=$(LIBNAME).so
-LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
-LIBSOREL=$(LIBSOMAJ).$(RELEASE)
-OLDSO=libpng.so
-
-# Utilities:
-AR_RC=ar rc
-CC=gcc
-MKDIR_P=mkdir -p
-LN_SF=ln -f -s
-RANLIB=echo
-CP=cp
-RM_F=/bin/rm -f
-
-# Where make install puts libpng.a, libpng16.so*, and png.h
-prefix=/usr/local
-exec_prefix=$(prefix)
-
-# Where the zlib library and include files are located
-# Changing these to ../zlib poses a security risk. If you want
-# to have zlib in an adjacent directory, specify the full path instead of "..".
-#ZLIBLIB=../zlib
-#ZLIBINC=../zlib
-
-ZLIBLIB=/usr/local/lib
-ZLIBINC=/usr/local/include
-
-WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
- -Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
-CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O # $(WARNMORE) -g
-LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
-
-INCPATH=$(prefix)/include
-LIBPATH=$(exec_prefix)/lib
-MANPATH=$(prefix)/man
-BINPATH=$(exec_prefix)/bin
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
-DB=$(DESTDIR)$(BINPATH)
-DI=$(DESTDIR)$(INCPATH)
-DL=$(DESTDIR)$(LIBPATH)
-DM=$(DESTDIR)$(MANPATH)
-
-# Pre-built configuration
-# See scripts/pnglibconf.mak for more options
-PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
-
-OBJSDLL = $(OBJS:.o=.pic.o)
-
-.SUFFIXES: .c .o .pic.o
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-
-.c.pic.o:
- $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
-
-all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
-
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- $(CP) $(PNGLIBCONF_H_PREBUILT) $@
-
-libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
- $(RANLIB) $@
-
-libpng.pc:
- cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
- -e s!@exec_prefix@!$(exec_prefix)! \
- -e s!@libdir@!$(LIBPATH)! \
- -e s!@includedir@!$(INCPATH)! \
- -e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
-
-libpng-config:
- ( cat scripts/libpng-config-head.in; \
- echo prefix=\"$(prefix)\"; \
- echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
- echo cppflags=\""; \
- echo L_opts=\"-L$(LIBPATH)\"; \
- echo R_opts=\"-R$(LIBPATH)\"; \
- echo libs=\"-lpng16 -lz -lm\"; \
- cat scripts/libpng-config-body.in ) > libpng-config
- chmod +x libpng-config
-
-$(LIBSO): $(LIBSOMAJ)
- $(LN_SF) $(LIBSOMAJ) $(LIBSO)
-
-$(LIBSOMAJ): $(OBJSDLL)
- @case "`type ld`" in *ucb*) \
- echo; \
- echo '## WARNING:'; \
- echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
- echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
- echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
- echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
- echo '## at all. If it is, things are likely to break because of'; \
- echo '## the libucb dependency that is created.'; \
- echo; \
- ;; \
- esac
- $(LD) -G -h $(LIBSOMAJ) \
- -o $(LIBSOMAJ) $(OBJSDLL)
-
-pngtest: pngtest.o $(LIBSO)
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
-
-test: pngtest
- ./pngtest
-
-install-headers: png.h pngconf.h pnglibconf.h
- -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
- -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
- cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
- chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
- -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
- -@$(RM_F) $(DI)/libpng
- (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-
-install-static: install-headers libpng.a
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- cp libpng.a $(DL)/$(LIBNAME).a
- chmod 644 $(DL)/$(LIBNAME).a
- -@$(RM_F) $(DL)/libpng.a
- (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
-
-install-shared: install-headers $(LIBSOMAJ) libpng.pc
- -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
- -@$(RM_F) $(DL)/$(LIBSO)
- -@$(RM_F) $(DL)/$(LIBSOREL)
- -@$(RM_F) $(DL)/$(OLDSO)
- cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
- chmod 755 $(DL)/$(LIBSOREL)
- (cd $(DL); \
- $(LN_SF) $(LIBSOREL) $(LIBSO); \
- $(LN_SF) $(LIBSO) $(OLDSO))
- -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
- -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
- -@$(RM_F) $(DL)/pkgconfig/libpng.pc
- cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
- chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
- (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
-
-install-man: libpng.3 libpngpf.3 png.5
- -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
- -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
- -@$(RM_F) $(DM)/man3/libpng.3
- -@$(RM_F) $(DM)/man3/libpngpf.3
- cp libpng.3 $(DM)/man3
- cp libpngpf.3 $(DM)/man3
- -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
- -@$(RM_F) $(DM)/man5/png.5
- cp png.5 $(DM)/man5
-
-install-config: libpng-config
- -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
- -@$(RM_F) $(DB)/libpng-config
- -@$(RM_F) $(DB)/$(LIBNAME)-config
- cp libpng-config $(DB)/$(LIBNAME)-config
- chmod 755 $(DB)/$(LIBNAME)-config
- (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
-
-install: install-static install-shared install-man install-config
-
-# If you installed in $(DESTDIR), test-installed won't work until you
-# move the library to its final location. Use test-dd to test it
-# before then.
-
-test-dd:
- echo
- echo Testing installed dynamic shared library in $(DL).
- $(CC) -I$(DI) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
- ./pngtestd pngtest.png
-
-test-installed:
- echo
- echo Testing installed dynamic shared library.
- $(CC) $(CPPFLAGS) \
- `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
- -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
- -L$(ZLIBLIB) -R$(ZLIBLIB)
- ./pngtesti pngtest.png
-
-clean:
- $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
- libpng-config $(LIBSO) $(LIBSOMAJ)* \
- libpng.pc pnglibconf.h
-
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-
-pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.std b/scripts/makefile.std
index ee6a86835..6ce0a498a 100644
--- a/scripts/makefile.std
+++ b/scripts/makefile.std
@@ -1,4 +1,5 @@
# makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -6,21 +7,6 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# where make install puts libpng.a and png.h
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
@@ -28,30 +14,31 @@ ZLIBLIB=../zlib
ZLIBINC=../zlib
CC = cc
+CPP = $(CC) -E
+LD = $(CC)
AR_RC = ar rc
-MKDIR_P = mkdir
-LN_SF = ln -sf
RANLIB = ranlib
-CP = cp
+MKDIR_P = mkdir
+MV_F = mv -f
RM_F = rm -f
AWK = awk
-SED = sed
-CPP = $(CC) -E
-ECHO = echo
+NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
+ -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build
DFA_EXTRA = # extra files that can be used to control configuration
-CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
+CPPFLAGS = -I$(ZLIBINC) $(NOHWOPT) # -DPNG_DEBUG=5
CFLAGS = -O # -g
-LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm
+LDFLAGS = -L$(ZLIBLIB) # -g
+LIBS = -lz -lm
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
@@ -62,73 +49,56 @@ all: libpng.a pngtest
# copy this if the following doesn't work.
pnglibconf.h: pnglibconf.dfn
$(RM_F) $@ pnglibconf.c pnglibconf.out pnglibconf.tmp
- $(ECHO) '#include "pnglibconf.dfn"' >pnglibconf.c
- $(ECHO) "If '$(CC) -E' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
+ echo '#include "pnglibconf.dfn"' >pnglibconf.c
+ @echo "## If '$(CC) -E' fails, try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
$(CPP) $(DFNFLAGS) pnglibconf.c >pnglibconf.out
- $(AWK) -f "scripts/dfn.awk" out="pnglibconf.tmp" pnglibconf.out 1>&2
- mv pnglibconf.tmp $@
+ $(AWK) -f scripts/dfn.awk out=pnglibconf.tmp pnglibconf.out >&2
+ $(MV_F) pnglibconf.tmp $@
pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
$(RM_F) $@ pnglibconf.pre pnglibconf.tmp
- $(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2
- $(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2
- $(AWK) -f scripts/options.awk out="pnglibconf.pre"\
+ @echo "## Calling $(AWK) from scripts/pnglibconf.mak" >&2
+ @echo "## If 'awk' fails, try a better awk (e.g. AWK='nawk')" >&2
+ $(AWK) -f scripts/options.awk out=pnglibconf.pre\
version=search pngconf.h scripts/pnglibconf.dfa\
- pngusr.dfa $(DFA_XTRA) 1>&2
- $(AWK) -f scripts/options.awk out="pnglibconf.tmp" pnglibconf.pre 1>&2
- mv pnglibconf.tmp $@
+ pngusr.dfa $(DFA_XTRA) >&2
+ $(AWK) -f scripts/options.awk out=pnglibconf.tmp pnglibconf.pre >&2
+ $(MV_F) pnglibconf.tmp $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR_RC) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o libpng.a
- $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+ $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
test: pngtest
./pngtest
-install: libpng.a pnglibconf.h
- -@$(MKDIR_P) $(DESTDIR)$(INCPATH)
- -@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng
- -@$(MKDIR_P) $(DESTDIR)$(LIBPATH)
- -@$(RM_F) $(DESTDIR)$(INCPATH)/png.h
- -@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h
- -@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h
- cp png.h $(DESTDIR)$(INCPATH)/libpng
- cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
- cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
- (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
- cp libpng.a $(DESTDIR)$(LIBPATH)
- chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
clean:
- $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h pnglibconf.c \
- pnglibconf.out
-
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
+ $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
+ $(RM_F) pnglibconf.c pnglibconf.dfn pnglibconf.out pnglibconf.pre
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.sunos b/scripts/makefile.sunos
index efe308c47..675e8760f 100644
--- a/scripts/makefile.sunos
+++ b/scripts/makefile.sunos
@@ -1,4 +1,5 @@
# makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -6,51 +7,30 @@
# For conditions of distribution and use, see the disclaimer
# and license in png.h
-# where make install puts libpng.a and png.h
-prefix=/usr/local
-INCPATH=$(prefix)/include
-LIBPATH=$(prefix)/lib
-
-# override DESTDIR= on the make install command line to easily support
-# installing into a temporary location. Example:
-#
-# make install DESTDIR=/tmp/build/libpng
-#
-# If you're going to install into a temporary location
-# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
-# you execute make install.
-DESTDIR=
-
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=../zlib
ZLIBINC=../zlib
-
-WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow -Wconversion \
- -Wmissing-declarations -Wtraditional -Wcast-align \
- -Wstrict-prototypes -Wmissing-prototypes
-
CC=gcc
AR_RC=ar rc
-MKDIR_P=mkdir -p
-LN_SF=ln -f -s
RANLIB=ranlib
+MKDIR_P=mkdir -p
CP=cp
RM_F=/bin/rm -f
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-O # $(WARNMORE)
+CFLAGS=-O
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
- pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
- pngwtran.o pngmem.o pngerror.o pngpread.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
@@ -61,7 +41,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR_RC) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o libpng.a
@@ -70,46 +50,29 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
-install: libpng.a
- -@$(MKDIR_P) $(DESTDIR)$(INCPATH)
- -@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng
- -@$(MKDIR_P) $(DESTDIR)$(LIBPATH)
- -@$(RM_F) $(DESTDIR)$(INCPATH)/png.h
- -@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h
- -@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h
- cp png.h $(DESTDIR)$(INCPATH)/libpng
- cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
- cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
- chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
- (cd $(DESTDIR)$(INCPATH); $(LN_SF) libpng/* .)
- cp libpng.a $(DESTDIR)$(LIBPATH)
- chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
+install:
+ @echo "The $@ target is no longer supported by this makefile."
+ @false
clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
-DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
-writelock:
- chmod a-w *.[ch35] $(DOCS) scripts/*
-
# DO NOT DELETE THIS LINE -- make depend depends on it.
-png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
-pngtest.o: png.h pngconf.h pnglibconf.h
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.tc3 b/scripts/makefile.tc3
deleted file mode 100644
index 1d015026c..000000000
--- a/scripts/makefile.tc3
+++ /dev/null
@@ -1,100 +0,0 @@
-# Makefile for libpng
-# TurboC/C++ (Note: All modules are compiled in C mode)
-
-# To use, do "make -fmakefile.tc3"
-
-# ----- Turbo C++ 3.0 -----
-
-MODEL=l
-CPPFLAGS=-I..\zlib
-CFLAGS=-O2 -Z -m$(MODEL)
-CC=tcc
-LD=tcc
-LIB=tlib
-LDFLAGS=-m$(MODEL) -L..\zlib
-CP=copy
-
-# Pre-built configuration
-# See scripts\pnglibconf.mak for more options
-!ifndef PNGLIBCONF_H_PREBUILT
-PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
-!endif
-
-O=.obj
-E=.exe
-
-# variables
-OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O)
-OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O)
-OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
-OBJSL1 = +png$(O) +pngset$(O) +pngget$(O) +pngrutil$(O) +pngtrans$(O)
-OBJSL2 = +pngwutil$(O) +pngmem$(O) +pngpread$(O) +pngread$(O) +pngerror$(O)
-OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O) +pngwio$(O)
-
-all: libpng$(MODEL).lib pngtest$(E)
-
-pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
- $(CP) $(PNGLIBCONF_H_PREBUILT) $@
-
-pngtest: pngtest$(E)
-
-test: pngtest$(E)
- pngtest$(E)
-
-png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngtest$(O): png.h pngconf.h pnglibconf.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-
-libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3)
- $(LIB) libpng$(MODEL) +$(OBJSL1)
- $(LIB) libpng$(MODEL) +$(OBJSL2)
- $(LIB) libpng$(MODEL) +$(OBJSL3)
-
-pngtest$(E): pngtest$(O) libpng$(MODEL).lib
- $(LD) $(LDFLAGS) pngtest.obj libpng$(MODEL).lib zlib_$(MODEL).lib
-
-# End of makefile for libpng
diff --git a/scripts/makefile.msc b/scripts/makefile.vcwin-arm64
index 539d62e94..9795ba6b0 100644
--- a/scripts/makefile.msc
+++ b/scripts/makefile.vcwin-arm64
@@ -1,36 +1,46 @@
-# makefile for libpng
-# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
-# Copyright (C) 2006, 2009, 2014 Glenn Randers-Pehrson
+# makefile for libpng on win-arm64
+# Copyright (C) 2021 Gabor Kertesz
+# Copyright (C) 1998 Tim Wegner
+# Copyright (C) 2006,2009,2011,2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
#
# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib
+# To use, do "nmake /f scripts\makefile.vcwin-arm64"
-# -------- Microsoft C 5.1 and later, does not use assembler code --------
-MODEL=L
-CPPFLAGS=-I..\zlib
-CFLAGS=-Oait -Gs -nologo -W3 -A$(MODEL)
-#-Ox generates bad code with MSC 5.1
-CC=cl
-LD=link
-LDFLAGS=/e/st:0x1500/noe
-CP=copy
-O=.obj
+# -------- Microsoft Visual C++ 2.0 and later --------
+
+# Compiler, linker, librarian and other tools
+CC = cl
+LD = link
+AR = lib
+CPPFLAGS = -I..\zlib
+CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -DPNG_ARM_NEON_OPT=1 -MD -O2 -W3
+LDFLAGS = -nologo
+ARFLAGS = -nologo
+CP = copy
+RM = del
+
+# Uncomment next to put error messages in a file
+#ERRFILE= >> pngerrs.log
# Pre-built configuration
# See scripts\pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
-#uncomment next to put error messages in a file
-ERRFILE= >> pngerrs
+# File extensions
+O=.obj
-# variables
-OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O)
-OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O)
-OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
+# File lists
+OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O)
+OBJS2 = pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O)
+OBJS3 = pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
+OBJS4 = arm_init$(O) filter_neon_intrinsics$(O) palette_neon_intrinsics$(O)
+OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
+# Targets
all: libpng.lib
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
@@ -39,37 +49,37 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
@@ -81,20 +91,33 @@ pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngde
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3)
- del libpng.lib
- lib libpng $(OBJS1);
- lib libpng $(OBJS2);
- lib libpng $(OBJS3);
+arm_init$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) arm\$*.c $(ERRFILE)
+
+filter_neon_intrinsics$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) arm\$*.c $(ERRFILE)
+
+palette_neon_intrinsics$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) arm\$*.c $(ERRFILE)
+
+libpng.lib: $(OBJS)
+ -$(RM) $@
+ $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE)
+
+pngtest.exe: pngtest$(O) libpng.lib
+ $(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE)
pngtest$(O): png.h pngconf.h pnglibconf.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngtest.exe: pngtest.obj libpng.lib
- $(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ;
-
test: pngtest.exe
- pngtest
+ pngtest.exe
-# End of makefile for libpng
+clean:
+ -$(RM) *$(O)
+ -$(RM) libpng.lib
+ -$(RM) pnglibconf.h
+ -$(RM) pngtest.exe
+ -$(RM) pngout.png
+# End of makefile for libpng
diff --git a/scripts/makefile.vcwin32 b/scripts/makefile.vcwin32
index 2bd143cc0..ebc053da2 100644
--- a/scripts/makefile.vcwin32
+++ b/scripts/makefile.vcwin32
@@ -22,6 +22,9 @@ ARFLAGS = -nologo
CP = copy
RM = del
+# Uncomment next to put error messages in a file
+#ERRFILE= >> pngerrs.log
+
# Pre-built configuration
# See scripts\pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
@@ -29,10 +32,7 @@ PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
# File extensions
O=.obj
-#uncomment next to put error messages in a file
-#ERRFILE= >> pngerrs.log
-
-# Variables
+# File lists
OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O)
OBJS2 = pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O)
OBJS3 = pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
@@ -47,37 +47,37 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
@@ -93,14 +93,14 @@ libpng.lib: $(OBJS)
-$(RM) $@
$(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE)
-pngtest$(O): png.h pngconf.h pnglibconf.h
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
-
pngtest.exe: pngtest$(O) libpng.lib
$(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE)
+pngtest$(O): png.h pngconf.h pnglibconf.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
+
test: pngtest.exe
- pngtest
+ pngtest.exe
clean:
-$(RM) *$(O)
@@ -110,4 +110,3 @@ clean:
-$(RM) pngout.png
# End of makefile for libpng
-
diff --git a/scripts/options.awk b/scripts/options.awk
index 81b82ff09..284811967 100755
--- a/scripts/options.awk
+++ b/scripts/options.awk
@@ -1,8 +1,7 @@
#!/bin/awk -f
+
# scripts/options.awk - library build configuration control
#
-# last changed in libpng version 1.6.11 - June 5, 2014
-#
# Copyright (c) 1998-2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
@@ -40,7 +39,7 @@ BEGIN{
# the lines, for example by inserting spaces around operators, and all
# C preprocessors notice lines that start with '#', most remove comments.
# The technique adopted here is to make the final output lines into
- # C strings (enclosed in double quotes), preceeded by PNG_DFN. As a
+ # C strings (enclosed in double quotes), preceded by PNG_DFN. As a
# consequence the output cannot contain a 'raw' double quote - instead put
# @' in, this will be replaced by a single " afterward. See the parser
# script dfn.awk for more capabilities (not required here). Note that if
@@ -243,7 +242,7 @@ $1 == "file" && NF >= 2{
# option NAME ( (requires|enables|if) NAME* | on | off | disabled |
# sets SETTING VALUE+ )*
-#
+#
# Declares an option 'NAME' and describes its default setting (disabled)
# and its relationship to other options. The option is disabled
# unless *all* the options listed after 'requires' are set and at
@@ -336,7 +335,7 @@ $1 == "option" && NF >= 2{
# chunk NAME [requires OPT] [enables LIST] [on|off|disabled]
# Expands to the 'option' settings appropriate to the reading and
-# writing of an ancilliary PNG chunk 'NAME':
+# writing of an ancillary PNG chunk 'NAME':
#
# option READ_NAME requires READ_ANCILLARY_CHUNKS [READ_OPT]
# option READ_NAME enables NAME LIST
@@ -805,8 +804,8 @@ END{
print comment, "end of options", cend >out
# Do the 'setting' values second, the algorithm the standard
- # tree walk (O(1)) done in an O(2) while/for loop; interations
- # settings x depth, outputing the deepest required macros
+ # tree walk (O(1)) done in an O(2) while/for loop; iterations
+ # settings x depth, outputting the deepest required macros
# first.
print "" >out
print "/* SETTINGS */" >out
diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa
index 52c0c742e..003e0f2f0 100644
--- a/scripts/pnglibconf.dfa
+++ b/scripts/pnglibconf.dfa
@@ -8,7 +8,8 @@ com pnglibconf.h - library build configuration
com
version
com
-com Copyright (c) 1998-2017 Glenn Randers-Pehrson
+com Copyright (c) 2018-2023 Cosmin Truta
+com Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
com
com This code is released under the libpng license.
com For conditions of distribution and use, see the disclaimer
@@ -68,9 +69,9 @@ file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H
#
# 1) Create 'pngusr.h', enter the required private build information
# detailed below and #define PNG_NO_<option> for each option you
-# don't want in that file in that file. You can also turn on options
-# using PNG_<option>_SUPPORTED. When you have finished rerun
-# configure and rebuild pnglibconf.h file with -DPNG_USER_CONFIG:
+# don't want in that file. You can also turn on options using
+# PNG_<option>_SUPPORTED. When you have finished, rerun configure
+# and rebuild pnglibconf.h file with -DPNG_USER_CONFIG:
#
# make clean
# CPPFLAGS='-DPNG_USER_CONFIG' ./configure
@@ -189,7 +190,7 @@ setting USER_VERSIONINFO_LEGALTRADEMARKS
setting API_RULE default 0
-# This allows a prefix to be added to the front of every API functon name (and
+# This allows a prefix to be added to the front of every API function name (and
# therefore every symbol) by redefining all the function names with the prefix
# at the end of pnglibconf.h. It also turns on similar internal symbol renaming
# by causing a similar build-time only file, pngprefix.h, to be generated.
@@ -324,7 +325,7 @@ option WRITE_INT_FUNCTIONS disabled
# By default recoverable errors on write should just generate warnings,
# not generally safe because this allows the application to write invalid
# PNG files. Applications should enable this themselves; it's useful
-# because it means that a failure to write an ancilliary chunk can often be
+# because it means that a failure to write an ancillary chunk can often be
# ignored.
option WARNINGS
@@ -395,7 +396,7 @@ option IO_STATE
option USER_LIMITS requires READ
# The default settings given below for the limits mean that libpng will
-# limit the size of images or the size of data in ancilliary chunks to less
+# limit the size of images or the size of data in ancillary chunks to less
# than the specification or implementation limits. Settings have the
# following interpretations:
#
@@ -559,7 +560,7 @@ option WRITE_CUSTOMIZE_ZTXT_COMPRESSION requires WRITE
option WRITE_CUSTOMIZE_COMPRESSION requires WRITE
# Any chunks you are not interested in, you can undef here. The
-# ones that allocate memory may be expecially important (hIST,
+# ones that allocate memory may be especially important (hIST,
# tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
# a bit smaller.
@@ -715,7 +716,7 @@ setting sCAL_PRECISION default 5
setting ZBUF_SIZE default 8192
# This is the size of the decompression buffer used when counting or checking
-# the decompressed size of an LZ stream from a compressed ancilliary chunk; the
+# the decompressed size of an LZ stream from a compressed ancillary chunk; the
# decompressed data is never used so a different size may be optimal. This size
# was determined using contrib/libtests/timepng.c with compressed zTXt data
# around 11MByte in size. Slight speed improvements (up to about 14% in
diff --git a/scripts/pnglibconf.h.prebuilt b/scripts/pnglibconf.h.prebuilt
index 53b5e442c..c7033ae17 100644
--- a/scripts/pnglibconf.h.prebuilt
+++ b/scripts/pnglibconf.h.prebuilt
@@ -1,10 +1,9 @@
-/* libpng 1.6.34 STANDARD API DEFINITION */
-
/* pnglibconf.h - library build configuration */
-/* Libpng version 1.6.34 - September 29, 2017 */
+/* libpng version 1.6.40 */
-/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
+/* Copyright (c) 2018-2023 Cosmin Truta */
+/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
@@ -20,8 +19,6 @@
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
-/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
-/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
@@ -46,6 +43,8 @@
#define PNG_IO_STATE_SUPPORTED
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
+/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
+/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
#define PNG_READ_ALPHA_MODE_SUPPORTED
diff --git a/scripts/pnglibconf.mak b/scripts/pnglibconf.mak
index c125ca2c9..34a240e10 100755
--- a/scripts/pnglibconf.mak
+++ b/scripts/pnglibconf.mak
@@ -11,12 +11,12 @@ AWK = gawk
AWK = mawk
AWK = nawk
AWK = one-true-awk
-AWK = awk # Crashes on SunOS 5.10 - use 'nawk'
-CPP = $(CC) -E # On SUN OS 5.10 if this causes problems use /lib/cpp
+AWK = awk # This fails on SunOS 5.10; use 'nawk'
+CPP = $(CC) -E # If this fails on SunOS 5.10, use '/lib/cpp'
-MOVE = mv
+MOVE = mv -f
DELETE = rm -f
-ECHO = echo
+
DFA_XTRA = # Put your configuration file here, see scripts/pnglibconf.dfa. Eg:
# DFA_XTRA = pngusr.dfa
@@ -25,27 +25,27 @@ DFA_XTRA = # Put your configuration file here, see scripts/pnglibconf.dfa. Eg:
# as appropriate
DFNFLAGS = $(DEFS) $(CPPFLAGS) $(CFLAGS)
-# srcdir is a defacto standard for the location of the source
+# srcdir is a de-facto standard for the location of the source
srcdir = .
# The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt,
# copy this if the following doesn't work.
pnglibconf.h: pnglibconf.dfn
$(DELETE) $@ pnglibconf.c pnglibconf.out pnglibconf.tmp
- $(ECHO) '#include "pnglibconf.dfn"' >pnglibconf.c
- $(ECHO) "If '$(CC) -E' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
+ echo '#include "pnglibconf.dfn"' >pnglibconf.c
+ @echo "## If '$(CC) -E' fails, try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
$(CPP) $(DFNFLAGS) pnglibconf.c >pnglibconf.out
- $(AWK) -f "$(srcdir)/scripts/dfn.awk" out="pnglibconf.tmp" pnglibconf.out 1>&2
+ $(AWK) -f $(srcdir)/scripts/dfn.awk out=pnglibconf.tmp pnglibconf.out >&2
$(MOVE) pnglibconf.tmp $@
pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk $(srcdir)/pngconf.h $(srcdir)/pngusr.dfa $(DFA_XTRA)
$(DELETE) $@ pnglibconf.pre pnglibconf.tmp
- $(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2
- $(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2
- $(AWK) -f $(srcdir)/scripts/options.awk out="pnglibconf.pre"\
+ @echo "## Calling $(AWK) from scripts/pnglibconf.mak" >&2
+ @echo "## If 'awk' fails, try a better awk (e.g. AWK='nawk')" >&2
+ $(AWK) -f $(srcdir)/scripts/options.awk out=pnglibconf.pre\
version=search $(srcdir)/pngconf.h $(srcdir)/scripts/pnglibconf.dfa\
- $(srcdir)/pngusr.dfa $(DFA_XTRA) 1>&2
- $(AWK) -f $(srcdir)/scripts/options.awk out="pnglibconf.tmp" pnglibconf.pre 1>&2
+ $(srcdir)/pngusr.dfa $(DFA_XTRA) >&2
+ $(AWK) -f $(srcdir)/scripts/options.awk out=pnglibconf.tmp pnglibconf.pre >&2
$(MOVE) pnglibconf.tmp $@
clean-pnglibconf:
diff --git a/scripts/prefix.c b/scripts/prefix.c
index 8b604a091..06576ae6a 100644
--- a/scripts/prefix.c
+++ b/scripts/prefix.c
@@ -1,7 +1,6 @@
/* prefix.c - generate an unprefixed symbol list
*
- * Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2013-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
diff --git a/scripts/smakefile.ppc b/scripts/smakefile.ppc
index 2e7380b1f..2fa5b6510 100644
--- a/scripts/smakefile.ppc
+++ b/scripts/smakefile.ppc
@@ -19,9 +19,9 @@ LN = ppc-amigaos-ld
RM = delete quiet
MKDIR = makedir
-OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o pngread.o \
- pngerror.o pngpread.o pngwrite.o pngrtran.o pngwtran.o pngrio.o \
- pngwio.o pngmem.o
+OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
+ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
+ pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
all: $(LIBNAME) pngtest
diff --git a/scripts/sym.c b/scripts/sym.c
index ea9e4c507..7571de2b7 100644
--- a/scripts/sym.c
+++ b/scripts/sym.c
@@ -1,7 +1,6 @@
/* sym.c - define format of libpng.sym
*
- * Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2011-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
diff --git a/scripts/symbols.c b/scripts/symbols.c
index 28b841d8b..d51a8303c 100644
--- a/scripts/symbols.c
+++ b/scripts/symbols.c
@@ -1,7 +1,6 @@
/* symbols.c - find all exported symbols
*
- * Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2011-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
diff --git a/scripts/symbols.def b/scripts/symbols.def
index 519019014..82494bbf9 100644
--- a/scripts/symbols.def
+++ b/scripts/symbols.def
@@ -1,4 +1,3 @@
-;Version 1.6.34
;--------------------------------------------------------------
; LIBPNG symbol list as a Win32 DEF file
; Contains all the symbols that can be exported from libpng
diff --git a/scripts/vers.c b/scripts/vers.c
index de7319716..d74972643 100644
--- a/scripts/vers.c
+++ b/scripts/vers.c
@@ -1,7 +1,6 @@
/* vers.c - define format of libpng.vers
*
- * Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2011-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
diff --git a/test-driver b/test-driver
index 8e575b017..be73b80ad 100755
--- a/test-driver
+++ b/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -42,11 +42,13 @@ print_usage ()
{
cat <<END
Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--]
+ test-driver --test-name NAME --log-file PATH --trs-file PATH
+ [--expect-failure {yes|no}] [--color-tests {yes|no}]
+ [--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
END
}
@@ -103,8 +105,11 @@ trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
-# Test script is run here.
-"$@" >$log_file 2>&1
+# Test script is run here. We create the file first, then append to it,
+# to ameliorate tests themselves also writing to the log file. Our tests
+# don't, but others can (automake bug#35762).
+: >"$log_file"
+"$@" >>"$log_file" 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
@@ -126,7 +131,7 @@ esac
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
-echo "$res $test_name (exit status: $estatus)" >>$log_file
+echo "$res $test_name (exit status: $estatus)" >>"$log_file"
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
@@ -140,9 +145,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/tests/pngtest b/tests/pngtest
deleted file mode 100755
index 813973b23..000000000
--- a/tests/pngtest
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec ./pngtest --strict ${srcdir}/pngtest.png
diff --git a/tests/pngtest-badpngs b/tests/pngtest-all
index 77775232b..5e96451d3 100755
--- a/tests/pngtest-badpngs
+++ b/tests/pngtest-all
@@ -1,5 +1,9 @@
#!/bin/sh
+# normal execution
+
+./pngtest --strict ${srcdir}/pngtest.png
+
# various crashers
# using --relaxed because some come from fuzzers that don't maintain CRC's
@@ -9,5 +13,4 @@
./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/empty_ancillary_chunks.png
./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_*_chunk.png \
${srcdir}/contrib/testpngs/crashers/huge_*safe_to_copy.png
-
-exec ./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_IDAT.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_IDAT.png