diff --git a/.appveyor.yml b/.appveyor.yml index e07b932fc7..2db991877d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,8 @@ version: 1.6.x-{build} branches: except: - - /libpng[0-1][0-7]/ + - /master/ + - /v[0-9]+[.][0-9]+[.][0-9]+/ image: - Visual Studio 2022 @@ -47,6 +48,7 @@ install: - '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' + - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-ninja' before_build: - 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022' @@ -57,11 +59,11 @@ before_build: - 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0' - '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' + - 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang' + - 'if "%TOOLCHAIN%"=="msys2" set CI_CMAKE_GENERATOR=Ninja' + - 'if "%TOOLCHAIN%"=="msys2" set CI_CC=gcc' + - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set MSYSTEM=MINGW32' + - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set MSYSTEM=MINGW64' - 'set CI_CMAKE_BUILD_FLAGS=-j2' - 'set CI_CTEST_FLAGS=-j2' - 'set CI_MAKE_FLAGS=-j2' @@ -75,4 +77,5 @@ build_script: - '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 + - 'C:\tools\vcpkg\installed' + - 'C:\msys64\var\cache\pacman' diff --git a/.cmake-format.yaml b/.cmake-format.yaml new file mode 100644 index 0000000000..67c53d2db1 --- /dev/null +++ b/.cmake-format.yaml @@ -0,0 +1,94 @@ +# https://pypi.org/project/cmakelang +# https://github.com/cheshirekow/cmake_format + +# ---------------------- +# Options for formatting +# ---------------------- + +# How wide to allow formatted cmake files +# TODO: Reflow the CMake files to allow setting the maximum line width to 100. +line_width: 255 + +# How many spaces to tab for indent +tab_size: 2 + +# If true, lines are indented using tab characters (utf-8 0x09) instead of +# space characters (utf-8 0x20). In cases where the layout would +# require a fractional tab character, the behavior of the fractional +# indentation is governed by +use_tabchars: false + +# If is True, then the value of this variable indicates how +# fractional indentions are handled during whitespace replacement. If set to +# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set +# to `round-up` fractional indentation is replaced with a single tab character +# (utf-8 0x09) effectively shifting the column to the next tabstop +fractional_tab_policy: "use-space" + +# Enable comment markup parsing and reflow +enable_markup: false + +# ------------------- +# Options for linting +# ------------------- + +# Lint codes to disable +disabled_codes: [ + # TODO: + # Reconcile the CMake variable names with the patterns below, then + # re-enable the "invalid variable name XXX" messages. + "C0103", + + # TODO: + # Add brief COMMENT arguments to the `add_custom_target` commands. + "C0113", +] + +# Regular expression pattern describing valid function names +function_pattern: "[0-9a-z_]+" + +# Regular expression pattern describing valid macro names +macro_pattern: "[0-9A-Z_]+" + +# Regular expression pattern describing valid names for variables with global +# (cache) scope +global_var_pattern: "[A-Z][0-9A-Z_]+" + +# Regular expression pattern describing valid names for variables with global +# scope (but internal semantic) +internal_var_pattern: "_[A-Z][0-9A-Z_]+" + +# Regular expression pattern describing valid names for variables with local +# scope +local_var_pattern: "[a-z][a-z0-9_]+" + +# Regular expression pattern describing valid names for privatedirectory +# variables +private_var_pattern: "_[0-9a-z_]+" + +# Regular expression pattern describing valid names for public directory +# variables +public_var_pattern: "[A-Z][0-9A-Z_]+" + +# Regular expression pattern describing valid names for function/macro +# arguments and loop variables. +argument_var_pattern: "[a-z][a-z0-9_]+" + +# Regular expression pattern describing valid names for keywords used in +# functions or macros +keyword_pattern: "[A-Z][0-9A-Z_]+" + +# In the heuristic for C0201, how many conditionals to match within a loop in +# before considering the loop a parser +max_conditionals_custom_parser: 2 + +# Require at least this many newlines between statements; +# require no more than this many newlines between statements; +# etc. +min_statement_spacing: 1 +max_statement_spacing: 2 +max_returns: 6 +max_branches: 12 +max_arguments: 5 +max_localvars: 15 +max_statements: 50 diff --git a/.editorconfig b/.editorconfig index 34a145d4c4..4181a3796b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,32 +7,49 @@ charset = utf-8 insert_final_newline = true trim_trailing_whitespace = true -# Traditionally, the end-of-line character has been platform-specific. -end_of_line = unset +[*.txt] +indent_size = unset +indent_style = space [*.[chS]] +indent_size = 3 +indent_style = space +max_doc_length = 80 +max_line_length = 80 + +[*.dfa] +indent_size = 3 indent_style = space -max_line_length = 81 +max_doc_length = 80 +max_line_length = 80 -[*.{awk,cmake,dfa,in,sh}] +[*.awk] +indent_size = 3 indent_style = space +max_doc_length = 80 max_line_length = 100 -[*.txt] +[*.cmake] +indent_size = 2 indent_style = space -max_line_length = unset +max_doc_length = 80 +max_line_length = 100 -[{Makefile.in,ltmain.sh}] -indent_style = unset -insert_final_newline = unset -max_line_length = unset -trim_trailing_whitespace = unset +[*.sh] +indent_size = 4 +indent_style = space +max_doc_length = 100 +max_line_length = 100 -[*~] +[{Makefile.in,aclocal.m4,ltmain.sh}] +indent_size = unset indent_style = unset insert_final_newline = unset +max_doc_length = unset max_line_length = unset trim_trailing_whitespace = unset [COMMIT_EDITMSG] +indent_style = space +max_doc_length = unset max_line_length = 72 diff --git a/.editorconfig-checker.json b/.editorconfig-checker.json new file mode 100644 index 0000000000..70eb654b5c --- /dev/null +++ b/.editorconfig-checker.json @@ -0,0 +1,10 @@ +{ + "Disable": { + "Charset": true, + "IndentSize": true + }, + "Exclude": [ + ".git/", + "out/" + ] +} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..12318ea376 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,34 @@ +# Copyright (C) 2024 Cosmin Truta +# SPDX-License-Identifier: MIT-0 + +name: Linting libpng + +on: + push: + branches: + - libpng16 + - libpng18 + pull_request: + branches: + - libpng16 + - libpng18 + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Set up the cache + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pip.txt') }} + restore-keys: ${{ runner.os }}-pip- + - name: Install yamllint + run: pip install yamllint + - name: Install editorconfig-checker + uses: editorconfig-checker/action-editorconfig-checker@main + - name: Check out the code + uses: actions/checkout@v4 + - name: Run the linting script + run: bash ./ci/ci_lint.sh diff --git a/.github/workflows/verify-linux.yml b/.github/workflows/verify-linux.yml new file mode 100644 index 0000000000..da048f36bb --- /dev/null +++ b/.github/workflows/verify-linux.yml @@ -0,0 +1,35 @@ +# Copyright (C) 2025 Cosmin Truta +# SPDX-License-Identifier: MIT-0 + +name: Verifying libpng on Linux + +on: + push: + branches: + - libpng16 + - libpng18 + pull_request: + branches: + - libpng16 + - libpng18 + +jobs: + verify-linux: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Install dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends build-essential zlib1g-dev + if [[ "${{ github.ref }}" != refs/*/libpng16 && "${{ github.base_ref }}" != libpng16 ]] + then + sudo apt-get install -y --no-install-recommends autoconf automake libtool m4 + fi + - name: Check out the code + uses: actions/checkout@v4 + - name: Run the configure verification script + run: bash ./ci/ci_verify_configure.sh + env: + CI_MAKE_FLAGS: -j2 + CI_SANITIZERS: address,undefined diff --git a/.github/workflows/verify-macos.yml b/.github/workflows/verify-macos.yml new file mode 100644 index 0000000000..d61174f7f8 --- /dev/null +++ b/.github/workflows/verify-macos.yml @@ -0,0 +1,28 @@ +# Copyright (C) 2025 Cosmin Truta +# SPDX-License-Identifier: MIT-0 + +name: Verifying libpng on macOS + +on: + push: + branches: + - libpng16 + - libpng18 + pull_request: + branches: + - libpng16 + - libpng18 + +jobs: + verify-macos: + runs-on: macos-latest + timeout-minutes: 10 + steps: + - name: Check out the code + uses: actions/checkout@v4 + - name: Run the CMake verification script + run: bash ./ci/ci_verify_cmake.sh + env: + CI_CMAKE_GENERATOR: Xcode + CI_CMAKE_BUILD_FLAGS: -j2 + CI_CTEST_FLAGS: -j2 diff --git a/.github/workflows/verify-windows.yml b/.github/workflows/verify-windows.yml new file mode 100644 index 0000000000..5f9bd338ed --- /dev/null +++ b/.github/workflows/verify-windows.yml @@ -0,0 +1,51 @@ +# Copyright (C) 2025 Cosmin Truta +# SPDX-License-Identifier: MIT-0 + +name: Verifying libpng on Windows + +on: + push: + branches: + - libpng16 + - libpng18 + pull_request: + branches: + - libpng16 + - libpng18 + +jobs: + verify-windows: + strategy: + matrix: + include: + - os: windows-2025 + vcpkg_triplet: x64-windows + cmake_generator: Visual Studio 18 2026 + cmake_generator_platform: x64 + - os: windows-11-arm + vcpkg_triplet: arm64-windows + cmake_generator: Visual Studio 17 2022 + cmake_generator_platform: ARM64 + runs-on: ${{ matrix.os }} + timeout-minutes: 10 + steps: + - name: Set up vcpkg cache + uses: actions/cache@v4 + with: + path: C:/vcpkg/installed + key: ${{ runner.os }}-vcpkg-${{ matrix.vcpkg_triplet }}-${{ hashFiles('vcpkg.json', '**/vcpkg.json') }} + restore-keys: ${{ runner.os }}-vcpkg-${{ matrix.vcpkg_triplet }}- + - name: Install dependencies + run: | + vcpkg install zlib:${{ matrix.vcpkg_triplet }} + vcpkg integrate install + - name: Check out the code + uses: actions/checkout@v4 + - name: Run the CMake verification script + run: bash ./ci/ci_verify_cmake.sh + env: + CI_CMAKE_GENERATOR: ${{ matrix.cmake_generator }} + CI_CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }} + CI_CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake + CI_CMAKE_BUILD_FLAGS: -j2 + CI_CTEST_FLAGS: -j2 diff --git a/.gitignore b/.gitignore index 52e789d2b1..5eccb4e4cb 100644 --- a/.gitignore +++ b/.gitignore @@ -31,31 +31,109 @@ # Compiled executables *.app/ *.exe +a.out # Debug files *.dSYM/ +*.dmp *.idb *.pdb *.su +*.sym +*.tds +core +core.[0-9]* +!core/ -# Libpng configuration and build artifacts +# Tag files +TAGS +.TAGS +!TAGS/ +tags +.tags +!tags/ +gtags.files +GTAGS +GRTAGS +GPATH +GSYMS +cscope.files +cscope.out +cscope.*.out + +# Text editing and text processing artifacts +\#*\# +.\#* +[._]*.sw[a-p] +[._]sw[a-p] +*.bak +*.orig +*.rej +*.tmp +*~ + +# IDE files and directories +## Eclipse +.cproject/ +.project/ +.settings/ +## Embarcadero RAD Studio +*.cbproj.* +__recovery/ +## JetBrains +.idea/ +## NetBeans +nbbuild/ +nbdist/ +nbproject/ +## Visual Studio 2015 and newer +.vs/ +## Visual Studio Code +.vscode/* +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/settings.json +!.vscode/tasks.json +## Xcode 9 and newer +xcuserdata/ +## (Various) +*.*cache +*.cache* +[._]*_history +.history/ +[Bb]ackup*/ +CMakeLists.txt.user* +CMakeUserPresets.json + +# Local files created or used by coding agents +*.local +*.local.* + +# Build, test and CI output directories +[._]build*/ +/[Bb]uild/ +/[Oo]ut/ +*[Dd]ebug/ +[Dd]ebug*/ +*[Rr]elease/ +[Rr]elease*/ + +# Libpng configuration and auxiliary build artifacts *.out -.deps/ +*out.png +[._]deps/ +[._]libs/ .dirstamp /Makefile /autom4te.cache/ -/config.guess~ -/config.h.in~ +/config*~ +/config.h /config.log /config.status -/config.sub~ -/configure~ -/install-sh~ -/libpng-config -/libpng.pc +/install*~ +/libpng*-config +/libpng*.pc /libpng.vers -/libpng16-config -/libpng16.pc /libtool /stamp-h1 pnglibconf.[ch] @@ -63,17 +141,17 @@ pnglibconf.dfn pnglibconf.pre pngprefix.h -# Libpng test artifacts -png-fix-itxt -pngcp -pngfix -pngimage -pngstest -pngtest -pngunknown -pngvalid -timepng -pngout.png - -# Libpng CI artifacts -out/ +# Libpng test programs, scripts and artifacts +/test-suite.log +/tests/*.log +/tests/*.trs +/png-fix-itxt +/pngcp +/pngfix +/pnggetset +/pngimage +/pngstest +/pngtest +/pngunknown +/pngvalid +/timepng diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000000..5072a31792 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,25 @@ +# Markdownlint configuration +# See https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md + +# MD004 +ul-style: + style: sublist + +# MD007 +ul-indent: + start_indented: true + start_indent: 1 + indent: 3 + +# MD012 +no-multiple-blanks: + maximum: 2 + +# MD024 +no-duplicate-heading: false + +# MD025 +single-title: false + +# MD028 +no-blanks-blockquote: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab3fba6d64..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -branches: - except: - - /libpng[0-1][0-7]/ - -language: c - -os: - - freebsd - - linux - - osx - -env: - - AUTOMATION=cmake CI_CMAKE_VARS="-DPNG_HARDWARE_OPTIMIZATIONS=ON" - - AUTOMATION=cmake CI_CMAKE_VARS="-DPNG_HARDWARE_OPTIMIZATIONS=OFF" - - AUTOMATION=configure CI_CONFIGURE_FLAGS="--enable-hardware-optimizations" - - AUTOMATION=configure CI_CONFIGURE_FLAGS="--disable-hardware-optimizations" - - AUTOMATION=makefiles - -matrix: - include: - - os: osx - env: AUTOMATION=cmake CI_CMAKE_GENERATOR=Xcode - -before_script: - - 'if test "$TRAVIS_OS_NAME" = "linux"; then export CI_CC="gcc"; else export CI_CC="clang"; fi' - - 'if test "$TRAVIS_OS_NAME" != "osx"; then export CI_SANITIZERS="address,undefined"; fi' - - 'export CI_MAKEFILES="scripts/makefile.$CI_CC scripts/makefile.std"' - - 'export CI_MAKE_FLAGS=-j2' - - 'export CI_CMAKE_BUILD_FLAGS=-j2' - - 'export CI_CTEST_FLAGS=-j2' - -script: - - './ci/ci_verify_$AUTOMATION.sh' diff --git a/.yamllint.yml b/.yamllint.yml index 3829416280..9b7af5f2c3 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -3,3 +3,5 @@ rules: document-start: disable document-end: disable line-length: disable + truthy: + check-keys: false diff --git a/ANNOUNCE b/ANNOUNCE index 2e749c307a..8d7116ea20 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -libpng 1.6.43.git +libpng 1.6.59.git ================= This is a development version, not intended to be a public release. @@ -6,8 +6,8 @@ It will be replaced by a public release, or by another development version, at a later time. -libpng 1.6.42 - January 29, 2024 -================================ +libpng 1.6.58 - April 15, 2026 +============================== This is a public release of libpng, intended for use in production code. @@ -15,15 +15,12 @@ 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): +Source files: - * libpng-1.6.42.tar.xz (LZMA-compressed, recommended) - * libpng-1.6.42.tar.gz (deflate-compressed) - -Source files with CRLF line endings (for Windows): - - * lpng1642.7z (LZMA-compressed, recommended) - * lpng1642.zip (deflate-compressed) + * libpng-1.6.58.tar.xz (LZMA-compressed, recommended) + * libpng-1.6.58.tar.gz (deflate-compressed) + * lpng1658.7z (LZMA-compressed) + * lpng1658.zip (deflate-compressed) Other information: @@ -33,50 +30,16 @@ Other information: * TRADEMARK.md -Changes from version 1.6.41 to version 1.6.42 ---------------------------------------------- - - * Fixed the implementation of the macro function `png_check_sig`. - This was an API regression, introduced in libpng-1.6.41. - (Reported by Matthieu Darbois) - - -Changes from version 1.6.40 to version 1.6.41 +Changes from version 1.6.57 to version 1.6.58 --------------------------------------------- - * Added SIMD-optimized code for the Loongarch LSX hardware. - (Contributed by GuXiWei, JinBo and ZhangLixia) - * Fixed the run-time discovery of MIPS MSA hardware. - (Contributed by Sui Jingfeng) - * Fixed an off-by-one error in the function `png_do_check_palette_indexes`, - which failed to recognize errors that might have existed in the first - column of a broken palette-encoded image. This was a benign regression - accidentally introduced in libpng-1.6.33. No pixel was harmed. - (Contributed by Adam Richter; reviewed by John Bowler) - * Fixed, improved and modernized the contrib/pngminus programs, i.e., - png2pnm.c and pnm2png.c - * Removed old and peculiar portability hacks that were meant to silence - warnings issued by gcc version 7.1 alone. - (Contributed by John Bowler) - * Fixed and modernized the CMake file, and raised the minimum required - CMake version from 3.1 to 3.6. - (Contributed by Clinton Ingram, Timothy Lyanguzov, Tyler Kropp, et al.) - * Allowed the configure script to disable the building of auxiliary tools - and tests, thus catching up with the CMake file. - (Contributed by Carlo Bramini) - * Fixed a build issue on Mac. - (Contributed by Zixu Wang) - * Moved the Autoconf macro files to scripts/autoconf. - * Moved the CMake files (except for the main CMakeLists.txt) to - scripts/cmake and moved the list of their contributing authors to - scripts/cmake/AUTHORS.md - * Updated the CI configurations and scripts. - * Relicensed the CI scripts to the MIT License. - * Improved the test coverage. - (Contributed by John Bowler) + * Fixed a regression introduced in version 1.6.56 that caused `png_get_PLTE` + to return stale palette data after applying gamma and background transforms + in-place. + (Reported by ralfjunker .) 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 index 544341694a..0aaba0c69e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,7 +5,9 @@ This is the list of PNG Reference Library ("libpng") Contributing Authors, for copyright and licensing purposes. * Adam Richter + * Alexander Smorkalov * Andreas Dilger + * Anthony Hurtado * Chris Blume * Cosmin Truta * Dave Martindale @@ -14,33 +16,43 @@ Authors, for copyright and licensing purposes. * Glenn Randers-Pehrson * Greg Roelofs * Guy Eric Schalnat + * Halil Oktay * James Yu * John Bowler + * Joshua Inscoe * Kevin Bracey + * Lucas Chollet * Magnus Holmgren * Mandar Sahastrabuddhe + * Manfred Schlaegl * Mans Rullgard * Matt Sarett * Mike Klein + * Mohammad Seet * Pascal Massimino * Paul Schmidt + * Petr Simecek * Philippe Antoine * Qiang Zhou * Sam Bushell * Samuel Williams * Simon-Pierre Cadieux + * Taegu Ha (하태구) * Tim Wegner + * Tobias Stoeckmann * Tom Lane * Tom Tanner * Vadim Barkov * Willem van Schaik + * Yuelin Wang (王跃林) * Zhijie Liang * Apple Inc. - Zixu Wang (王子旭) * Arm Holdings - Richard Townsend - * Google Inc. + * Google LLC - Dan Field + - Dragoș Tiselice - Leon Scroggins III - Matt Sarett - Mike Klein @@ -50,6 +62,10 @@ Authors, for copyright and licensing purposes. - GuXiWei (顾希伟) - JinBo (金波) - ZhangLixia (张利霞) + * Samsung Group + - Filip Wasil + * SpacemiT Hangzhou Technology, Co. + - Liang Junzhao (梁俊钊) The build projects, the build scripts, the test scripts, and other files in the "projects", "scripts" and "tests" directories, have diff --git a/CHANGES b/CHANGES index 478b63a9dd..b4afd0533c 100644 --- a/CHANGES +++ b/CHANGES @@ -5988,7 +5988,7 @@ Version 1.6.32rc01 [August 18, 2017] Version 1.6.32rc02 [August 22, 2017] Added contrib/oss-fuzz directory which contains files used by the oss-fuzz - project (https://github.com/google/oss-fuzz/tree/master/projects/libpng). + project . Version 1.6.32 [August 24, 2017] No changes. @@ -6130,7 +6130,7 @@ Version 1.6.40 [June 21, 2023] Cleaned up the code, the build scripts, and the documentation. Version 1.6.41 [January 24, 2024] - Added SIMD-optimized code for the Loongarch LSX hardware. + Added SIMD-optimized code for the LoongArch LSX hardware. (Contributed by GuXiWei, JinBo and ZhangLixia) Fixed the run-time discovery of MIPS MSA hardware. (Contributed by Sui Jingfeng) @@ -6167,9 +6167,227 @@ Version 1.6.42 [January 29, 2024] (Reported by Matthieu Darbois) Fixed and updated the libpng manual. -Version 1.6.43 [TODO] +Version 1.6.43 [February 23, 2024] + Fixed the row width check in png_check_IHDR(). + This corrected a bug that was specific to the 16-bit platforms, + and removed a spurious compiler warning from the 64-bit builds. + (Reported by Jacek Caban; fixed by John Bowler) + Added eXIf chunk support to the push-mode reader in pngpread.c. + (Contributed by Chris Blume) + Added contrib/pngexif for the benefit of the users who would like + to inspect the content of eXIf chunks. + Added contrib/conftest/basic.dfa, a basic build-time configuration. + (Contributed by John Bowler) + Fixed a preprocessor condition in pngread.c that broke build-time + configurations like contrib/conftest/pngcp.dfa. + (Contributed by John Bowler) + Added CMake build support for LoongArch LSX. + (Contributed by GuXiWei) + Fixed a CMake build error that occurred under a peculiar state of the + dependency tree. This was a regression introduced in libpng-1.6.41. + (Contributed by Dan Rosser) + Marked the installed libpng headers as system headers in CMake. + (Contributed by Benjamin Buch) + Updated the build support for RISCOS. + (Contributed by Cameron Cawley) + Updated the makefiles to allow cross-platform builds to initialize + conventional make variables like AR and ARFLAGS. + Added various improvements to the CI scripts in areas like version + consistency verification and text linting. + Added version consistency verification to pngtest.c also. + +Version 1.6.44 [September 12, 2024] + Hardened calculations in chroma handling to prevent overflows, and + relaxed a constraint in cHRM validation to accomodate the standard + ACES AP1 set of color primaries. + (Contributed by John Bowler) + Removed the ASM implementation of ARM Neon optimizations and updated + the build accordingly. Only the remaining C implementation shall be + used from now on, thus ensuring the support of the PAC/BTI security + features on ARM64. + (Contributed by Ross Burton and John Bowler) + Fixed the pickup of the PNG_HARDWARE_OPTIMIZATIONS option in the + CMake build on FreeBSD/amd64. This is an important performance fix + on this platform. + Applied various fixes and improvements to the CMake build. + (Contributed by Eric Riff, Benjamin Buch and Erik Scholz) + Added fuzzing targets for the simplified read API. + (Contributed by Mikhail Khachayants) + Fixed a build error involving pngtest.c under a custom config. + This was a regression introduced in a code cleanup in libpng-1.6.43. + (Contributed by Ben Wagner) + Fixed and improved the config files for AppVeyor CI and Travis CI. + +Version 1.6.45 [January 7, 2025] + Added support for the cICP chunk. + (Contributed by Lucas Chollet and John Bowler) + Adjusted and improved various checks in colorspace calculations. + (Contributed by John Bowler) + Rearranged the write order of colorspace chunks for better conformance + with the PNG v3 draft specification. + (Contributed by John Bowler) + Raised the minimum required CMake version from 3.6 to 3.14. + Forked off a development branch for libpng version 1.8. + +Version 1.6.46 [January 23, 2025] + Added support for the mDCV and cLLI chunks. + (Contributed by John Bowler) + Fixed a build issue affecting C89 compilers. + This was a regression introduced in libpng-1.6.45. + (Contributed by John Bowler) + Added makefile.c89, specifically for testing C89 compilers. + Cleaned up contrib/pngminus: corrected an old typo, removed an old + workaround, and updated the CMake file. + +Version 1.6.47 [February 18, 2025] + Modified the behaviour of colorspace chunks in order to adhere + to the new precedence rules formulated in the latest draft of + the PNG Specification. + (Contributed by John Bowler) + Fixed a latent bug in `png_write_iCCP`. + This would have been a read-beyond-end-of-malloc vulnerability, + introduced early in the libpng-1.6.0 development, yet (fortunately!) + it was inaccessible before the above-mentioned modification of the + colorspace precedence rules, due to pre-existing colorspace checks. + (Reported by Bob Friesenhahn; fixed by John Bowler) + +Version 1.6.48 [April 30, 2025] + Fixed the floating-point version of the mDCv setter `png_set_mDCv`. + (Reported by Mohit Bakshi; fixed by John Bowler) + Added #error directives to discourage the inclusion of private + libpng implementation header files in PNG-supporting applications. + Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an + alternative to `DFA_XTRA`. + Removed the Travis CI configuration files, with heartfelt thanks for + their generous support of our project over the past five years! + +Version 1.6.49 [June 12, 2025] + Added SIMD-optimized code for the RISC-V Vector Extension (RVV). + (Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil) + Added various fixes and improvements to the build scripts and to + the sample code. + +Version 1.6.50 [July 1, 2025] + Improved the detection of the RVV Extension on the RISC-V platform. + (Contributed by Filip Wasil) + Replaced inline ASM with C intrinsics in the RVV code. + (Contributed by Filip Wasil) + Fixed a decoder defect in which unknown chunks trailing IDAT, set + to go through the unknown chunk handler, incorrectly triggered + out-of-place IEND errors. + (Contributed by John Bowler) + Fixed the CMake file for cross-platform builds that require `libm`. + +Version 1.6.51 [November 21, 2025] + Fixed CVE-2025-64505 (moderate severity): + Heap buffer overflow in `png_do_quantize` via malformed palette index. + (Reported by Samsung; analyzed by Fabio Gritti.) + Fixed CVE-2025-64506 (moderate severity): + Heap buffer over-read in `png_write_image_8bit` with 8-bit input and + `convert_to_8bit` enabled. + (Reported by Samsung and ; + analyzed by Fabio Gritti.) + Fixed CVE-2025-64720 (high severity): + Buffer overflow in `png_image_read_composite` via incorrect palette + premultiplication. + (Reported by Samsung; analyzed by John Bowler.) + Fixed CVE-2025-65018 (high severity): + Heap buffer overflow in `png_combine_row` triggered via + `png_image_finish_read`. + (Reported by .) + Fixed a memory leak in `png_set_quantize`. + (Reported by Samsung; analyzed by Fabio Gritti.) + Removed the experimental and incomplete ERROR_NUMBERS code. + (Contributed by Tobias Stoeckmann.) + Improved the RISC-V vector extension support; required RVV 1.0 or newer. + (Contributed by Filip Wasil.) + Added GitHub Actions workflows for automated testing. + Performed various refactorings and cleanups. + +Version 1.6.52 [December 3, 2025] + Fixed CVE-2025-66293 (high severity): + Out-of-bounds read in `png_image_read_composite`. + (Reported by flyfish101 .) + Fixed the Paeth filter handling in the RISC-V RVV implementation. + (Reported by Filip Wasil; fixed by Liang Junzhao.) + Improved the performance of the RISC-V RVV implementation. + (Contributed by Liang Junzhao.) + Added allocation failure fuzzing to oss-fuzz. + (Contributed by Philippe Antoine.) + +Version 1.6.53 [December 5, 2025] + Fixed a build failure on RISC-V RVV caused by a misspelled intrinsic. + (Contributed by Alexander Smorkalov.) + Fixed a build failure with CMake 4.1 or newer, on Windows, when using + Visual C++ without MASM installed. + +Version 1.6.54 [January 12, 2026] + Fixed CVE-2026-22695 (medium severity): + Heap buffer over-read in `png_image_read_direct_scaled`. + (Reported and fixed by Petr Simecek.) + Fixed CVE-2026-22801 (medium severity): + Integer truncation causing heap buffer over-read in `png_image_write_*`. + Implemented various improvements in oss-fuzz. + (Contributed by Philippe Antoine.) + +Version 1.6.55 [February 9, 2026] + Fixed CVE-2026-25646 (high severity): + Heap buffer overflow in `png_set_quantize`. + (Reported and fixed by Joshua Inscoe.) + Resolved an oss-fuzz build issue involving nalloc. + (Contributed by Philippe Antoine.) + +Version 1.6.56 [March 25, 2026] + Fixed CVE-2026-33416 (high severity): + Use-after-free via pointer aliasing in `png_set_tRNS` and `png_set_PLTE`. + (Reported by Halil Oktay and Ryo Shimada; + fixed by Halil Oktay and Cosmin Truta.) + Fixed CVE-2026-33636 (high severity): + Out-of-bounds read/write in the palette expansion on ARM Neon. + (Reported by Taegu Ha; fixed by Taegu Ha and Cosmin Truta.) + Fixed uninitialized reads beyond `num_trans` in `trans_alpha` buffers. + (Contributed by Halil Oktay.) + Fixed stale `info_ptr->palette` after in-place gamma and background + transforms. + Fixed wrong channel indices in `png_image_read_and_map` RGB_ALPHA path. + (Contributed by Yuelin Wang.) + Fixed wrong background color in colormap read. + (Contributed by Yuelin Wang.) + Fixed dead loop in sPLT write. + (Contributed by Yuelin Wang.) + Added missing null pointer checks in four public API functions. + (Contributed by Yuelin Wang.) + Validated shift bit depths in `png_set_shift` to prevent infinite loop. + (Contributed by Yuelin Wang.) + Avoided undefined behavior in library and tests. + Deprecated the hardly-ever-tested POINTER_INDEXING config option. + Added negative-stride test coverage for the simplified API. + Fixed memory leaks and API misuse in oss-fuzz. + (Contributed by Owen Sanzas.) + Implemented various fixes and improvements in oss-fuzz. + (Contributed by Bob Friesenhahn and Philippe Antoine.) + Performed various refactorings and cleanups. + +Version 1.6.57 [April 8, 2026] + Fixed CVE-2026-34757 (medium severity): + Use-after-free in `png_set_PLTE`, `png_set_tRNS` and `png_set_hIST` + leading to corrupted chunk data and potential heap information disclosure. + Also hardened the append-style setters (`png_set_text`, `png_set_sPLT`, + `png_set_unknown_chunks`) against a theoretical variant of the same + aliasing pattern. + (Reported by Iv4n .) + Fixed integer overflow in rowbytes computation in read transforms. + (Contributed by Mohammad Seet.) + +Version 1.6.58 [April 15, 2026] + Fixed a regression introduced in version 1.6.56 that caused `png_get_PLTE` + to return stale palette data after applying gamma and background transforms + in-place. + (Reported by ralfjunker .) + +Version 1.6.59 [TODO] 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/CMakeLists.txt b/CMakeLists.txt index 9cf62ba836..020489e86e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,8 @@ - # CMakeLists.txt - CMake lists for libpng # -# Copyright (c) 2018-2024 Cosmin Truta. -# Copyright (c) 2007-2018 Glenn Randers-Pehrson. -# Originally written by Christian Ehrlicher, 2007. +# Copyright (c) 2018-2026 Cosmin Truta +# Copyright (c) 2007-2018 Glenn Randers-Pehrson +# Originally written by Christian Ehrlicher, 2007 # # Use, modification and distribution are subject to # the same licensing terms and conditions as libpng. @@ -15,11 +14,11 @@ # # SPDX-License-Identifier: libpng-2.0 -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.14...4.4) set(PNGLIB_MAJOR 1) set(PNGLIB_MINOR 6) -set(PNGLIB_REVISION 43) +set(PNGLIB_REVISION 59) #set(PNGLIB_SUBREVISION 0) set(PNGLIB_SUBREVISION "git") set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION}) @@ -28,448 +27,475 @@ set(PNGLIB_SHARED_VERSION ${PNGLIB_ABI_VERSION}.${PNGLIB_REVISION}.${PNGLIB_SUBR project(libpng VERSION ${PNGLIB_VERSION} - LANGUAGES C ASM) - -if(POLICY CMP0074) - # Allow find_package() to use the ZLIB_ROOT variable, if available. - cmake_policy(SET CMP0074 NEW) -endif() + LANGUAGES C) include(CheckCSourceCompiles) +include(CheckLibraryExists) include(GNUInstallDirs) # 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 "" +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" +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") +# Those settings can be either passed via DFA_XTRA if they are in DFA form +# (such as "pngusr.dfa"), or via PNG_LIBCONF_HEADER if they are in prebuilt +# header file form (such as "scripts/pnglibconf.h.prebuilt"), but not both. +# For platforms such as Android or iOS, or in certain cross-platform build +# scenarios, having a valid PNG_LIBCONF_HEADER is mandatory. +set(DFA_XTRA + "" + CACHE FILEPATH "DFA file containing customized build configuration settings for libpng") +set(PNG_LIBCONF_HEADER + "" + CACHE FILEPATH "C header file containing customized build configuration settings for libpng") +set(PNG_LIBCONF_HEADER_PREBUILT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt") +if(ANDROID OR IOS) + set(PNG_LIBCONF_HEADER "${PNG_LIBCONF_HEADER_PREBUILT}") +endif() +if((NOT DFA_XTRA STREQUAL "") AND (NOT PNG_LIBCONF_HEADER STREQUAL "")) + message(SEND_ERROR "The options DFA_XTRA=\"${DFA_XTRA}\" " + "and PNG_LIBCONF_HEADER=\"${PNG_LIBCONF_HEADER}\" " + "are mutually exclusive") +endif() # Allow the users to switch on/off various library build types. option(PNG_SHARED "Build libpng as a shared library" ON) option(PNG_STATIC "Build libpng as a static library" ON) if(APPLE) option(PNG_FRAMEWORK "Build libpng as a framework bundle" ON) +else() + option(PNG_FRAMEWORK "Build libpng as a framework bundle (not available on this platform)" OFF) +endif() +if(NOT APPLE AND PNG_FRAMEWORK) + message(SEND_ERROR "The option PNG_FRAMEWORK should not be set on this platform") endif() # Allow the users to switch on/off the auxiliary build and test artifacts. -# NOTE: These artifacts are NOT part of libpng proper, and are subject to change at any time. +# These artifacts are NOT part of libpng proper, and are subject to change +# at any time. option(PNG_TESTS "Build the libpng tests" ON) -option(PNG_TOOLS "Build the libpng tools" ON) + +# Same as above, but for the third-party tools. +# Although these tools are targeted at development environments only, +# the users are allowed to override the option to build by default. +if(ANDROID OR IOS) + option(PNG_TOOLS "Build the libpng tools" OFF) +else() + option(PNG_TOOLS "Build the libpng tools" ON) +endif() # Maintain backwards compatibility with the deprecated option PNG_EXECUTABLES. option(PNG_EXECUTABLES "[Deprecated; please use PNG_TOOLS]" ON) if(NOT PNG_EXECUTABLES) message(DEPRECATION "The option PNG_EXECUTABLES has been deprecated in favour of PNG_TOOLS") if(PNG_TOOLS) - message(AUTHOR_WARNING - "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, to stay compatible with PNG_EXECUTABLES") + message(AUTHOR_WARNING "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, " + "to stay compatible with PNG_EXECUTABLES") set(PNG_TOOLS "${PNG_EXECUTABLES}") endif() endif() -# Allow the users to configure various compilation options. -option(PNG_DEBUG "Enable debug output" OFF) +# Allow the users to switch on/off the use of hardware (SIMD) optimized code. option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" ON) +# Initialize and show the target architecture variable PNG_TARGET_ARCHITECTURE. +# +# NOTE: +# On macOS, CMake sets CMAKE_SYSTEM_PROCESSOR to either "x86_64" or "arm64", +# 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) + string(TOLOWER "${CMAKE_OSX_ARCHITECTURES}" PNG_TARGET_ARCHITECTURE) +else() + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" PNG_TARGET_ARCHITECTURE) +endif() +message(STATUS "Building for target architecture: ${PNG_TARGET_ARCHITECTURE}") + # Allow the users to specify a custom location of zlib. -# This option is deprecated, and no longer needed with CMake 3.12 and newer. -# Under the CMake policy CMP0074, if zlib is being built alongside libpng as a -# subproject, its location can be passed on to CMake via the ZLIB_ROOT variable. -option(PNG_BUILD_ZLIB "Custom zlib location, else find_package is used" OFF) -if(NOT PNG_BUILD_ZLIB) - find_package(ZLIB REQUIRED) -elseif(POLICY CMP0074) - # TODO: Remove the policy check if CMake version 3.12 or greater becomes the minimum required. +# With CMake 3.12 and newer, this option is no longer necessary. +option(PNG_BUILD_ZLIB "[Deprecated; please use ZLIB_ROOT]" OFF) +if(PNG_BUILD_ZLIB) if("x${ZLIB_ROOT}" STREQUAL "x") - message(DEPRECATION - "The option PNG_BUILD_ZLIB has been deprecated; please use ZLIB_ROOT instead") + message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; " + "please use ZLIB_ROOT instead") else() - message(SEND_ERROR - "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} and " - "the variable ZLIB_ROOT=\"${ZLIB_ROOT}\" are mutually exclusive") + message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; " + "using ZLIB_ROOT=\"${ZLIB_ROOT}\"") endif() endif() -if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU AND NOT EMSCRIPTEN) - find_library(M_LIBRARY m) - if(M_LIBRARY) - set(M_LIBRARY m) - else() - set(M_LIBRARY "") - endif() -else() - # libm is not available or not needed. +# Find the zlib library. +find_package(ZLIB REQUIRED) +set(PNG_LINK_LIBRARIES ZLIB::ZLIB) + +# Find the math library (unless we already know it's not available or +# not needed). +if(UNIX AND NOT (APPLE OR BEOS OR HAIKU OR EMSCRIPTEN)) + check_library_exists(m pow "" PNG_HAVE_LIBM_POW) +endif() +if(PNG_HAVE_LIBM_POW) + list(APPEND PNG_LINK_LIBRARIES m) endif() -# 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}) +# Silence function deprecation warnings on the Windows compilers that might +# use the MSVC Runtime library headers. +if(WIN32 AND (CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel|Clang")) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) endif() if(PNG_HARDWARE_OPTIMIZATIONS) -# Set definitions and sources for ARM. -if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)") - if(TARGET_ARCH MATCHES "^(ARM64|arm64|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 "off") - set(libpng_arm_sources - arm/arm_init.c - arm/filter_neon_intrinsics.c - arm/palette_neon_intrinsics.c) - if(NOT MSVC) - list(APPEND libpng_arm_sources arm/filter_neon.S) + # Set definitions and sources for ARM. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)") + if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm64|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() - if(PNG_ARM_NEON STREQUAL "on") - add_definitions(-DPNG_ARM_NEON_OPT=2) - elseif(PNG_ARM_NEON STREQUAL "check") - add_definitions(-DPNG_ARM_NEON_CHECK_SUPPORTED) + 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 "off") + set(libpng_arm_sources + arm/arm_init.c + 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") + add_definitions(-DPNG_ARM_NEON_CHECK_SUPPORTED) + endif() + else() + add_definitions(-DPNG_ARM_NEON_OPT=0) endif() - else() - add_definitions(-DPNG_ARM_NEON_OPT=0) endif() -endif() -# Set definitions and sources for PowerPC. -if(TARGET_ARCH MATCHES "^(powerpc|ppc64)") - set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off) - 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 "off") - set(libpng_powerpc_sources - powerpc/powerpc_init.c - powerpc/filter_vsx_intrinsics.c) - if(PNG_POWERPC_VSX STREQUAL "on") - add_definitions(-DPNG_POWERPC_VSX_OPT=2) + # Set definitions and sources for PowerPC. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)") + set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off) + 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 "off") + set(libpng_powerpc_sources + powerpc/powerpc_init.c + powerpc/filter_vsx_intrinsics.c) + if(PNG_POWERPC_VSX STREQUAL "on") + add_definitions(-DPNG_POWERPC_VSX_OPT=2) + endif() + else() + add_definitions(-DPNG_POWERPC_VSX_OPT=0) endif() - else() - add_definitions(-DPNG_POWERPC_VSX_OPT=0) endif() -endif() -# Set definitions and sources for Intel. -if(TARGET_ARCH MATCHES "^(i[3-6]86|x86|AMD64)") - set(PNG_INTEL_SSE_POSSIBLE_VALUES on off) - 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 "off") - set(libpng_intel_sources - intel/intel_init.c - intel/filter_sse2_intrinsics.c) - if(PNG_INTEL_SSE STREQUAL "on") - add_definitions(-DPNG_INTEL_SSE_OPT=1) + # Set definitions and sources for Intel. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)") + set(PNG_INTEL_SSE_POSSIBLE_VALUES on off) + 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 "off") + set(libpng_intel_sources + intel/intel_init.c + intel/filter_sse2_intrinsics.c) + if(PNG_INTEL_SSE STREQUAL "on") + add_definitions(-DPNG_INTEL_SSE_OPT=1) + endif() + else() + add_definitions(-DPNG_INTEL_SSE_OPT=0) endif() - else() - add_definitions(-DPNG_INTEL_SSE_OPT=0) endif() -endif() -# Set definitions and sources for MIPS. -if(TARGET_ARCH MATCHES "^(mipsel|mips64el)") - set(PNG_MIPS_MSA_POSSIBLE_VALUES on off) - 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_msa) - if(index_msa EQUAL -1) - message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]") - endif() + # Set definitions and sources for MIPS. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)") + set(PNG_MIPS_MSA_POSSIBLE_VALUES on off) + 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_msa) + if(index_msa EQUAL -1) + message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]") + endif() - set(PNG_MIPS_MMI_POSSIBLE_VALUES on off) - set(PNG_MIPS_MMI "on" - CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default") - set_property(CACHE PNG_MIPS_MMI - PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES}) - list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi) - if(index_mmi EQUAL -1) - message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]") + set(PNG_MIPS_MMI_POSSIBLE_VALUES on off) + set(PNG_MIPS_MMI + "on" + CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default") + set_property(CACHE PNG_MIPS_MMI + PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES}) + list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi) + if(index_mmi EQUAL -1) + message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]") + endif() + + if(PNG_MIPS_MSA STREQUAL "on" AND PNG_MIPS_MMI STREQUAL "on") + set(libpng_mips_sources + mips/mips_init.c + mips/filter_msa_intrinsics.c + mips/filter_mmi_inline_assembly.c) + add_definitions(-DPNG_MIPS_MSA_OPT=2) + add_definitions(-DPNG_MIPS_MMI_OPT=1) + elseif(PNG_MIPS_MSA STREQUAL "on") + set(libpng_mips_sources + mips/mips_init.c + mips/filter_msa_intrinsics.c) + add_definitions(-DPNG_MIPS_MSA_OPT=2) + add_definitions(-DPNG_MIPS_MMI_OPT=0) + elseif(PNG_MIPS_MMI STREQUAL "on") + set(libpng_mips_sources + mips/mips_init.c + mips/filter_mmi_inline_assembly.c) + add_definitions(-DPNG_MIPS_MSA_OPT=0) + add_definitions(-DPNG_MIPS_MMI_OPT=1) + else() + add_definitions(-DPNG_MIPS_MSA_OPT=0) + add_definitions(-DPNG_MIPS_MMI_OPT=0) + endif() endif() - if(PNG_MIPS_MSA STREQUAL "on" AND PNG_MIPS_MMI STREQUAL "on") - set(libpng_mips_sources - mips/mips_init.c - mips/filter_msa_intrinsics.c - mips/filter_mmi_inline_assembly.c) - add_definitions(-DPNG_MIPS_MSA_OPT=2) - add_definitions(-DPNG_MIPS_MMI_OPT=1) - elseif(PNG_MIPS_MSA STREQUAL "on") - set(libpng_mips_sources - mips/mips_init.c - mips/filter_msa_intrinsics.c) - add_definitions(-DPNG_MIPS_MSA_OPT=2) - add_definitions(-DPNG_MIPS_MMI_OPT=0) - elseif(PNG_MIPS_MMI STREQUAL "on") - set(libpng_mips_sources - mips/mips_init.c - mips/filter_mmi_inline_assembly.c) - add_definitions(-DPNG_MIPS_MSA_OPT=0) - add_definitions(-DPNG_MIPS_MMI_OPT=1) + # Set definitions and sources for LoongArch. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)") + include(CheckCCompilerFlag) + set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off) + set(PNG_LOONGARCH_LSX + "on" + CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default") + set_property(CACHE PNG_LOONGARCH_LSX + PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}) + list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index) + if(index EQUAL -1) + message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]") + elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off") + check_c_compiler_flag("-mlsx" COMPILER_SUPPORTS_LSX) + if(COMPILER_SUPPORTS_LSX) + set(libpng_loongarch_sources + loongarch/loongarch_lsx_init.c + loongarch/filter_lsx_intrinsics.c) + set_source_files_properties(${libpng_loongarch_sources} + PROPERTIES COMPILE_FLAGS "-mlsx") + add_definitions(-DPNG_LOONGARCH_LSX_OPT=1) + else() + message(FATAL_ERROR "This compiler does not support the -mlsx option") + endif() else() - add_definitions(-DPNG_MIPS_MSA_OPT=0) - add_definitions(-DPNG_MIPS_MMI_OPT=0) + add_definitions(-DPNG_LOONGARCH_LSX_OPT=0) endif() -endif() + endif() -# Set definitions and sources for LoongArch. -if(TARGET_ARCH MATCHES "^(loongarch)") - include(CheckCCompilerFlag) - set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off) - set(PNG_LOONGARCH_LSX "on" - CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default") - set_property(CACHE PNG_LOONGARCH_LSX - PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}) - list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index) - if(index EQUAL -1) - message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]") - elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off") - CHECK_C_COMPILER_FLAG("-mlsx" COMPILER_SUPPORTS_LSX) - if(COMPILER_SUPPORTS_LSX) - set(libpng_loongarch_sources - loongarch/loongarch_lsx_init.c - loongarch/filter_lsx_intrinsics.c) - set_source_files_properties(${libpng_loongarch_sources} - PROPERTIES - COMPILE_FLAGS "-mlsx") - add_definitions(-DPNG_LOONGARCH_LSX_OPT=1) + # Set definitions and sources for RISC-V. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(riscv)") + include(CheckCCompilerFlag) + set(PNG_RISCV_RVV_POSSIBLE_VALUES on off) + set(PNG_RISCV_RVV "off" + CACHE STRING "Enable RISC-V Vector optimizations: on|off; off is default") + set_property(CACHE PNG_RISCV_RVV + PROPERTY STRINGS ${PNG_RISCV_RVV_POSSIBLE_VALUES}) + list(FIND PNG_RISCV_RVV_POSSIBLE_VALUES ${PNG_RISCV_RVV} index) + if(index EQUAL -1) + message(FATAL_ERROR "PNG_RISCV_RVV must be one of [${PNG_RISCV_RVV_POSSIBLE_VALUES}]") + elseif(NOT PNG_RISCV_RVV STREQUAL "off") + + check_c_source_compiles(" + #include + int main() { + const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; + uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A}; + vuint8m1_t a = __riscv_vreinterpret_v_u64m1_u8m1(__riscv_vle64_v_u64m1(ptr, 2)); + vfloat32m1_t val = __riscv_vle32_v_f32m1((const float*)(src), 4); + return (int)__riscv_vfmv_f_s_f32m1_f32(val); + }" COMPILER_SUPPORTS_RVV) + + if(NOT COMPILER_SUPPORTS_RVV) + message(FATAL_ERROR "Compiler does not support RISC-V Vector extension or its unable to detect it") + endif() + set(libpng_riscv_sources + riscv/filter_rvv_intrinsics.c + riscv/riscv_init.c) + if(PNG_RISCV_RVV STREQUAL "on") + add_definitions(-DPNG_RISCV_RVV_OPT=2) + else() + add_definitions(-DPNG_RISCV_RVV_OPT=0) + endif() else() - message(FATAL_ERROR "Compiler does not support -mlsx option") + add_definitions(-DPNG_RISCV_RVV_OPT=0) endif() - else() - add_definitions(-DPNG_LOONGARCH_LSX_OPT=0) endif() -endif() else(PNG_HARDWARE_OPTIMIZATIONS) -# Set definitions and sources for ARM. -if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)") - add_definitions(-DPNG_ARM_NEON_OPT=0) -endif() + # Set definitions and sources for ARM. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)") + add_definitions(-DPNG_ARM_NEON_OPT=0) + endif() -# Set definitions and sources for PowerPC. -if(TARGET_ARCH MATCHES "^(powerpc|ppc64)") - add_definitions(-DPNG_POWERPC_VSX_OPT=0) -endif() + # Set definitions and sources for PowerPC. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)") + add_definitions(-DPNG_POWERPC_VSX_OPT=0) + endif() -# Set definitions and sources for Intel. -if(TARGET_ARCH MATCHES "^(i[3-6]86|x86|AMD64)") - add_definitions(-DPNG_INTEL_SSE_OPT=0) -endif() + # Set definitions and sources for Intel. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)") + add_definitions(-DPNG_INTEL_SSE_OPT=0) + endif() -# Set definitions and sources for MIPS. -if(TARGET_ARCH MATCHES "^(mipsel|mips64el)") - add_definitions(-DPNG_MIPS_MSA_OPT=0) -endif() + # Set definitions and sources for MIPS. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)") + add_definitions(-DPNG_MIPS_MSA_OPT=0) + endif() -# Set definitions and sources for LoongArch. -if(TARGET_ARCH MATCHES "^(loongarch)") - add_definitions(-DPNG_LOONGARCH_LSX_OPT=0) -endif() + # Set definitions and sources for LoongArch. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)") + add_definitions(-DPNG_LOONGARCH_LSX_OPT=0) + endif() + + # Set definitions and sources for RISC-V. + if(PNG_TARGET_ARCHITECTURE MATCHES "^(riscv)") + add_definitions(-DPNG_RISCV_RVV_OPT=0) + endif() endif(PNG_HARDWARE_OPTIMIZATIONS) option(ld-version-script "Enable linker version script" ON) -if(ld-version-script AND NOT ANDROID AND NOT APPLE) +if(ld-version-script AND NOT (ANDROID OR APPLE)) # Check if LD supports linker scripts. file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" " VERS_1 { global: sym1; local: *; }; VERS_2 { global: sym2; main; } VERS_1; ") - set(_SAVED_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + # CMAKE_REQUIRED_FLAGS is a space-separated string, not a CMake list. + # Use string(APPEND) instead of list(APPEND) to prevent misparsing by + # try_compile under CMake 4.4 or newer. + set(_SAVED_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") if(NOT CMAKE_HOST_SOLARIS) # 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}) + string(APPEND CMAKE_REQUIRED_FLAGS " ${CMAKE_SHARED_LIBRARY_C_FLAGS}") endif() - list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'") + string(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; } " HAVE_LD_VERSION_SCRIPT) if(NOT HAVE_LD_VERSION_SCRIPT) - set(CMAKE_REQUIRED_FLAGS ${_SAVED_CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "${_SAVED_CMAKE_REQUIRED_FLAGS}") if(NOT CMAKE_HOST_SOLARIS) # Again, avoid using CMAKE_SHARED_LIBRARY_C_FLAGS in version script # checks on Solaris. - list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) + string(APPEND CMAKE_REQUIRED_FLAGS " ${CMAKE_SHARED_LIBRARY_C_FLAGS}") endif() - list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,-M -Wl,${CMAKE_CURRENT_BINARY_DIR}/conftest.map") + string(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; } " HAVE_SOLARIS_LD_VERSION_SCRIPT) endif() - set(CMAKE_REQUIRED_FLAGS ${_SAVED_CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "${_SAVED_CMAKE_REQUIRED_FLAGS}") file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") endif() -find_program(AWK NAMES gawk awk) +if(PNG_LIBCONF_HEADER STREQUAL "") + # No custom configuration header file has been specified, so we build it + # from our DFA files and (optionally) out of the user-supplied DFA file. + # Find an AWK language processor. + # Start with specific AWK implementations like gawk and nawk, which are + # known to work with our scripts, then fall back to the system awk. + find_program(AWK NAMES gawk nawk awk) + if(AWK) + message(STATUS "Found AWK program: ${AWK}") + else() + message(STATUS "Could not find an AWK-compatible program") + endif() +endif() -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +# Include the internal module PNGCheckLibconf.cmake +include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGCheckLibconf.cmake") -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) +if(NOT PNG_LIBCONF_HEADER STREQUAL "") + # Configure libpng with the user-defined pnglibconf.h file. + png_check_libconf(HEADER "${PNG_LIBCONF_HEADER}") + configure_file("${PNG_LIBCONF_HEADER}" + "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" + @ONLY) + add_custom_target(png_genfiles) +elseif(NOT AWK) + # No AWK program available to generate pnglibconf.h. + # Configure libpng with pnglibconf.h.prebuilt. + png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}") + configure_file("${PNG_LIBCONF_HEADER_PREBUILT}" + "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" + @ONLY) add_custom_target(png_genfiles) else() - # 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 + png_check_libconf(DFA_XTRA "${DFA_XTRA}") + + # Include the internal module PNGGenConfig.cmake + include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake") + + # Work around a limitation of various Windows AWK programs that are + # unable to process CRLF-terminated AWK scripts. + # Copy these AWK scripts to a temporary location, converting their + # line endings from Windows (CRLF) to Unix (LF) at the destination. + 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 + 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 + 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 "generate_chk: Missing INPUT argument") - endif() - if(NOT _GC_OUTPUT) - message(FATAL_ERROR "generate_chk: Missing OUTPUT argument") - endif() - - add_custom_command(OUTPUT "${_GC_OUTPUT}" - COMMAND "${CMAKE_COMMAND}" - "-DINPUT=${_GC_INPUT}" - "-DOUTPUT=${_GC_OUTPUT}" - -P "${CMAKE_CURRENT_BINARY_DIR}/genchk.cmake" - DEPENDS "${_GC_INPUT}" ${_GC_DEPENDS} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - # Generate .out from .c with awk - # generate_out(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]]) - function(generate_out) - set(options) - set(oneValueArgs INPUT OUTPUT) - set(multiValueArgs DEPENDS) - cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(NOT _GO_INPUT) - message(FATAL_ERROR "generate_out: Missing INPUT argument") - endif() - if(NOT _GO_OUTPUT) - message(FATAL_ERROR "generate_out: Missing OUTPUT argument") - endif() - - add_custom_command(OUTPUT "${_GO_OUTPUT}" - COMMAND "${CMAKE_COMMAND}" - "-DINPUT=${_GO_INPUT}" - "-DOUTPUT=${_GO_OUTPUT}" - -P "${CMAKE_CURRENT_BINARY_DIR}/genout.cmake" - DEPENDS "${_GO_INPUT}" ${_GO_DEPENDS} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - # Generate specific source file with awk - # generate_source(OUTPUT outputfile [DEPENDS dep1 [dep2...]]) - function(generate_source) - set(options) - set(oneValueArgs OUTPUT) - set(multiValueArgs DEPENDS) - cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(NOT _GSO_OUTPUT) - message(FATAL_ERROR "generate_source: Missing OUTPUT argument") - endif() - - add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}" - COMMAND "${CMAKE_COMMAND}" - "-DOUTPUT=${_GSO_OUTPUT}" - -P "${CMAKE_CURRENT_BINARY_DIR}/gensrc.cmake" - DEPENDS ${_GSO_DEPENDS} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - # Copy file - # 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" + generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa" "${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" + generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa" "${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 @@ -480,103 +506,76 @@ else() endif() generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" - DEPENDS pnglibconf_c) - add_custom_target(pnglibconf_out - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out") + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out") # Generate pnglibconf.h - generate_source(OUTPUT "pnglibconf.h" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out + generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/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" pnglibconf_h) - add_custom_target(png_scripts_intprefix_out - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out") + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h") 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" pnglibconf_out) - add_custom_target(png_scripts_prefix_out - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out") + "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out") # Generate pngprefix.h - generate_source(OUTPUT "pngprefix.h" + generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/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" pnglibconf_h) - add_custom_target(png_scripts_sym_out - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out") + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h") 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" pnglibconf_h) - add_custom_target(png_scripts_vers_out - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out") + "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h") generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk" - DEPENDS png_scripts_symbols_out - "${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def") - add_custom_target(png_scripts_symbols_chk - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk") - 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) + OUTPUT "${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") + generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers") add_custom_target(png_genprebuilt COMMAND "${CMAKE_COMMAND}" "-DOUTPUT=scripts/pnglibconf.h.prebuilt" - -P "${CMAKE_CURRENT_BINARY_DIR}/gensrc.cmake" + -P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") # A single target handles generation of all generated files. 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) + 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() # List the source code files. set(libpng_public_hdrs @@ -590,7 +589,7 @@ set(libpng_private_hdrs pnginfo.h pngstruct.h ) -if(AWK AND NOT ANDROID AND NOT IOS) +if(AWK) list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h") endif() set(libpng_sources @@ -616,7 +615,9 @@ set(libpng_sources ${libpng_mips_sources} ${libpng_powerpc_sources} ${libpng_loongarch_sources} + ${libpng_riscv_sources} ) + set(pngtest_sources pngtest.c ) @@ -626,6 +627,9 @@ set(pngvalid_sources set(pngstest_sources contrib/libtests/pngstest.c ) +set(pnggetset_sources + contrib/libtests/pnggetset.c +) set(pngunknown_sources contrib/libtests/pngunknown.c ) @@ -639,15 +643,6 @@ set(png_fix_itxt_sources contrib/tools/png-fix-itxt.c ) -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() - -if(PNG_DEBUG) - add_definitions(-DPNG_DEBUG) -endif() - # Now build our targets. # Initialize the list of libpng library targets. @@ -675,72 +670,89 @@ if(PNG_SHARED) 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}") + 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_shared 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_shared 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(APPLE) # Avoid CMake's implicit compile definition "png_shared_EXPORTS". - set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL "") + set_target_properties(png_shared + PROPERTIES DEFINE_SYMBOL "") elseif(WIN32) # Use the explicit compile definition "PNG_BUILD_DLL" for Windows DLLs. - set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL) + set_target_properties(png_shared + PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL) endif() target_include_directories(png_shared - PUBLIC - $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY}) + PUBLIC "$") + target_include_directories(png_shared + PUBLIC "$") + target_include_directories(png_shared + SYSTEM + INTERFACE "$") + target_link_libraries(png_shared + PUBLIC ${PNG_LINK_LIBRARIES}) endif() if(PNG_STATIC) add_library(png_static STATIC ${libpng_sources}) 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}") + set_target_properties(png_static + PROPERTIES OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}" + DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}") + target_include_directories(png_static + PUBLIC "$") + target_include_directories(png_static + PUBLIC "$") target_include_directories(png_static - PUBLIC - $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY}) + SYSTEM + INTERFACE "$") + target_link_libraries(png_static + PUBLIC ${PNG_LINK_LIBRARIES}) endif() -if(PNG_FRAMEWORK AND APPLE) +if(PNG_FRAMEWORK AND NOT APPLE) + message(AUTHOR_WARNING "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems") + set(PNG_FRAMEWORK OFF) +endif() + +if(PNG_FRAMEWORK) add_library(png_framework SHARED ${libpng_sources}) add_dependencies(png_framework png_genfiles) list(APPEND PNG_LIBRARY_TARGETS png_framework) - 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" - DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}") + 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" + DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}") # Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS". - set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "") + set_target_properties(png_framework + PROPERTIES DEFINE_SYMBOL "") + target_include_directories(png_framework + PUBLIC "$") + target_include_directories(png_framework + PUBLIC "$") target_include_directories(png_framework - PUBLIC - $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY}) + SYSTEM + INTERFACE "$") + target_link_libraries(png_framework + PUBLIC ${PNG_LINK_LIBRARIES}) endif() if(NOT PNG_LIBRARY_TARGETS) @@ -752,30 +764,8 @@ endif() if(PNG_TESTS AND PNG_SHARED) enable_testing() - function(png_add_test) - set(options) - set(oneValueArgs NAME COMMAND) - set(multiValueArgs OPTIONS FILES) - cmake_parse_arguments(_PAT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(NOT _PAT_NAME) - message(FATAL_ERROR "png_add_test: Missing NAME argument") - endif() - 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/cmake/test.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake" - @ONLY) - add_test(NAME "${_PAT_NAME}" - COMMAND "${CMAKE_COMMAND}" - "-DLIBPNG=$" - "-DTEST_COMMAND=$" - -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake") - endfunction() + # Include the internal module PNGTest.cmake + include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGTest.cmake") # Find test PNG files by globbing, but sort lists to ensure # consistency between different filesystems. @@ -783,18 +773,40 @@ if(PNG_TESTS AND PNG_SHARED) list(SORT PNGSUITE_PNGS) file(GLOB TEST_PNGS "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/*.png") list(SORT TEST_PNGS) + file(GLOB TEST_PNG3_PNGS "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/png-3/*.png") + list(SORT TEST_PNG3_PNGS) set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png") + # pngtest tests: + # Basic read/write roundtrip using the sequential API. add_executable(pngtest ${pngtest_sources}) - target_link_libraries(pngtest PRIVATE png_shared) + target_link_libraries(pngtest + PRIVATE png_shared) png_add_test(NAME pngtest COMMAND pngtest FILES "${PNGTEST_PNG}") + png_add_test(NAME pngtest-png-3 + COMMAND pngtest + FILES "${TEST_PNG3_PNGS}") + + # pnggetset test: + # Getter-to-setter roundtrips for various chunk types. + add_executable(pnggetset ${pnggetset_sources}) + target_link_libraries(pnggetset + PRIVATE png_shared) + + png_add_test(NAME pnggetset + COMMAND pnggetset) + + # pngvalid tests: + # Internal validation of standard and progressive reading, + # transforms, and gamma handling. add_executable(pngvalid ${pngvalid_sources}) - target_link_libraries(pngvalid PRIVATE png_shared) + target_link_libraries(pngvalid + PRIVATE png_shared) png_add_test(NAME pngvalid-gamma-16-to-8 COMMAND pngvalid @@ -839,8 +851,12 @@ if(PNG_TESTS AND PNG_SHARED) COMMAND pngvalid OPTIONS --transform) + # pngstest tests: + # Format conversions through the simplified API, + # by gamma type and alpha type. add_executable(pngstest ${pngstest_sources}) - target_link_libraries(pngstest PRIVATE png_shared) + target_link_libraries(pngstest + PRIVATE png_shared) foreach(gamma_type 1.8 linear none sRGB) foreach(alpha_type none alpha) @@ -894,8 +910,51 @@ if(PNG_TESTS AND PNG_SHARED) endforeach() endforeach() + # Large-stride test: + # Use stride_extra > 32767 to trigger row_bytes > 65535 for linear images. + png_add_test(NAME pngstest-large-stride + COMMAND pngstest + OPTIONS --stride-extra 33000 --tmpfile "large-stride-" --log + FILES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-16-linear.png") + + # Negative-stride test: + # Bottom-up layout through all read/write paths. + png_add_test(NAME pngstest-negative-stride + COMMAND pngstest + OPTIONS --negative-stride --tmpfile "negative-stride-" --log + FILES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-1.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-16-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-8-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-16-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/palette-8-tRNS.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-alpha-8-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-alpha-16-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-8-1.8.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-8-sRGB.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-16-linear.png") + + # Negative-stride-extra test: + # Bottom-up layout with non-aligned padding. + png_add_test(NAME pngstest-negative-stride-extra + COMMAND pngstest + OPTIONS --negative-stride --stride-extra 7 + --tmpfile "negative-stride-extra-" --log + FILES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-1.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-16-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-8-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-16-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/palette-8-tRNS.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-alpha-8-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/gray-alpha-16-linear.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-8-1.8.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-8-sRGB.png" + "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/rgb-alpha-16-linear.png") + + # pngunknown tests: + # Unknown chunk handling under various read policies. add_executable(pngunknown ${pngunknown_sources}) - target_link_libraries(pngunknown PRIVATE png_shared) + target_link_libraries(pngunknown + PRIVATE png_shared) png_add_test(NAME pngunknown-discard COMMAND pngunknown @@ -911,7 +970,8 @@ if(PNG_TESTS AND PNG_SHARED) 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 + 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 @@ -926,8 +986,11 @@ if(PNG_TESTS AND PNG_SHARED) OPTIONS --strict vpAg=if-safe FILES "${PNGTEST_PNG}") + # pngimage tests: + # Image read validation against the pngsuite corpus. add_executable(pngimage ${pngimage_sources}) - target_link_libraries(pngimage PRIVATE png_shared) + target_link_libraries(pngimage + PRIVATE png_shared) png_add_test(NAME pngimage-quick COMMAND pngimage @@ -941,25 +1004,31 @@ endif() if(PNG_SHARED AND PNG_TOOLS) add_executable(pngfix ${pngfix_sources}) - target_link_libraries(pngfix PRIVATE png_shared) + target_link_libraries(pngfix + PRIVATE png_shared) set(PNG_BIN_TARGETS pngfix) add_executable(png-fix-itxt ${png_fix_itxt_sources}) - target_link_libraries(png-fix-itxt PRIVATE ZLIB::ZLIB ${M_LIBRARY}) + target_link_libraries(png-fix-itxt + PRIVATE ${PNG_LINK_LIBRARIES}) list(APPEND PNG_BIN_TARGETS png-fix-itxt) endif() -# Create a symlink from src to dest (if possible), or, alternatively, -# copy src to dest if different. +# Create a symlink that points to a target file (if symlinking is possible), +# or make a copy of the target file (if symlinking is not possible): +# create_symlink( [FILE | TARGET ]) function(create_symlink DEST_FILE) + # TODO: + # Replace this implementation with CMake's built-in create_symlink function, + # which has been fully functional on all platforms, including Windows, since + # CMake version 3.13. 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") + message(FATAL_ERROR "create_symlink: Missing arguments: FILE or TARGET") endif() if(_SYM_FILE AND _SYM_TARGET) - message(FATAL_ERROR "create_symlink: " - "The arguments FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET}) " - "are mutually-exclusive") + message(FATAL_ERROR "create_symlink: Mutually-exclusive arguments:" + "FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET})") endif() if(_SYM_FILE) @@ -968,12 +1037,14 @@ function(create_symlink DEST_FILE) if(CMAKE_HOST_WIN32 AND NOT CYGWIN) execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_if_different - ${_SYM_FILE} ${DEST_FILE} + "${_SYM_FILE}" + "${DEST_FILE}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") else() execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink - ${_SYM_FILE} ${DEST_FILE} + "${_SYM_FILE}" + "${DEST_FILE}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") endif() endif() @@ -987,28 +1058,28 @@ function(create_symlink DEST_FILE) POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different - $/$ - $/${DEST_FILE}) + "$/$" + "$/${DEST_FILE}") else() add_custom_command(TARGET ${_SYM_TARGET} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E create_symlink - $ - $/${DEST_FILE}) + "$" + "$/${DEST_FILE}") endif() endif() endfunction() # Create source generation scripts. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/genchk.cmake +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake" @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/genout.cmake +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake" @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/gensrc.cmake +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake" @ONLY) # libpng is a library so default to 'lib' @@ -1021,17 +1092,17 @@ endif() # 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_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}/libpng${PNGLIB_ABI_VERSION}.pc + set(prefix "${CMAKE_INSTALL_PREFIX}") + set(exec_prefix "${CMAKE_INSTALL_PREFIX}") + 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}/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}/libpng${PNGLIB_ABI_VERSION}-config + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in" + "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config" @ONLY) create_symlink(libpng-config FILE libpng${PNGLIB_ABI_VERSION}-config) endif() @@ -1040,75 +1111,106 @@ endif() if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) install(TARGETS ${PNG_LIBRARY_TARGETS} EXPORT libpng - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}) + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + 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 + # Create an unversioned symlink to the shared library's link-time file. if(NOT WIN32 OR CYGWIN OR MINGW) - create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png_shared) - install(FILES $/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(CYGWIN OR MINGW) + # The symlink is for the import library (e.g., libpng.dll.a => libpng16.dll.a). + set(libpng_symlink_name "libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}") + else() + # The symlink is for the shared object (e.g., libpng.so => libpng16.so). + set(libpng_symlink_name "libpng${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() + create_symlink(${libpng_symlink_name} TARGET png_shared) + install(FILES "$/${libpng_symlink_name}" + 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 $/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES "$/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 ${CMAKE_INSTALL_INCLUDEDIR}) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install(FILES ${libpng_public_hdrs} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}") endif() 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 ${CMAKE_INSTALL_BINDIR}) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config - DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng-config" + DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config" + DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() endif() if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL) install(TARGETS ${PNG_BIN_TARGETS} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() 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) + DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") install(FILES png.5 - DESTINATION ${CMAKE_INSTALL_MANDIR}/man5) + 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 ${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}/libpng${PNGLIB_ABI_VERSION}-config - DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libpng.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng-config" + 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}/libpng${PNGLIB_ABI_VERSION}-config" + DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() endif() # 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 ${CMAKE_INSTALL_LIBDIR}/libpng + DESTINATION "${CMAKE_INSTALL_LIBDIR}/libpng" FILE libpng${PNGLIB_ABI_VERSION}.cmake) endif() +# Create a CMake Config File that can be used via find_package(PNG CONFIG) +if(NOT SKIP_INSTALL_CONFIG_FILE AND NOT SKIP_INSTALL_ALL) + install(TARGETS ${PNG_LIBRARY_TARGETS} + EXPORT PNGTargets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}") + + include(CMakePackageConfigHelpers) + write_basic_package_version_file(PNGConfigVersion.cmake + VERSION ${PNGLIB_VERSION} + COMPATIBILITY SameMinorVersion) + + install(EXPORT PNGTargets + FILE PNGTargets.cmake + NAMESPACE PNG:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PNG") + + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/PNGConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PNG") +endif() + # 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 042d729291..1557fbded4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,3 @@ - Installing libpng Contents @@ -137,7 +136,7 @@ Your directory structure should look like this: depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc. contrib arm-neon, conftest, examples, gregbook, libtests, pngminim, - pngminus, pngsuite, tools, visupng + pngminus, pngsuite, tools, visupng, riscv-rvv projects owatcom, visualc71, vstudio scripts @@ -290,6 +289,7 @@ such as one of --enable-mips-msa=yes --enable-intel-sse=yes --enable-powerpc-vsx=yes + --enable-riscv-rvv=yes or enable them all at once with @@ -302,6 +302,7 @@ or more of CPPFLAGS += "-DPNG_MIPS_MSA" CPPFLAGS += "-DPNG_INTEL_SSE" CPPFLAGS += "-DPNG_POWERPC_VSX" + CPPFLAGS += "-DPNG_RISCV_RVV" See for example scripts/makefile.linux-opt @@ -318,13 +319,15 @@ to disable a particular one, or via compiler-command options such as CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0, - -DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0" + -DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0, + -DPNG_RISCV_RVV_OPT=0" If you are using cmake, hardware optimizations are "on" by default. To disable them, use cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \ - -DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no + -DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no \ + -DPNG_RISCV_RVV=no or disable them all at once with diff --git a/LICENSE b/LICENSE index 25f298f0fc..1b765ae9f9 100644 --- a/LICENSE +++ b/LICENSE @@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE PNG Reference Library License version 2 --------------------------------------- - * Copyright (c) 1995-2024 The PNG Reference Library Authors. - * Copyright (c) 2018-2024 Cosmin Truta. + * Copyright (c) 1995-2026 The PNG Reference Library Authors. + * Copyright (c) 2018-2026 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. diff --git a/LICENSES/MIT-0.txt b/LICENSES/MIT-0.txt new file mode 100644 index 0000000000..30c629513b --- /dev/null +++ b/LICENSES/MIT-0.txt @@ -0,0 +1,16 @@ +MIT No Attribution + +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. + +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/ci/LICENSE_MIT.txt b/LICENSES/MIT.txt similarity index 100% rename from ci/LICENSE_MIT.txt rename to LICENSES/MIT.txt diff --git a/Makefile.am b/Makefile.am index 1f06c703a1..fa5bbeb614 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # Makefile.am, the source file for Makefile.in (and hence Makefile), is # -# Copyright (c) 2018-2024 Cosmin Truta +# Copyright (c) 2018-2026 Cosmin Truta # Copyright (c) 2004-2016 Glenn Randers-Pehrson # # This code is released under the libpng license. @@ -13,7 +13,7 @@ ACLOCAL_AMFLAGS = -I scripts/autoconf # test programs - run on make check, make distcheck if ENABLE_TESTS -check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp +check_PROGRAMS= pngtest pnggetset pngunknown pngstest pngvalid pngimage pngcp if HAVE_CLOCK_GETTIME check_PROGRAMS += timepng endif @@ -42,6 +42,9 @@ if ENABLE_TESTS pngtest_SOURCES = pngtest.c pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +pnggetset_SOURCES = contrib/libtests/pnggetset.c +pnggetset_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + pngvalid_SOURCES = contrib/libtests/pngvalid.c pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la @@ -73,21 +76,41 @@ endif if ENABLE_TESTS TESTS =\ 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/pnggetset\ + 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\ - tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\ - tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\ + tests/pngvalid-gamma-expand16-transform\ + tests/pngvalid-gamma-sbit\ + tests/pngvalid-gamma-threshold\ + tests/pngvalid-gamma-transform\ tests/pngvalid-progressive-size\ tests/pngvalid-progressive-interlace-standard\ tests/pngvalid-transform\ - tests/pngvalid-progressive-standard tests/pngvalid-standard\ - tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\ - tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\ - tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\ - tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\ - tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\ - tests/pngimage-quick tests/pngimage-full + tests/pngvalid-progressive-standard\ + tests/pngvalid-standard\ + tests/pngstest-1.8\ + tests/pngstest-1.8-alpha\ + tests/pngstest-linear\ + tests/pngstest-linear-alpha\ + tests/pngstest-none\ + tests/pngstest-none-alpha\ + tests/pngstest-sRGB\ + tests/pngstest-sRGB-alpha\ + tests/pngstest-large-stride\ + tests/pngstest-negative-stride\ + tests/pngstest-negative-stride-extra\ + tests/pngunknown-IDAT\ + tests/pngunknown-discard\ + tests/pngunknown-if-safe\ + tests/pngunknown-sAPI\ + tests/pngunknown-sTER\ + tests/pngunknown-save\ + tests/pngunknown-vpAg\ + tests/pngimage-quick\ + tests/pngimage-full endif # man pages @@ -108,7 +131,7 @@ 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_intrinsics.c \ arm/palette_neon_intrinsics.c endif @@ -134,13 +157,20 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += powerpc/powerpc_init.c\ powerpc/filter_vsx_intrinsics.c endif +if PNG_RISCV_RVV +noinst_LTLIBRARIES= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_SOURCES = riscv/riscv_init.c\ + riscv/filter_rvv_intrinsics.c +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS = -march=rv64gv +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la +endif + if PNG_LOONGARCH_LSX noinst_LTLIBRARIES= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_SOURCES = loongarch/loongarch_lsx_init.c\ loongarch/filter_lsx_intrinsics.c libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_CFLAGS = -mlsx libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la -# libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la endif nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h @@ -163,6 +193,10 @@ else libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym endif +if PNG_RISCV_RVV + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la +endif + if PNG_LOONGARCH_LSX libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la endif @@ -199,7 +233,7 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ config.sub configure depcomp install-sh ltmain.sh missing # PNG_COPTS give extra options for the C compiler to be used on all compilation -# steps (unless targe_CFLAGS is specified; that will take precedence over +# steps (unless target_CFLAGS is specified; that will take precedence over # AM_CFLAGS) PNG_COPTS = @PNG_COPTS@ AM_CFLAGS = ${PNG_COPTS} @@ -273,9 +307,10 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt: pngtest.o: pnglibconf.h contrib/libtests/makepng.o: pnglibconf.h +contrib/libtests/pnggetset.o: pnglibconf.h +contrib/libtests/pngimage.o: pnglibconf.h contrib/libtests/pngstest.o: pnglibconf.h contrib/libtests/pngunknown.o: pnglibconf.h -contrib/libtests/pngimage.o: pnglibconf.h contrib/libtests/pngvalid.o: pnglibconf.h contrib/libtests/readpng.o: pnglibconf.h contrib/libtests/tarith.o: pnglibconf.h diff --git a/Makefile.in b/Makefile.in index c9eac7dbc6..f2d25433d3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. +# Makefile.in generated by automake 1.18.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2021 Free Software Foundation, Inc. +# Copyright (C) 1994-2025 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,7 @@ # Makefile.am, the source file for Makefile.in (and hence Makefile), is # -# Copyright (c) 2018-2024 Cosmin Truta +# Copyright (c) 2018-2026 Cosmin Truta # Copyright (c) 2004-2016 Glenn Randers-Pehrson # # This code is released under the libpng license. @@ -83,6 +83,8 @@ am__make_running_with_option = \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -101,14 +103,15 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_TESTS_TRUE@check_PROGRAMS = pngtest$(EXEEXT) \ -@ENABLE_TESTS_TRUE@ pngunknown$(EXEEXT) pngstest$(EXEEXT) \ -@ENABLE_TESTS_TRUE@ pngvalid$(EXEEXT) pngimage$(EXEEXT) \ -@ENABLE_TESTS_TRUE@ pngcp$(EXEEXT) $(am__EXEEXT_1) +@ENABLE_TESTS_TRUE@ pnggetset$(EXEEXT) pngunknown$(EXEEXT) \ +@ENABLE_TESTS_TRUE@ pngstest$(EXEEXT) pngvalid$(EXEEXT) \ +@ENABLE_TESTS_TRUE@ pngimage$(EXEEXT) pngcp$(EXEEXT) \ +@ENABLE_TESTS_TRUE@ $(am__EXEEXT_1) @ENABLE_TESTS_TRUE@@HAVE_CLOCK_GETTIME_TRUE@am__append_1 = timepng @ENABLE_TOOLS_TRUE@bin_PROGRAMS = pngfix$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ 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_intrinsics.c \ @PNG_ARM_NEON_TRUE@ arm/palette_neon_intrinsics.c @PNG_MIPS_MSA_TRUE@am__append_3 = mips/mips_init.c\ @@ -128,8 +131,9 @@ host_triplet = @host@ @HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_FALSE@am__append_9 = -Wl,--version-script=libpng.vers # Only restricted exports when possible @HAVE_LD_VERSION_SCRIPT_FALSE@am__append_10 = -export-symbols libpng.sym -@PNG_LOONGARCH_LSX_TRUE@am__append_11 = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la -@DO_PNG_PREFIX_TRUE@am__append_12 = -DPNG_PREFIX='@PNG_PREFIX@' +@PNG_RISCV_RVV_TRUE@am__append_11 = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la +@PNG_LOONGARCH_LSX_TRUE@am__append_12 = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la +@DO_PNG_PREFIX_TRUE@am__append_13 = -DPNG_PREFIX='@PNG_PREFIX@' subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/scripts/autoconf/libtool.m4 \ @@ -177,10 +181,9 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \ @@ -188,13 +191,13 @@ am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \ pngrtran.c pngrutil.c pngset.c pngtrans.c pngwio.c pngwrite.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 \ - arm/palette_neon_intrinsics.c mips/mips_init.c \ - mips/filter_msa_intrinsics.c mips/filter_mmi_inline_assembly.c \ - intel/intel_init.c intel/filter_sse2_intrinsics.c \ - powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c + arm/filter_neon_intrinsics.c arm/palette_neon_intrinsics.c \ + mips/mips_init.c mips/filter_msa_intrinsics.c \ + mips/filter_mmi_inline_assembly.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@am__objects_1 = arm/arm_init.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 \ @@ -238,6 +241,18 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_LINK = $(LIBTOOL) $(AM_V_lt) \ $(CCLD) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @PNG_LOONGARCH_LSX_TRUE@am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_rpath = +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_LIBADD = +am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_SOURCES_DIST = \ + riscv/riscv_init.c riscv/filter_rvv_intrinsics.c +@PNG_RISCV_RVV_TRUE@am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_OBJECTS = riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo \ +@PNG_RISCV_RVV_TRUE@ riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_OBJECTS = \ + $(am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_OBJECTS) +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_LINK = $(LIBTOOL) $(AM_V_lt) \ + --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +@PNG_RISCV_RVV_TRUE@am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_rpath = am__png_fix_itxt_SOURCES_DIST = contrib/tools/png-fix-itxt.c @ENABLE_TOOLS_TRUE@am_png_fix_itxt_OBJECTS = \ @ENABLE_TOOLS_TRUE@ contrib/tools/png-fix-itxt.$(OBJEXT) @@ -253,6 +268,12 @@ am__pngfix_SOURCES_DIST = contrib/tools/pngfix.c pngfix_OBJECTS = $(am_pngfix_OBJECTS) @ENABLE_TOOLS_TRUE@pngfix_DEPENDENCIES = \ @ENABLE_TOOLS_TRUE@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am__pnggetset_SOURCES_DIST = contrib/libtests/pnggetset.c +@ENABLE_TESTS_TRUE@am_pnggetset_OBJECTS = \ +@ENABLE_TESTS_TRUE@ contrib/libtests/pnggetset.$(OBJEXT) +pnggetset_OBJECTS = $(am_pnggetset_OBJECTS) +@ENABLE_TESTS_TRUE@pnggetset_DEPENDENCIES = \ +@ENABLE_TESTS_TRUE@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la am__pngimage_SOURCES_DIST = contrib/libtests/pngimage.c @ENABLE_TESTS_TRUE@am_pngimage_OBJECTS = \ @ENABLE_TESTS_TRUE@ contrib/libtests/pngimage.$(OBJEXT) @@ -312,9 +333,10 @@ am__depfiles_remade = ./$(DEPDIR)/png.Plo ./$(DEPDIR)/pngerror.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)/arm_init.Plo \ arm/$(DEPDIR)/filter_neon_intrinsics.Plo \ arm/$(DEPDIR)/palette_neon_intrinsics.Plo \ + contrib/libtests/$(DEPDIR)/pnggetset.Po \ contrib/libtests/$(DEPDIR)/pngimage.Po \ contrib/libtests/$(DEPDIR)/pngstest.Po \ contrib/libtests/$(DEPDIR)/pngunknown.Po \ @@ -331,18 +353,10 @@ am__depfiles_remade = ./$(DEPDIR)/png.Plo ./$(DEPDIR)/pngerror.Plo \ mips/$(DEPDIR)/filter_msa_intrinsics.Plo \ mips/$(DEPDIR)/mips_init.Plo \ powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo \ - powerpc/$(DEPDIR)/powerpc_init.Plo + powerpc/$(DEPDIR)/powerpc_init.Plo \ + riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Plo \ + riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.Plo am__mv = mv -f -CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CCASFLAGS) $(CCASFLAGS) -AM_V_CPPAS = $(am__v_CPPAS_@AM_V@) -am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@) -am__v_CPPAS_0 = @echo " CPPAS " $@; -am__v_CPPAS_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -364,17 +378,20 @@ am__v_CCLD_1 = SOURCES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ $(nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_SOURCES) \ + $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_SOURCES) \ $(png_fix_itxt_SOURCES) $(pngcp_SOURCES) $(pngfix_SOURCES) \ - $(pngimage_SOURCES) $(pngstest_SOURCES) $(pngtest_SOURCES) \ - $(pngunknown_SOURCES) $(pngvalid_SOURCES) $(timepng_SOURCES) + $(pnggetset_SOURCES) $(pngimage_SOURCES) $(pngstest_SOURCES) \ + $(pngtest_SOURCES) $(pngunknown_SOURCES) $(pngvalid_SOURCES) \ + $(timepng_SOURCES) DIST_SOURCES = \ $(am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST) \ $(am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_SOURCES_DIST) \ + $(am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_SOURCES_DIST) \ $(am__png_fix_itxt_SOURCES_DIST) $(am__pngcp_SOURCES_DIST) \ - $(am__pngfix_SOURCES_DIST) $(am__pngimage_SOURCES_DIST) \ - $(am__pngstest_SOURCES_DIST) $(am__pngtest_SOURCES_DIST) \ - $(am__pngunknown_SOURCES_DIST) $(am__pngvalid_SOURCES_DIST) \ - $(am__timepng_SOURCES_DIST) + $(am__pngfix_SOURCES_DIST) $(am__pnggetset_SOURCES_DIST) \ + $(am__pngimage_SOURCES_DIST) $(am__pngstest_SOURCES_DIST) \ + $(am__pngtest_SOURCES_DIST) $(am__pngunknown_SOURCES_DIST) \ + $(am__pngvalid_SOURCES_DIST) $(am__timepng_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -513,12 +530,13 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ + $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). @@ -537,6 +555,11 @@ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ +if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ + am__collect_skipped_logs='--collect-skipped-logs no'; \ +else \ + am__collect_skipped_logs=''; \ +fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ @@ -592,20 +615,22 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ + find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ + ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz -GZIP_ENV = --best +GZIP_ENV = -9 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$$' -distcleancheck_listfiles = find . -type f -print +distcleancheck_listfiles = \ + find . \( -type f -a \! \ + \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print #distribute headers in /usr/include/libpng/* pkgincludedir = $(includedir)/$(PNGLIB_BASENAME) @@ -688,7 +713,7 @@ PNGLIB_RELEASE = @PNGLIB_RELEASE@ PNGLIB_VERSION = @PNGLIB_VERSION@ # PNG_COPTS give extra options for the C compiler to be used on all compilation -# steps (unless targe_CFLAGS is specified; that will take precedence over +# steps (unless target_CFLAGS is specified; that will take precedence over # AM_CFLAGS) PNG_COPTS = @PNG_COPTS@ PNG_PREFIX = @PNG_PREFIX@ @@ -709,8 +734,10 @@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ # generate the -config scripts if required binconfigs = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config @@ -773,6 +800,8 @@ ACLOCAL_AMFLAGS = -I scripts/autoconf BUILT_SOURCES = pnglibconf.h @ENABLE_TESTS_TRUE@pngtest_SOURCES = pngtest.c @ENABLE_TESTS_TRUE@pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +@ENABLE_TESTS_TRUE@pnggetset_SOURCES = contrib/libtests/pnggetset.c +@ENABLE_TESTS_TRUE@pnggetset_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la @ENABLE_TESTS_TRUE@pngvalid_SOURCES = contrib/libtests/pngvalid.c @ENABLE_TESTS_TRUE@pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la @ENABLE_TESTS_TRUE@pngstest_SOURCES = contrib/libtests/pngstest.c @@ -793,21 +822,41 @@ BUILT_SOURCES = pnglibconf.h # set of parameters: @ENABLE_TESTS_TRUE@TESTS = \ @ENABLE_TESTS_TRUE@ tests/pngtest-all\ -@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\ -@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\ +@ENABLE_TESTS_TRUE@ tests/pnggetset\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-16-to-8\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-alpha-mode\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-background\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-expand16-alpha-mode\ @ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-expand16-background\ -@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\ -@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-expand16-transform\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-sbit\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-threshold\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-gamma-transform\ @ENABLE_TESTS_TRUE@ tests/pngvalid-progressive-size\ @ENABLE_TESTS_TRUE@ tests/pngvalid-progressive-interlace-standard\ @ENABLE_TESTS_TRUE@ tests/pngvalid-transform\ -@ENABLE_TESTS_TRUE@ tests/pngvalid-progressive-standard tests/pngvalid-standard\ -@ENABLE_TESTS_TRUE@ tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\ -@ENABLE_TESTS_TRUE@ tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\ -@ENABLE_TESTS_TRUE@ tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\ -@ENABLE_TESTS_TRUE@ tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\ -@ENABLE_TESTS_TRUE@ tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\ -@ENABLE_TESTS_TRUE@ tests/pngimage-quick tests/pngimage-full +@ENABLE_TESTS_TRUE@ tests/pngvalid-progressive-standard\ +@ENABLE_TESTS_TRUE@ tests/pngvalid-standard\ +@ENABLE_TESTS_TRUE@ tests/pngstest-1.8\ +@ENABLE_TESTS_TRUE@ tests/pngstest-1.8-alpha\ +@ENABLE_TESTS_TRUE@ tests/pngstest-linear\ +@ENABLE_TESTS_TRUE@ tests/pngstest-linear-alpha\ +@ENABLE_TESTS_TRUE@ tests/pngstest-none\ +@ENABLE_TESTS_TRUE@ tests/pngstest-none-alpha\ +@ENABLE_TESTS_TRUE@ tests/pngstest-sRGB\ +@ENABLE_TESTS_TRUE@ tests/pngstest-sRGB-alpha\ +@ENABLE_TESTS_TRUE@ tests/pngstest-large-stride\ +@ENABLE_TESTS_TRUE@ tests/pngstest-negative-stride\ +@ENABLE_TESTS_TRUE@ tests/pngstest-negative-stride-extra\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-IDAT\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-discard\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-if-safe\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-sAPI\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-sTER\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-save\ +@ENABLE_TESTS_TRUE@ tests/pngunknown-vpAg\ +@ENABLE_TESTS_TRUE@ tests/pngimage-quick\ +@ENABLE_TESTS_TRUE@ tests/pngimage-full # man pages @@ -826,21 +875,28 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c \ $(am__append_4) $(am__append_5) $(am__append_6) \ $(am__append_7) @PNG_LOONGARCH_LSX_TRUE@noinst_LTLIBRARIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la +@PNG_RISCV_RVV_TRUE@noinst_LTLIBRARIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la +@PNG_RISCV_RVV_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_SOURCES = riscv/riscv_init.c\ +@PNG_RISCV_RVV_TRUE@ riscv/filter_rvv_intrinsics.c + +@PNG_RISCV_RVV_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS = -march=rv64gv +@PNG_LOONGARCH_LSX_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la +@PNG_RISCV_RVV_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la @PNG_LOONGARCH_LSX_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_SOURCES = loongarch/loongarch_lsx_init.c\ @PNG_LOONGARCH_LSX_TRUE@ loongarch/filter_lsx_intrinsics.c @PNG_LOONGARCH_LSX_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_CFLAGS = -mlsx -@PNG_LOONGARCH_LSX_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la -# libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la 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 \ $(am__append_8) $(am__append_9) $(am__append_10) @HAVE_LD_VERSION_SCRIPT_FALSE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = \ -@HAVE_LD_VERSION_SCRIPT_FALSE@ libpng.sym $(am__append_11) +@HAVE_LD_VERSION_SCRIPT_FALSE@ libpng.sym $(am__append_11) \ +@HAVE_LD_VERSION_SCRIPT_FALSE@ $(am__append_12) @HAVE_LD_VERSION_SCRIPT_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = \ -@HAVE_LD_VERSION_SCRIPT_TRUE@ libpng.vers $(am__append_11) +@HAVE_LD_VERSION_SCRIPT_TRUE@ libpng.vers $(am__append_11) \ +@HAVE_LD_VERSION_SCRIPT_TRUE@ $(am__append_12) pkginclude_HEADERS = png.h pngconf.h nodist_pkginclude_HEADERS = pnglibconf.h pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc @@ -874,7 +930,7 @@ SUFFIXES = .chk .out SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0' \ -DPNGLIB_VERSION='@PNGLIB_VERSION@' \ -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)' -DPNG_NO_USE_READ_MACROS \ - -DPNG_BUILDING_SYMBOL_TABLE $(am__append_12) + -DPNG_BUILDING_SYMBOL_TABLE $(am__append_13) # EXT_LIST is a list of the possibly library directory extensions, this exists # because we can't find a good way of discovering the file extensions that are @@ -885,7 +941,7 @@ all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .chk .out .S .c .lo .log .o .obj .test .test$(EXEEXT) .trs +.SUFFIXES: .chk .out .c .lo .log .o .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @@ -925,12 +981,12 @@ config.h: stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h + $(AM_V_at)rm -f stamp-h1 + $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ + $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + $(AM_V_at)rm -f stamp-h1 + $(AM_V_at)touch $@ distclean-hdr: -rm -f config.h stamp-h1 @@ -977,25 +1033,15 @@ uninstall-binPROGRAMS: `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + cd "$(DESTDIR)$(bindir)" && $(am__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 + $(am__rm_f) $(bin_PROGRAMS) + test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) 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 + $(am__rm_f) $(check_PROGRAMS) + test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @@ -1022,44 +1068,39 @@ uninstall-libLTLIBRARIES: done clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + -$(am__rm_f) $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } + echo rm -f $${locs}; \ + $(am__rm_f) $${locs} clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } + echo rm -f $${locs}; \ + $(am__rm_f) $${locs} arm/$(am__dirstamp): @$(MKDIR_P) arm - @: > arm/$(am__dirstamp) + @: >>arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) arm/$(DEPDIR) - @: > arm/$(DEPDIR)/$(am__dirstamp) + @: >>arm/$(DEPDIR)/$(am__dirstamp) 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) + @: >>mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) mips/$(DEPDIR) - @: > mips/$(DEPDIR)/$(am__dirstamp) + @: >>mips/$(DEPDIR)/$(am__dirstamp) mips/mips_init.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) mips/filter_msa_intrinsics.lo: mips/$(am__dirstamp) \ mips/$(DEPDIR)/$(am__dirstamp) @@ -1067,20 +1108,20 @@ mips/filter_mmi_inline_assembly.lo: mips/$(am__dirstamp) \ mips/$(DEPDIR)/$(am__dirstamp) intel/$(am__dirstamp): @$(MKDIR_P) intel - @: > intel/$(am__dirstamp) + @: >>intel/$(am__dirstamp) intel/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) intel/$(DEPDIR) - @: > intel/$(DEPDIR)/$(am__dirstamp) + @: >>intel/$(DEPDIR)/$(am__dirstamp) intel/intel_init.lo: intel/$(am__dirstamp) \ intel/$(DEPDIR)/$(am__dirstamp) intel/filter_sse2_intrinsics.lo: intel/$(am__dirstamp) \ intel/$(DEPDIR)/$(am__dirstamp) powerpc/$(am__dirstamp): @$(MKDIR_P) powerpc - @: > powerpc/$(am__dirstamp) + @: >>powerpc/$(am__dirstamp) powerpc/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) powerpc/$(DEPDIR) - @: > powerpc/$(DEPDIR)/$(am__dirstamp) + @: >>powerpc/$(DEPDIR)/$(am__dirstamp) powerpc/powerpc_init.lo: powerpc/$(am__dirstamp) \ powerpc/$(DEPDIR)/$(am__dirstamp) powerpc/filter_vsx_intrinsics.lo: powerpc/$(am__dirstamp) \ @@ -1090,10 +1131,10 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_O $(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) loongarch/$(am__dirstamp): @$(MKDIR_P) loongarch - @: > loongarch/$(am__dirstamp) + @: >>loongarch/$(am__dirstamp) loongarch/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) loongarch/$(DEPDIR) - @: > loongarch/$(DEPDIR)/$(am__dirstamp) + @: >>loongarch/$(DEPDIR)/$(am__dirstamp) loongarch/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la-loongarch_lsx_init.lo: \ loongarch/$(am__dirstamp) loongarch/$(DEPDIR)/$(am__dirstamp) loongarch/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la-filter_lsx_intrinsics.lo: \ @@ -1101,12 +1142,25 @@ loongarch/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la-filter_lsx_intrinsics.lo: \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_DEPENDENCIES) $(EXTRA_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_DEPENDENCIES) $(AM_V_CCLD)$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_LINK) $(am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_rpath) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_LIBADD) $(LIBS) +riscv/$(am__dirstamp): + @$(MKDIR_P) riscv + @: >>riscv/$(am__dirstamp) +riscv/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) riscv/$(DEPDIR) + @: >>riscv/$(DEPDIR)/$(am__dirstamp) +riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo: \ + riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) +riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo: \ + riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) + +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_DEPENDENCIES) $(EXTRA_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_LINK) $(am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_rpath) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_LIBADD) $(LIBS) contrib/tools/$(am__dirstamp): @$(MKDIR_P) contrib/tools - @: > contrib/tools/$(am__dirstamp) + @: >>contrib/tools/$(am__dirstamp) contrib/tools/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) contrib/tools/$(DEPDIR) - @: > contrib/tools/$(DEPDIR)/$(am__dirstamp) + @: >>contrib/tools/$(DEPDIR)/$(am__dirstamp) contrib/tools/png-fix-itxt.$(OBJEXT): contrib/tools/$(am__dirstamp) \ contrib/tools/$(DEPDIR)/$(am__dirstamp) @@ -1127,10 +1181,17 @@ pngfix$(EXEEXT): $(pngfix_OBJECTS) $(pngfix_DEPENDENCIES) $(EXTRA_pngfix_DEPENDE $(AM_V_CCLD)$(LINK) $(pngfix_OBJECTS) $(pngfix_LDADD) $(LIBS) contrib/libtests/$(am__dirstamp): @$(MKDIR_P) contrib/libtests - @: > contrib/libtests/$(am__dirstamp) + @: >>contrib/libtests/$(am__dirstamp) contrib/libtests/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) contrib/libtests/$(DEPDIR) - @: > contrib/libtests/$(DEPDIR)/$(am__dirstamp) + @: >>contrib/libtests/$(DEPDIR)/$(am__dirstamp) +contrib/libtests/pnggetset.$(OBJEXT): \ + contrib/libtests/$(am__dirstamp) \ + contrib/libtests/$(DEPDIR)/$(am__dirstamp) + +pnggetset$(EXEEXT): $(pnggetset_OBJECTS) $(pnggetset_DEPENDENCIES) $(EXTRA_pnggetset_DEPENDENCIES) + @rm -f pnggetset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pnggetset_OBJECTS) $(pnggetset_LDADD) $(LIBS) contrib/libtests/pngimage.$(OBJEXT): contrib/libtests/$(am__dirstamp) \ contrib/libtests/$(DEPDIR)/$(am__dirstamp) @@ -1216,6 +1277,8 @@ mostlyclean-compile: -rm -f mips/*.lo -rm -f powerpc/*.$(OBJEXT) -rm -f powerpc/*.lo + -rm -f riscv/*.$(OBJEXT) + -rm -f riscv/*.lo distclean-compile: -rm -f *.tab.c @@ -1237,9 +1300,9 @@ distclean-compile: @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)/pnggetset.Po@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 @@ -1257,37 +1320,15 @@ distclean-compile: @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 +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_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$$||'`;\ -@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $< - -.S.obj: -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.S.lo: -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< - .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @@ -1326,6 +1367,20 @@ loongarch/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la-filter_lsx_intrinsics.lo: loo @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_CFLAGS) $(CFLAGS) -c -o loongarch/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la-filter_lsx_intrinsics.lo `test -f 'loongarch/filter_lsx_intrinsics.c' || echo '$(srcdir)/'`loongarch/filter_lsx_intrinsics.c +riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo: riscv/riscv_init.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS) $(CFLAGS) -MT riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo -MD -MP -MF riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.Tpo -c -o riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo `test -f 'riscv/riscv_init.c' || echo '$(srcdir)/'`riscv/riscv_init.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.Tpo riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='riscv/riscv_init.c' object='riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS) $(CFLAGS) -c -o riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.lo `test -f 'riscv/riscv_init.c' || echo '$(srcdir)/'`riscv/riscv_init.c + +riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo: riscv/filter_rvv_intrinsics.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS) $(CFLAGS) -MT riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo -MD -MP -MF riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Tpo -c -o riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo `test -f 'riscv/filter_rvv_intrinsics.c' || echo '$(srcdir)/'`riscv/filter_rvv_intrinsics.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Tpo riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='riscv/filter_rvv_intrinsics.c' object='riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS) $(CFLAGS) -c -o riscv/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.lo `test -f 'riscv/filter_rvv_intrinsics.c' || echo '$(srcdir)/'`riscv/filter_rvv_intrinsics.c + mostlyclean-libtool: -rm -f *.lo @@ -1336,6 +1391,7 @@ clean-libtool: -rm -rf loongarch/.libs loongarch/_libs -rm -rf mips/.libs mips/_libs -rm -rf powerpc/.libs powerpc/_libs + -rm -rf riscv/.libs riscv/_libs distclean-libtool: -rm -f libtool config.lt @@ -1561,7 +1617,6 @@ distclean-tags: am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: - $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ @@ -1637,10 +1692,37 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ + output_system_information () \ + { \ + echo; \ + { uname -a | $(AWK) '{ \ + printf "System information (uname -a):"; \ + for (i = 1; i < NF; ++i) \ + { \ + if (i != 2) \ + printf " %s", $$i; \ + } \ + printf "\n"; \ +}'; } 2>&1; \ + if test -r /etc/os-release; then \ + echo "Distribution information (/etc/os-release):"; \ + sed 8q /etc/os-release; \ + elif test -r /etc/issue; then \ + echo "Distribution information (/etc/issue):"; \ + cat /etc/issue; \ + fi; \ + }; \ + please_report () \ + { \ +echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ +echo "together with the test-suite.log file (gzipped) and your system"; \ +echo "information. Thanks."; \ + }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ + output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ @@ -1660,26 +1742,25 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 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) + @$(am__rm_f) $(RECHECK_LOGS) + @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) + @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ @@ -1696,6 +1777,13 @@ tests/pngtest-all.log: tests/pngtest-all --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/pnggetset.log: tests/pnggetset + @p='tests/pnggetset'; \ + b='tests/pnggetset'; \ + $(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/pngvalid-gamma-16-to-8.log: tests/pngvalid-gamma-16-to-8 @p='tests/pngvalid-gamma-16-to-8'; \ b='tests/pngvalid-gamma-16-to-8'; \ @@ -1850,6 +1938,27 @@ tests/pngstest-sRGB-alpha.log: tests/pngstest-sRGB-alpha --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/pngstest-large-stride.log: tests/pngstest-large-stride + @p='tests/pngstest-large-stride'; \ + b='tests/pngstest-large-stride'; \ + $(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/pngstest-negative-stride.log: tests/pngstest-negative-stride + @p='tests/pngstest-negative-stride'; \ + b='tests/pngstest-negative-stride'; \ + $(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/pngstest-negative-stride-extra.log: tests/pngstest-negative-stride-extra + @p='tests/pngstest-negative-stride-extra'; \ + b='tests/pngstest-negative-stride-extra'; \ + $(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/pngunknown-IDAT.log: tests/pngunknown-IDAT @p='tests/pngunknown-IDAT'; \ b='tests/pngunknown-IDAT'; \ @@ -1927,12 +2036,13 @@ 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-am: $(DISTFILES) $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" + $(AM_V_at)$(MKDIR_P) "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1980,6 +2090,10 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) +dist-bzip3: distdir + tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3 + $(am__post_remove_distdir) + dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) @@ -2020,9 +2134,11 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.bz3*) \ + bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -2030,7 +2146,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ @@ -2138,36 +2254,38 @@ install-strip: "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + -$(am__rm_f) $(TEST_LOGS) + -$(am__rm_f) $(TEST_LOGS:.log=.trs) + -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + -$(am__rm_f) $(CLEANFILES) distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f arm/$(DEPDIR)/$(am__dirstamp) - -rm -f arm/$(am__dirstamp) - -rm -f contrib/libtests/$(DEPDIR)/$(am__dirstamp) - -rm -f contrib/libtests/$(am__dirstamp) - -rm -f contrib/tools/$(DEPDIR)/$(am__dirstamp) - -rm -f contrib/tools/$(am__dirstamp) - -rm -f intel/$(DEPDIR)/$(am__dirstamp) - -rm -f intel/$(am__dirstamp) - -rm -f loongarch/$(DEPDIR)/$(am__dirstamp) - -rm -f loongarch/$(am__dirstamp) - -rm -f mips/$(DEPDIR)/$(am__dirstamp) - -rm -f mips/$(am__dirstamp) - -rm -f powerpc/$(DEPDIR)/$(am__dirstamp) - -rm -f powerpc/$(am__dirstamp) + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) arm/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) arm/$(am__dirstamp) + -$(am__rm_f) contrib/libtests/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) contrib/libtests/$(am__dirstamp) + -$(am__rm_f) contrib/tools/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) contrib/tools/$(am__dirstamp) + -$(am__rm_f) intel/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) intel/$(am__dirstamp) + -$(am__rm_f) loongarch/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) loongarch/$(am__dirstamp) + -$(am__rm_f) mips/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) mips/$(am__dirstamp) + -$(am__rm_f) powerpc/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) powerpc/$(am__dirstamp) + -$(am__rm_f) riscv/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) riscv/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -$(am__rm_f) $(BUILT_SOURCES) + -$(am__rm_f) $(MAINTAINERCLEANFILES) @DO_INSTALL_LIBPNG_CONFIG_FALSE@@DO_INSTALL_LINKS_FALSE@install-exec-hook: @DO_INSTALL_LIBPNG_PC_FALSE@@DO_INSTALL_LINKS_FALSE@install-data-hook: @DO_INSTALL_LIBPNG_CONFIG_FALSE@@DO_INSTALL_LIBPNG_PC_FALSE@@DO_INSTALL_LINKS_FALSE@uninstall-hook: @@ -2179,7 +2297,7 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f ./$(DEPDIR)/png.Plo + -rm -f ./$(DEPDIR)/png.Plo -rm -f ./$(DEPDIR)/pngerror.Plo -rm -f ./$(DEPDIR)/pngget.Plo -rm -f ./$(DEPDIR)/pngmem.Plo @@ -2196,9 +2314,9 @@ distclean: distclean-am -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)/pnggetset.Po -rm -f contrib/libtests/$(DEPDIR)/pngimage.Po -rm -f contrib/libtests/$(DEPDIR)/pngstest.Po -rm -f contrib/libtests/$(DEPDIR)/pngunknown.Po @@ -2216,6 +2334,8 @@ distclean: distclean-am -rm -f mips/$(DEPDIR)/mips_init.Plo -rm -f powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo -rm -f powerpc/$(DEPDIR)/powerpc_init.Plo + -rm -f riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Plo + -rm -f riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags @@ -2267,7 +2387,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -f ./$(DEPDIR)/png.Plo + -rm -f ./$(DEPDIR)/png.Plo -rm -f ./$(DEPDIR)/pngerror.Plo -rm -f ./$(DEPDIR)/pngget.Plo -rm -f ./$(DEPDIR)/pngmem.Plo @@ -2284,9 +2404,9 @@ maintainer-clean: maintainer-clean-am -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)/pnggetset.Po -rm -f contrib/libtests/$(DEPDIR)/pngimage.Po -rm -f contrib/libtests/$(DEPDIR)/pngstest.Po -rm -f contrib/libtests/$(DEPDIR)/pngunknown.Po @@ -2304,6 +2424,8 @@ maintainer-clean: maintainer-clean-am -rm -f mips/$(DEPDIR)/mips_init.Plo -rm -f powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo -rm -f powerpc/$(DEPDIR)/powerpc_init.Plo + -rm -f riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-filter_rvv_intrinsics.Plo + -rm -f riscv/$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la-riscv_init.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -2336,15 +2458,15 @@ uninstall-man: uninstall-man3 uninstall-man5 clean-checkPROGRAMS clean-cscope clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ 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 \ + dist-bzip3 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 \ @@ -2418,9 +2540,10 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt: pngtest.o: pnglibconf.h contrib/libtests/makepng.o: pnglibconf.h +contrib/libtests/pnggetset.o: pnglibconf.h +contrib/libtests/pngimage.o: pnglibconf.h contrib/libtests/pngstest.o: pnglibconf.h contrib/libtests/pngunknown.o: pnglibconf.h -contrib/libtests/pngimage.o: pnglibconf.h contrib/libtests/pngvalid.o: pnglibconf.h contrib/libtests/readpng.o: pnglibconf.h contrib/libtests/tarith.o: pnglibconf.h @@ -2548,3 +2671,10 @@ all-am: $(check_PROGRAMS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/README b/README index afb8c7a9bf..130c7e7663 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.43.git +README for libpng version 1.6.59.git ==================================== See the note about version numbers near the top of `png.h`. @@ -24,14 +24,14 @@ 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 . +these at . -This code is currently being archived at https://libpng.sourceforge.io -in the download area, and at http://libpng.download/src . +This code is currently being archived at +in the download area, and at . 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 @@ -39,12 +39,12 @@ 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 @@ -142,10 +142,12 @@ Files included in this distribution pngwrite.c => High-level write functions pngwtran.c => Write data transformations pngwutil.c => Write utility functions - arm/ => Optimized code for the ARM platform - intel/ => Optimized code for the INTEL-SSE2 platform - mips/ => Optimized code for the MIPS platform - powerpc/ => Optimized code for the PowerPC platform + arm/ => Optimized code for ARM Neon + intel/ => Optimized code for INTEL SSE2 + loongarch/ => Optimized code for LoongArch LSX + mips/ => Optimized code for MIPS MSA and MIPS MMI + powerpc/ => Optimized code for PowerPC VSX + riscv/ => Optimized code for the RISC-V platform ci/ => Scripts for continuous integration contrib/ => External contributions arm-neon/ => Optimized code for the ARM-NEON platform @@ -156,12 +158,12 @@ Files included in this distribution "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 + pngexif/ => Program to inspect the EXIF information in PNG files pngminim/ => Minimal decoder, encoder, and progressive decoder programs demonstrating the use of pngusr.dfa pngminus/ => Simple pnm2png and png2pnm programs pngsuite/ => Test images + riscv-rvv/ => Optimized code for the RISC-V Vector platform testpngs/ => Test images tools/ => Various tools visupng/ => VisualPng, a Windows viewer for PNG images diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000000..4f385e592d --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,9 @@ +version = 1 + +[[annotations]] +SPDX-License-Identifier = "MIT" +path = "ci/**" + +[[annotations]] +SPDX-License-Identifier = "MIT-0" +path = ".github/workflows/**" diff --git a/TODO b/TODO index 562dab0696..83b123753b 100644 --- a/TODO +++ b/TODO @@ -1,23 +1,22 @@ -TODO - list of things to do for libpng: +TODO list for libpng +==================== -* 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. + * Fix all defects (duh!) + * 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 to 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/aclocal.m4 b/aclocal.m4 index 20850042aa..60f3217351 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.5 -*- Autoconf -*- +# generated automatically by aclocal 1.18.1 -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2025 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.72],, -[m4_warning([this file was generated for autoconf 2.72. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.73],, +[m4_warning([this file was generated for autoconf 2.73. 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-2021 Free Software Foundation, Inc. +# Copyright (C) 2002-2025 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.16' +[am__api_version='1.18' 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.16.5], [], +m4_if([$1], [1.18.1], [], [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.16.5])dnl +[AM_AUTOMAKE_VERSION([1.18.1])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-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2025 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-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2025 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-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2025 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-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -293,7 +293,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: + # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported @@ -352,7 +352,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -420,7 +420,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -520,8 +520,9 @@ AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], @@ -554,7 +555,7 @@ if test -z "$CSCOPE"; then fi AC_SUBST([CSCOPE]) -AC_REQUIRE([AM_SILENT_RULES])dnl +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 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. @@ -562,47 +563,9 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -# 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 -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. +AC_REQUIRE([_AM_PROG_RM_F]) +AC_REQUIRE([_AM_PROG_XARGS_N]) -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'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: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. @@ -635,7 +598,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-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -656,7 +619,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# Copyright (C) 2003-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -678,7 +641,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -713,7 +676,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -756,7 +719,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -790,7 +753,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -819,7 +782,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -851,7 +814,10 @@ AC_CACHE_CHECK( break fi done - rm -f core conftest* + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. @@ -866,7 +832,23 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2022-2025 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_PROG_RM_F +# --------------- +# Check whether 'rm -f' without any arguments works. +# https://bugs.gnu.org/10828 +AC_DEFUN([_AM_PROG_RM_F], +[am__rm_f_notfound= +AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) +AC_SUBST(am__rm_f_notfound) +]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -885,26 +867,181 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-2025 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_SLEEP_FRACTIONAL_SECONDS +# ---------------------------- +AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl +AC_CACHE_CHECK([whether sleep supports fractional seconds], + am_cv_sleep_fractional_seconds, [dnl +AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], + [am_cv_sleep_fractional_seconds=no]) +])]) + +# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION +# ----------------------------------- +# Determine the filesystem's resolution for file modification +# timestamps. The coarsest we know of is FAT, with a resolution +# of only two seconds, even with the most recent "exFAT" extensions. +# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one +# nanosecond, matching clock_gettime. However, it is probably not +# possible to delay execution of a shell script for less than one +# millisecond, due to process creation overhead and scheduling +# granularity, so we don't check for anything finer than that. (See below.) +AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl +AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) +AC_CACHE_CHECK([filesystem timestamp resolution], + am_cv_filesystem_timestamp_resolution, [dnl +# Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `[ls -t conftest.ts[12]]` && + { + test "$[]*" != "X conftest.ts1 conftest.ts2" || + test "$[]*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + _AS_ECHO_UNQUOTED( + ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], + [AS_MESSAGE_LOG_FD]) + AC_MSG_FAILURE([ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment.]) +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$[]2" = conftest.ts3 && + test "$[]3" = conftest.ts2 && + test "$[]4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) +])]) + # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) +[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) +# This check should not be cached, as it may vary across builds of +# different projects. +AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_RESULT([no]) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_RESULT([no]) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac @@ -913,49 +1050,40 @@ esac # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[]*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$[]2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +AC_MSG_RESULT([$am_build_env_is_sane]) +if test "$am_build_env_is_sane" = no; then + AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT([yes]) + # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & +AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl + ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! -fi +]) AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then @@ -966,18 +1094,18 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2009-2025 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_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl +# _AM_SILENT_RULES +# ---------------- +# Enable less verbose build rules support. +AC_DEFUN([_AM_SILENT_RULES], +[AM_DEFAULT_VERBOSITY=1 +AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) @@ -985,11 +1113,6 @@ AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. @@ -1008,14 +1131,6 @@ am__doit: else am_cv_make_support_nested_variables=no fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl @@ -1024,9 +1139,37 @@ AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls +dnl to AM_SILENT_RULES to change the default value. +AC_CONFIG_COMMANDS_PRE([dnl +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +])dnl +]) + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or +# empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_REQUIRE([_AM_SILENT_RULES]) +AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline +dnl We intentionally force a newline after the assignment, since a) nothing +dnl good can come of more text following, and b) that was the behavior +dnl before 1.17. See https://bugs.gnu.org/72267. ]) -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1054,7 +1197,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# Copyright (C) 2006-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1073,7 +1216,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# Copyright (C) 2004-2025 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1119,15 +1262,19 @@ m4_if([$1], [v7], am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) + if test x$am_uid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) + elif test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no]) - _am_tools=none + AC_MSG_RESULT([no]) + _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) + if test x$gm_gid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) + elif test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none @@ -1204,6 +1351,26 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +# Copyright (C) 2022-2025 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_PROG_XARGS_N +# ---------------- +# Check whether 'xargs -n' works. It should work everywhere, so the fallback +# is not optimized at all as we never expect to use it. +AC_DEFUN([_AM_PROG_XARGS_N], +[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl +AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) +AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl + am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' +])dnl +AC_SUBST(am__xargs_n) +]) + m4_include([scripts/autoconf/libtool.m4]) m4_include([scripts/autoconf/ltoptions.m4]) m4_include([scripts/autoconf/ltsugar.m4]) diff --git a/arm/arm_init.c b/arm/arm_init.c index 84d05556f8..0ea9c836cc 100644 --- a/arm/arm_init.c +++ b/arm/arm_init.c @@ -1,4 +1,3 @@ - /* arm_init.c - NEON optimised filter functions * * Copyright (c) 2018-2022 Cosmin Truta @@ -36,14 +35,14 @@ #ifndef PNG_ARM_NEON_FILE # 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" +# 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" +# 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" +# error No support for run-time ARM Neon checking; use compile-time options # endif #endif @@ -54,7 +53,7 @@ static int png_have_neon(png_structp png_ptr); #endif /* PNG_ARM_NEON_CHECK_SUPPORTED */ #ifndef PNG_ALIGNED_MEMORY_SUPPORTED -# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED" +# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED #endif void diff --git a/arm/filter_neon.S b/arm/filter_neon.S index 2308aad13e..0cbd372cb1 100644 --- a/arm/filter_neon.S +++ b/arm/filter_neon.S @@ -1,253 +1,60 @@ - -/* filter_neon.S - NEON optimised filter functions +/* filter_neon.S - placeholder file * - * Copyright (c) 2018 Cosmin Truta - * Copyright (c) 2014,2017 Glenn Randers-Pehrson - * Written by Mans Rullgard, 2011. + * Copyright (c) 2024 Cosmin Truta * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ +/* IMPORTANT NOTE: + * + * Historically, the hand-coded assembler implementation of Neon optimizations + * in this module had not been in sync with the intrinsics-based implementation + * in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since + * the introduction of riffled palette optimizations. Moreover, the assembler + * code used to work on 32-bit ARM only, and it caused problems, even if empty, + * on 64-bit ARM. + * + * All references to this module from our internal build scripts and projects + * have been removed. + * + * For the external projects that might still expect this module to be present, + * we leave this stub in place, for the remaining lifetime of libpng-1.6.x. + * Everything should continue to function normally, as long as there are no + * deliberate attempts to use the old hand-made assembler code. A build error + * will be raised otherwise. + */ + /* This is required to get the symbol renames, which are #defines, and the * definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION. */ #define PNG_VERSION_INFO_ONLY #include "../pngpriv.h" -#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ -#endif - #ifdef PNG_READ_SUPPORTED - -/* Assembler NEON support - only works for 32-bit ARM (i.e. it does not work for - * ARM64). The code in arm/filter_neon_intrinsics.c supports ARM64, however it - * only works if -mfpu=neon is specified on the GCC command line. See pngpriv.h - * for the logic which sets PNG_USE_ARM_NEON_ASM: - */ #if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */ - #if PNG_ARM_NEON_OPT > 0 -#ifdef __ELF__ -# define ELF +#if defined(__clang__) +#define GNUC_VERSION 0 /* not gcc, although it might pretend to be */ +#elif defined(__GNUC__) +#define GNUC_MAJOR (__GNUC__ + 0) +#define GNUC_MINOR (__GNUC_MINOR__ + 0) +#define GNUC_PATCHLEVEL (__GNUC_PATCHLEVEL__ + 0) +#define GNUC_VERSION (GNUC_MAJOR * 10000 + GNUC_MINOR * 100 + GNUC_PATCHLEVEL) #else -# define ELF @ +#define GNUC_VERSION 0 /* not gcc */ #endif - .arch armv7-a - .fpu neon - -.macro func name, export=0 - .macro endfunc -ELF .size \name, . - \name - .endfunc - .purgem endfunc - .endm - .text - - /* Explicitly specifying alignment here because some versions of - * GAS don't align code correctly. This is harmless in correctly - * written versions of GAS. - */ - .align 2 - - .if \export - .global \name - .endif -ELF .type \name, STT_FUNC - .func \name -\name: -.endm - -func png_read_filter_row_sub4_neon, export=1 - ldr r3, [r0, #4] @ rowbytes - vmov.i8 d3, #0 -1: - vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] - vadd.u8 d0, d3, d4 - vadd.u8 d1, d0, d5 - vadd.u8 d2, d1, d6 - vadd.u8 d3, d2, d7 - vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! - subs r3, r3, #16 - bgt 1b - - bx lr -endfunc - -func png_read_filter_row_sub3_neon, export=1 - ldr r3, [r0, #4] @ rowbytes - vmov.i8 d3, #0 - mov r0, r1 - mov r2, #3 - mov r12, #12 - vld1.8 {q11}, [r0], r12 -1: - vext.8 d5, d22, d23, #3 - vadd.u8 d0, d3, d22 - vext.8 d6, d22, d23, #6 - vadd.u8 d1, d0, d5 - vext.8 d7, d23, d23, #1 - vld1.8 {q11}, [r0], r12 - vst1.32 {d0[0]}, [r1,:32], r2 - vadd.u8 d2, d1, d6 - vst1.32 {d1[0]}, [r1], r2 - vadd.u8 d3, d2, d7 - vst1.32 {d2[0]}, [r1], r2 - vst1.32 {d3[0]}, [r1], r2 - subs r3, r3, #12 - bgt 1b - - bx lr -endfunc - -func png_read_filter_row_up_neon, export=1 - ldr r3, [r0, #4] @ rowbytes -1: - vld1.8 {q0}, [r1,:128] - vld1.8 {q1}, [r2,:128]! - vadd.u8 q0, q0, q1 - vst1.8 {q0}, [r1,:128]! - subs r3, r3, #16 - bgt 1b - - bx lr -endfunc - -func png_read_filter_row_avg4_neon, export=1 - ldr r12, [r0, #4] @ rowbytes - vmov.i8 d3, #0 -1: - vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] - vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]! - vhadd.u8 d0, d3, d16 - vadd.u8 d0, d0, d4 - vhadd.u8 d1, d0, d17 - vadd.u8 d1, d1, d5 - vhadd.u8 d2, d1, d18 - vadd.u8 d2, d2, d6 - vhadd.u8 d3, d2, d19 - vadd.u8 d3, d3, d7 - vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! - subs r12, r12, #16 - bgt 1b - - bx lr -endfunc - -func png_read_filter_row_avg3_neon, export=1 - push {r4,lr} - ldr r12, [r0, #4] @ rowbytes - vmov.i8 d3, #0 - mov r0, r1 - mov r4, #3 - mov lr, #12 - vld1.8 {q11}, [r0], lr -1: - vld1.8 {q10}, [r2], lr - vext.8 d5, d22, d23, #3 - vhadd.u8 d0, d3, d20 - vext.8 d17, d20, d21, #3 - vadd.u8 d0, d0, d22 - vext.8 d6, d22, d23, #6 - vhadd.u8 d1, d0, d17 - vext.8 d18, d20, d21, #6 - vadd.u8 d1, d1, d5 - vext.8 d7, d23, d23, #1 - vld1.8 {q11}, [r0], lr - vst1.32 {d0[0]}, [r1,:32], r4 - vhadd.u8 d2, d1, d18 - vst1.32 {d1[0]}, [r1], r4 - vext.8 d19, d21, d21, #1 - vadd.u8 d2, d2, d6 - vhadd.u8 d3, d2, d19 - vst1.32 {d2[0]}, [r1], r4 - vadd.u8 d3, d3, d7 - vst1.32 {d3[0]}, [r1], r4 - subs r12, r12, #12 - bgt 1b - - pop {r4,pc} -endfunc - -.macro paeth rx, ra, rb, rc - vaddl.u8 q12, \ra, \rb @ a + b - vaddl.u8 q15, \rc, \rc @ 2*c - vabdl.u8 q13, \rb, \rc @ pa - vabdl.u8 q14, \ra, \rc @ pb - vabd.u16 q15, q12, q15 @ pc - vcle.u16 q12, q13, q14 @ pa <= pb - vcle.u16 q13, q13, q15 @ pa <= pc - vcle.u16 q14, q14, q15 @ pb <= pc - vand q12, q12, q13 @ pa <= pb && pa <= pc - vmovn.u16 d28, q14 - vmovn.u16 \rx, q12 - vbsl d28, \rb, \rc - vbsl \rx, \ra, d28 -.endm - -func png_read_filter_row_paeth4_neon, export=1 - ldr r12, [r0, #4] @ rowbytes - vmov.i8 d3, #0 - vmov.i8 d20, #0 -1: - vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] - vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]! - paeth d0, d3, d16, d20 - vadd.u8 d0, d0, d4 - paeth d1, d0, d17, d16 - vadd.u8 d1, d1, d5 - paeth d2, d1, d18, d17 - vadd.u8 d2, d2, d6 - paeth d3, d2, d19, d18 - vmov d20, d19 - vadd.u8 d3, d3, d7 - vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! - subs r12, r12, #16 - bgt 1b - - bx lr -endfunc - -func png_read_filter_row_paeth3_neon, export=1 - push {r4,lr} - ldr r12, [r0, #4] @ rowbytes - vmov.i8 d3, #0 - vmov.i8 d4, #0 - mov r0, r1 - mov r4, #3 - mov lr, #12 - vld1.8 {q11}, [r0], lr -1: - vld1.8 {q10}, [r2], lr - paeth d0, d3, d20, d4 - vext.8 d5, d22, d23, #3 - vadd.u8 d0, d0, d22 - vext.8 d17, d20, d21, #3 - paeth d1, d0, d17, d20 - vst1.32 {d0[0]}, [r1,:32], r4 - vext.8 d6, d22, d23, #6 - vadd.u8 d1, d1, d5 - vext.8 d18, d20, d21, #6 - paeth d2, d1, d18, d17 - vext.8 d7, d23, d23, #1 - vld1.8 {q11}, [r0], lr - vst1.32 {d1[0]}, [r1], r4 - vadd.u8 d2, d2, d6 - vext.8 d19, d21, d21, #1 - paeth d3, d2, d19, d18 - vst1.32 {d2[0]}, [r1], r4 - vmov d4, d19 - vadd.u8 d3, d3, d7 - vst1.32 {d3[0]}, [r1], r4 - subs r12, r12, #12 - bgt 1b +#if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300) +#error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0" +#elif GNUC_VERSION == 40504 +#error "PNG_ARM_NEON is not supported with gcc version 4.5.4" +#else +#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support" +#endif - pop {r4,pc} -endfunc #endif /* PNG_ARM_NEON_OPT > 0 */ -#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 (assembler) */ +#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */ #endif /* READ */ diff --git a/arm/filter_neon_intrinsics.c b/arm/filter_neon_intrinsics.c index 4466d48b20..6c3f1184a8 100644 --- a/arm/filter_neon_intrinsics.c +++ b/arm/filter_neon_intrinsics.c @@ -1,4 +1,3 @@ - /* filter_neon_intrinsics.c - NEON optimised filter functions * * Copyright (c) 2018 Cosmin Truta @@ -49,7 +48,7 @@ void png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_bytep rp_stop = row + row_info->rowbytes; @@ -70,7 +69,7 @@ png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row, void png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_bytep rp_stop = row + row_info->rowbytes; @@ -117,7 +116,7 @@ png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row, void png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_bytep rp_stop = row + row_info->rowbytes; @@ -149,7 +148,7 @@ png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row, void png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_const_bytep pp = prev_row; @@ -217,7 +216,7 @@ png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row, void png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_bytep rp_stop = row + row_info->rowbytes; @@ -286,7 +285,7 @@ paeth(uint8x8_t a, uint8x8_t b, uint8x8_t c) void png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_const_bytep pp = prev_row; @@ -354,7 +353,7 @@ png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row, void png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp = row; png_bytep rp_stop = row + row_info->rowbytes; diff --git a/arm/palette_neon_intrinsics.c b/arm/palette_neon_intrinsics.c index 92c7d6f9f6..0967ea1aeb 100644 --- a/arm/palette_neon_intrinsics.c +++ b/arm/palette_neon_intrinsics.c @@ -1,7 +1,6 @@ - /* palette_neon_intrinsics.c - NEON optimised palette expansion functions * - * Copyright (c) 2018-2019 Cosmin Truta + * Copyright (c) 2018-2026 Cosmin Truta * Copyright (c) 2017-2018 Arm Holdings. All rights reserved. * Written by Richard Townsend , February 2017. * @@ -49,12 +48,12 @@ png_riffle_palette_neon(png_structrp png_ptr) 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); + vst4q_u8(riffled_palette + i * 4, w); } /* Fix up the missing transparency values. */ for (i = 0; i < num_trans; i++) - riffled_palette[(i << 2) + 3] = trans_alpha[i]; + riffled_palette[i * 4 + 3] = trans_alpha[i]; } /* Expands a palettized row into RGBA8. */ @@ -64,7 +63,7 @@ png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info, { png_uint_32 row_width = row_info->width; const png_uint_32 *riffled_palette = - (const png_uint_32 *)png_ptr->riffled_palette; + png_aligncastconst(png_const_uint_32p, png_ptr->riffled_palette); const png_uint_32 pixels_per_chunk = 4; png_uint_32 i; @@ -78,27 +77,26 @@ png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info, * 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); + *ddp = *ddp - (pixels_per_chunk * 4 - 1); - for (i = 0; i < row_width; i += pixels_per_chunk) + for (i = 0; i + pixels_per_chunk <= row_width; i += pixels_per_chunk) { uint32x4_t cur; - png_bytep sp = *ssp - i, dp = *ddp - (i << 2); + png_bytep sp = *ssp - i, dp = *ddp - i * 4; 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. */ + /* Undo the pre-adjustment of *ddp before the pointer handoff, + * so the scalar fallback in pngrtran.c receives a dp that points + * to the correct position. + */ + *ddp = *ddp + (pixels_per_chunk * 4 - 1); *ssp = *ssp - i; - *ddp = *ddp - (i << 2); + *ddp = *ddp - i * 4; return i; } @@ -119,32 +117,30 @@ png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info, return 0; /* Seeking this back by 8 pixels x 3 bytes. */ - *ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1); + *ddp = *ddp - (pixels_per_chunk * 3 - 1); - for (i = 0; i < row_width; i += pixels_per_chunk) + for (i = 0; i + pixels_per_chunk <= 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); + png_bytep sp = *ssp - i, dp = *ddp - i * 3; + cur = vld3_dup_u8(palette + *(sp - 7) * 3); + cur = vld3_lane_u8(palette + *(sp - 6) * 3, cur, 1); + cur = vld3_lane_u8(palette + *(sp - 5) * 3, cur, 2); + cur = vld3_lane_u8(palette + *(sp - 4) * 3, cur, 3); + cur = vld3_lane_u8(palette + *(sp - 3) * 3, cur, 4); + cur = vld3_lane_u8(palette + *(sp - 2) * 3, cur, 5); + cur = vld3_lane_u8(palette + *(sp - 1) * 3, cur, 6); + cur = vld3_lane_u8(palette + *(sp - 0) * 3, 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. */ + /* Undo the pre-adjustment of *ddp before the pointer handoff, + * so the scalar fallback in pngrtran.c receives a dp that points + * to the correct position. + */ + *ddp = *ddp + (pixels_per_chunk * 3 - 1); *ssp = *ssp - i; - *ddp = *ddp - ((i << 1) + i); + *ddp = *ddp - i * 3; return i; } diff --git a/ci/.shellcheckrc b/ci/.shellcheckrc index 3c035d60c9..da7fd52d69 100644 --- a/ci/.shellcheckrc +++ b/ci/.shellcheckrc @@ -1,3 +1,6 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + # Disable the "expressions don't expand in single quotes, use double quotes" # advice. We need the regular expressions to remain uninterpolated. disable=SC2016 diff --git a/ci/README.md b/ci/README.md new file mode 100644 index 0000000000..d11c14d2aa --- /dev/null +++ b/ci/README.md @@ -0,0 +1,24 @@ +Scripts for the Continuous Integration of the PNG Reference Library +=================================================================== + +Copyright Notice +---------------- + +Copyright (C) 2019 Cosmin Truta. + +Use, modification and distribution are subject to the MIT License. +Please see the accompanying file `LICENSES/MIT.txt` or visit + + +File List +--------- + + README.md ==> This file + ci_lint.sh ==> Lint the source code + ci_verify_cmake.sh ==> Verify the build driven by CMakeLists.txt + ci_verify_configure.sh ==> Verify the build driven by configure + ci_verify_makefiles.sh ==> Verify the build driven by scripts/makefile.* + ci_verify_version.sh ==> Verify the consistency of version definitions + lib/ci.lib.sh ==> Shell library for the main ci_*.sh scripts + libexec/ci_*.sh ==> Shell utilities for the main ci_*.sh scripts + targets/*/ci_env.*.sh ==> Shell environments for cross-platform testing diff --git a/ci/ci_lint.sh b/ci/ci_lint.sh index 9b9dc6bf26..c1e1550fb8 100755 --- a/ci/ci_lint.sh +++ b/ci/ci_lint.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash set -o errexit -o pipefail -o posix -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# +# Copyright (C) 2019 Cosmin Truta # SPDX-License-Identifier: MIT -# shellcheck source="ci/lib/ci.lib.sh" +# shellcheck source=ci/lib/ci.lib.sh source "$(dirname "$0")/lib/ci.lib.sh" cd "$CI_TOPLEVEL_DIR" @@ -17,8 +13,8 @@ CI_SHELLCHECK="${CI_SHELLCHECK:-shellcheck}" CI_EDITORCONFIG_CHECKER="${CI_EDITORCONFIG_CHECKER:-editorconfig-checker}" CI_YAMLLINT="${CI_YAMLLINT:-yamllint}" -# Initialize the global lint counter. -CI_LINT_COUNTER=0 +# Initialize the global lint status. +CI_LINT_STATUS=0 function ci_init_lint { ci_info "## START OF LINTING ##" @@ -45,14 +41,13 @@ function ci_init_lint { function ci_finish_lint { ci_info "## END OF LINTING ##" - if [[ $CI_LINT_COUNTER -eq 0 ]] + if [[ $CI_LINT_STATUS -eq 0 ]] then - ci_info "success!" - return 0 + ci_info "## SUCCESS ##" else - ci_warn "$CI_LINT_COUNTER failure(s)" - return 1 + ci_info "linting failed" fi + return "$CI_LINT_STATUS" } function ci_lint_ci_scripts { @@ -61,14 +56,17 @@ function ci_lint_ci_scripts { return 0 } ci_info "## LINTING: CI scripts ##" - local my_file ci_spawn "$CI_SHELLCHECK" --version - for my_file in ci/*.sh - do - ci_spawn "$CI_SHELLCHECK" -x "$my_file" || { - CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1)) - } - done + find ./ci -name "ci_*.sh" -not -name "ci_env.*.sh" | { + local my_file + while IFS="" read -r my_file + do + ci_spawn "$CI_SHELLCHECK" -x "$my_file" || { + # Linting failed. + return 1 + } + done + } } function ci_lint_text_files { @@ -77,10 +75,10 @@ function ci_lint_text_files { return 0 } ci_info "## LINTING: text files ##" - local my_file ci_spawn "$CI_EDITORCONFIG_CHECKER" --version - ci_spawn "$CI_EDITORCONFIG_CHECKER" || { - CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1)) + ci_spawn "$CI_EDITORCONFIG_CHECKER" --config .editorconfig-checker.json || { + # Linting failed. + return 1 } } @@ -90,21 +88,26 @@ function ci_lint_yaml_files { return 0 } ci_info "## LINTING: YAML files ##" - local my_file ci_spawn "$CI_YAMLLINT" --version - for my_file in .*.yml - do - ci_spawn "$CI_YAMLLINT" --strict "$my_file" || { - CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1)) - } - done + # Considering that the YAML format is an extension of the JSON format, + # we can lint both the YAML files and the plain JSON files here. + find . \( -iname "*.yml" -o -iname "*.yaml" -o -iname "*.json" \) -not -path "./out/*" | { + local my_file + while IFS="" read -r my_file + do + ci_spawn "$CI_YAMLLINT" --strict "$my_file" || { + # Linting failed. + return 1 + } + done + } } function ci_lint { ci_init_lint - ci_lint_ci_scripts - ci_lint_text_files - ci_lint_yaml_files + ci_lint_ci_scripts || CI_LINT_STATUS=1 + ci_lint_text_files || CI_LINT_STATUS=1 + ci_lint_yaml_files || CI_LINT_STATUS=1 # TODO: ci_lint_png_files, etc. ci_finish_lint } diff --git a/ci/ci_shellify.sh b/ci/ci_shellify.sh deleted file mode 100755 index bf6dd7ce6c..0000000000 --- a/ci/ci_shellify.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -o pipefail -o posix - -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# -# SPDX-License-Identifier: MIT - -# shellcheck source="ci/lib/ci.lib.sh" -source "$(dirname "$0")/lib/ci.lib.sh" -cd "$CI_TOPLEVEL_DIR" - -function ci_shellify_c { - # Convert C preprocessor text, specifically originating - # from png.h, to shell scripting text. - # Select only the easy-to-parse definitions of PNG_LIBPNG_*. - sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' | - sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \ - -e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \ - -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/' -} - -function ci_shellify_autoconf { - # Convert autoconf (M4) text, specifically originating - # from configure.ac, to shell scripting text. - # Select only the easy-to-parse definitions of PNGLIB_*. - sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' | - sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \ - -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/' -} - -function ci_shellify_cmake { - # Convert CMake lists text, specifically originating - # from CMakeLists.txt, to shell scripting text. - # Select only the easy-to-parse definitions of PNGLIB_*. - sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' | - sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \ - -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/' -} - -function ci_shellify { - local arg filename - for arg in "$@" - do - test -f "$arg" || ci_err "no such file: '$arg'" - filename="$(basename -- "$arg")" - case "$filename" in - ( *.[ch] ) - [[ $filename == png.h ]] || { - ci_err "unable to shellify: '$filename' (expecting: 'png.h')" - } - ci_shellify_c <"$arg" ;; - ( config* | *.ac ) - [[ $filename == configure.ac ]] || { - ci_err "unable to shellify: '$filename' (expecting: 'configure.ac')" - } - ci_shellify_autoconf <"$arg" ;; - ( *CMake* | *cmake* | *.txt ) - [[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || { - ci_err "unable to shellify: '$filename' (expecting: 'CMakeLists.txt')" - } - ci_shellify_cmake <"$arg" ;; - ( * ) - ci_err "unable to shellify: '$arg'" ;; - esac - done -} - -function usage { - echo "usage: $CI_SCRIPT_NAME [] ..." - echo "options: -?|-h|--help" - echo "files: png.h|configure.ac|CMakeLists.txt" - exit "${@:-0}" -} - -function main { - local opt - while getopts ":" opt - do - # This ain't a while-loop. It only pretends to be. - [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0 - ci_err "unknown option: '$1'" - done - shift $((OPTIND - 1)) - [[ $# -eq 0 ]] && usage 2 - # And... go! - ci_shellify "$@" -} - -main "$@" diff --git a/ci/ci_verify_cmake.sh b/ci/ci_verify_cmake.sh index 0985d5f84e..adb7eb61d5 100755 --- a/ci/ci_verify_cmake.sh +++ b/ci/ci_verify_cmake.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash set -o errexit -o pipefail -o posix -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# +# Copyright (C) 2019 Cosmin Truta # SPDX-License-Identifier: MIT -# shellcheck source="ci/lib/ci.lib.sh" +# shellcheck source=ci/lib/ci.lib.sh source "$(dirname "$0")/lib/ci.lib.sh" cd "$CI_TOPLEVEL_DIR" @@ -17,12 +13,6 @@ CI_OUT_DIR="$CI_TOPLEVEL_DIR/out" CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build" CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.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_BUILD_TO_SRC_RELDIR="../.." -CI_BUILD_TO_INSTALL_RELDIR="../ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install" - function ci_init_build { # Ensure that the mandatory variables are initialized. CI_CMAKE="${CI_CMAKE:-cmake}" @@ -69,6 +59,8 @@ function ci_trace_build { ci_info "environment option: \$CI_AR: '$CI_AR'" ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'" ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'" + ci_info "environment option: \$CI_FORCE: '$CI_FORCE'" + ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'" 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'" @@ -126,61 +118,56 @@ function ci_build { local all_cmake_build_flags=() local all_ctest_flags=() [[ $CI_CMAKE_TOOLCHAIN_FILE ]] && { - all_cmake_vars+=(-DCMAKE_TOOLCHAIN_FILE="$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_cmake_vars+=("-DCMAKE_C_COMPILER=$CI_CC") } [[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && { [[ $CI_SANITIZERS ]] && CI_CC_FLAGS+="${CI_CC_FLAGS:+" "}-fsanitize=$CI_SANITIZERS" - all_cmake_vars+=(-DCMAKE_C_FLAGS="$CI_CC_FLAGS") + all_cmake_vars+=("-DCMAKE_C_FLAGS=$CI_CC_FLAGS") } [[ $CI_AR ]] && { - all_cmake_vars+=(-DCMAKE_AR="$CI_AR") + all_cmake_vars+=("-DCMAKE_AR=$CI_AR") } [[ $CI_RANLIB ]] && { - all_cmake_vars+=(-DCMAKE_RANLIB="$CI_RANLIB") + all_cmake_vars+=("-DCMAKE_RANLIB=$CI_RANLIB") } - all_cmake_vars+=(-DCMAKE_BUILD_TYPE="$CI_CMAKE_BUILD_TYPE") - all_cmake_vars+=(-DCMAKE_VERBOSE_MAKEFILE=ON) + all_cmake_vars+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE") + all_cmake_vars+=("-DCMAKE_VERBOSE_MAKEFILE=ON") all_cmake_vars+=($CI_CMAKE_VARS) all_cmake_build_flags+=($CI_CMAKE_BUILD_FLAGS) all_ctest_flags+=($CI_CTEST_FLAGS) # And... build! - # Use $CI_BUILD_TO_SRC_RELDIR and $CI_BUILD_TO_INSTALL_RELDIR - # instead of $CI_SRC_DIR and $CI_INSTALL_DIR from this point onwards. ci_spawn mkdir -p "$CI_BUILD_DIR" - ci_spawn cd "$CI_BUILD_DIR" - [[ $CI_BUILD_TO_SRC_RELDIR -ef $CI_SRC_DIR ]] || { - ci_err_internal "bad or missing \$CI_BUILD_TO_SRC_RELDIR" - } - ci_spawn mkdir -p "$CI_INSTALL_DIR" - [[ $CI_BUILD_TO_INSTALL_RELDIR -ef $CI_INSTALL_DIR ]] || { - ci_err_internal "bad or missing \$CI_BUILD_TO_INSTALL_RELDIR" - } # Spawn "cmake ...". - ci_spawn "$CI_CMAKE" -DCMAKE_INSTALL_PREFIX="$CI_BUILD_TO_INSTALL_RELDIR" \ - "${all_cmake_vars[@]}" \ - "$CI_BUILD_TO_SRC_RELDIR" - # Spawn "cmake --build ...". - ci_spawn "$CI_CMAKE" --build . \ - --config "$CI_CMAKE_BUILD_TYPE" \ - "${all_cmake_build_flags[@]}" + ci_spawn "$CI_CMAKE" -B "$CI_BUILD_DIR" \ + -S . \ + -DCMAKE_INSTALL_PREFIX="$CI_INSTALL_DIR" \ + "${all_cmake_vars[@]}" + ci_expr $((CI_NO_BUILD)) || { + # Spawn "cmake --build ...". + ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \ + --config "$CI_CMAKE_BUILD_TYPE" \ + "${all_cmake_build_flags[@]}" + } ci_expr $((CI_NO_TEST)) || { # Spawn "ctest" if testing is not disabled. + ci_spawn pushd "$CI_BUILD_DIR" ci_spawn "$CI_CTEST" --build-config "$CI_CMAKE_BUILD_TYPE" \ "${all_ctest_flags[@]}" + ci_spawn popd } ci_expr $((CI_NO_INSTALL)) || { # Spawn "cmake --build ... --target install" if installation is not disabled. - ci_spawn "$CI_CMAKE" --build . \ + ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \ --config "$CI_CMAKE_BUILD_TYPE" \ --target install \ "${all_cmake_build_flags[@]}" } ci_expr $((CI_NO_CLEAN)) || { # Spawn "make --build ... --target clean" if cleaning is not disabled. - ci_spawn "$CI_CMAKE" --build . \ + ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \ --config "$CI_CMAKE_BUILD_TYPE" \ --target clean \ "${all_cmake_build_flags[@]}" diff --git a/ci/ci_verify_configure.sh b/ci/ci_verify_configure.sh index 0a2bd807a3..2f986eb686 100755 --- a/ci/ci_verify_configure.sh +++ b/ci/ci_verify_configure.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash set -o errexit -o pipefail -o posix -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# +# Copyright (C) 2019 Cosmin Truta # SPDX-License-Identifier: MIT -# shellcheck source="ci/lib/ci.lib.sh" +# shellcheck source=ci/lib/ci.lib.sh source "$(dirname "$0")/lib/ci.lib.sh" cd "$CI_TOPLEVEL_DIR" @@ -57,6 +53,8 @@ function ci_trace_build { ci_info "environment option: \$CI_LD: '$CI_LD'" ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'" ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'" + ci_info "environment option: \$CI_FORCE: '$CI_FORCE'" + ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'" 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'" @@ -80,18 +78,29 @@ function ci_trace_build { } function ci_cleanup_old_build { - ci_info "## START OF PRE-BUILD CHECKUP ##" - ci_spawn test '!' -f "$CI_SRC_DIR/config.status" || { - # Warn the user, but do not delete their files. - ci_warn "unexpected build configuration file: '$CI_SRC_DIR/config.status'" - ci_warn "the configure script might fail" - } - ci_info "## END OF PRE-BUILD CHECKUP ##" ci_info "## START OF PRE-BUILD CLEANUP ##" [[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || { ci_spawn rm -fr "$CI_BUILD_DIR" ci_spawn rm -fr "$CI_INSTALL_DIR" } + [[ ! -e "$CI_SRC_DIR/config.status" ]] || { + ci_warn "unexpected build configuration file: '$CI_SRC_DIR/config.status'" + if ci_expr $((CI_FORCE)) + then + # Delete the old config and (possibly) the old build. + ci_info "note: forcing an in-tree build cleanup" + if [[ -f $CI_SRC_DIR/Makefile ]] + then + ci_spawn make -C "$CI_SRC_DIR" distclean + else + ci_spawn rm -fr "$CI_SRC_DIR"/config.{log,status} + fi + else + # Alert the user, but do not delete their files. + ci_warn "the configure script might fail" + ci_info "hint: consider using the option \$CI_FORCE=1" + fi + } ci_info "## END OF PRE-BUILD CLEANUP ##" } @@ -110,13 +119,19 @@ function ci_build { ci_spawn export CFLAGS="${CFLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS" ci_spawn export LDFLAGS="${LDFLAGS}${LDFLAGS:+" "}-fsanitize=$CI_SANITIZERS" } + # Spawn "autogen.sh" if the configure script is not available. + [[ -x "$CI_SRC_DIR/configure" ]] || { + ci_spawn "$CI_SRC_DIR/autogen.sh" + } # And... build! ci_spawn mkdir -p "$CI_BUILD_DIR" ci_spawn cd "$CI_BUILD_DIR" # Spawn "configure". ci_spawn "$CI_SRC_DIR/configure" --prefix="$CI_INSTALL_DIR" $CI_CONFIGURE_FLAGS - # Spawn "make". - ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS + ci_expr $((CI_NO_BUILD)) || { + # Spawn "make". + ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS + } ci_expr $((CI_NO_TEST)) || { # Spawn "make test" if testing is not disabled. ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS test diff --git a/ci/ci_verify_makefiles.sh b/ci/ci_verify_makefiles.sh index a0db93879c..412a79d55a 100755 --- a/ci/ci_verify_makefiles.sh +++ b/ci/ci_verify_makefiles.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash set -o errexit -o pipefail -o posix -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# +# Copyright (C) 2019 Cosmin Truta # SPDX-License-Identifier: MIT -# shellcheck source="ci/lib/ci.lib.sh" +# shellcheck source=ci/lib/ci.lib.sh source "$(dirname "$0")/lib/ci.lib.sh" cd "$CI_TOPLEVEL_DIR" @@ -50,6 +46,8 @@ function ci_trace_build { ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'" ci_info "environment option: \$CI_LIBS: '$CI_LIBS'" ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'" + ci_info "environment option: \$CI_FORCE: '$CI_FORCE'" + ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'" 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")" @@ -79,13 +77,26 @@ function ci_cleanup_old_build { # Fortunately, for a clean makefiles-based build, it should be # sufficient to remove the old object files only. ci_info "## START OF PRE-BUILD CLEANUP ##" - local my_file - find "$CI_SRC_DIR" -maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \) | - while IFS="" read -r my_file - do - ci_spawn rm -fr "$my_file" - done - ci_info "## END OF PRE-BUILD CLEANUP ##" + local find_args=(-maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \)) + [[ ! $(find "$CI_SRC_DIR" "${find_args[@]}" | head -n1) ]] || { + ci_warn "unexpected build found in '$CI_SRC_DIR'" + if ci_expr $((CI_FORCE)) + then + # Delete the old build. + local my_file + find "$CI_SRC_DIR" "${find_args[@]}" | + while IFS="" read -r my_file + do + ci_spawn rm -fr "$my_file" + done + ci_info "## END OF PRE-BUILD CLEANUP ##" + else + # Alert the user, but do not delete their existing files, + # and do not mess up their existing build. + ci_info "hint: consider using the option \$CI_FORCE=1" + ci_err "unable to continue" + fi + } } function ci_build { @@ -97,33 +108,33 @@ function ci_build { all_make_flags+=($CI_MAKE_FLAGS) } [[ $CI_CC ]] && { - all_make_vars+=(CC="$CI_CC") + all_make_vars+=("CC=$CI_CC") } [[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && { [[ $CI_SANITIZERS ]] && CI_CC_FLAGS="${CI_CC_FLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS" - all_make_vars+=(CFLAGS="$CI_CC_FLAGS") + all_make_vars+=("CFLAGS=$CI_CC_FLAGS") } [[ $CI_CPP ]] && { - all_make_vars+=(CPP="$CI_CPP") + all_make_vars+=("CPP=$CI_CPP") } [[ $CI_CPP_FLAGS ]] && { - all_make_vars+=(CPPFLAGS="$CI_CPP_FLAGS") + all_make_vars+=("CPPFLAGS=$CI_CPP_FLAGS") } [[ $CI_AR ]] && { - all_make_vars+=(AR="$CI_AR") + all_make_vars+=("AR=$CI_AR") } [[ $CI_RANLIB ]] && { - all_make_vars+=(RANLIB="$CI_RANLIB") + all_make_vars+=("RANLIB=$CI_RANLIB") } [[ $CI_LD ]] && { - all_make_vars+=(LD="$CI_LD") + all_make_vars+=("LD=$CI_LD") } [[ $CI_LD_FLAGS || $CI_SANITIZERS ]] && { [[ $CI_SANITIZERS ]] && CI_LD_FLAGS+="${CI_LD_FLAGS:+" "}-fsanitize=$CI_SANITIZERS" - all_make_vars+=(LDFLAGS="$CI_LD_FLAGS") + all_make_vars+=("LDFLAGS=$CI_LD_FLAGS") } [[ $CI_LIBS ]] && { - all_make_vars+=(LIBS="$CI_LIBS") + all_make_vars+=("LIBS=$CI_LIBS") } all_make_vars+=($CI_MAKE_VARS) # And... build! @@ -131,10 +142,12 @@ function ci_build { for my_makefile in $CI_MAKEFILES do ci_info "using makefile: $my_makefile" - # Spawn "make". - ci_spawn "$CI_MAKE" -f "$my_makefile" \ - "${all_make_flags[@]}" \ - "${all_make_vars[@]}" + ci_expr $((CI_NO_BUILD)) || { + # Spawn "make". + ci_spawn "$CI_MAKE" -f "$my_makefile" \ + "${all_make_flags[@]}" \ + "${all_make_vars[@]}" + } ci_expr $((CI_NO_TEST)) || { # Spawn "make test" if testing is not disabled. ci_spawn "$CI_MAKE" -f "$my_makefile" \ diff --git a/ci/ci_verify_version.sh b/ci/ci_verify_version.sh index 8199d7935d..31b58896c0 100755 --- a/ci/ci_verify_version.sh +++ b/ci/ci_verify_version.sh @@ -1,44 +1,50 @@ #!/usr/bin/env bash set -o errexit -o pipefail -o posix -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# +# Copyright (C) 2019 Cosmin Truta # SPDX-License-Identifier: MIT -# shellcheck source="ci/lib/ci.lib.sh" +# shellcheck source=ci/lib/ci.lib.sh source "$(dirname "$0")/lib/ci.lib.sh" cd "$CI_TOPLEVEL_DIR" -function ci_init_shellify { - [[ -f $CI_SCRIPT_DIR/ci_shellify.sh ]] || { - ci_err_internal "missing script: '$CI_SCRIPT_DIR/ci_shellify.sh'" - } -} +# Declare the global environments collected from various sources. +declare CI_ENV_LIBPNG_VER # collected from png.h +declare CI_ENV_AUTOCONF_VER # collected from configure.ac +declare CI_ENV_CMAKE_VER # collected from CMakeLists.txt +declare CI_ENV_LIBPNGCONFIG_VER # collected from scripts/libpng-config-head.in function ci_run_shellify { + local my_script my_result + my_script="$CI_SCRIPT_DIR/libexec/ci_shellify_${1#--}.sh" + shift 1 + [[ -f $my_script ]] || { + ci_err_internal "missing script: '$my_script'" + } ci_info "shellifying:" "$@" - local my_result - "$BASH" "$CI_SCRIPT_DIR/ci_shellify.sh" "$@" + "$BASH" "$my_script" "$@" echo "$my_result" | "$BASH" --posix || ci_err "bad shellify output" echo "$my_result" } -function ci_verify_version { +function ci_init_version_verification { ci_info "## START OF VERIFICATION ##" - local my_env_libpng_ver my_env_autoconf_ver my_env_cmake_ver my_expect - ci_init_shellify - my_env_libpng_ver="$(ci_run_shellify png.h)" - echo "$my_env_libpng_ver" - my_env_autoconf_ver="$(ci_run_shellify configure.ac)" - echo "$my_env_autoconf_ver" - my_env_cmake_ver="$(ci_run_shellify CMakeLists.txt)" - echo "$my_env_cmake_ver" - ci_info "## VERIFYING: png.h version definitions ##" - eval "$my_env_libpng_ver" - local my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}" + CI_ENV_LIBPNG_VER="$(ci_run_shellify --c png.h)" + echo "$CI_ENV_LIBPNG_VER" + CI_ENV_AUTOCONF_VER="$(ci_run_shellify --autoconf configure.ac)" + echo "$CI_ENV_AUTOCONF_VER" + CI_ENV_CMAKE_VER="$(ci_run_shellify --cmake CMakeLists.txt)" + echo "$CI_ENV_CMAKE_VER" + CI_ENV_LIBPNGCONFIG_VER="$(ci_run_shellify --shell scripts/libpng-config-head.in)" + echo "$CI_ENV_LIBPNGCONFIG_VER" +} + +# shellcheck disable=SC2154 +function ci_do_version_verification { + local my_expect + ci_info "## VERIFYING: version definitions in 'png.h' ##" + eval "$CI_ENV_LIBPNG_VER" + my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}" if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect"* ]] then ci_info "matched: \$PNG_LIBPNG_VER_STRING == $my_expect*" @@ -71,46 +77,58 @@ function ci_verify_version { else ci_err "mismatched: \$PNG_LIBPNG_VER_DLLNUM != $my_expect" fi - if [[ "$PNG_LIBPNG_VER_BUILD" == 1 ]] + if [[ "$PNG_LIBPNG_VER_BUILD" == [01] ]] then - ci_info "matched: \$PNG_LIBPNG_VER_BUILD == 1" + ci_info "matched: \$PNG_LIBPNG_VER_BUILD == [01]" else - ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != 1" + ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != [01]" fi - ci_info "## VERIFYING: png.h build definitions ##" + ci_info "## VERIFYING: build definitions in 'png.h' ##" my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}" if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect" ]] then + if [[ $PNG_LIBPNG_VER_BUILD -eq 0 ]] + then + ci_info "matched: \$PNG_LIBPNG_VER_BUILD -eq 0" + else + ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -ne 0" + fi if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -eq $PNG_LIBPNG_BUILD_STABLE ]] then - ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_BETA" + ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_STABLE" else - ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_BETA" + ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_STABLE" fi elif [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect".git ]] then - if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -eq $PNG_LIBPNG_BUILD_BETA ]] + if [[ $PNG_LIBPNG_VER_BUILD -ne 0 ]] then - ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_BETA" + ci_info "matched: \$PNG_LIBPNG_VER_BUILD -ne 0" else - ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_BETA" + ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -eq 0" + fi + if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -ne $PNG_LIBPNG_BUILD_STABLE ]] + then + ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_STABLE" + else + ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_STABLE" fi else ci_err "unexpected: \$PNG_LIBPNG_VER_STRING == '$PNG_LIBPNG_VER_STRING'" fi - ci_info "## VERIFYING: png.h type definitions ##" + ci_info "## VERIFYING: type definitions in 'png.h' ##" my_expect="$(echo "png_libpng_version_${PNG_LIBPNG_VER_STRING}" | tr . _)" ci_spawn grep -w -e "$my_expect" png.h - ci_info "## VERIFYING: configure.ac version definitions ##" - eval "$my_env_autoconf_ver" + ci_info "## VERIFYING: version definitions in 'configure.ac' ##" + eval "$CI_ENV_AUTOCONF_VER" if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" ]] then ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING" else ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING" fi - ci_info "## VERIFYING: CMakeLists.txt version definitions ##" - eval "$my_env_cmake_ver" + ci_info "## VERIFYING: version definitions in 'CMakeLists.txt' ##" + eval "$CI_ENV_CMAKE_VER" if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" && "$PNGLIB_SUBREVISION" == 0 ]] then ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING" @@ -121,8 +139,26 @@ function ci_verify_version { else ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING" fi + ci_info "## VERIFYING: version definitions in 'scripts/libpng-config-head.in' ##" + eval "$CI_ENV_LIBPNGCONFIG_VER" + if [[ "$version" == "$PNG_LIBPNG_VER_STRING" ]] + then + ci_info "matched: \$version == \$PNG_LIBPNG_VER_STRING" + else + ci_err "mismatched: \$version != \$PNG_LIBPNG_VER_STRING" + fi +} + +function ci_finish_version_verification { ci_info "## END OF VERIFICATION ##" - ci_info "success!" + # Relying on "set -o errexit" to not reach here in case of error. + ci_info "## SUCCESS ##" +} + +function ci_verify_version { + ci_init_version_verification + ci_do_version_verification + ci_finish_version_verification } function usage { diff --git a/ci/lib/ci.lib.sh b/ci/lib/ci.lib.sh index 813cc09c59..1bc5b4e5bf 100644 --- a/ci/lib/ci.lib.sh +++ b/ci/lib/ci.lib.sh @@ -1,8 +1,4 @@ -# Copyright (c) 2019-2024 Cosmin Truta. -# -# Use, modification and distribution are subject to the MIT License. -# Please see the accompanying file LICENSE_MIT.txt -# +# Copyright (C) 2019 Cosmin Truta # SPDX-License-Identifier: MIT test -f "$BASH_SOURCE" || { @@ -88,6 +84,12 @@ function ci_spawn { } # Ensure that the user initialization is correct. +[[ ${CI_FORCE:-0} == [01] ]] || { + ci_err "bad boolean option: \$CI_FORCE: '$CI_FORCE'" +} +[[ ${CI_NO_BUILD:-0} == [01] ]] || { + ci_err "bad boolean option: \$CI_NO_BUILD: '$CI_NO_BUILD'" +} [[ ${CI_NO_TEST:-0} == [01] ]] || { ci_err "bad boolean option: \$CI_NO_TEST: '$CI_NO_TEST'" } @@ -97,3 +99,9 @@ function ci_spawn { [[ ${CI_NO_CLEAN:-0} == [01] ]] || { ci_err "bad boolean option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'" } +if ci_expr $((CI_NO_BUILD)) +then + ci_expr $((CI_NO_TEST && CI_NO_INSTALL)) || { + ci_err "\$CI_NO_BUILD requires \$CI_NO_TEST and \$CI_NO_INSTALL" + } +fi diff --git a/ci/libexec/ci_shellify_autoconf.sh b/ci/libexec/ci_shellify_autoconf.sh new file mode 100755 index 0000000000..d251b9d5fc --- /dev/null +++ b/ci/libexec/ci_shellify_autoconf.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -o errexit -o pipefail -o posix + +# Copyright (C) 2019 Cosmin Truta +# SPDX-License-Identifier: MIT + +# shellcheck source=ci/lib/ci.lib.sh +source "$(dirname "$0")/../lib/ci.lib.sh" + +function ci_shellify_autoconf { + # Convert autoconf (M4) text, specifically originating + # from configure.ac, to shell scripting text. + # Select only the easy-to-parse definitions of PNGLIB_*. + sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' | + sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \ + -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/' +} + +function usage { + echo "usage: $CI_SCRIPT_NAME [] configure.ac" + echo "options: -?|-h|--help" + exit "${@:-0}" +} + +function main { + local opt + while getopts ":" opt + do + # This ain't a while-loop. It only pretends to be. + [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0 + ci_err "unknown option: '$1'" + done + shift $((OPTIND - 1)) + [[ $# -eq 0 ]] && usage 2 + [[ $# -eq 1 ]] || ci_err "too many operands" + # And... go! + test -e "$1" || ci_err "no such file: '$1'" + [[ $(basename -- "$1") == configure.ac ]] || { + ci_err "incorrect operand: '$1' (expecting: 'configure.ac')" + } + ci_shellify_autoconf <"$1" +} + +main "$@" diff --git a/ci/libexec/ci_shellify_c.sh b/ci/libexec/ci_shellify_c.sh new file mode 100755 index 0000000000..dacc29ebad --- /dev/null +++ b/ci/libexec/ci_shellify_c.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -o errexit -o pipefail -o posix + +# Copyright (C) 2019 Cosmin Truta +# SPDX-License-Identifier: MIT + +# shellcheck source=ci/lib/ci.lib.sh +source "$(dirname "$0")/../lib/ci.lib.sh" + +function ci_shellify_c { + # Convert C preprocessor text, specifically originating + # from png.h, to shell scripting text. + # Select only the easy-to-parse definitions of PNG_LIBPNG_*. + sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' | + sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \ + -e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \ + -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/' +} + +function usage { + echo "usage: $CI_SCRIPT_NAME [] png.h" + echo "options: -?|-h|--help" + exit "${@:-0}" +} + +function main { + local opt + while getopts ":" opt + do + # This ain't a while-loop. It only pretends to be. + [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0 + ci_err "unknown option: '$1'" + done + shift $((OPTIND - 1)) + [[ $# -eq 0 ]] && usage 2 + [[ $# -eq 1 ]] || ci_err "too many operands" + # And... go! + test -e "$1" || ci_err "no such file: '$1'" + [[ $(basename -- "$1") == png.h ]] || { + ci_err "incorrect operand: '$1' (expecting: 'png.h')" + } + ci_shellify_c <"$1" +} + +main "$@" diff --git a/ci/libexec/ci_shellify_cmake.sh b/ci/libexec/ci_shellify_cmake.sh new file mode 100755 index 0000000000..389c23033a --- /dev/null +++ b/ci/libexec/ci_shellify_cmake.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -o errexit -o pipefail -o posix + +# Copyright (C) 2019 Cosmin Truta +# SPDX-License-Identifier: MIT + +# shellcheck source=ci/lib/ci.lib.sh +source "$(dirname "$0")/../lib/ci.lib.sh" + +function ci_shellify_cmake { + # Convert CMake lists text, specifically originating + # from CMakeLists.txt, to shell scripting text. + # Select only the easy-to-parse definitions of PNGLIB_*. + sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' | + sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \ + -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/' +} + +function usage { + echo "usage: $CI_SCRIPT_NAME [] CMakeLists.txt" + echo "options: -?|-h|--help" + exit "${@:-0}" +} + +function main { + local opt + while getopts ":" opt + do + # This ain't a while-loop. It only pretends to be. + [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0 + ci_err "unknown option: '$1'" + done + shift $((OPTIND - 1)) + [[ $# -eq 0 ]] && usage 2 + [[ $# -eq 1 ]] || ci_err "too many operands" + # And... go! + test -e "$1" || ci_err "no such file: '$1'" + filename="$(basename -- "$1")" + [[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || { + ci_err "incorrect operand: '$1' (expecting: 'CMakeLists.txt')" + } + ci_shellify_cmake <"$1" +} + +main "$@" diff --git a/ci/libexec/ci_shellify_shell.sh b/ci/libexec/ci_shellify_shell.sh new file mode 100755 index 0000000000..17fdeec8e1 --- /dev/null +++ b/ci/libexec/ci_shellify_shell.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -o errexit -o pipefail -o posix + +# Copyright (C) 2019 Cosmin Truta +# SPDX-License-Identifier: MIT + +# shellcheck source=ci/lib/ci.lib.sh +source "$(dirname "$0")/../lib/ci.lib.sh" + +function ci_shellify_shell { + # Convert shell scripting text to shell scripting text. + # Select only the easy-to-parse version definitions. + sed -n -e '/^ *[A-Za-z_][0-9A-Za-z_]*=[0-9][^ #]* *$/ p' | + sed -e 's/^ *\([^ ]*=[^ ]*\) *$/export \1;/' +} + +function usage { + echo "usage: $CI_SCRIPT_NAME [] libpng-config-head.in" + echo "options: -?|-h|--help" + exit "${@:-0}" +} + +function main { + local opt + while getopts ":" opt + do + # This ain't a while-loop. It only pretends to be. + [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0 + ci_err "unknown option: '$1'" + done + shift $((OPTIND - 1)) + [[ $# -eq 0 ]] && usage 2 + [[ $# -eq 1 ]] || ci_err "too many operands" + # And... go! + test -e "$1" || ci_err "no such file: '$1'" + [[ $(basename -- "$1") == libpng-config-head.in ]] || { + ci_err "incorrect operand: '$1' (expecting: 'libpng-config-head.in')" + } + ci_shellify_shell <"$1" +} + +main "$@" diff --git a/ci/targets/android/ci_env.aarch64-linux-android.sh b/ci/targets/android/ci_env.aarch64-linux-android.sh new file mode 100644 index 0000000000..7d5b33e56c --- /dev/null +++ b/ci/targets/android/ci_env.aarch64-linux-android.sh @@ -0,0 +1,12 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=aarch64 +export CI_TARGET_ARCHVER=aarch64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=android +export CI_TARGET_ABIVER=android29 + +export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" diff --git a/ci/targets/android/ci_env.armv7a-linux-androideabi.sh b/ci/targets/android/ci_env.armv7a-linux-androideabi.sh new file mode 100644 index 0000000000..bf19aa8419 --- /dev/null +++ b/ci/targets/android/ci_env.armv7a-linux-androideabi.sh @@ -0,0 +1,12 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=arm +export CI_TARGET_ARCHVER=armv7a +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=androideabi +export CI_TARGET_ABIVER=androideabi29 + +export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" diff --git a/ci/targets/android/ci_env.i686-linux-android.sh b/ci/targets/android/ci_env.i686-linux-android.sh new file mode 100644 index 0000000000..2268ae771d --- /dev/null +++ b/ci/targets/android/ci_env.i686-linux-android.sh @@ -0,0 +1,12 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i686 +export CI_TARGET_ARCHVER=i686 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=android +export CI_TARGET_ABIVER=android29 + +export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" diff --git a/ci/targets/android/ci_env.x86_64-linux-android.sh b/ci/targets/android/ci_env.x86_64-linux-android.sh new file mode 100644 index 0000000000..aaf1038819 --- /dev/null +++ b/ci/targets/android/ci_env.x86_64-linux-android.sh @@ -0,0 +1,12 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_ARCHVER=x86_64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=android +export CI_TARGET_ABIVER=android29 + +export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" diff --git a/ci/targets/cygwin/ci_env.i686-pc-cygwin.sh b/ci/targets/cygwin/ci_env.i686-pc-cygwin.sh new file mode 100644 index 0000000000..d5ee8dffd0 --- /dev/null +++ b/ci/targets/cygwin/ci_env.i686-pc-cygwin.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i686 +export CI_TARGET_SYSTEM=cygwin + +export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc" +export CI_AR="$CI_CC-ar" +export CI_RANLIB="$CI_CC-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=CYGWIN + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/cygwin/ci_env.x86_64-pc-cygwin.sh b/ci/targets/cygwin/ci_env.x86_64-pc-cygwin.sh new file mode 100644 index 0000000000..1f7defac6a --- /dev/null +++ b/ci/targets/cygwin/ci_env.x86_64-pc-cygwin.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_SYSTEM=cygwin + +export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc" +export CI_AR="$CI_CC-ar" +export CI_RANLIB="$CI_CC-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=CYGWIN + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/darwin/ci_env.arm64-apple-darwin.sh b/ci/targets/darwin/ci_env.arm64-apple-darwin.sh new file mode 100644 index 0000000000..b8913e91ea --- /dev/null +++ b/ci/targets/darwin/ci_env.arm64-apple-darwin.sh @@ -0,0 +1,11 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=arm64 +export CI_TARGET_SYSTEM=darwin + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Darwin + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH + -DCMAKE_OSX_ARCHITECTURES=$CI_TARGET_ARCH +" diff --git a/ci/targets/darwin/ci_env.x86_64-apple-darwin.sh b/ci/targets/darwin/ci_env.x86_64-apple-darwin.sh new file mode 100644 index 0000000000..b04a0fad15 --- /dev/null +++ b/ci/targets/darwin/ci_env.x86_64-apple-darwin.sh @@ -0,0 +1,11 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_SYSTEM=darwin + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Darwin + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH + -DCMAKE_OSX_ARCHITECTURES=$CI_TARGET_ARCH +" diff --git a/ci/targets/freebsd/ci_env.aarch64-unknown-freebsd.sh b/ci/targets/freebsd/ci_env.aarch64-unknown-freebsd.sh new file mode 100644 index 0000000000..58b6707e36 --- /dev/null +++ b/ci/targets/freebsd/ci_env.aarch64-unknown-freebsd.sh @@ -0,0 +1,10 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=aarch64 +export CI_TARGET_SYSTEM=freebsd + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=FreeBSD + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/freebsd/ci_env.i686-unknown-freebsd.sh b/ci/targets/freebsd/ci_env.i686-unknown-freebsd.sh new file mode 100644 index 0000000000..0fdfa5c43a --- /dev/null +++ b/ci/targets/freebsd/ci_env.i686-unknown-freebsd.sh @@ -0,0 +1,10 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i686 +export CI_TARGET_SYSTEM=freebsd + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=FreeBSD + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/freebsd/ci_env.riscv64-unknown-freebsd.sh b/ci/targets/freebsd/ci_env.riscv64-unknown-freebsd.sh new file mode 100644 index 0000000000..6365b69914 --- /dev/null +++ b/ci/targets/freebsd/ci_env.riscv64-unknown-freebsd.sh @@ -0,0 +1,10 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=riscv64 +export CI_TARGET_SYSTEM=freebsd + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=FreeBSD + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/freebsd/ci_env.x86_64-unknown-freebsd.sh b/ci/targets/freebsd/ci_env.x86_64-unknown-freebsd.sh new file mode 100644 index 0000000000..cdc7aea170 --- /dev/null +++ b/ci/targets/freebsd/ci_env.x86_64-unknown-freebsd.sh @@ -0,0 +1,10 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_SYSTEM=freebsd + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=FreeBSD + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.aarch64-linux-gnu.sh b/ci/targets/linux/ci_env.aarch64-linux-gnu.sh new file mode 100644 index 0000000000..a185d68fd1 --- /dev/null +++ b/ci/targets/linux/ci_env.aarch64-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=aarch64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.arm-linux-gnueabi.sh b/ci/targets/linux/ci_env.arm-linux-gnueabi.sh new file mode 100644 index 0000000000..c8ec561646 --- /dev/null +++ b/ci/targets/linux/ci_env.arm-linux-gnueabi.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=arm +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnueabi + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.arm-linux-gnueabihf.sh b/ci/targets/linux/ci_env.arm-linux-gnueabihf.sh new file mode 100644 index 0000000000..30f767c8b4 --- /dev/null +++ b/ci/targets/linux/ci_env.arm-linux-gnueabihf.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=arm +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnueabihf + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.i686-linux-gnu.sh b/ci/targets/linux/ci_env.i686-linux-gnu.sh new file mode 100644 index 0000000000..324676a85b --- /dev/null +++ b/ci/targets/linux/ci_env.i686-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i686 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mips-linux-gnu.sh b/ci/targets/linux/ci_env.mips-linux-gnu.sh new file mode 100644 index 0000000000..d5fc2cc7f3 --- /dev/null +++ b/ci/targets/linux/ci_env.mips-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mips +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mips64-linux-gnuabi64.sh b/ci/targets/linux/ci_env.mips64-linux-gnuabi64.sh new file mode 100644 index 0000000000..68e2b98d8a --- /dev/null +++ b/ci/targets/linux/ci_env.mips64-linux-gnuabi64.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mips64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnuabi64 + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mips64el-linux-gnuabi64.sh b/ci/targets/linux/ci_env.mips64el-linux-gnuabi64.sh new file mode 100644 index 0000000000..f8ab18ff1d --- /dev/null +++ b/ci/targets/linux/ci_env.mips64el-linux-gnuabi64.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mips64el +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnuabi64 + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mipsel-linux-gnu.sh b/ci/targets/linux/ci_env.mipsel-linux-gnu.sh new file mode 100644 index 0000000000..68688c596a --- /dev/null +++ b/ci/targets/linux/ci_env.mipsel-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mipsel +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mipsisa32r6-linux-gnu.sh b/ci/targets/linux/ci_env.mipsisa32r6-linux-gnu.sh new file mode 100644 index 0000000000..d3443c004a --- /dev/null +++ b/ci/targets/linux/ci_env.mipsisa32r6-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mipsisa32r6 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mipsisa32r6el-linux-gnu.sh b/ci/targets/linux/ci_env.mipsisa32r6el-linux-gnu.sh new file mode 100644 index 0000000000..c534f739ce --- /dev/null +++ b/ci/targets/linux/ci_env.mipsisa32r6el-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mipsisa32r6el +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mipsisa64r6-linux-gnuabi64.sh b/ci/targets/linux/ci_env.mipsisa64r6-linux-gnuabi64.sh new file mode 100644 index 0000000000..bd1ddb83c8 --- /dev/null +++ b/ci/targets/linux/ci_env.mipsisa64r6-linux-gnuabi64.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mipsisa64r6 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnuabi64 + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.mipsisa64r6el-linux-gnuabi64.sh b/ci/targets/linux/ci_env.mipsisa64r6el-linux-gnuabi64.sh new file mode 100644 index 0000000000..9101097e1c --- /dev/null +++ b/ci/targets/linux/ci_env.mipsisa64r6el-linux-gnuabi64.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=mipsisa64r6el +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnuabi64 + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.powerpc-linux-gnu.sh b/ci/targets/linux/ci_env.powerpc-linux-gnu.sh new file mode 100644 index 0000000000..43d676a4c4 --- /dev/null +++ b/ci/targets/linux/ci_env.powerpc-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=powerpc +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.powerpc64-linux-gnu.sh b/ci/targets/linux/ci_env.powerpc64-linux-gnu.sh new file mode 100644 index 0000000000..cb9cdda22b --- /dev/null +++ b/ci/targets/linux/ci_env.powerpc64-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=powerpc64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.powerpc64le-linux-gnu.sh b/ci/targets/linux/ci_env.powerpc64le-linux-gnu.sh new file mode 100644 index 0000000000..d254e01dd1 --- /dev/null +++ b/ci/targets/linux/ci_env.powerpc64le-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=powerpc64le +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.riscv64-linux-gnu.sh b/ci/targets/linux/ci_env.riscv64-linux-gnu.sh new file mode 100644 index 0000000000..9b35104e83 --- /dev/null +++ b/ci/targets/linux/ci_env.riscv64-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=riscv64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/linux/ci_env.x86_64-linux-gnu.sh b/ci/targets/linux/ci_env.x86_64-linux-gnu.sh new file mode 100644 index 0000000000..d8bca7bc25 --- /dev/null +++ b/ci/targets/linux/ci_env.x86_64-linux-gnu.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_SYSTEM=linux +export CI_TARGET_ABI=gnu + +export CI_GCC="${CI_GCC-gcc}" + +export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC" +export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar" +export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Linux + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/msdos/ci_env.i386-pc-msdoswatcom.sh b/ci/targets/msdos/ci_env.i386-pc-msdoswatcom.sh new file mode 100644 index 0000000000..9bdcc276c3 --- /dev/null +++ b/ci/targets/msdos/ci_env.i386-pc-msdoswatcom.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i386 +export CI_TARGET_SYSTEM=msdoswatcom + +export CI_CC="wcl386" + +# Open Watcom V2 CMake build +# https://github.com/open-watcom/open-watcom-v2/discussions/716 +export CI_CMAKE_GENERATOR="Watcom WMake" +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=DOS +" diff --git a/ci/targets/msdos/ci_env.i586-pc-msdosdjgpp.sh b/ci/targets/msdos/ci_env.i586-pc-msdosdjgpp.sh new file mode 100644 index 0000000000..9ae66bf53e --- /dev/null +++ b/ci/targets/msdos/ci_env.i586-pc-msdosdjgpp.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i586 +export CI_TARGET_SYSTEM=msdosdjgpp + +export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc" +export CI_AR="$CI_CC-ar" +export CI_RANLIB="$CI_CC-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Generic + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/msdos/ci_env.i86-pc-msdoswatcom.sh b/ci/targets/msdos/ci_env.i86-pc-msdoswatcom.sh new file mode 100644 index 0000000000..97f9dcfaff --- /dev/null +++ b/ci/targets/msdos/ci_env.i86-pc-msdoswatcom.sh @@ -0,0 +1,15 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i86 +export CI_TARGET_SYSTEM=msdoswatcom + +export CI_CC="wcl" + +# Open Watcom V2 CMake build +# https://github.com/open-watcom/open-watcom-v2/discussions/716 +export CI_CMAKE_GENERATOR="Watcom WMake" +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=DOS + -DCMAKE_SYSTEM_PROCESSOR=I86 +" diff --git a/ci/targets/windows/ci_env.aarch64-windows-llvm.sh b/ci/targets/windows/ci_env.aarch64-windows-llvm.sh new file mode 100644 index 0000000000..5f3584587d --- /dev/null +++ b/ci/targets/windows/ci_env.aarch64-windows-llvm.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=aarch64 +export CI_TARGET_SYSTEM=windows + +export CI_CC="clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Windows + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/windows/ci_env.i686-w64-mingw32.sh b/ci/targets/windows/ci_env.i686-w64-mingw32.sh new file mode 100644 index 0000000000..825881a605 --- /dev/null +++ b/ci/targets/windows/ci_env.i686-w64-mingw32.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i686 +export CI_TARGET_SYSTEM=mingw32 + +# The output of `uname -s` on MSYS2 is understandable, and so is +# CI_TARGET_SYSTEM above, in simplified form. (See also Cygwin.) +# But aside from that, the Mingw-w64 nomenclature is rather messy. +export CI_CC="$CI_TARGET_ARCH-w64-mingw32-gcc" +export CI_AR="$CI_CC-ar" +export CI_RANLIB="$CI_CC-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Windows + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/windows/ci_env.i686-windows-llvm.sh b/ci/targets/windows/ci_env.i686-windows-llvm.sh new file mode 100644 index 0000000000..c54a1130c2 --- /dev/null +++ b/ci/targets/windows/ci_env.i686-windows-llvm.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=i686 +export CI_TARGET_SYSTEM=windows + +export CI_CC="clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Windows + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/windows/ci_env.x86_64-w64-mingw32.sh b/ci/targets/windows/ci_env.x86_64-w64-mingw32.sh new file mode 100644 index 0000000000..bb0dfc2809 --- /dev/null +++ b/ci/targets/windows/ci_env.x86_64-w64-mingw32.sh @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_SYSTEM=mingw64 + +# The output of `uname -s` on MSYS2 is understandable, and so is +# CI_TARGET_SYSTEM above, in simplified form. (See also Cygwin.) +# But aside from that, the Mingw-w64 nomenclature is rather messy. +export CI_CC="$CI_TARGET_ARCH-w64-mingw32-gcc" +export CI_AR="$CI_CC-ar" +export CI_RANLIB="$CI_CC-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Windows + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/ci/targets/windows/ci_env.x86_64-windows-llvm.sh b/ci/targets/windows/ci_env.x86_64-windows-llvm.sh new file mode 100644 index 0000000000..f543fcf3b2 --- /dev/null +++ b/ci/targets/windows/ci_env.x86_64-windows-llvm.sh @@ -0,0 +1,14 @@ +# Copyright (C) 2023 Cosmin Truta +# SPDX-License-Identifier: MIT + +export CI_TARGET_ARCH=x86_64 +export CI_TARGET_SYSTEM=windows + +export CI_CC="clang" +export CI_AR="llvm-ar" +export CI_RANLIB="llvm-ranlib" + +export CI_CMAKE_VARS=" + -DCMAKE_SYSTEM_NAME=Windows + -DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH +" diff --git a/compile b/compile index df363c8fbf..02ff093c33 100755 --- a/compile +++ b/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2018-03-07.03; # UTC +scriptversion=2025-06-18.21; # UTC -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2025 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -37,11 +37,11 @@ IFS=" "" $nl" file_conv= -# func_file_conv build_file lazy +# func_file_conv build_file unneeded_conversions # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. +# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no +# conversion will take place. func_file_conv () { file=$1 @@ -51,9 +51,20 @@ func_file_conv () # lazily determine how to convert abs files case `uname -s` in MINGW*) - file_conv=mingw + if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then + # MSYS2 environment. + file_conv=cygwin + else + # Original MinGW environment. + file_conv=mingw + fi ;; - CYGWIN* | MSYS*) + MSYS*) + # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell. + file_conv=cygwin + ;; + CYGWIN*) + # Cygwin environment. file_conv=cygwin ;; *) @@ -63,12 +74,14 @@ func_file_conv () fi case $file_conv/,$2, in *,$file_conv,*) + # This is the optimization mentioned above: + # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert. ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/* | msys/*) - file=`cygpath -m "$file" || echo "$file"` + cygwin/*) + file=`cygpath -w "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` @@ -143,7 +156,7 @@ func_cl_wrapper () # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in - *.o | *.[oO][bB][jJ]) + *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift @@ -248,14 +261,17 @@ If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . +GNU Automake home page: . +General help using GNU software: . EOF exit $? ;; -v | --v*) - echo "compile $scriptversion" + echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; @@ -340,9 +356,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/config.guess b/config.guess index cdfc439204..a9d01fde46 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2023 Free Software Foundation, Inc. +# Copyright 1992-2025 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-08-22' +timestamp='2025-07-10' # 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 @@ -60,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2025 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." @@ -123,7 +123,7 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -165,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -632,7 +634,8 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -716,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -1593,6 +1597,12 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-pc-ironclad-mlibc + ;; + *:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc + ;; esac # Do we have a guess based on uname results? @@ -1616,6 +1626,7 @@ cat > "$dummy.c" <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2025 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." @@ -120,7 +120,6 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 @@ -1845,7 +2245,7 @@ case $kernel-$os-$obj in echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; - kfreebsd*-gnu*- | kopensolaris*-gnu*-) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; @@ -1853,8 +2253,12 @@ case $kernel-$os-$obj in ;; os2-emx-) ;; + rtmk-nova-) + ;; *-eabi*- | *-gnueabi*-) ;; + ios*-simulator- | tvos*-simulator- | watchos*-simulator- ) + ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format @@ -1879,7 +2283,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1953,8 +2357,8 @@ echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-format: "%Y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/configure b/configure index 7f3a0f8bc3..fb69725b62 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for libpng 1.6.43.git. +# Generated by GNU Autoconf 2.73 for libpng 1.6.59.git. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2026 Free Software Foundation, # Inc. # # @@ -22,7 +22,7 @@ then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. + # contradicts POSIX and common usage. Disable this. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( @@ -109,7 +109,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$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 @@ -131,10 +131,13 @@ case $- in # (((( *x* ) as_opts=-x ;; * ) as_opts= ;; esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +case $# in # (( + 0) exec $CONFIG_SHELL $as_opts "$as_myself" ;; + *) exec $CONFIG_SHELL $as_opts "$as_myself" "$@" ;; +esac # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +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. @@ -145,7 +148,7 @@ then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. + # contradicts POSIX and common usage. Disable this. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( @@ -263,22 +266,25 @@ case $- in # (((( *x* ) as_opts=-x ;; * ) as_opts= ;; esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +case $# in # (( + 0) exec $CONFIG_SHELL $as_opts "$as_myself" ;; + *) exec $CONFIG_SHELL $as_opts "$as_myself" "$@" ;; +esac # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. -printf "%s\n" "$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 : - 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." + 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." + 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 - printf "%s\n" "$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 @@ -339,7 +345,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$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" @@ -348,7 +354,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +printf '%s\n' X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -431,9 +437,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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + printf '%s\n' "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -460,7 +466,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +printf '%s\n' X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -506,7 +512,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { printf "%s\n" "$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 @@ -520,29 +526,6 @@ 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*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - 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 @@ -603,6 +586,7 @@ ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # Initializations. # ac_default_prefix=/usr/local +ac_clean_CONFIG_STATUS= ac_clean_files= ac_config_libobj_dir=. LIBOBJS= @@ -614,8 +598,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libpng' PACKAGE_TARNAME='libpng' -PACKAGE_VERSION='1.6.43.git' -PACKAGE_STRING='libpng 1.6.43.git' +PACKAGE_VERSION='1.6.59.git' +PACKAGE_STRING='libpng 1.6.59.git' PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' PACKAGE_URL='' @@ -656,6 +640,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +PNG_RISCV_RVV_FALSE +PNG_RISCV_RVV_TRUE PNG_LOONGARCH_LSX_FALSE PNG_LOONGARCH_LSX_TRUE PNG_POWERPC_VSX_FALSE @@ -753,6 +739,8 @@ CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE +am__xargs_n +am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -783,13 +771,13 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +ECHO_T +ECHO_N +ECHO_C target_alias host_alias build_alias LIBS -ECHO_T -ECHO_N -ECHO_C DEFS mandir localedir @@ -832,8 +820,10 @@ enable_dependency_tracking with_gnu_ld enable_shared enable_static +enable_pic with_pic enable_fast_install +enable_aix_soname with_aix_soname with_sysroot enable_libtool_lock @@ -854,6 +844,7 @@ enable_mips_mmi enable_intel_sse enable_powerpc_vsx enable_loongarch_lsx +enable_riscv_rvv ' ac_precious_vars='build_alias host_alias @@ -867,6 +858,7 @@ CCAS CCASFLAGS CPP LT_SYS_LIBRARY_PATH +AWK PNG_COPTS' @@ -978,7 +970,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1004,7 +996,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1217,7 +1209,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1233,7 +1225,7 @@ do expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1277,9 +1269,9 @@ Try '$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$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 && - printf "%s\n" "$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}" ;; @@ -1287,7 +1279,7 @@ Try '$0 --help' for more information" done if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` + ac_option=--`printf '%s\n' $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi @@ -1295,7 +1287,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf '%s\n' "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1359,7 +1351,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | +printf '%s\n' X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1416,7 +1408,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.43.git to adapt to many kinds of systems. +'configure' configures libpng 1.6.59.git to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1487,7 +1479,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libpng 1.6.43.git:";; + short | recursive ) echo "Configuration of libpng 1.6.59.git:";; esac cat <<\_ACEOF @@ -1506,8 +1498,13 @@ Optional Features: speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] + --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] + --enable-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) --disable-tests do not build the test programs (default is to build) --disable-tools do not build the auxiliary tools (default is to @@ -1543,36 +1540,36 @@ Optional Features: default - use --disable-unversioned-libpng-config to change this. --enable-hardware-optimizations - Enable hardware optimizations: =no/off, yes/on: + Enable hardware optimizations: =no/off, yes/on. --enable-arm-neon Enable ARM NEON optimizations: =no/off, check, api, - yes/on: no/off: disable the optimizations; check: + yes/on. no/off: disable the optimizations; check: use internal checking code (deprecated and poorly supported); api: disable by default, enable by a call to png_set_option; yes/on: turn on unconditionally. If not specified: determined by the compiler. --enable-mips-msa Enable MIPS MSA optimizations: =no/off, check, api, - yes/on: no/off: disable the optimizations; check: + yes/on. no/off: disable the optimizations; check: use internal checking code (deprecated and poorly supported); api: disable by default, enable by a call to png_set_option; yes/on: turn on unconditionally. If not specified: determined by the compiler. --enable-mips-mmi Enable MIPS MMI optimizations: =no/off, check, api, - yes/on: no/off: disable the optimizations; check: + yes/on. no/off: disable the optimizations; check: use internal checking code (deprecated and poorly supported); api: disable by default, enable by a call to png_set_option; yes/on: turn on unconditionally. If not specified: determined by the compiler. - --enable-intel-sse Enable Intel SSE optimizations: =no/off, yes/on: + --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. --enable-powerpc-vsx Enable POWERPC VSX optimizations: =no/off, check, - api, yes/on: no/off: disable the optimizations; - check: use internal checking code api: disable by - default, enable by a call to png_set_option yes/on: + api, yes/on. no/off: disable the optimizations; + check: use internal checking code; api: disable by + default, enable by a call to png_set_option; yes/on: turn on unconditionally. If not specified: determined by the compiler. --enable-loongarch-lsx @@ -1580,16 +1577,17 @@ Optional Features: no/off: disable the optimizations; yes/on: turn on unconditionally. If not specified: determined by the compiler. + --enable-riscv-rvv Enable RISC-V Vector optimizations: =no/off, check, + api, yes/on: no/off: disable the optimizations; + check: use internal checking code api: disable by + default, enable by a call to png_set_option yes/on: + turn on. If not specified: determined by the + compiler. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-zlib-prefix prefix that may have been used in installed zlib @@ -1613,7 +1611,8 @@ Some influential environment variables: CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. - PNG_COPTS additional flags for the C compiler, use this for options that + AWK AWK language processor + PNG_COPTS additional flags for the C compiler, to be used for options that would cause configure itself to fail Use these variables to override the choices made by 'configure' or to help @@ -1635,9 +1634,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=/`printf "%s\n" "$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=`printf "%s\n" "$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/ ;; @@ -1674,7 +1673,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - printf "%s\n" "$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 @@ -1683,10 +1682,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libpng configure 1.6.43.git -generated by GNU Autoconf 2.72 +libpng configure 1.6.59.git +generated by GNU Autoconf 2.73 -Copyright (C) 2023 Free Software Foundation, Inc. +Copyright (C) 2026 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1710,7 +1709,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$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 @@ -1718,7 +1717,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$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 @@ -1726,7 +1725,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1749,7 +1748,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$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 @@ -1757,7 +1756,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$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 @@ -1765,7 +1764,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1789,7 +1788,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$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 @@ -1797,7 +1796,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - printf "%s\n" "$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 @@ -1808,7 +1807,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 then : ac_retval=0 else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; @@ -1831,7 +1830,7 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : @@ -1853,8 +1852,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$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 @@ -1865,7 +1864,7 @@ printf "%s\n" "$ac_res" >&6; } ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : @@ -1917,8 +1916,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ esac fi eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$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 @@ -1927,7 +1926,7 @@ for ac_arg do case $ac_arg in *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf '%s\n' "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done @@ -1939,15 +1938,15 @@ case $ac_configure_args_raw in 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"`;; + ac_configure_args_raw=` printf '%s\n' "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac 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.43.git, which was -generated by GNU Autoconf 2.72. Invocation command line was +It was created by libpng $as_me 1.6.59.git, which was +generated by GNU Autoconf 2.73. Invocation command line was $ $0$ac_configure_args_raw @@ -1987,7 +1986,7 @@ do */) ;; *) as_dir=$as_dir/ ;; esac - printf "%s\n" "PATH: $as_dir" + printf '%s\n' "PATH: $as_dir" done IFS=$as_save_IFS @@ -2022,7 +2021,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`printf "%s\n" "$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'" ;; @@ -2051,31 +2050,22 @@ done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# 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 - - printf "%s\n" "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, +# Dump the cache to stdout. It can be in a pipe (this is a requirement). +ac_cache_dump () +{ + # The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. ( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_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;} ;; + *_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) ;; #( @@ -2084,67 +2074,95 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} esac ;; esac done + (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) - echo +} + +# Print debugging info to stdout. +ac_dump_debugging_info () +{ + echo + + printf '%s\n' "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + ac_cache_dump + echo - printf "%s\n" "## ----------------- ## + printf '%s\n' "## ----------------- ## ## Output variables. ## ## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'*) ac_val=`printf '%s\n' "$ac_val" | sed "s/'/'\\\\\\\\''/g"`;; + esac + printf '%s\n' "$ac_var='$ac_val'" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf '%s\n' "## ------------------- ## +## File substitutions. ## +## ------------------- ##" echo - for ac_var in $ac_subst_vars + for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'*) ac_val=`printf '%s\n' "$ac_val" | sed "s/'/'\\\\\\\\''/g"`;; esac - printf "%s\n" "$ac_var='\''$ac_val'\''" + printf '%s\n' "$ac_var='$ac_val'" done | sort echo + fi - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## + if test -s confdefs.h; then + printf '%s\n' "## ----------- ## ## confdefs.h. ## ## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf '%s\n' "$as_me: caught signal $ac_signal" + printf '%s\n' "$as_me: exit $exit_status" +} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. +ac_exit_trap () +{ + exit_status= + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + ac_dump_debugging_info >&5 + eval "rm -f $ac_clean_CONFIG_STATUS core *.core core.conftest.*" && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 +} + +trap 'ac_exit_trap $?' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done @@ -2153,21 +2171,21 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -printf "%s\n" "/* confdefs.h */" > confdefs.h +printf '%s\n' "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h +printf '%s\n' "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. @@ -2189,12 +2207,12 @@ do 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;} + { 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" \ - || { { 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: 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 @@ -2204,27 +2222,120 @@ 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$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 C23 (global declarations) +ac_c_conftest_c23_globals=' +/* Does the compiler advertise conformance to C17 or earlier? + Although GCC 14 does not do that, even with -std=gnu23, + it is close enough, and defines __STDC_VERSION == 202000L. */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ <= 201710L +# error "Compiler advertises conformance to C17 or earlier" +#endif + +// Check alignas. +char alignas (double) c23_aligned_as_double; +char alignas (0) c23_no_special_alignment; +extern char c23_aligned_as_int; +char alignas (0) alignas (int) c23_aligned_as_int; + +// Check alignof. +enum +{ + c23_int_alignment = alignof (int), + c23_int_array_alignment = alignof (int[100]), + c23_char_alignment = alignof (char) +}; +static_assert (0 < -alignof (int), "alignof is signed"); + +int function_with_unnamed_parameter (int) { return 0; } + +void c23_noreturn (); + +/* Test parsing of string and char UTF-8 literals (including hex escapes). + The parens pacify GCC 15. */ +bool use_u8 = (!sizeof u8"\xFF") == (!u8'\''x'\''); + +bool check_that_bool_works = true | false | !nullptr; +#if !true +# error "true does not work in #if" +#endif +#if false +#elifdef __STDC_VERSION__ +#else +# error "#elifdef does not work" +#endif + +#ifndef __has_c_attribute +# error "__has_c_attribute not defined" +#endif + +#ifndef __has_include +# error "__has_include not defined" +#endif + +#define LPAREN() ( +#define FORTY_TWO(x) 42 +#define VA_OPT_TEST(r, x, ...) __VA_OPT__ (FORTY_TWO r x)) +static_assert (VA_OPT_TEST (LPAREN (), 0, <:-) == 42); + +static_assert (0b101010 == 42); +static_assert (0B101010 == 42); +static_assert (0xDEAD'\''BEEF == 3'\''735'\''928'\''559); +static_assert (0.500'\''000'\''000 == 0.5); + +enum unsignedish : unsigned int { uione = 1 }; +static_assert (0 < -uione); + +#include +constexpr nullptr_t null_pointer = nullptr; + +static typeof (1 + 1L) two () { return 2; } +static long int three () { return 3; } +' + +# Test code for whether the C compiler supports C23 (body of main). +ac_c_conftest_c23_main=' + { + label_before_declaration: + int arr[10] = {}; + if (arr[0]) + goto label_before_declaration; + if (!arr[0]) + goto label_at_end_of_block; + label_at_end_of_block: + } + ok |= !null_pointer; + ok |= two != three; +' + +# Test code for whether the C compiler supports C23 (complete). +ac_c_conftest_c23_program="${ac_c_conftest_c23_globals} + +int +main (int, char **) +{ + int ok = 0; + ${ac_c_conftest_c23_main} + return ok; +} +" + # 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 +/* Do not test the value of __STDC__, because some compilers define it to 0 + or do not define it, while otherwise adequately conforming. */ #include #include @@ -2304,7 +2415,8 @@ extern void free (void *); // 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. +// FILE and stderr, and "aND" is used instead of "and" to work around +// GCC bug 40564 which is irrelevant here. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) @@ -2315,7 +2427,7 @@ test_varargs_macros (void) int y = 5678; debug ("Flag"); debug ("X = %d\n", x); - showlist (The first, second, and third items.); + showlist (The first, second, aND third items.); report (x>y, "x is %d but y is %d", x, y); } @@ -2403,15 +2515,15 @@ ac_c_conftest_c99_main=' // Check restrict. if (test_restrict ("String literal") == 0) success = true; - char *restrict newvar = "Another string"; + const 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)); + static struct incomplete_array *volatile incomplete_array_pointer; + struct incomplete_array *ia = incomplete_array_pointer; ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; @@ -2427,13 +2539,12 @@ ac_c_conftest_c99_main=' ni.number = 58; - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; + // Do not test for VLAs, as some otherwise-conforming compilers lack them. + // C code should instead use __STDC_NO_VLA__; see Autoconf manual. // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); + || ni.number != 58); ' # Test code for whether the C compiler supports C11 (global declarations) @@ -2565,7 +2676,7 @@ ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${ # $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 +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 @@ -2578,7 +2689,7 @@ do esac as_found=: - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + 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 @@ -2589,13 +2700,13 @@ do 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 + 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 + 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 + 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 @@ -2607,7 +2718,7 @@ do fi else if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + 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 @@ -2660,38 +2771,44 @@ 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,) - { 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;} + { 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) - { 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;} + { 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=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` + ac_old_val_w= + for ac_val in x $ac_old_val; do + ac_old_val_w="$ac_old_val_w $ac_val" + done + ac_new_val_w= + for ac_val in x $ac_new_val; do + ac_new_val_w="$ac_new_val_w $ac_val" + done if test "$ac_old_val_w" != "$ac_new_val_w"; then - { 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;} + { 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 - { 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;} + { 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 - { 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;} + { 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=`printf "%s\n" "$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 @@ -2701,10 +2818,10 @@ printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { 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;} + { 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 @@ -2712,6 +2829,23 @@ fi ## Main body of script. ## ## -------------------- ## + +# 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*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2727,7 +2861,7 @@ 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.16' +am__api_version='1.18' @@ -2745,7 +2879,7 @@ am__api_version='1.16' # 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. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +{ 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 test ${ac_cv_path_install+y} @@ -2768,8 +2902,8 @@ case $as_dir in #(( ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root + # OSF/1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF/1 since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do @@ -2819,8 +2953,8 @@ fi INSTALL=$ac_install_sh fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -printf "%s\n" "$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. @@ -2830,7 +2964,166 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in #( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf '%s\n' "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf '%s\n' ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { 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 $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf '%s\n' "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. +{ 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. @@ -2838,10 +3131,14 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac @@ -2850,49 +3147,45 @@ esac # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf '%s\n' "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ 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= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in #( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! + ;; +esac fi rm -f conftest.file @@ -2905,7 +3198,7 @@ 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=`printf "%s\n" "$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. @@ -2920,8 +3213,8 @@ if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { 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;} + { 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 @@ -2941,7 +3234,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -2962,7 +3255,7 @@ do 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_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$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 @@ -2974,11 +3267,11 @@ esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf '%s\n' "$STRIP" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -2987,7 +3280,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3008,7 +3301,7 @@ do 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_STRIP="strip" - printf "%s\n" "$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 @@ -3020,11 +3313,11 @@ esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -3032,8 +3325,8 @@ fi 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;} +{ 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 @@ -3046,7 +3339,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 + { 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 test ${ac_cv_path_mkdir+y} @@ -3089,14 +3382,14 @@ fi MKDIR_P='mkdir -p' fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -printf "%s\n" "$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 +for ac_prog in gawk mawk nawk awk 'busybox 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3117,7 +3410,7 @@ do 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_AWK="$ac_prog" - printf "%s\n" "$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 @@ -3129,21 +3422,21 @@ esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf '%s\n' "$AWK" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi test -n "$AWK" && break done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ 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=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +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 @@ -3151,7 +3444,7 @@ else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: - @echo '@@@%%%=$(MAKE)=@@@%%%' + @printf '%s\n' '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in @@ -3164,12 +3457,12 @@ rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } SET_MAKE= else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3182,25 +3475,21 @@ else fi rmdir .tst 2>/dev/null +AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac am_make=${MAKE-make} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +{ 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 case e in #( - e) if printf "%s\n" 'TRUE=$(BAR$(V)) + e) if printf '%s\n' 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3213,17 +3502,47 @@ else fi ;; esac fi -{ 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)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi +{ 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; } AM_BACKSLASH='\' +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in #( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in #( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf '%s\n' "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in #( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -3246,13 +3565,13 @@ fi # Define the identity of the package. PACKAGE='libpng' - VERSION='1.6.43.git' + VERSION='1.6.59.git' -printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h +printf '%s\n' "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h +printf '%s\n' "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3284,9 +3603,133 @@ AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test x$am_uid = xunknown; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 +printf '%s\n' "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} + elif test $am_uid -le $am_max_uid; then + { 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; } + _am_tools=none + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test x$gm_gid = xunknown; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 +printf '%s\n' "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} + elif test $am_gid -le $am_max_gid; then + { 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; } + _am_tools=none + fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf '%s\n' "$am_cv_prog_tar_ustar" >&6; } @@ -3307,53 +3750,15 @@ 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 -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'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: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi # The following line causes --disable-maintainer-mode to be the default to # configure. This is necessary because libpng distributions cannot rely on the # time stamps of the autotools generated files being correct -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +{ 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+y} @@ -3364,8 +3769,8 @@ else case e in #( esac fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -printf "%s\n" "$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='#' @@ -3379,17 +3784,17 @@ fi -PNGLIB_VERSION=1.6.43.git +PNGLIB_VERSION=1.6.59.git PNGLIB_MAJOR=1 PNGLIB_MINOR=6 -PNGLIB_RELEASE=43 +PNGLIB_RELEASE=59 ac_config_headers="$ac_config_headers config.h" -# Checks for programs. +# Check the basic programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3405,6 +3810,9 @@ 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' @@ -3413,7 +3821,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3434,7 +3842,7 @@ do 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}gcc" - printf "%s\n" "$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 @@ -3446,11 +3854,11 @@ esac 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3459,7 +3867,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3480,7 +3888,7 @@ do 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="gcc" - printf "%s\n" "$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 @@ -3492,11 +3900,11 @@ esac 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; } + { 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; } + { 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 @@ -3504,8 +3912,8 @@ fi 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;} +{ 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 @@ -3518,7 +3926,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3539,7 +3947,7 @@ do 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}cc" - printf "%s\n" "$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 @@ -3551,11 +3959,11 @@ esac 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3564,7 +3972,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3590,7 +3998,7 @@ do continue fi ac_cv_prog_CC="cc" - printf "%s\n" "$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 @@ -3614,11 +4022,11 @@ esac 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3629,7 +4037,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3650,7 +4058,7 @@ do 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$ac_prog" - printf "%s\n" "$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 @@ -3662,11 +4070,11 @@ esac 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3679,7 +4087,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -3700,7 +4108,7 @@ do 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="$ac_prog" - printf "%s\n" "$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 @@ -3712,11 +4120,11 @@ esac 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3728,8 +4136,8 @@ done 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;} +{ 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 @@ -3741,7 +4149,7 @@ 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\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 : @@ -3762,7 +4170,7 @@ do 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 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3774,11 +4182,11 @@ esac 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -3787,7 +4195,7 @@ 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\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 : @@ -3808,7 +4216,7 @@ do 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 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3820,11 +4228,11 @@ esac 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; } + { 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; } + { 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 @@ -3832,8 +4240,8 @@ fi 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;} +{ 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 @@ -3845,13 +4253,13 @@ fi fi -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;} +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. -printf "%s\n" "$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 -version; do @@ -3861,7 +4269,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$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 @@ -3871,7 +4279,7 @@ printf "%s\n" "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3891,9 +4299,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. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +{ 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[^ ]*//'` +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.*" @@ -3914,10 +4322,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + 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'. @@ -3958,29 +4366,29 @@ esac fi 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 + { 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 -{ { 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: 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 case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } ;; + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +{ 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; } +{ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +{ 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 @@ -3988,10 +4396,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$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 both 'conftest.exe' and 'conftest' are 'present' (well, observable) @@ -4008,15 +4416,15 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { 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; } ;; esac fi rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$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 @@ -4039,7 +4447,7 @@ _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. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +{ 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" @@ -4048,10 +4456,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - printf "%s\n" "$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 @@ -4059,31 +4467,31 @@ printf "%s\n" "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - printf "%s\n" "$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 - { { 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: 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$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.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +{ 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 : @@ -4107,10 +4515,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 +printf '%s\n' "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + 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 @@ -4122,11 +4530,11 @@ then : esac done else case e in #( - e) printf "%s\n" "$as_me: failed program was:" >&5 + e) printf '%s\n' "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&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: 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; } ;; esac @@ -4134,11 +4542,11 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +{ 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 : @@ -4170,8 +4578,8 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$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 @@ -4181,7 +4589,7 @@ else fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +{ 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 : @@ -4249,8 +4657,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +{ 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 @@ -4269,7 +4677,56 @@ fi 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\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C23 features" >&5 +printf %s "checking for $CC option to enable C23 features... " >&6; } +if test ${ac_cv_prog_cc_c23+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c23=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c23_program +_ACEOF +for ac_arg in '' -std=gnu23 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c23=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c23" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c23" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c23" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c23" >&5 +printf '%s\n' "$ac_cv_prog_cc_c23" >&6; } + CC="$CC $ac_cv_prog_cc_c23" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c23 + ac_prog_cc_stdc=c23 ;; +esac +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 C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : @@ -4281,7 +4738,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF -for ac_arg in '' -std=gnu11 +for ac_arg in '' -std=gnu11 -std:c11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" @@ -4298,16 +4755,16 @@ fi 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + e) { 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" ;; esac fi @@ -4318,7 +4775,7 @@ 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\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 : @@ -4347,16 +4804,16 @@ fi 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + e) { 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" ;; esac fi @@ -4367,7 +4824,7 @@ 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\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 : @@ -4396,16 +4853,16 @@ fi 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } else case e in #( e) 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + e) { 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" ;; esac fi @@ -4427,7 +4884,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +{ 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 : @@ -4462,12 +4919,15 @@ _ACEOF break fi done - rm -f core conftest* + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i ;; esac fi -{ 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; } +{ 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. @@ -4486,7 +4946,7 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +{ 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: @@ -4523,8 +4983,8 @@ esac fi done rm -f confinc.* confmf.* -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -printf "%s\n" "${_am_result}" >&6; } +{ 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+y} @@ -4549,7 +5009,7 @@ fi depcc="$CC" am_compiler_list= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +{ 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 : @@ -4642,7 +5102,7 @@ else case e in #( # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: + # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported @@ -4662,8 +5122,8 @@ fi ;; esac fi -{ 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; } +{ 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 @@ -4686,7 +5146,7 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +{ 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 : @@ -4777,7 +5237,7 @@ else case e in #( # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: + # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported @@ -4797,8 +5257,8 @@ fi ;; esac fi -{ 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; } +{ 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 @@ -4818,7 +5278,7 @@ fi $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\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 : @@ -4834,8 +5294,8 @@ ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$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;; @@ -4851,10 +5311,10 @@ shift; shift # except with old shells: build_os=$* IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +case $build_os in *\ *) build_os=`printf '%s\n' "$build_os" | sed 's/ /-/g'`;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +{ 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 : @@ -4869,8 +5329,8 @@ fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$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;; @@ -4886,10 +5346,10 @@ shift; shift # except with old shells: host_os=$* IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +case $host_os in *\ *) host_os=`printf '%s\n' "$host_os" | sed 's/ /-/g'`;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +{ 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 : @@ -4932,7 +5392,7 @@ case `"$ac_path_SED" --version 2>&1` in #( cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "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 @@ -4961,8 +5421,8 @@ fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$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 @@ -4979,7 +5439,7 @@ Xsed="$SED -e 1s/^X//" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +{ 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 : @@ -5016,7 +5476,7 @@ case `"$ac_path_GREP" --version 2>&1` in #( cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" '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 @@ -5045,12 +5505,12 @@ fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$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" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +{ 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 : @@ -5090,7 +5550,7 @@ case `"$ac_path_EGREP" --version 2>&1` in #( cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" '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 @@ -5120,14 +5580,14 @@ fi fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$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" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +{ 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 : @@ -5167,7 +5627,7 @@ case `"$ac_path_FGREP" --version 2>&1` in #( cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" '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 @@ -5197,8 +5657,8 @@ fi fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -printf "%s\n" "$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" @@ -5224,7 +5684,7 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +{ 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 && \ @@ -5251,12 +5711,12 @@ func_echo_all () } case $ECHO in - 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; } ;; + 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 @@ -5286,10 +5746,10 @@ fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 + { 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*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -5316,10 +5776,10 @@ printf %s "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} @@ -5355,14 +5815,14 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -printf "%s\n" "$LD" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf '%s\n' "$LD" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +{ 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 : @@ -5379,8 +5839,8 @@ case `$LD -v 2>&1 &5 -printf "%s\n" "$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 @@ -5396,7 +5856,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +{ 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 @@ -5467,8 +5927,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$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 @@ -5516,8 +5976,8 @@ if $ac_preproc_ok then : else case e in #( - e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + e) { { 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; } ;; esac @@ -5529,11 +5989,11 @@ 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 -for ac_prog in gawk mawk nawk awk +for ac_prog in gawk mawk nawk awk 'busybox 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -5554,7 +6014,7 @@ do 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_AWK="$ac_prog" - printf "%s\n" "$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 @@ -5566,11 +6026,11 @@ esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf '%s\n' "$AWK" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -5578,21 +6038,21 @@ fi done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +{ 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { 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, using $LN_S" >&5 -printf "%s\n" "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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ 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=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +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 @@ -5600,7 +6060,7 @@ else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: - @echo '@@@%%%=$(MAKE)=@@@%%%' + @printf '%s\n' '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in @@ -5613,26 +6073,26 @@ rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } SET_MAKE= else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 *\ * | *\ *) - { 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;} ;; + { 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.7' -macro_revision='2.4.7' +macro_version='2.5.4' +macro_revision='2.5.4' @@ -5666,7 +6126,7 @@ delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +{ 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 : @@ -5693,7 +6153,7 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in @@ -5722,8 +6182,8 @@ else fi ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -printf "%s\n" "$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 @@ -5736,7 +6196,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -5757,7 +6217,7 @@ do 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_DUMPBIN="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 @@ -5769,11 +6229,11 @@ esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -printf "%s\n" "$DUMPBIN" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf '%s\n' "$DUMPBIN" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -5786,7 +6246,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -5807,7 +6267,7 @@ do 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_DUMPBIN="$ac_prog" - printf "%s\n" "$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 @@ -5819,11 +6279,11 @@ esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -5835,8 +6295,8 @@ done 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;} +{ 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 @@ -5864,7 +6324,7 @@ test -z "$NM" && NM=nm -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +{ 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 : @@ -5886,11 +6346,11 @@ else case e in #( rm -f conftest* ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -printf "%s\n" "$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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +{ 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 : @@ -5908,14 +6368,14 @@ else case e in #( lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. + gnu* | ironclad*) + # Under GNU Hurd and Ironclad, this test is not required because there + # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5937,7 +6397,7 @@ else case e in #( lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + 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` @@ -6023,11 +6483,11 @@ esac fi if test -n "$lt_cv_sys_max_cmd_len"; then - { 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; } + { 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "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 @@ -6071,7 +6531,7 @@ esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +{ 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 : @@ -6080,7 +6540,7 @@ else case e in #( e) case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -6093,7 +6553,7 @@ else case e in #( ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -6113,14 +6573,14 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ 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; } +{ 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; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +{ 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 : @@ -6129,9 +6589,9 @@ else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac @@ -6142,14 +6602,14 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ 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; } +{ 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; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +{ 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 : @@ -6158,8 +6618,8 @@ else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -printf "%s\n" "$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 "" | " "*) ;; @@ -6167,7 +6627,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -6189,10 +6649,9 @@ 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 +# 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_FILECMD+y} then : @@ -6212,86 +6671,27 @@ do 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 + ac_cv_prog_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 + test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac 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 case e in #( - e) 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 ;; -esac -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; } + { 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; } + { 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 @@ -6302,7 +6702,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -6323,7 +6723,7 @@ do 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_OBJDUMP="${ac_tool_prefix}objdump" - printf "%s\n" "$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 @@ -6335,11 +6735,11 @@ esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -printf "%s\n" "$OBJDUMP" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf '%s\n' "$OBJDUMP" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6348,7 +6748,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -6369,7 +6769,7 @@ do 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_OBJDUMP="objdump" - printf "%s\n" "$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 @@ -6381,11 +6781,11 @@ esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -6393,8 +6793,8 @@ fi 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;} +{ 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 @@ -6410,7 +6810,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +{ 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 : @@ -6424,7 +6824,6 @@ lt_cv_deplibs_check_method='unknown' # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure @@ -6451,7 +6850,7 @@ cygwin*) lt_cv_file_magic_cmd='func_win32_libid' ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -6460,7 +6859,7 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; @@ -6533,7 +6932,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +*-mlibc) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -6551,7 +6954,7 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) +openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else @@ -6567,6 +6970,10 @@ rdos*) lt_cv_deplibs_check_method=pass_all ;; +serenity*) + lt_cv_deplibs_check_method=pass_all + ;; + solaris*) lt_cv_deplibs_check_method=pass_all ;; @@ -6612,14 +7019,14 @@ esac ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -printf "%s\n" "$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 if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -6657,7 +7064,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -6678,7 +7085,7 @@ do 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_DLLTOOL="${ac_tool_prefix}dlltool" - printf "%s\n" "$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 @@ -6690,11 +7097,11 @@ esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -printf "%s\n" "$DLLTOOL" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf '%s\n' "$DLLTOOL" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6703,7 +7110,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -6724,7 +7131,7 @@ do 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_DLLTOOL="dlltool" - printf "%s\n" "$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 @@ -6736,11 +7143,11 @@ esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -6748,8 +7155,8 @@ fi 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;} +{ 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 @@ -6766,7 +7173,7 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +{ 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 : @@ -6775,7 +7182,7 @@ else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -6795,8 +7202,8 @@ esac ;; esac fi -{ 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; } +{ 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 @@ -6807,12 +7214,116 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO +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 +{ 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 case e in #( + e) if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib" + 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 ;; +esac +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf '%s\n' "$RANLIB" >&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_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 +{ 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 case e in #( + e) if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib" + 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 ;; +esac +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf '%s\n' "$ac_ct_RANLIB" >&6; } +else + { 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 + RANLIB=":" + 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 + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + if test -n "$ac_tool_prefix"; then for ac_prog in ar 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -6833,7 +7344,7 @@ do 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_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$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 @@ -6845,11 +7356,11 @@ esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf '%s\n' "$AR" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6862,7 +7373,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -6883,7 +7394,7 @@ do 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_AR="$ac_prog" - printf "%s\n" "$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 @@ -6895,11 +7406,11 @@ esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -6911,8 +7422,8 @@ done 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;} +{ 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 @@ -6928,7 +7439,7 @@ fi # 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 +# higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. @@ -6948,7 +7459,7 @@ lt_ar_flags=$AR_FLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +{ 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 : @@ -6973,7 +7484,7 @@ then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - printf "%s\n" "$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. @@ -6981,7 +7492,7 @@ then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - printf "%s\n" "$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=@ @@ -6994,8 +7505,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -printf "%s\n" "$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= @@ -7012,7 +7523,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -7033,7 +7544,7 @@ do 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_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$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 @@ -7045,11 +7556,11 @@ esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf '%s\n' "$STRIP" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -7058,7 +7569,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -7079,7 +7590,7 @@ do 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_STRIP="strip" - printf "%s\n" "$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 @@ -7091,11 +7602,11 @@ esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -7103,8 +7614,8 @@ fi 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;} +{ 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 @@ -7120,140 +7631,30 @@ 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 -{ 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 case e in #( - e) if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib" - 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 ;; -esac -fi -RANLIB=$ac_cv_prog_RANLIB +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + if test -n "$RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -printf "%s\n" "$RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi - -fi -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 -{ 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 case e in #( - e) if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib" - 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 ;; -esac -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -printf "%s\n" "$ac_ct_RANLIB" >&6; } -else - { 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 - RANLIB=":" - 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 - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac @@ -7304,7 +7705,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +{ 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 : @@ -7325,7 +7726,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7340,7 +7741,7 @@ osf*) symcode='[BCDEGQRST]' ;; solaris*) - symcode='[BDRT]' + symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' @@ -7404,7 +7805,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -7455,21 +7856,18 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -7537,7 +7935,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - printf "%s\n" "$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 @@ -7573,11 +7971,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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -printf "%s\n" "failed" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf '%s\n' "failed" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -printf "%s\n" "ok" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf '%s\n' "ok" >&6; } fi # Response file support. @@ -7623,7 +8021,7 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. @@ -7640,7 +8038,9 @@ lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` + # Trim trailing / since we'll always append absolute paths and we want + # to avoid //, if only for less confusing output for the user. + lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) @@ -7649,20 +8049,20 @@ case $with_sysroot in #( no|'') ;; #( *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -printf "%s\n" "${lt_sysroot:-no}" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf '%s\n' "${lt_sysroot:-no}" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +{ 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 : @@ -7707,11 +8107,11 @@ fi rm -f conftest.i conftest2.i conftest.out ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -printf "%s\n" "$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; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +{ 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 : @@ -7728,8 +8128,8 @@ rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -printf "%s\n" "$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; } @@ -7769,7 +8169,7 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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 `$FILECMD conftest.$ac_objext` in *ELF-32*) @@ -7789,7 +8189,7 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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 `$FILECMD conftest.$ac_objext` in @@ -7827,7 +8227,7 @@ mips64*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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 `$FILECMD conftest.$ac_objext` in @@ -7857,7 +8257,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -7868,7 +8268,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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 `$FILECMD conftest.o` in *32-bit*) @@ -7876,7 +8276,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" @@ -7905,7 +8305,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) @@ -7931,7 +8331,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 + { 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 : @@ -7971,8 +8371,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -printf "%s\n" "$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 @@ -7985,7 +8385,7 @@ printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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 `$FILECMD conftest.o` in *64-bit*) @@ -8022,7 +8422,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8043,7 +8443,7 @@ do 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_MANIFEST_TOOL="${ac_tool_prefix}mt" - printf "%s\n" "$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 @@ -8055,11 +8455,11 @@ esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -printf "%s\n" "$MANIFEST_TOOL" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf '%s\n' "$MANIFEST_TOOL" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8068,7 +8468,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8089,7 +8489,7 @@ do 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_MANIFEST_TOOL="mt" - printf "%s\n" "$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 @@ -8101,11 +8501,11 @@ esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -8113,8 +8513,8 @@ fi 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;} +{ 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 @@ -8124,25 +8524,25 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +{ 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} +if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( - e) lt_cv_path_mainfest_tool=no + e) lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes + lt_cv_path_manifest_tool=yes fi rm -f conftest* ;; esac fi -{ 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 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 +printf '%s\n' "$lt_cv_path_manifest_tool" >&6; } +if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi @@ -8156,7 +8556,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8177,7 +8577,7 @@ do 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_DSYMUTIL="${ac_tool_prefix}dsymutil" - printf "%s\n" "$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 @@ -8189,11 +8589,11 @@ esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -printf "%s\n" "$DSYMUTIL" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf '%s\n' "$DSYMUTIL" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8202,7 +8602,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8223,7 +8623,7 @@ do 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_DSYMUTIL="dsymutil" - printf "%s\n" "$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 @@ -8235,11 +8635,11 @@ esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -8247,8 +8647,8 @@ fi 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;} +{ 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 @@ -8260,7 +8660,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8281,7 +8681,7 @@ do 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_NMEDIT="${ac_tool_prefix}nmedit" - printf "%s\n" "$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 @@ -8293,11 +8693,11 @@ esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -printf "%s\n" "$NMEDIT" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf '%s\n' "$NMEDIT" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8306,7 +8706,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8327,7 +8727,7 @@ do 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_NMEDIT="nmedit" - printf "%s\n" "$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 @@ -8339,11 +8739,11 @@ esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -8351,8 +8751,8 @@ fi 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;} +{ 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 @@ -8364,7 +8764,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8385,7 +8785,7 @@ do 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_LIPO="${ac_tool_prefix}lipo" - printf "%s\n" "$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 @@ -8397,11 +8797,11 @@ esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -printf "%s\n" "$LIPO" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf '%s\n' "$LIPO" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8410,7 +8810,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8431,7 +8831,7 @@ do 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_LIPO="lipo" - printf "%s\n" "$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 @@ -8443,11 +8843,11 @@ esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -8455,8 +8855,8 @@ fi 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;} +{ 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 @@ -8468,7 +8868,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8489,7 +8889,7 @@ do 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_OTOOL="${ac_tool_prefix}otool" - printf "%s\n" "$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 @@ -8501,11 +8901,11 @@ esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -printf "%s\n" "$OTOOL" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf '%s\n' "$OTOOL" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8514,7 +8914,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8535,7 +8935,7 @@ do 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_OTOOL="otool" - printf "%s\n" "$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 @@ -8547,11 +8947,11 @@ esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -8559,8 +8959,8 @@ fi 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;} +{ 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 @@ -8572,7 +8972,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8593,7 +8993,7 @@ do 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_OTOOL64="${ac_tool_prefix}otool64" - printf "%s\n" "$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 @@ -8605,11 +9005,11 @@ esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -printf "%s\n" "$OTOOL64" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf '%s\n' "$OTOOL64" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8618,7 +9018,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8639,7 +9039,7 @@ do 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_OTOOL64="otool64" - printf "%s\n" "$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 @@ -8651,11 +9051,11 @@ esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -8663,8 +9063,8 @@ fi 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;} +{ 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 @@ -8699,7 +9099,7 @@ fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 + { 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 : @@ -8734,10 +9134,49 @@ else case e in #( fi ;; esac fi -{ 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; } +{ 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; } + + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 +printf %s "checking for -no_fixup_chains linker flag... " >&6; } +if test ${lt_cv_support_no_fixup_chains+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_support_no_fixup_chains=yes +else case e in #( + e) lt_cv_support_no_fixup_chains=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 +printf '%s\n' "$lt_cv_support_no_fixup_chains" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 + { 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 : @@ -8771,10 +9210,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ ;; esac fi -{ 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; } +{ 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; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 + { 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 : @@ -8791,7 +9230,7 @@ _LT_EOF echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -8808,8 +9247,8 @@ _LT_EOF ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -printf "%s\n" "$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' ;; @@ -8820,13 +9259,32 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } 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' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + if test yes = "$lt_cv_support_no_fixup_chains"; then + as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' + fi + ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi + _lt_dar_needs_single_mod=no + case $host_os in + rhapsody* | darwin1.*) + _lt_dar_needs_single_mod=yes ;; + darwin*) + # When targeting Mac OS X 10.4 (darwin 8) or later, + # -single_module is the default and -multi_module is unsupported. + # The toolchain on macOS 10.14 (darwin 18) and later cannot + # target any OS version that needs -single_module. + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) + _lt_dar_needs_single_mod=yes ;; + esac + ;; + esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else @@ -8881,7 +9339,7 @@ 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 + printf '%s\n' "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then @@ -8901,14 +9359,14 @@ done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h +printf '%s\n' "#define STDC_HEADERS 1" >>confdefs.h fi 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 : - printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + printf '%s\n' "#define HAVE_DLFCN_H 1" >>confdefs.h fi @@ -8920,11 +9378,11 @@ fi enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8945,7 +9403,7 @@ do 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_AS="${ac_tool_prefix}as" - printf "%s\n" "$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 @@ -8957,11 +9415,11 @@ esac fi AS=$ac_cv_prog_AS if test -n "$AS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -printf "%s\n" "$AS" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf '%s\n' "$AS" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -8970,7 +9428,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -8991,7 +9449,7 @@ do 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_AS="as" - printf "%s\n" "$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 @@ -9003,11 +9461,11 @@ esac fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -9015,8 +9473,8 @@ fi 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;} +{ 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 @@ -9028,7 +9486,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -9049,7 +9507,7 @@ do 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_DLLTOOL="${ac_tool_prefix}dlltool" - printf "%s\n" "$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 @@ -9061,11 +9519,11 @@ esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -printf "%s\n" "$DLLTOOL" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf '%s\n' "$DLLTOOL" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9074,7 +9532,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -9095,7 +9553,7 @@ do 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_DLLTOOL="dlltool" - printf "%s\n" "$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 @@ -9107,11 +9565,11 @@ esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -9119,8 +9577,8 @@ fi 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;} +{ 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 @@ -9132,7 +9590,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -9153,7 +9611,7 @@ do 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_OBJDUMP="${ac_tool_prefix}objdump" - printf "%s\n" "$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 @@ -9165,11 +9623,11 @@ esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -printf "%s\n" "$OBJDUMP" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf '%s\n' "$OBJDUMP" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9178,7 +9636,7 @@ 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 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ 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 : @@ -9199,7 +9657,7 @@ do 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_OBJDUMP="objdump" - printf "%s\n" "$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 @@ -9211,11 +9669,11 @@ esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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 @@ -9223,8 +9681,8 @@ fi 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;} +{ 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 @@ -9326,31 +9784,54 @@ fi - -# Check whether --with-pic was given. + # Check whether --enable-pic was given. +if test ${enable_pic+y} +then : + enableval=$enable_pic; lt_p=${PACKAGE-default} + case $enableval in + yes|no) pic_mode=$enableval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else case e in #( + e) # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac else case e in #( e) pic_mode=default ;; esac fi + ;; +esac +fi + @@ -9393,20 +9874,31 @@ fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 + { 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. + # Check whether --enable-aix-soname was given. +if test ${enable_aix_soname+y} +then : + enableval=$enable_aix_soname; case $enableval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$enable_aix_soname +else case e in #( + e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : @@ -9414,14 +9906,18 @@ then : else case e in #( e) lt_cv_with_aix_soname=aix ;; esac +fi + ;; +esac fi - with_aix_soname=$lt_cv_with_aix_soname ;; + enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -printf "%s\n" "$with_aix_soname" >&6; } + with_aix_soname=$enable_aix_soname + { 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', @@ -9503,7 +9999,7 @@ if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +{ 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 : @@ -9520,15 +10016,15 @@ fi rmdir .libs 2>/dev/null ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -printf "%s\n" "$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 -printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h +printf '%s\n' "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -9574,7 +10070,7 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 + { 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 : @@ -9629,11 +10125,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -printf "%s\n" "$MAGIC_CMD" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf '%s\n' "$MAGIC_CMD" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9642,7 +10138,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 + { 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 : @@ -9697,11 +10193,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -printf "%s\n" "$MAGIC_CMD" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf '%s\n' "$MAGIC_CMD" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } fi @@ -9735,7 +10231,7 @@ objext=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' @@ -9786,7 +10282,7 @@ if test yes = "$GCC"; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + { 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 : @@ -9823,8 +10319,8 @@ else case e in #( ;; esac fi -{ 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; } +{ 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" @@ -9877,7 +10373,7 @@ lt_prog_compiler_static= # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -9980,7 +10476,7 @@ lt_prog_compiler_static= esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -10021,6 +10517,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + *flang* | ftn | f18* | f95*) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -10103,6 +10605,12 @@ lt_prog_compiler_static= lt_prog_compiler_static='-Bstatic' ;; + *-mlibc) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. @@ -10119,6 +10627,9 @@ lt_prog_compiler_static= lt_prog_compiler_static='-non_shared' ;; + serenity*) + ;; + solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' @@ -10181,7 +10692,7 @@ case $host_os in ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +{ 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 : @@ -10190,15 +10701,15 @@ else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 + { 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 : @@ -10235,8 +10746,8 @@ else case e in #( ;; esac fi -{ 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; } +{ 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 @@ -10264,7 +10775,7 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +{ 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 : @@ -10294,8 +10805,8 @@ else case e in #( ;; esac fi -{ 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; } +{ 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 : @@ -10309,7 +10820,7 @@ fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 + { 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 : @@ -10358,15 +10869,15 @@ else case e in #( ;; esac fi -{ 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; } +{ 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; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 + { 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 : @@ -10415,8 +10926,8 @@ else case e in #( ;; esac fi -{ 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; } +{ 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; } @@ -10424,7 +10935,7 @@ printf "%s\n" "$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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 + { 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* @@ -10432,11 +10943,11 @@ printf %s "checking if we can lock with hard links... " >&6; } touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -printf "%s\n" "$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 - { 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;} + { 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 @@ -10448,7 +10959,7 @@ fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 + { 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= @@ -10492,7 +11003,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # 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++ or Intel C++ Compiler. @@ -10504,9 +11015,6 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; esac ld_shlibs=yes @@ -10607,7 +11115,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -10617,6 +11125,7 @@ _LT_EOF enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + file_list_spec='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -10636,7 +11145,7 @@ _LT_EOF haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs=yes + link_all_deplibs=no ;; os2*) @@ -10663,7 +11172,7 @@ _LT_EOF cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $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='@' ;; @@ -10742,6 +11251,7 @@ _LT_EOF case $cc_basename in tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -10762,7 +11272,12 @@ _LT_EOF fi ;; - netbsd*) + *-mlibc) + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -11154,7 +11669,7 @@ fi export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -11171,14 +11686,14 @@ fi # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' @@ -11344,7 +11859,7 @@ 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) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 + { 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 : @@ -11374,8 +11889,8 @@ else case e in #( ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -printf "%s\n" "$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' @@ -11415,7 +11930,7 @@ 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. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 + { 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 : @@ -11439,8 +11954,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LDFLAGS=$save_LDFLAGS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -printf "%s\n" "$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 @@ -11461,11 +11976,15 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; - netbsd*) + *-mlibc) + ;; + + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -11487,7 +12006,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no @@ -11530,7 +12049,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $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='@' ;; @@ -11566,6 +12085,9 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_separator=: ;; + serenity*) + ;; + solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then @@ -11721,8 +12243,8 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -printf "%s\n" "$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 @@ -11758,7 +12280,7 @@ 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. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 + { 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 : @@ -11770,7 +12292,7 @@ else case e in #( if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - printf "%s\n" "$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 @@ -11788,7 +12310,7 @@ else case e in #( 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=$? - printf "%s\n" "$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 @@ -11803,8 +12325,8 @@ else case e in #( ;; esac fi -{ 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; } +{ 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 @@ -11963,7 +12485,7 @@ esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 + { 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 @@ -11972,7 +12494,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -12030,7 +12552,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -12104,7 +12626,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -12198,7 +12720,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -12209,15 +12731,29 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' + # If user builds GCC with multilib enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test xyes = x"$multilib"; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -12230,7 +12766,7 @@ cygwin* | mingw* | pw32* | cegcc*) sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; @@ -12249,7 +12785,7 @@ cygwin* | mingw* | pw32* | cegcc*) library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -12356,7 +12892,28 @@ freebsd* | dragonfly* | midnightbsd*) need_version=yes ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else case e in #( + e) shlibpath_var=LD_32_LIBRARY_PATH ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -12386,8 +12943,9 @@ haiku*) soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes + sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' + sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' + hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) @@ -12497,7 +13055,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -12509,8 +13067,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -12567,7 +13126,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -12587,6 +13146,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -12605,6 +13176,18 @@ netbsd*) hardcode_into_libs=yes ;; +*-mlibc) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='mlibc ld.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' @@ -12624,7 +13207,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -12684,6 +13267,17 @@ rdos*) dynamic_linker=no ;; +serenity*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + dynamic_linker='SerenityOS LibELF' + ;; + solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -12732,61 +13326,551 @@ sysv4 | sysv4.3*) esac ;; -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +emscripten*) + version_type=none + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + dynamic_linker="Emscripten linker" + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + *flang* | ftn | f18* | f95*) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + 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' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *-mlibc) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + serenity*) + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ 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 case e in #( + e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; +esac +fi +{ 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 + { 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 case e in #( + e) lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + ;; +esac +fi +{ 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 + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; +fi -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ 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 case e in #( + e) lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + ;; +esac +fi +{ 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 + : +else + lt_prog_compiler_static= +fi + + + +='-fPIC' + archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' + archive_cmds_need_lc=no + no_undefined_flag= ;; *) dynamic_linker=no ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -printf "%s\n" "$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" @@ -12907,7 +13991,7 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 + { 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" || @@ -12932,8 +14016,8 @@ else # directories. hardcode_action=unsupported fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -printf "%s\n" "$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 @@ -12965,7 +14049,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -12977,7 +14061,7 @@ else darwin*) # if libdl is installed we need to link against it - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 + { 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 : @@ -13018,8 +14102,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +{ 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 @@ -13048,7 +14132,7 @@ if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 + e) { 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 : @@ -13089,8 +14173,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ 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; } +{ 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 @@ -13100,7 +14184,7 @@ if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 + e) { 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 : @@ -13141,13 +14225,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +{ 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 case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 + e) { 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 : @@ -13188,13 +14272,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +{ 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 case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 + e) { 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 : @@ -13235,8 +14319,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ 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; } +{ 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 @@ -13282,7 +14366,7 @@ fi save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 + { 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 : @@ -13338,11 +14422,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -13366,7 +14450,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - printf "%s\n" "$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=$? @@ -13385,12 +14469,12 @@ rm -fr conftest* ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -printf "%s\n" "$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\" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 + { 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 : @@ -13446,11 +14530,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -13474,7 +14558,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - printf "%s\n" "$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=$? @@ -13493,8 +14577,8 @@ rm -fr conftest* ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -printf "%s\n" "$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 @@ -13532,40 +14616,40 @@ fi striplib= old_striplib= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +{ 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; } + { 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; } + { 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" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { 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; } + { 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; } + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } ;; esac fi @@ -13583,12 +14667,12 @@ fi # Report what library types will actually be built - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 + { 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; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf '%s\n' "$can_build_shared" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 + { 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 @@ -13613,15 +14697,15 @@ printf %s "checking whether to build shared libraries... " >&6; } fi ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -printf "%s\n" "$enable_shared" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf '%s\n' "$enable_shared" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 + { 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -printf "%s\n" "$enable_static" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf '%s\n' "$enable_static" >&6; } @@ -13659,20 +14743,22 @@ CC=$lt_save_CC -# Some awks crash when confronted with pnglibconf.dfa, do a test run now -# to make sure this doesn't happen -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that AWK works" >&5 -printf %s "checking that AWK works... " >&6; } + + +# Some awk implementations crash when confronted with pnglibconf.dfa. +# Run a test now, to make sure this doesn't happen. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if awk ($AWK) works" >&5 +printf %s "checking if awk ($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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -printf "%s\n" "ok" >&6; } + { 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}: error: in '$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} -as_fn_error 1 "failed + { { 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 "no See 'config.log' for more details" "$LINENO" 5; } fi @@ -13730,7 +14816,7 @@ then : if test "$enable_werror" != "no"; then sav_CFLAGS="$CFLAGS" CFLAGS="$enable_werror $CFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler allows $enable_werror" >&5 + { 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. */ @@ -13741,12 +14827,12 @@ printf %s "checking if the compiler allows $enable_werror... " >&6; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } PNG_COPTS="$PNG_COPTS $enable_werror" else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13759,7 +14845,7 @@ fi # 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\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. */ @@ -13777,15 +14863,15 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } else case e in #( e) 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } CFLAGS="$CFLAGS -std=c89" ;; esac @@ -13793,7 +14879,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # 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\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 : @@ -13824,15 +14910,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -printf "%s\n" "$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 -printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h +printf '%s\n' "#define TM_IN_SYS_TIME 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +{ 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 : @@ -13872,14 +14958,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 -printf "%s\n" "$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) printf "%s\n" "#define restrict /**/" >>confdefs.h + no) printf '%s\n' "#define restrict /**/" >>confdefs.h ;; - *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h + *) printf '%s\n' "#define restrict $ac_cv_c_restrict" >>confdefs.h ;; esac @@ -13891,10 +14977,10 @@ do : ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = xyes then : - printf "%s\n" "#define HAVE_POW 1" >>confdefs.h + printf '%s\n' "#define HAVE_POW 1" >>confdefs.h else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 + e) { 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 : @@ -13935,11 +15021,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 -printf "%s\n" "$ac_cv_lib_m_pow" >&6; } +{ 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 + printf '%s\n' "#define HAVE_LIBM 1" >>confdefs.h LIBS="-lm $LIBS" @@ -13960,8 +15046,8 @@ if test "x$ac_cv_func_clock_gettime" = xyes then : else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: not building timepng" >&5 -printf "%s\n" "$as_me: WARNING: not building timepng" >&2;} ;; + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: not building timepng" >&5 +printf '%s\n' "$as_me: WARNING: not building timepng" >&2;} ;; esac fi @@ -13984,7 +15070,7 @@ else case e in #( esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +{ 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 : @@ -14025,17 +15111,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 -printf "%s\n" "$ac_cv_lib_z_zlibVersion" >&6; } +{ 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 + printf '%s\n' "#define HAVE_LIBZ 1" >>confdefs.h LIBS="-lz $LIBS" else case e in #( - e) as_ac_Lib=`printf "%s\n" "ac_cv_lib_z_${ZPREFIX}zlibVersion" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ZPREFIX}zlibVersion in -lz" >&5 + e) as_ac_Lib=`printf '%s\n' "ac_cv_lib_z_${ZPREFIX}zlibVersion" | sed "$as_sed_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 : @@ -14077,11 +15163,11 @@ LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + { 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 + printf '%s\n' "#define HAVE_LIBZ 1" >>confdefs.h LIBS="-lz $LIBS" @@ -14097,7 +15183,7 @@ 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. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for feenableexcept in -lm" >&5 +{ 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 : @@ -14138,11 +15224,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$ac_check_lib_save_LIBS ;; esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_feenableexcept" >&5 -printf "%s\n" "$ac_cv_lib_m_feenableexcept" >&6; } +{ 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 + printf '%s\n' "#define HAVE_LIBM 1" >>confdefs.h LIBS="-lm $LIBS" @@ -14151,22 +15237,22 @@ fi 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 + printf '%s\n' "#define HAVE_FEENABLEEXCEPT 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if using Solaris linker" >&5 +{ 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else have_solaris_ld=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "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= @@ -14177,7 +15263,7 @@ else fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 +{ 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 @@ -14185,8 +15271,8 @@ printf %s "checking if libraries can be versioned... " >&6; } case $host in *cygwin* | *mingw32* | *interix* ) have_ld_version_script=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } ;; * ) @@ -14198,14 +15284,14 @@ fi if test "$GLD"; then have_ld_version_script=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } else have_ld_version_script=no - { 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;} + { 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 @@ -14220,15 +15306,15 @@ fi if test "$have_ld_version_script" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for symbol prefix" >&5 + { 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__::"` + | ${CPP:-${CC:-gcc} -E} - 2>&1 \ + | ${EGREP:-grep} "^PREFIX=" \ + | ${SED:-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SYMBOL_PREFIX" >&5 -printf "%s\n" "$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 @@ -14251,8 +15337,8 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkgconfig directory is ${pkgconfigdir}" >&5 -printf "%s\n" "$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 @@ -14261,8 +15347,8 @@ if test ${with_binconfigs+y} then : withval=$with_binconfigs; if test "${withval}" = no; then binconfigs= - { 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;} + { 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 @@ -14359,27 +15445,31 @@ then : # disable hardware optimization on all systems: enable_arm_neon=no -printf "%s\n" "#define PNG_ARM_NEON_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_ARM_NEON_OPT 0" >>confdefs.h enable_mips_msa=no -printf "%s\n" "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h enable_mips_mmi=no -printf "%s\n" "#define PNG_MIPS_MMI_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MMI_OPT 0" >>confdefs.h enable_powerpc_vsx=no -printf "%s\n" "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h enable_intel_sse=no -printf "%s\n" "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h enable_loongarch_lsx=no -printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_LOONGARCH_LSX_OPT 0" >>confdefs.h + + enable_riscv_rvv=no + +printf '%s\n' "#define PNG_RISCV_RVV_OPT 0" >>confdefs.h ;; *) @@ -14388,35 +15478,41 @@ printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 0" >>confdefs.h arm*|aarch64*) enable_arm_neon=yes -printf "%s\n" "#define PNG_ARM_NEON_OPT 2" >>confdefs.h +printf '%s\n' "#define PNG_ARM_NEON_OPT 2" >>confdefs.h ;; mipsel*|mips64el*) enable_mips_mmi=yes enable_mips_msa=yes -printf "%s\n" "#define PNG_MIPS_MMI_OPT 1" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MMI_OPT 1" >>confdefs.h -printf "%s\n" "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h ;; i?86|x86_64) enable_intel_sse=yes -printf "%s\n" "#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 -printf "%s\n" "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h +printf '%s\n' "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h ;; loongarch*) enable_loongarch_lsx=yes -printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h +printf '%s\n' "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h + + ;; + riscv64) + enable_riscv_rvv=yes + +printf '%s\n' "#define PNG_RISCV_RVV_OPT 2" >>confdefs.h ;; esac @@ -14425,10 +15521,8 @@ printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h fi -# ARM -# === -# -# ARM NEON (SIMD) support. +# ARM NEON +# ======== # Check whether --enable-arm-neon was given. if test ${enable_arm_neon+y} @@ -14437,37 +15531,38 @@ then : no|off) # disable the default enabling on __ARM_NEON__ systems: -printf "%s\n" "#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 ;; check) -printf "%s\n" "#define PNG_ARM_NEON_CHECK_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_ARM_NEON_CHECK_SUPPORTED /**/" >>confdefs.h ;; api) -printf "%s\n" "#define PNG_ARM_NEON_API_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_ARM_NEON_API_SUPPORTED /**/" >>confdefs.h ;; yes|on) -printf "%s\n" "#define PNG_ARM_NEON_OPT 2" >>confdefs.h +printf '%s\n' "#define PNG_ARM_NEON_OPT 2" >>confdefs.h - { 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 -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;};; + { 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 +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;};; *) - as_fn_error $? "--enable-arm-neon=${enable_arm_neon}: invalid value" "$LINENO" 5 + as_fn_error $? "--enable-arm-neon=${enable_arm_neon}: + invalid argument" "$LINENO" 5 esac fi # Add ARM-specific files to all builds where $host_cpu is arm ('arm*') or -# where ARM optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'arm*') +# where ARM optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'arm*'.) if test "$enable_arm_neon" != 'no' && case "$host_cpu" in @@ -14482,10 +15577,8 @@ else fi -# MIPS -# ==== -# -# MIPS MSA (SIMD) support. +# MIPS MSA +# ======== # Check whether --enable-mips-msa was given. if test ${enable_mips_msa+y} @@ -14494,37 +15587,38 @@ then : no|off) # disable the default enabling on __mips_msa systems: -printf "%s\n" "#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 ;; check) -printf "%s\n" "#define PNG_MIPS_MSA_CHECK_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MSA_CHECK_SUPPORTED /**/" >>confdefs.h ;; api) -printf "%s\n" "#define PNG_MIPS_MSA_API_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MSA_API_SUPPORTED /**/" >>confdefs.h ;; yes|on) -printf "%s\n" "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h - { 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 -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;};; + { 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 +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;};; *) - as_fn_error $? "--enable-mips-msa=${enable_mips_msa}: invalid value" "$LINENO" 5 + as_fn_error $? "--enable-mips-msa=${enable_mips_msa}: + invalid argument" "$LINENO" 5 esac fi # Add MIPS-specific files to all builds where $host_cpu is mips ('mips*') or -# where MIPS optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'mips*') +# where MIPS optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'mips*'.) if test "$enable_mips_msa" != 'no' && case "$host_cpu" in @@ -14538,10 +15632,8 @@ else fi -# MIPS -# === -# -# MIPS MMI (SIMD) support. +# MIPS MMI +# ======== # Check whether --enable-mips-mmi was given. if test ${enable_mips_mmi+y} @@ -14550,41 +15642,42 @@ then : no|off) # disable the default enabling on __mips_mmi systems: -printf "%s\n" "#define PNG_MIPS_MMI_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MMI_OPT 0" >>confdefs.h # Prevent inclusion of the assembler files below: enable_mips_mmi=no;; check) -printf "%s\n" "#define PNG_MIPS_MMI_CHECK_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MMI_CHECK_SUPPORTED /**/" >>confdefs.h ;; api) -printf "%s\n" "#define PNG_MIPS_MMI_API_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MMI_API_SUPPORTED /**/" >>confdefs.h ;; yes|on) -printf "%s\n" "#define PNG_MIPS_MMI_OPT 1" >>confdefs.h +printf '%s\n' "#define PNG_MIPS_MMI_OPT 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-mips-mmi: please specify 'check' or 'api', if - you want the optimizations unconditionally pass '-mloongson-mmi -march=loongson3a' - to the compiler." >&5 -printf "%s\n" "$as_me: WARNING: --enable-mips-mmi: please specify 'check' or 'api', if - you want the optimizations unconditionally pass '-mloongson-mmi -march=loongson3a' - to the compiler." >&2;};; + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: --enable-mips-mmi: please specify 'check' or 'api'; + if you want the optimizations unconditionally + pass '-mloongson-mmi -march=loongson3a' to the compiler." >&5 +printf '%s\n' "$as_me: WARNING: --enable-mips-mmi: please specify 'check' or 'api'; + if you want the optimizations unconditionally + pass '-mloongson-mmi -march=loongson3a' to the compiler." >&2;};; *) - as_fn_error $? "--enable-mips-mmi=${enable_mips_mmi}: invalid value" "$LINENO" 5 + as_fn_error $? "--enable-mips-mmi=${enable_mips_mmi}: + invalid argument" "$LINENO" 5 esac 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*') +# where MIPS optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'mips*'.) if test "$enable_mips_mmi" != 'no' && case "$host_cpu" in - mipsel*|mips64el*) :;; + mipsel*|mips64el*) : ;; esac; then PNG_MIPS_MMI_TRUE= PNG_MIPS_MMI_FALSE='#' @@ -14594,10 +15687,8 @@ else fi -# INTEL -# ===== -# -# INTEL SSE (SIMD) support. +# INTEL SSE +# ========= # Check whether --enable-intel-sse was given. if test ${enable_intel_sse+y} @@ -14606,23 +15697,24 @@ then : no|off) # disable the default enabling: -printf "%s\n" "#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 ;; yes|on) -printf "%s\n" "#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 + as_fn_error $? "--enable-intel-sse=${enable_intel_sse}: + invalid argument" "$LINENO" 5 esac fi # Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or -# where Intel optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'x86*') +# where Intel optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'x86*'.) if test "$enable_intel_sse" != 'no' && case "$host_cpu" in i?86|x86_64) : ;; @@ -14636,10 +15728,8 @@ else fi -# PowerPC -# ======= -# -# PowerPC VSX (SIMD) support. +# POWERPC VSX +# =========== # Check whether --enable-powerpc-vsx was given. if test ${enable_powerpc_vsx+y} @@ -14648,41 +15738,42 @@ then : no|off) # disable the default enabling on __ppc64__ systems: -printf "%s\n" "#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 ;; check) -printf "%s\n" "#define PNG_POWERPC_VSX_CHECK_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_POWERPC_VSX_CHECK_SUPPORTED /**/" >>confdefs.h - { 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 -printf "%s\n" "$as_me: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file - for the list of supported OSes." >&2;};; + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx: please see contrib/powerpc/README + for the list of supported systems." >&5 +printf '%s\n' "$as_me: WARNING: --enable-powerpc-vsx: please see contrib/powerpc/README + for the list of supported systems." >&2;};; api) -printf "%s\n" "#define PNG_POWERPC_VSX_API_SUPPORTED /**/" >>confdefs.h +printf '%s\n' "#define PNG_POWERPC_VSX_API_SUPPORTED /**/" >>confdefs.h ;; yes|on) -printf "%s\n" "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h +printf '%s\n' "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h - { 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 -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;};; + { 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 +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;};; *) - as_fn_error $? "--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value" "$LINENO" 5 + as_fn_error $? "--enable-powerpc-vsx=${enable_powerpc_vsx}: + invalid argument" "$LINENO" 5 esac fi -# Add PowerPC-specific files to all builds where $host_cpu is powerpc('powerpc*') -# or where PowerPC optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'powerpc*') +# Add PowerPC-specific files to all builds where $host_cpu is powerpc +# ('powerpc*') or where PowerPC optimizations were explicitly requested. +# (This allows a fallback if a future host CPU does not match 'powerpc*'.) if test "$enable_powerpc_vsx" != 'no' && case "$host_cpu" in @@ -14696,28 +15787,52 @@ else fi -# LOONGARCH -# === -# -# LOONGARCH LSX (SIMD) support +# LOONGARCH LSX +# ============= + +# Check whether --enable-loongarch-lsx was given. +if test ${enable_loongarch_lsx+y} +then : + enableval=$enable_loongarch_lsx; case "$enableval" in + no|off) + # disable the default enabling on __loongarch_simd systems: + +printf '%s\n' "#define PNG_LOONGARCH_LSX_OPT 0" >>confdefs.h + + # Prevent inclusion of the assembler files below: + enable_loongarch_lsx=no;; + yes|on) -if test "$LSX_CFLAGS" = ''; then - LSX_CFLAGS="-mlsx" +printf '%s\n' "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h + + ;; + *) + as_fn_error $? "--enable-loongarch-lsx=${enable_loongarch_lsx}: + invalid argument" "$LINENO" 5 + esac fi -compiler_support_loongarch_lsx=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use loongarch LSX intrinsics" >&5 -printf %s "checking whether to use loongarch LSX intrinsics... " >&6; } -save_CFLAGS=$CFLAGS -CFLAGS="$CFLAGS $LSX_CFLAGS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +if test "$enable_loongarch_lsx" != "no" && + case "$host_cpu" in + loongarch*) : ;; + *) test "$enable_loongarch_lsx" != '' ;; + esac +then + compiler_support_loongarch_lsx=no + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether to use LoongArch LSX intrinsics" >&5 +printf %s "checking whether to use LoongArch LSX intrinsics... " >&6; } + save_CFLAGS="$CFLAGS" + LSX_CFLAGS="${LSX_CFLAGS:-"-mlsx"}" + CFLAGS="$CFLAGS $LSX_CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main(){ - __m128i a, b, c; - a = __lsx_vadd_w(b, c); - return 0; + __m128i a, b, c; + a = __lsx_vadd_w(b, c); + return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" @@ -14725,62 +15840,126 @@ then : compiler_support_loongarch_lsx=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -CFLAGS=$save_CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $compiler_support_loongarch_lsx" >&5 -printf "%s\n" "$compiler_support_loongarch_lsx" >&6; } + CFLAGS="$save_CFLAGS" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $compiler_support_loongarch_lsx" >&5 +printf '%s\n' "$compiler_support_loongarch_lsx" >&6; } + if test "$compiler_support_loongarch_lsx" = "yes"; then -# Check whether --enable-loongarch-lsx was given. -if test ${enable_loongarch_lsx+y} +printf '%s\n' "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h + + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Compiler does not support loongarch LSX." >&5 +printf '%s\n' "$as_me: WARNING: Compiler does not support loongarch LSX." >&2;} + fi +fi + +# Add LoongArch specific files to all builds where the host_cpu is loongarch +# ('loongarch*') or where LoongArch optimizations were explicitly requested. +# (This allows a fallback if a future host CPU does not match 'loongarch*'.) + + if test "$enable_loongarch_lsx" != "no" && + test "$compiler_support_loongarch_lsx" = "yes" && + case "$host_cpu" in + loongarch*) : ;; + *) test "$enable_loongarch_lsx" != '' ;; + esac; then + PNG_LOONGARCH_LSX_TRUE= + PNG_LOONGARCH_LSX_FALSE='#' +else + PNG_LOONGARCH_LSX_TRUE='#' + PNG_LOONGARCH_LSX_FALSE= +fi + + +# RISC-V +# ====== +# +# RISC-V Vector support. + +# Check whether --enable-riscv-rvv was given. +if test ${enable_riscv_rvv+y} then : - enableval=$enable_loongarch_lsx; case "$enableval" in + enableval=$enable_riscv_rvv; case "$enableval" in no|off) - # disable the default enabling on __loongarch_simd systems: + # disable the default enabling on __riscv systems: -printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 0" >>confdefs.h +printf '%s\n' "#define PNG_RISCV_RVV_OPT 0" >>confdefs.h - # Prevent inclusion of the assembler files below: - enable_loongarch_lsx=no;; + # Prevent inclusion of the platform-specific files below: + enable_riscv_rvv=no ;; yes|on) -printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h +printf '%s\n' "#define PNG_RISCV_RVV_OPT 2" >>confdefs.h - ;; + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: --enable-riscv-rvv: + if you want the optimizations pass e.g. '-march=rv64gv1p0' to the compiler." >&5 +printf '%s\n' "$as_me: WARNING: --enable-riscv-rvv: + if you want the optimizations pass e.g. '-march=rv64gv1p0' to the compiler." >&2;};; *) - as_fn_error $? "--enable-loongarch-lsx=${enable_loongarch_lsx}: invalid value" "$LINENO" 5 + as_fn_error $? "--enable-riscv-rvv=${enable_riscv_rvv}: invalid value" "$LINENO" 5 esac fi -if test "$enable_loongarch_lsx" != 'no'; then - if test $compiler_support_loongarch_lsx = yes; then +if test "$enable_riscv_rvv" != "no" && + case "$host_cpu" in + riscv64) : ;; + *) test "$enable_riscv_rvv" != '' ;; + esac +then + compiler_support_riscv_rvv=no + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether to use RISC-V RVV intrinsics" >&5 +printf %s "checking whether to use RISC-V RVV intrinsics... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int main() { + const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; + uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A}; + vuint8m1_t a = __riscv_vreinterpret_v_u64m1_u8m1(__riscv_vle64_v_u64m1(ptr, 2)); + vfloat32m1_t val = __riscv_vle32_v_f32m1((const float*)(src), 4); + return (int)__riscv_vfmv_f_s_f32m1_f32(val); +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + compiler_support_riscv_rvv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $compiler_support_riscv_rvv" >&5 +printf '%s\n' "$compiler_support_riscv_rvv" >&6; } + if test "$compiler_support_riscv_rvv" = "yes"; then -printf "%s\n" "#define PNG_LOONGARCH_LSX_OPT 1" >>confdefs.h +printf '%s\n' "#define PNG_RISCV_RVV_OPT 1" >>confdefs.h else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Compiler does not support loongarch LSX." >&5 -printf "%s\n" "$as_me: WARNING: Compiler does not support loongarch LSX." >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Compiler does not support riscv rvv." >&5 +printf '%s\n' "$as_me: WARNING: Compiler does not support riscv rvv." >&2;} fi fi -# Add LOONGARCH specific files to all builds where the host_cpu is loongarch ('loongarch*') or -# where LOONGARCH optimizations were explicitly requested (this allows a fallback if a -# future host CPU does not match 'loongarch*') +# Add RISC-V-specific files to all builds where $host_cpu is riscv ('riscv64') +# or where RISC-V optimizations were explicitly requested (this allows a fallback +# if a future host CPU does not match 'riscv64') - if test "$enable_loongarch_lsx" != 'no' && test $compiler_support_loongarch_lsx = yes && + if test "$enable_riscv_rvv" != "no" && + test "$compiler_support_riscv_rvv" = "yes" && case "$host_cpu" in - loongarch*) :;; - *) test "$enable_loongarch_lsx" != '';; + riscv64) : ;; + *) test "$compiler_support_riscv_rvv" != '' ;; esac; then - PNG_LOONGARCH_LSX_TRUE= - PNG_LOONGARCH_LSX_FALSE='#' + PNG_RISCV_RVV_TRUE= + PNG_RISCV_RVV_FALSE='#' else - PNG_LOONGARCH_LSX_TRUE='#' - PNG_LOONGARCH_LSX_FALSE= + PNG_RISCV_RVV_TRUE='#' + PNG_RISCV_RVV_FALSE= fi -{ 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;} +{ 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" @@ -14804,44 +15983,7 @@ cat >confcache <<\_ACEOF _ACEOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_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) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # 'set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # 'set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | +ac_cache_dump | sed ' /^ac_cv_env_/b end t clear @@ -14853,8 +15995,8 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$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 @@ -14868,8 +16010,8 @@ printf "%s\n" "$as_me: updating cache $cache_file" >&6;} fi fi else - { 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;} + { 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 @@ -14886,7 +16028,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=`printf "%s\n" "$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" @@ -14897,14 +16039,26 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +{ 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 -printf "%s\n" "done" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf '%s\n' "done" >&6; } +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -14989,15 +16143,27 @@ if test -z "${PNG_LOONGARCH_LSX_TRUE}" && test -z "${PNG_LOONGARCH_LSX_FALSE}"; as_fn_error $? "conditional \"PNG_LOONGARCH_LSX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${PNG_RISCV_RVV_TRUE}" && test -z "${PNG_RISCV_RVV_FALSE}"; then + as_fn_error $? "conditional \"PNG_RISCV_RVV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" +case $CONFIG_STATUS in #( + -*) : + CONFIG_STATUS=./$CONFIG_STATUS ;; #( + */*) : + ;; #( + *) : + CONFIG_STATUS=./$CONFIG_STATUS ;; +esac + ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +ac_clean_CONFIG_STATUS='"$CONFIG_STATUS"' +{ 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 +cat >"$CONFIG_STATUS" <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -15011,7 +16177,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -15023,7 +16189,7 @@ then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. + # contradicts POSIX and common usage. Disable this. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( @@ -15110,7 +16276,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$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 @@ -15126,9 +16292,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 - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + printf '%s\n' "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -15223,7 +16389,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +printf '%s\n' X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -15245,29 +16411,6 @@ 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*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - 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 @@ -15309,7 +16452,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$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" @@ -15318,7 +16461,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +printf '%s\n' X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -15371,19 +16514,19 @@ as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## +## ------------------------------------- ## +## Main body of "$CONFIG_STATUS" script. ## +## ------------------------------------- ## _ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 +test $as_write_fail = 0 && chmod +x "$CONFIG_STATUS" || ac_write_fail=1 -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # 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.43.git, which was -generated by GNU Autoconf 2.72. Invocation command line was +This file was extended by libpng $as_me 1.6.59.git, which was +generated by GNU Autoconf 2.73. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -15405,7 +16548,7 @@ case $ac_config_headers in *" esac -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -15413,7 +16556,7 @@ config_commands="$ac_config_commands" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files @@ -15445,16 +16588,16 @@ $config_commands Report bugs to ." _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=`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='$ac_cs_config_escaped' ac_cs_version="\\ -libpng config.status 1.6.43.git -configured by $0, generated by GNU Autoconf 2.72, +libpng config.status 1.6.59.git +configured by $0, generated by GNU Autoconf 2.73, with options \\"\$ac_cs_config\\" -Copyright (C) 2023 Free Software Foundation, Inc. +Copyright (C) 2026 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -15463,10 +16606,14 @@ srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' -test -n "\$AWK" || AWK=awk +test -n "\$AWK" || { + awk '' >$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 @@ -15494,15 +16641,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; + printf '%s\n' "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$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=`printf "%s\n" "$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'" @@ -15510,7 +16657,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$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;; @@ -15519,7 +16666,7 @@ do as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) - printf "%s\n" "$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=: ;; @@ -15543,29 +16690,29 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +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 - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf '%s\n' "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - printf "%s\n" "$ac_log" + printf '%s\n' "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # @@ -15860,7 +17007,7 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -15945,13 +17092,13 @@ _ACEOF echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim_num=`echo "$ac_subst_vars" | sed -n '$='` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | sed -n '$='` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then @@ -15962,7 +17109,7 @@ for ac_last_try in false false false false false :; do done rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' @@ -16007,9 +17154,9 @@ t delim N s/\n// } -' >>$CONFIG_STATUS || ac_write_fail=1 +' >>"$CONFIG_STATUS" || ac_write_fail=1 rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 @@ -16038,7 +17185,7 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && _ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else @@ -16070,7 +17217,7 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. @@ -16141,9 +17288,9 @@ s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 +"/g' >>"$CONFIG_STATUS" || ac_write_fail=1 -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } @@ -16161,8 +17308,12 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { + suffix = P[macro] D[macro] + while (suffix ~ /[\t ]$/) { + suffix = substr(suffix, 1, length(suffix) - 1) + } # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] + print prefix "define", macro suffix next } else { # Replace #undef with comments. This is necessary, for example, @@ -16177,7 +17328,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 { print } _ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -16221,7 +17372,7 @@ do esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$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 @@ -16229,17 +17380,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - printf "%s\n" "$*" | 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" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$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=`printf "%s\n" "$configure_input" | + ac_sed_conf_input=`printf '%s\n' "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -16256,7 +17407,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | +printf '%s\n' X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -16280,9 +17431,9 @@ printf "%s\n" X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$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=`printf "%s\n" "$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/ ;; @@ -16327,7 +17478,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= @@ -16344,10 +17495,10 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { 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;} + { 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 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -16361,11 +17512,11 @@ _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t @@ -16389,9 +17540,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"; } && - { printf "%s\n" "$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 -printf "%s\n" "$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" @@ -16407,20 +17558,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - printf "%s\n" "/* $configure_input */" >&1 \ + 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$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 - printf "%s\n" "/* $configure_input */" >&1 \ + 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 @@ -16440,7 +17591,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$_am_arg" | +printf '%s\n' X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -16460,8 +17611,8 @@ printf "%s\n" X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$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 @@ -16487,7 +17638,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + 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 @@ -16499,7 +17650,7 @@ $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" | +printf '%s\n' X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -16521,7 +17672,7 @@ printf "%s\n" X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$am_mf" | +printf '%s\n' X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -16546,8 +17697,8 @@ printf "%s\n" X/"$am_mf" | (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;} + { { 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 @@ -16578,19 +17729,18 @@ See 'config.log' for more details" "$LINENO" 5; } cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2024 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. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you @@ -16974,7 +18124,7 @@ hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -17124,7 +18274,7 @@ done # for ac_tag as_fn_exit 0 _ACEOF -ac_clean_files=$ac_clean_files_save +ac_clean_CONFIG_STATUS= test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 @@ -17140,19 +18290,26 @@ test $ac_write_fail = 0 || # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: + case $CONFIG_STATUS in #( + -*) : + ac_no_opts=-- ;; #( + *) : + ac_no_opts= ;; +esac ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + $SHELL $ac_no_opts "$CONFIG_STATUS" $ac_config_status_args || + ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { 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;} + { 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 b9162e8d2b..42d0beb66d 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ AC_PREREQ([2.68]) dnl Version number stuff here: -AC_INIT([libpng],[1.6.43.git],[png-mng-implement@lists.sourceforge.net]) +AC_INIT([libpng],[1.6.59.git],[png-mng-implement@lists.sourceforge.net]) AC_CONFIG_MACRO_DIR([scripts/autoconf]) # libpng does not follow GNU file name conventions (hence 'foreign') @@ -46,17 +46,17 @@ 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.43.git +PNGLIB_VERSION=1.6.59.git PNGLIB_MAJOR=1 PNGLIB_MINOR=6 -PNGLIB_RELEASE=43 +PNGLIB_RELEASE=59 dnl End of version number stuff AC_CONFIG_SRCDIR([pngget.c]) AC_CONFIG_HEADERS([config.h]) -# Checks for programs. +# Check the basic programs. AC_LANG([C]) AC_PROG_CC AM_PROG_AS @@ -72,16 +72,19 @@ dnl compatible later version may be used LT_INIT([win32-dll]) LT_PREREQ([2.4.2]) -# Some awks crash when confronted with pnglibconf.dfa, do a test run now -# to make sure this doesn't happen -AC_MSG_CHECKING([that AWK works]) +dnl Declare the AWK variable. +AC_ARG_VAR(AWK, [AWK language processor]) + +# Some awk implementations crash when confronted with pnglibconf.dfa. +# Run a test now, to make sure this doesn't happen. +AC_MSG_CHECKING([if awk ($AWK) works]) if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\ ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ ${srcdir}/pngusr.dfa 1>&2 then - AC_MSG_RESULT([ok]) + AC_MSG_RESULT([yes]) else - AC_MSG_FAILURE([failed], 1) + AC_MSG_FAILURE([no], 1) fi # This is a remnant of the old cc -E validation, where it may have been @@ -111,7 +114,7 @@ AM_CONDITIONAL([ENABLE_TOOLS], # (it checks the compiler with a program that generates a warning). # Add the following option to deal with this: AC_ARG_VAR(PNG_COPTS, - [additional flags for the C compiler, use this for options that would] + [additional flags for the C compiler, to be used for options that would] [cause configure itself to fail]) AC_ARG_ENABLE(werror, AS_HELP_STRING([[[--enable-werror[=OPT]]]], @@ -223,9 +226,9 @@ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") if test "$have_ld_version_script" = "yes"; then AC_MSG_CHECKING([for symbol prefix]) SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ - | ${CPP-${CC-gcc} -E} - 2>&1 \ - | ${EGREP-grep} "^PREFIX=" \ - | ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"` + | ${CPP:-${CC:-gcc} -E} - 2>&1 \ + | ${EGREP:-grep} "^PREFIX=" \ + | ${SED:-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"` AC_SUBST(SYMBOL_PREFIX) AC_MSG_RESULT($SYMBOL_PREFIX) fi @@ -318,7 +321,7 @@ AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG], # AC_ARG_ENABLE([hardware-optimizations], AS_HELP_STRING([[[--enable-hardware-optimizations]]], - [Enable hardware optimizations: =no/off, yes/on:]), + [Enable hardware optimizations: =no/off, yes/on.]), [case "$enableval" in no|off) # disable hardware optimization on all systems: @@ -340,6 +343,9 @@ AC_ARG_ENABLE([hardware-optimizations], enable_loongarch_lsx=no AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0], [Disable LOONGARCH_LSX optimizations]) + enable_riscv_rvv=no + AC_DEFINE([PNG_RISCV_RVV_OPT], [0], + [Disable RISC-V Vector optimizations]) ;; *) # allow enabling hardware optimization on any system: @@ -372,21 +378,25 @@ AC_ARG_ENABLE([hardware-optimizations], AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1], [Enable LOONGARCH_LSX optimizations]) ;; + riscv64) + enable_riscv_rvv=yes + AC_DEFINE([PNG_RISCV_RVV_OPT], [2], + [Enable RISC-V Vector optimizations]) + ;; esac ;; esac]) -# ARM -# === -# -# ARM NEON (SIMD) support. +# ARM NEON +# ======== AC_ARG_ENABLE([arm-neon], AS_HELP_STRING([[[--enable-arm-neon]]], - [Enable ARM NEON optimizations: =no/off, check, api, yes/on:] - [no/off: disable the optimizations; check: use internal checking code] - [(deprecated and poorly supported); api: disable by default, enable by] - [a call to png_set_option; yes/on: turn on unconditionally.] + [Enable ARM NEON optimizations: =no/off, check, api, yes/on.] + [no/off: disable the optimizations;] + [check: use internal checking code (deprecated and poorly supported);] + [api: disable by default, enable by a call to png_set_option;] + [yes/on: turn on unconditionally.] [If not specified: determined by the compiler.]), [case "$enableval" in no|off) @@ -404,16 +414,17 @@ AC_ARG_ENABLE([arm-neon], yes|on) AC_DEFINE([PNG_ARM_NEON_OPT], [2], [Enable ARM Neon optimizations]) - AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if] - [you want the optimizations unconditionally pass -mfpu=neon] - [to the compiler.]);; + AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api';] + [if you want the optimizations unconditionally,] + [pass '-mfpu=neon' to the compiler.]);; *) - AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value]) + AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}:] + [invalid argument]) esac]) # Add ARM-specific files to all builds where $host_cpu is arm ('arm*') or -# where ARM optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'arm*') +# where ARM optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'arm*'.) AM_CONDITIONAL([PNG_ARM_NEON], [test "$enable_arm_neon" != 'no' && @@ -422,17 +433,16 @@ AM_CONDITIONAL([PNG_ARM_NEON], *) test "$enable_arm_neon" != '' ;; esac]) -# MIPS -# ==== -# -# MIPS MSA (SIMD) support. +# MIPS MSA +# ======== AC_ARG_ENABLE([mips-msa], AS_HELP_STRING([[[--enable-mips-msa]]], - [Enable MIPS MSA optimizations: =no/off, check, api, yes/on:] - [no/off: disable the optimizations; check: use internal checking code] - [(deprecated and poorly supported); api: disable by default, enable by] - [a call to png_set_option; yes/on: turn on unconditionally.] + [Enable MIPS MSA optimizations: =no/off, check, api, yes/on.] + [no/off: disable the optimizations;] + [check: use internal checking code (deprecated and poorly supported);] + [api: disable by default, enable by a call to png_set_option;] + [yes/on: turn on unconditionally.] [If not specified: determined by the compiler.]), [case "$enableval" in no|off) @@ -450,16 +460,17 @@ AC_ARG_ENABLE([mips-msa], yes|on) AC_DEFINE([PNG_MIPS_MSA_OPT], [2], [Enable MIPS MSA optimizations]) - AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api', if] - [you want the optimizations unconditionally pass '-mmsa -mfp64'] - [to the compiler.]);; + AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api';] + [if you want the optimizations unconditionally,] + [pass '-mmsa -mfp64' to the compiler.]);; *) - AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value]) + AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}:] + [invalid argument]) esac]) # Add MIPS-specific files to all builds where $host_cpu is mips ('mips*') or -# where MIPS optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'mips*') +# where MIPS optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'mips*'.) AM_CONDITIONAL([PNG_MIPS_MSA], [test "$enable_mips_msa" != 'no' && @@ -467,17 +478,16 @@ AM_CONDITIONAL([PNG_MIPS_MSA], mipsel*|mips64el*) : ;; esac]) -# MIPS -# === -# -# MIPS MMI (SIMD) support. +# MIPS MMI +# ======== AC_ARG_ENABLE([mips-mmi], AS_HELP_STRING([[[--enable-mips-mmi]]], - [Enable MIPS MMI optimizations: =no/off, check, api, yes/on:] - [no/off: disable the optimizations; check: use internal checking code] - [(deprecated and poorly supported); api: disable by default, enable by] - [a call to png_set_option; yes/on: turn on unconditionally.] + [Enable MIPS MMI optimizations: =no/off, check, api, yes/on.] + [no/off: disable the optimizations;] + [check: use internal checking code (deprecated and poorly supported);] + [api: disable by default, enable by a call to png_set_option;] + [yes/on: turn on unconditionally.] [If not specified: determined by the compiler.]), [case "$enableval" in no|off) @@ -495,31 +505,30 @@ AC_ARG_ENABLE([mips-mmi], yes|on) AC_DEFINE([PNG_MIPS_MMI_OPT], [1], [Enable MIPS MMI optimizations]) - AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api', if] - [you want the optimizations unconditionally pass '-mloongson-mmi -march=loongson3a'] - [to the compiler.]);; + AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api';] + [if you want the optimizations unconditionally] + [pass '-mloongson-mmi -march=loongson3a' to the compiler.]);; *) - AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}: invalid value]) + AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}:] + [invalid argument]) esac]) # Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or -# where MIPS optimizations were explicitly requested (this allows a fallback if a -# future host CPU does not match 'mips*') +# where MIPS optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'mips*'.) AM_CONDITIONAL([PNG_MIPS_MMI], [test "$enable_mips_mmi" != 'no' && case "$host_cpu" in - mipsel*|mips64el*) :;; + mipsel*|mips64el*) : ;; esac]) -# INTEL -# ===== -# -# INTEL SSE (SIMD) support. +# INTEL SSE +# ========= AC_ARG_ENABLE([intel-sse], AS_HELP_STRING([[[--enable-intel-sse]]], - [Enable Intel SSE optimizations: =no/off, yes/on:] + [Enable Intel SSE optimizations: =no/off, yes/on.] [no/off: disable the optimizations;] [yes/on: enable the optimizations.] [If not specified: determined by the compiler.]), @@ -534,12 +543,13 @@ AC_ARG_ENABLE([intel-sse], AC_DEFINE([PNG_INTEL_SSE_OPT], [1], [Enable Intel SSE optimizations]);; *) - AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value]) + AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}:] + [invalid argument]) esac]) # Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or -# where Intel optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'x86*') +# where Intel optimizations were explicitly requested. (This allows a fallback +# if a future host CPU does not match 'x86*'.) AM_CONDITIONAL([PNG_INTEL_SSE], [test "$enable_intel_sse" != 'no' && case "$host_cpu" in @@ -547,16 +557,15 @@ AM_CONDITIONAL([PNG_INTEL_SSE], *) test "$enable_intel_sse" != '' ;; esac]) -# PowerPC -# ======= -# -# PowerPC VSX (SIMD) support. +# POWERPC VSX +# =========== AC_ARG_ENABLE([powerpc-vsx], AS_HELP_STRING([[[--enable-powerpc-vsx]]], - [Enable POWERPC VSX optimizations: =no/off, check, api, yes/on:] - [no/off: disable the optimizations; check: use internal checking code] - [api: disable by default, enable by a call to png_set_option] + [Enable POWERPC VSX optimizations: =no/off, check, api, yes/on.] + [no/off: disable the optimizations;] + [check: use internal checking code;] + [api: disable by default, enable by a call to png_set_option;] [yes/on: turn on unconditionally.] [If not specified: determined by the compiler.]), [case "$enableval" in @@ -569,24 +578,25 @@ AS_HELP_STRING([[[--enable-powerpc-vsx]]], check) AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [], [Check for POWERPC VSX support at run-time]) - AC_MSG_WARN([--enable-powerpc-vsx Please check contrib/powerpc/README file] - [for the list of supported OSes.]);; + AC_MSG_WARN([--enable-powerpc-vsx: please see contrib/powerpc/README] + [for the list of supported systems.]);; api) AC_DEFINE([PNG_POWERPC_VSX_API_SUPPORTED], [], [Turn on POWERPC VSX optimizations at run-time]);; yes|on) AC_DEFINE([PNG_POWERPC_VSX_OPT], [2], [Enable POWERPC VSX optimizations]) - AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api', if] - [you want the optimizations unconditionally pass '-maltivec -mvsx'] - [or '-mcpu=power8' to the compiler.]);; + AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api';] + [if you want the optimizations unconditionally,] + [pass '-maltivec -mvsx' or '-mcpu=power8' to the compiler.]);; *) - AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value]) + AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}:] + [invalid argument]) esac]) -# Add PowerPC-specific files to all builds where $host_cpu is powerpc('powerpc*') -# or where PowerPC optimizations were explicitly requested (this allows a fallback -# if a future host CPU does not match 'powerpc*') +# Add PowerPC-specific files to all builds where $host_cpu is powerpc +# ('powerpc*') or where PowerPC optimizations were explicitly requested. +# (This allows a fallback if a future host CPU does not match 'powerpc*'.) AM_CONDITIONAL([PNG_POWERPC_VSX], [test "$enable_powerpc_vsx" != 'no' && @@ -594,28 +604,8 @@ AM_CONDITIONAL([PNG_POWERPC_VSX], powerpc*|ppc64*) : ;; esac]) -# LOONGARCH -# === -# -# LOONGARCH LSX (SIMD) support - -if test "$LSX_CFLAGS" = ''; then - LSX_CFLAGS="-mlsx" -fi - -compiler_support_loongarch_lsx=no -AC_MSG_CHECKING(whether to use loongarch LSX intrinsics) -save_CFLAGS=$CFLAGS -CFLAGS="$CFLAGS $LSX_CFLAGS" -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ -#include -int main(){ - __m128i a, b, c; - a = __lsx_vadd_w(b, c); - return 0; -}]])],compiler_support_loongarch_lsx=yes) -CFLAGS=$save_CFLAGS -AC_MSG_RESULT($compiler_support_loongarch_lsx) +# LOONGARCH LSX +# ============= AC_ARG_ENABLE([loongarch-lsx], AS_HELP_STRING([[[--enable-loongarch-lsx]]], @@ -635,26 +625,114 @@ AC_ARG_ENABLE([loongarch-lsx], [Enable LOONGARCH LSX optimizations]) ;; *) - AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}: invalid value]) + AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}:] + [invalid argument]) esac]) -if test "$enable_loongarch_lsx" != 'no'; then - if test $compiler_support_loongarch_lsx = yes; then - AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1], [Enable LOONGARCH LSX optimizations]) +if test "$enable_loongarch_lsx" != "no" && + case "$host_cpu" in + loongarch*) : ;; + *) test "$enable_loongarch_lsx" != '' ;; + esac +then + compiler_support_loongarch_lsx=no + AC_MSG_CHECKING(whether to use LoongArch LSX intrinsics) + save_CFLAGS="$CFLAGS" + LSX_CFLAGS="${LSX_CFLAGS:-"-mlsx"}" + CFLAGS="$CFLAGS $LSX_CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +int main(){ + __m128i a, b, c; + a = __lsx_vadd_w(b, c); + return 0; +}]])],compiler_support_loongarch_lsx=yes) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT($compiler_support_loongarch_lsx) + if test "$compiler_support_loongarch_lsx" = "yes"; then + AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1], + [Enable LOONGARCH LSX optimizations]) else AC_MSG_WARN([Compiler does not support loongarch LSX.]) fi fi -# Add LOONGARCH specific files to all builds where the host_cpu is loongarch ('loongarch*') or -# where LOONGARCH optimizations were explicitly requested (this allows a fallback if a -# future host CPU does not match 'loongarch*') +# Add LoongArch specific files to all builds where the host_cpu is loongarch +# ('loongarch*') or where LoongArch optimizations were explicitly requested. +# (This allows a fallback if a future host CPU does not match 'loongarch*'.) AM_CONDITIONAL([PNG_LOONGARCH_LSX], - [test "$enable_loongarch_lsx" != 'no' && test $compiler_support_loongarch_lsx = yes && + [test "$enable_loongarch_lsx" != "no" && + test "$compiler_support_loongarch_lsx" = "yes" && + case "$host_cpu" in + loongarch*) : ;; + *) test "$enable_loongarch_lsx" != '' ;; + esac]) + +# RISC-V +# ====== +# +# RISC-V Vector support. + +AC_ARG_ENABLE([riscv-rvv], +AS_HELP_STRING([[[--enable-riscv-rvv]]], + [Enable RISC-V Vector optimizations: =no/off, check, api, yes/on:] + [no/off: disable the optimizations; check: use internal checking code] + [api: disable by default, enable by a call to png_set_option] + [yes/on: turn on. If not specified: determined by the compiler.]), + [case "$enableval" in + no|off) + # disable the default enabling on __riscv systems: + AC_DEFINE([PNG_RISCV_RVV_OPT], [0], + [Disable RISC-V Vector optimizations]) + # Prevent inclusion of the platform-specific files below: + enable_riscv_rvv=no ;; + yes|on) + AC_DEFINE([PNG_RISCV_RVV_OPT], [2], + [Enable RISC-V Vector optimizations]) + AC_MSG_WARN([--enable-riscv-rvv:] + [if you want the optimizations pass e.g. '-march=rv64gv1p0' to the compiler.]);; + *) + AC_MSG_ERROR([--enable-riscv-rvv=${enable_riscv_rvv}: invalid value]) + esac]) + +if test "$enable_riscv_rvv" != "no" && + case "$host_cpu" in + riscv64) : ;; + *) test "$enable_riscv_rvv" != '' ;; + esac +then + compiler_support_riscv_rvv=no + AC_MSG_CHECKING(whether to use RISC-V RVV intrinsics) + + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +int main() { + const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; + uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A}; + vuint8m1_t a = __riscv_vreinterpret_v_u64m1_u8m1(__riscv_vle64_v_u64m1(ptr, 2)); + vfloat32m1_t val = __riscv_vle32_v_f32m1((const float*)(src), 4); + return (int)__riscv_vfmv_f_s_f32m1_f32(val); +}]])],compiler_support_riscv_rvv=yes) + AC_MSG_RESULT($compiler_support_riscv_rvv) + if test "$compiler_support_riscv_rvv" = "yes"; then + AC_DEFINE([PNG_RISCV_RVV_OPT], [1], + [Enable RISCV RVV optimizations]) + else + AC_MSG_WARN([Compiler does not support riscv rvv.]) + fi +fi + +# Add RISC-V-specific files to all builds where $host_cpu is riscv ('riscv64') +# or where RISC-V optimizations were explicitly requested (this allows a fallback +# if a future host CPU does not match 'riscv64') + +AM_CONDITIONAL([PNG_RISCV_RVV], + [test "$enable_riscv_rvv" != "no" && + test "$compiler_support_riscv_rvv" = "yes" && case "$host_cpu" in - loongarch*) :;; - *) test "$enable_loongarch_lsx" != '';; + riscv64) : ;; + *) test "$compiler_support_riscv_rvv" != '' ;; esac]) AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]]) diff --git a/contrib/.editorconfig b/contrib/.editorconfig index bd9b590d34..8b1466b1d9 100644 --- a/contrib/.editorconfig +++ b/contrib/.editorconfig @@ -2,12 +2,8 @@ root = false -[*] -charset = unset -end_of_line = unset +[*.[ch]] indent_size = unset indent_style = unset -insert_final_newline = unset max_doc_length = unset max_line_length = unset -trim_trailing_whitespace = unset diff --git a/contrib/README.txt b/contrib/README.txt index 97963c6d54..34dfbae4c4 100644 --- a/contrib/README.txt +++ b/contrib/README.txt @@ -1,3 +1,5 @@ +External contributions to libpng +-------------------------------- This "contrib" directory contains contributions which are not necessarily under the libpng license, although all are open source. They are not part of diff --git a/contrib/conftest/fixed.dfa b/contrib/conftest/fixed.dfa new file mode 100644 index 0000000000..cb45f01363 --- /dev/null +++ b/contrib/conftest/fixed.dfa @@ -0,0 +1,15 @@ +# fixed.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2025 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Test the standard libpng configuration without floating point (the internal +# fixed point implementations are used instead). +# +option FLOATING_ARITHMETIC off +option FLOATING_POINT off diff --git a/contrib/conftest/float-fixed.dfa b/contrib/conftest/float-fixed.dfa new file mode 100644 index 0000000000..c13da31984 --- /dev/null +++ b/contrib/conftest/float-fixed.dfa @@ -0,0 +1,14 @@ +# fixed-float.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2025 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Test the standard libpng configuration with the fixed point internal +# implementation in place of the default floating point +# +option FLOATING_ARITHMETIC off diff --git a/contrib/conftest/nocompile-limits.dfa b/contrib/conftest/nocompile-limits.dfa new file mode 100644 index 0000000000..24e1e2e083 --- /dev/null +++ b/contrib/conftest/nocompile-limits.dfa @@ -0,0 +1,21 @@ +# nolimits.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2025 +# +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng without any limits and without run-time settable limits. Turning +# USER_LIMITS off reduces libpng code size by allowing compile-time elimination +# of some checking code. +# +option USER_LIMITS off + +@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX +@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX +@# define PNG_USER_CHUNK_CACHE_MAX 0 +@# define PNG_USER_CHUNK_MALLOC_MAX 0 diff --git a/contrib/conftest/nolimits.dfa b/contrib/conftest/nolimits.dfa new file mode 100644 index 0000000000..5b37fcf727 --- /dev/null +++ b/contrib/conftest/nolimits.dfa @@ -0,0 +1,19 @@ +# nolimits.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2025 +# +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng without any limits. With these settigs run-time limits are still +# possible. +# +@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX +@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX +@# define PNG_USER_CHUNK_CACHE_MAX 0 +@# define PNG_USER_CHUNK_MALLOC_MAX 0 + diff --git a/contrib/conftest/read-full.dfa b/contrib/conftest/read-full.dfa new file mode 100644 index 0000000000..4860f83dd6 --- /dev/null +++ b/contrib/conftest/read-full.dfa @@ -0,0 +1,13 @@ +# read-full.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2025 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with no write support and full read support. +# +option WRITE off diff --git a/contrib/conftest/write-full.dfa b/contrib/conftest/write-full.dfa new file mode 100644 index 0000000000..2daf0b0551 --- /dev/null +++ b/contrib/conftest/write-full.dfa @@ -0,0 +1,13 @@ +# write-full.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2025 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with no read support and full write support. +# +option READ off diff --git a/contrib/examples/.clang-format b/contrib/examples/.clang-format new file mode 100644 index 0000000000..eb26af615a --- /dev/null +++ b/contrib/examples/.clang-format @@ -0,0 +1,143 @@ +--- +Language: Cpp +AccessModifierOffset: -3 +AlignAfterOpenBracket: Align +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false +AlignConsecutiveBitFields: + Enabled: false +AlignConsecutiveDeclarations: + Enabled: false +AlignConsecutiveMacros: + Enabled: false +AlignConsecutiveShortCaseStatements: + Enabled: false +AlignEscapedNewlines: DontAlign +AlignOperands: false +AlignTrailingComments: + Kind: Never + OverEmptyLines: 0 +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Never +AllowShortCaseExpressionOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AllowShortNamespacesOnASingleLine: false +AlwaysBreakBeforeMultilineStrings: false +BinPackArguments: true +BinPackParameters: BinPack +BitFieldColonSpacing: Both +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterExternBlock: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakAfterReturnType: TopLevel +BreakArrays: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Custom +BreakBeforeTernaryOperators: false +BreakStringLiterals: false +BreakTemplateDeclarations: MultiLine +ColumnLimit: 79 +ContinuationIndentWidth: 3 +DerivePointerAlignment: true +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +FixNamespaceComments: true +IncludeBlocks: Preserve +IndentAccessModifiers: false +IndentCaseBlocks: true +IndentCaseLabels: true +IndentExportBlock: true +IndentExternBlock: AfterExternBlock +IndentGotoLabels: false +IndentPPDirectives: None +IndentRequiresClause: true +IndentWidth: 3 +IndentWrappedFunctionNames: false +KeepEmptyLines: + AtEndOfFile: false + AtStartOfBlock: false + AtStartOfFile: false +KeepFormFeed: false +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +PackConstructorInitializers: Never +PointerAlignment: Left +QualifierAlignment: Custom +QualifierOrder: [static, inline, constexpr, const, volatile, restrict, type] +ReferenceAlignment: Pointer +ReflowComments: Never +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SortIncludes: false +SortUsingDeclarations: LexicographicNumeric +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false +SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: Never +SpacesInContainerLiterals: true +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParens: Never +SpacesInParensOptions: + ExceptDoubleParentheses: false + InCStyleCasts: false + InConditionalStatements: false + InEmptyParentheses: false + Other: false +SpacesInSquareBrackets: false +Standard: Latest +TabWidth: 8 +UseTab: Never +WrapNamespaceBodyWithEmptyLines: Leave +... diff --git a/contrib/examples/README.txt b/contrib/examples/README.txt index 48dab4f0fd..7833d536cc 100644 --- a/contrib/examples/README.txt +++ b/contrib/examples/README.txt @@ -1,4 +1,3 @@ - This directory (contrib/examples) contains examples of libpng usage. NO COPYRIGHT RIGHTS ARE CLAIMED TO ANY OF THE FILES IN THIS DIRECTORY. diff --git a/contrib/examples/iccfrompng.c b/contrib/examples/iccfrompng.c index 00056abfd7..0e095abb1d 100644 --- a/contrib/examples/iccfrompng.c +++ b/contrib/examples/iccfrompng.c @@ -26,8 +26,9 @@ #include -#if defined(PNG_READ_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) && \ - defined (PNG_iCCP_SUPPORTED) +#if !defined(PNG_iCCP_SUPPORTED) || !defined(PNG_READ_SUPPORTED) +#error This program requires libpng supporting the iCCP chunk and the read API +#endif static int verbose = 1; @@ -36,7 +37,8 @@ static png_byte no_profile[] = "no profile"; static png_bytep extract(FILE *fp, png_uint_32 *proflen) { - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); + png_structp png_ptr = + png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_infop info_ptr = NULL; png_bytep result = NULL; @@ -69,7 +71,7 @@ extract(FILE *fp, png_uint_32 *proflen) png_bytep profile; if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile, - proflen) & PNG_INFO_iCCP) + proflen) & PNG_INFO_iCCP) { result = malloc(*proflen); if (result != NULL) @@ -80,7 +82,7 @@ extract(FILE *fp, png_uint_32 *proflen) } else - result = no_profile; + result = no_profile; } png_destroy_read_struct(&png_ptr, &info_ptr, NULL); @@ -107,7 +109,7 @@ extract_one_file(const char *filename) const char *ep = strrchr(filename, '.'); if (ep != NULL) - len = ep-filename; + len = ep - filename; else len = strlen(filename); @@ -119,14 +121,14 @@ extract_one_file(const char *filename) FILE *of; memcpy(output, filename, len); - strcpy(output+len, ".icc"); + strcpy(output + len, ".icc"); of = fopen(output, "wb"); if (of != NULL) { if (fwrite(profile, proflen, 1, of) == 1 && - fflush(of) == 0 && - fclose(of) == 0) + fflush(of) == 0 && + fclose(of) == 0) { if (verbose) printf("%s -> %s\n", filename, output); @@ -155,12 +157,15 @@ extract_one_file(const char *filename) } else if (verbose && profile == no_profile) - printf("%s has no profile\n", filename); + printf("%s has no profile\n", filename); } else fprintf(stderr, "%s: could not open file\n", filename); + if (fp != NULL) + fclose(fp); + return result; } @@ -170,7 +175,7 @@ main(int argc, char **argv) int i; int extracted = 0; - for (i=1; i #include @@ -27,34 +27,37 @@ */ #include "../../png.h" -#if defined(PNG_READ_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED) +#if !defined(PNG_READ_SUPPORTED) || !defined(PNG_SEQUENTIAL_READ_SUPPORTED) +#error This program requires libpng supporting the read and sequential read API +#endif + /* Return component 'c' of pixel 'x' from the given row. */ static unsigned int component(png_const_bytep row, png_uint_32 x, unsigned int c, - unsigned int bit_depth, unsigned int channels) + unsigned int bit_depth, unsigned int channels) { - /* PNG images can be up to 2^31 pixels wide, but this means they can be up to - * 2^37 bits wide (for a 64-bit pixel - the largest possible) and hence 2^34 - * bytes wide. Since the row fitted into memory, however, the following must + /* PNG images can be up to 2^31 pixels wide, which means they can be up to + * 2^37 bits wide (for a 64-bit pixel - the largest possible) and hence + * 2^34 bytes wide. Since the row fitted into memory, the following must * work: */ 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)(((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; /* PNG pixels are packed into bytes to put the first pixel in the highest - * bits of the byte and into two bytes for 16-bit values with the high 8 bits - * first, so: + * bits of the byte, and into two bytes for 16-bit values with the high + * 8 bits first, so: */ switch (bit_depth) { - case 1: return (row[0] >> (7-bit_offset_lo)) & 0x01; - case 2: return (row[0] >> (6-bit_offset_lo)) & 0x03; - case 4: return (row[0] >> (4-bit_offset_lo)) & 0x0f; + case 1: return (row[0] >> (7 - bit_offset_lo)) & 0x01; + case 2: return (row[0] >> (6 - bit_offset_lo)) & 0x03; + case 4: return (row[0] >> (4 - bit_offset_lo)) & 0x0f; case 8: return row[0]; case 16: return (row[0] << 8) + row[1]; default: @@ -71,7 +74,7 @@ component(png_const_bytep row, png_uint_32 x, unsigned int c, */ static void print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row, - png_uint_32 x) + png_uint_32 x) { unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr); @@ -92,22 +95,24 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row, int num_palette = 0; if ((png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) & - PNG_INFO_PLTE) && num_palette > 0 && palette != NULL) + PNG_INFO_PLTE) && + (num_palette > 0) && + (palette != NULL)) { png_bytep trans_alpha = NULL; int num_trans = 0; if ((png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, - NULL) & PNG_INFO_tRNS) && num_trans > 0 && - trans_alpha != NULL) + NULL) & PNG_INFO_tRNS) && + (num_trans > 0) && + (trans_alpha != NULL)) printf("INDEXED %u = %d %d %d %d\n", index, - palette[index].red, palette[index].green, - palette[index].blue, - index < num_trans ? trans_alpha[index] : 255); + palette[index].red, palette[index].green, + palette[index].blue, + index < num_trans ? trans_alpha[index] : 255); else /* no transparency */ - printf("INDEXED %u = %d %d %d\n", index, - palette[index].red, palette[index].green, - palette[index].blue); + printf("INDEXED %u = %d %d %d\n", index, palette[index].red, + palette[index].green, palette[index].blue); } else @@ -117,20 +122,20 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row, case PNG_COLOR_TYPE_RGB: printf("RGB %u %u %u\n", component(row, x, 0, bit_depth, 3), - component(row, x, 1, bit_depth, 3), - component(row, x, 2, bit_depth, 3)); + component(row, x, 1, bit_depth, 3), + component(row, x, 2, bit_depth, 3)); return; case PNG_COLOR_TYPE_GRAY_ALPHA: printf("GRAY+ALPHA %u %u\n", component(row, x, 0, bit_depth, 2), - component(row, x, 1, bit_depth, 2)); + component(row, x, 1, bit_depth, 2)); return; case PNG_COLOR_TYPE_RGB_ALPHA: printf("RGBA %u %u %u %u\n", component(row, x, 0, bit_depth, 4), - component(row, x, 1, bit_depth, 4), - component(row, x, 2, bit_depth, 4), - component(row, x, 3, bit_depth, 4)); + component(row, x, 1, bit_depth, 4), + component(row, x, 2, bit_depth, 4), + component(row, x, 3, bit_depth, 4)); return; default: @@ -138,7 +143,8 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row, } } -int main(int argc, const char **argv) +int +main(int argc, const char **argv) { /* This program uses the default, based, libpng error handling * mechanism, therefore any local variable that exists before the call to @@ -146,7 +152,7 @@ int main(int argc, const char **argv) * be declared with 'volatile' to ensure that their values don't get * destroyed by longjmp: */ - volatile int result = 1/*fail*/; + volatile int result = 1 /*fail*/; if (argc == 4) { @@ -163,8 +169,8 @@ int main(int argc, const char **argv) * writes error messages to stderr. Creating the png_struct is a * little tricky; just copy the following code. */ - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, - NULL, NULL, NULL); + png_structp png_ptr = + png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png_ptr != NULL) { @@ -184,11 +190,11 @@ int main(int argc, const char **argv) compression_method, filter_method; png_bytep row_tmp; - /* Now associate the recently opened (FILE*) with the default - * libpng initialization functions. Sometimes libpng is - * compiled without stdio support (it can be difficult to do - * in some environments); in that case you will have to write - * your own read callback to read data from the (FILE*). + /* Now associate the recently opened FILE object with the + * default libpng initialization functions. Sometimes libpng + * is compiled without stdio support (it can be difficult to + * do in some environments); in that case you will have to + * write your own read callback to read data from the stream. */ png_init_io(png_ptr, f); @@ -202,21 +208,21 @@ int main(int argc, const char **argv) * space. In this case png_malloc is used - it will not * return if memory isn't available. */ - row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, - info_ptr)); + row = + png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); - /* To avoid the overhead of using a volatile auto copy row_tmp + /* Avoid the overhead of using a volatile auto copy row_tmp * to a local here - just use row for the png_free below. */ row_tmp = row; - /* All the information we need is in the header is returned by - * png_get_IHDR, if this fails we can now use 'png_error' to + /* All the information we need is in the header returned by + * png_get_IHDR. If this fails, we can use 'png_error' to * signal the error and return control to the setjmp above. */ if (png_get_IHDR(png_ptr, info_ptr, &width, &height, - &bit_depth, &color_type, &interlace_method, - &compression_method, &filter_method)) + &bit_depth, &color_type, &interlace_method, + &compression_method, &filter_method)) { int passes, pass; @@ -242,7 +248,7 @@ int main(int argc, const char **argv) /* Now read the pixels, pass-by-pass, row-by-row: */ png_start_read_image(png_ptr); - for (pass=0; pass #include @@ -20,10 +20,15 @@ * ensure the code picks up the local libpng implementation: */ #include "../../png.h" -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) && \ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) -int main(int argc, const char **argv) +#if !defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ + !defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) +#error This program requires libpng supporting the simplified read/write API +#endif + + +int +main(int argc, const char **argv) { int result = 1; @@ -48,22 +53,22 @@ int main(int argc, const char **argv) if (buffer != NULL) { - if (png_image_finish_read(&image, NULL/*background*/, buffer, - 0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */)) + if (png_image_finish_read(&image, NULL /*background*/, buffer, + 0 /*row_stride*/, NULL /*colormap */)) { - if (png_image_write_to_file(&image, argv[2], - 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, - NULL/*colormap*/)) + if (png_image_write_to_file( + &image, argv[2], 0 /*convert_to_8bit*/, buffer, + 0 /*row_stride*/, NULL /*colormap*/)) result = 0; else fprintf(stderr, "pngtopng: write %s: %s\n", argv[2], - image.message); + image.message); } else fprintf(stderr, "pngtopng: read %s: %s\n", argv[1], - image.message); + image.message); free(buffer); } @@ -71,7 +76,7 @@ int main(int argc, const char **argv) else { fprintf(stderr, "pngtopng: out of memory: %lu bytes\n", - (unsigned long)PNG_IMAGE_SIZE(image)); + (unsigned long)PNG_IMAGE_SIZE(image)); /* This is the only place where a 'free' is required; libpng does * the cleanup on error and success, but in this case we couldn't @@ -93,4 +98,3 @@ int main(int argc, const char **argv) return result; } -#endif /* READ && WRITE */ diff --git a/contrib/examples/simpleover.c b/contrib/examples/simpleover.c index 59dd313688..8dc9fecbde 100644 --- a/contrib/examples/simpleover.c +++ b/contrib/examples/simpleover.c @@ -6,9 +6,9 @@ * United States. * * Read several PNG files, which should have an alpha channel or transparency - * information, and composite them together to produce one or more 16-bit linear - * RGBA intermediates. This involves doing the correct 'over' composition to - * combine the alpha channels and corresponding data. + * information, and composite them together to produce one or more 16-bit + * linear RGBA intermediates. This involves doing the 'over' compositing + * operation to combine the alpha channels and corresponding data. * * Finally read an output (background) PNG using the 24-bit RGB format (the * PNG will be composited on green (#00ff00) by default if it has an alpha @@ -28,8 +28,8 @@ * correctly. Apart from the libpng Simplified API the only work done in here * is to combine multiple input PNG images into a single sprite; this involves * a Porter-Duff 'over' operation and the input PNG images may, as a result, - * be regarded as being layered one on top of the other with the first (leftmost - * on the command line) being at the bottom and the last on the top. + * be regarded as being layered one on top of the other with the first + * (leftmost on the command line) being at the bottom and the last on the top. */ #include #include @@ -44,54 +44,61 @@ */ #include "../../png.h" -#ifdef PNG_SIMPLIFIED_READ_SUPPORTED +#if !defined(PNG_SIMPLIFIED_READ_SUPPORTED) +#error This program requires libpng supporting the simplified read API +#endif #define sprite_name_chars 15 -struct sprite { - FILE *file; - png_uint_16p buffer; - unsigned int width; - unsigned int height; - char name[sprite_name_chars+1]; +struct sprite +{ + FILE *file; + png_uint_16p buffer; + unsigned int width; + unsigned int height; + char name[sprite_name_chars + 1]; }; #if 0 /* div by 65535 test program */ #include #include -int main(void) { +int +main(void) +{ double err = 0; unsigned int xerr = 0; unsigned int r = 32769; - { - unsigned int x = 0; + unsigned int x = 0; - do { - unsigned int t = x + (x >> 16) /*+ (x >> 31)*/ + r; - double v = x, errtest; + do + { + unsigned int t = x + (x >> 16) /*+ (x >> 31)*/ + r; + double v = x, errtest; - if (t < x) { - fprintf(stderr, "overflow: %u+%u -> %u\n", x, r, t); - return 1; - } + if (t < x) + { + fprintf(stderr, "overflow: %u+%u -> %u\n", x, r, t); + return 1; + } - v /= 65535; - errtest = v; - t >>= 16; - errtest -= t; + v /= 65535; + errtest = v; + t >>= 16; + errtest -= t; - if (errtest > err) { - err = errtest; - xerr = x; + if (errtest > err) + { + err = errtest; + xerr = x; - if (errtest >= .5) { - fprintf(stderr, "error: %u/65535 = %f, not %u, error %f\n", - x, v, t, errtest); - return 0; - } + if (errtest >= .5) + { + fprintf(stderr, "error: %u/65535 = %f, not %u, error %f\n", + x, v, t, errtest); + return 0; } - } while (++x <= 65535U*65535U); - } + } + } while (++x <= 65535U * 65535U); printf("error %f @ %u\n", err, xerr); @@ -101,7 +108,7 @@ int main(void) { static void sprite_op(const struct sprite *sprite, int x_offset, int y_offset, - png_imagep image, const png_uint_16 *buffer) + png_imagep image, const png_uint_16 *buffer) { /* This is where the Porter-Duff 'Over' operator is evaluated; change this * code to change the operator (this could be parameterized). Any other @@ -112,8 +119,8 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset, /* Check for an x or y offset that pushes any part of the image beyond the * right or bottom of the sprite: */ - if ((y_offset < 0 || (unsigned)/*SAFE*/y_offset < sprite->height) && - (x_offset < 0 || (unsigned)/*SAFE*/x_offset < sprite->width)) + if ((y_offset < 0 || /*SAFE*/ (unsigned)y_offset < sprite->height) && + (x_offset < 0 || /*SAFE*/ (unsigned)x_offset < sprite->width)) { unsigned int y = 0; @@ -130,7 +137,7 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset, do { /* In and out are RGBA values, so: */ - const png_uint_16 *in_pixel = buffer + (y * image->width + x)*4; + const png_uint_16 *in_pixel = buffer + (y * image->width + x) * 4; png_uint_32 in_alpha = in_pixel[3]; /* This is the optimized Porter-Duff 'Over' operation, when the @@ -139,10 +146,10 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset, if (in_alpha > 0) { png_uint_16 *out_pixel = sprite->buffer + - ((y+y_offset) * sprite->width + (x+x_offset))*4; + ((y + y_offset) * sprite->width + (x + x_offset)) * 4; /* This is the weight to apply to the output: */ - in_alpha = 65535-in_alpha; + in_alpha = 65535 - in_alpha; if (in_alpha > 0) { @@ -159,9 +166,9 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset, */ png_uint_32 tmp; -# define compose(c)\ - tmp = out_pixel[c] * in_alpha;\ - tmp = (tmp + (tmp >> 16) + 32769) >> 16;\ +# define compose(c) \ + tmp = out_pixel[c] * in_alpha; \ + tmp = (tmp + (tmp >> 16) + 32769) >> 16; \ out_pixel[c] = tmp + in_pixel[c] /* The following is very vectorizable... */ @@ -172,15 +179,15 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset, } else - out_pixel[0] = in_pixel[0], - out_pixel[1] = in_pixel[1], - out_pixel[2] = in_pixel[2], + { + out_pixel[0] = in_pixel[0]; + out_pixel[1] = in_pixel[1]; + out_pixel[2] = in_pixel[2]; out_pixel[3] = in_pixel[3]; + } } - } - while (++x < image->width); - } - while (++y < image->height); + } while (++x < image->width); + } while (++y < image->height); } } @@ -224,9 +231,8 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv) if (buffer != NULL) { - if (png_image_finish_read(&image, NULL/*background*/, buffer, - 0/*row_stride*/, - NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/)) + if (png_image_finish_read(&image, NULL /*background*/, buffer, + 0 /*row_stride*/, NULL /*colormap*/)) { /* This is the place where the Porter-Duff 'Over' operator * needs to be done by this code. In fact, any image @@ -245,14 +251,14 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv) { free(buffer); fprintf(stderr, "simpleover: read %s: %s\n", (*argv)[0], - image.message); + image.message); } } else { fprintf(stderr, "simpleover: out of memory: %lu bytes\n", - (unsigned long)PNG_IMAGE_SIZE(image)); + (unsigned long)PNG_IMAGE_SIZE(image)); /* png_image_free must be called if we abort the Simplified API * read because of a problem detected in this code. If problems @@ -290,8 +296,9 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv) save.flags = PNG_IMAGE_FLAG_FAST; save.colormap_entries = 0; - if (png_image_write_to_stdio(&save, sprite->file, 1/*convert_to_8_bit*/, - sprite->buffer, 0/*row_stride*/, NULL/*colormap*/)) + if (png_image_write_to_stdio(&save, sprite->file, 1 /*convert_to_8_bit*/, + sprite->buffer, 0 /*row_stride*/, + NULL /*colormap*/)) { /* Success; the buffer is no longer needed: */ free(sprite->buffer); @@ -301,19 +308,20 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv) else fprintf(stderr, "simpleover: write sprite %s: %s\n", sprite->name, - save.message); + save.message); } else - fprintf(stderr, "simpleover: sprite %s: could not allocate tmpfile: %s\n", - sprite->name, strerror(errno)); + fprintf(stderr, + "simpleover: sprite %s: could not allocate tmpfile: %s\n", + sprite->name, strerror(errno)); return 0; /* fail */ } static int add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, - int *argc, const char ***argv) + int *argc, const char ***argv) { /* Given a --add argument naming this sprite, perform the operations listed * in the following arguments. The arguments are expected to have the form @@ -334,13 +342,13 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, * will fit. */ if (x < 0 || y < 0 || - (unsigned)/*SAFE*/x >= output->width || - (unsigned)/*SAFE*/y >= output->height || - sprite->width > output->width-x || - sprite->height > output->height-y) + /*SAFE*/ (unsigned)x >= output->width || + /*SAFE*/ (unsigned)y >= output->height || + sprite->width > output->width - x || + sprite->height > output->height - y) { fprintf(stderr, "simpleover: sprite %s @ (%d,%d) outside image\n", - sprite->name, x, y); + sprite->name, x, y); /* Could just skip this, but for the moment it is an error */ return 0; /* error */ } @@ -359,10 +367,10 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, { in.format = PNG_FORMAT_RGB; /* force compose */ - if (png_image_finish_read(&in, NULL/*background*/, - out_buf + (y*output->width + x)*3/*RGB*/, - output->width*3/*row_stride*/, - NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/)) + if (png_image_finish_read( + &in, NULL /*background*/, + out_buf + (y * output->width + x) * 3 /*RGB*/, + output->width * 3 /*row_stride*/, NULL /*colormap*/)) { ++*argv, --*argc; continue; @@ -371,7 +379,7 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, /* The read failed: */ fprintf(stderr, "simpleover: add sprite %s: %s\n", sprite->name, - in.message); + in.message); return 0; /* error */ } } @@ -379,7 +387,7 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, else { fprintf(stderr, "simpleover: --add='%s': invalid position %s\n", - sprite->name, (*argv)[0]); + sprite->name, (*argv)[0]); return 0; /* error */ } } @@ -389,10 +397,10 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, static int simpleover_process(png_imagep output, png_bytep out_buf, int argc, - const char **argv) + const char **argv) { int result = 1; /* success */ -# define csprites 10/*limit*/ +# define csprites 10 /*limit*/ # define str(a) #a int nsprites = 0; struct sprite sprites[csprites]; @@ -412,23 +420,25 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, sprites[nsprites].width = sprites[nsprites].height = 0; sprites[nsprites].name[0] = 0; - n = sscanf(argv[0], "--sprite=%u,%u,%" str(sprite_name_chars) "s%c", - &sprites[nsprites].width, &sprites[nsprites].height, - sprites[nsprites].name, &tombstone); + n = sscanf(argv[0], + "--sprite=%u,%u,%" str(sprite_name_chars) "s%c", + &sprites[nsprites].width, &sprites[nsprites].height, + sprites[nsprites].name, &tombstone); if ((n == 2 || n == 3) && - sprites[nsprites].width > 0 && sprites[nsprites].height > 0) + (sprites[nsprites].width > 0) && + (sprites[nsprites].height > 0)) { size_t buf_size, tmp; /* Default a name if not given. */ if (sprites[nsprites].name[0] == 0) - sprintf(sprites[nsprites].name, "sprite-%d", nsprites+1); + sprintf(sprites[nsprites].name, "sprite-%d", nsprites + 1); /* Allocate a buffer for the sprite and calculate the buffer * size: */ - buf_size = sizeof (png_uint_16 [4]); + buf_size = sizeof(png_uint_16[4]); buf_size *= sprites[nsprites].width; buf_size *= sprites[nsprites].height; @@ -437,7 +447,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, tmp /= sprites[nsprites].width; tmp /= sprites[nsprites].height; - if (tmp == sizeof (png_uint_16 [4])) + if (tmp == sizeof(png_uint_16[4])) { sprites[nsprites].buffer = malloc(buf_size); /* This buffer must be initialized to transparent: */ @@ -448,7 +458,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, sprites[nsprites].file = NULL; ++argv, --argc; - if (create_sprite(sprites+nsprites++, &argc, &argv)) + if (create_sprite(sprites + nsprites++, &argc, &argv)) { result = 1; /* still ok */ continue; @@ -466,7 +476,8 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, else { fprintf(stderr, "simpleover: %s: invalid sprite (%u,%u)\n", - argv[0], sprites[nsprites].width, sprites[nsprites].height); + argv[0], + sprites[nsprites].width, sprites[nsprites].height); break; } } @@ -480,7 +491,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, else if (strncmp(argv[0], "--add=", 6) == 0) { - const char *name = argv[0]+6; + const char *name = argv[0] + 6; int isprite = nsprites; ++argv, --argc; @@ -489,7 +500,8 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, { if (strcmp(sprites[isprite].name, name) == 0) { - if (!add_sprite(output, out_buf, sprites+isprite, &argc, &argv)) + if (!add_sprite(output, out_buf, sprites + isprite, + &argc, &argv)) goto out; /* error in add_sprite */ break; @@ -498,7 +510,8 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, if (isprite < 0) /* sprite not found */ { - fprintf(stderr, "simpleover: --add='%s': sprite not found\n", name); + fprintf(stderr, "simpleover: --add='%s': sprite not found\n", + name); break; } } @@ -526,7 +539,8 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc, return result; } -int main(int argc, const char **argv) +int +main(int argc, const char **argv) { int result = 1; /* default to fail */ @@ -536,7 +550,7 @@ int main(int argc, const char **argv) const char *output = NULL; png_image image; - if (argc > 2 && argv[2][0] != '-'/*an operation*/) + if (argc > 2 && argv[2][0] != '-' /*an operation*/) { output = argv[2]; argi = 3; @@ -558,7 +572,7 @@ int main(int argc, const char **argv) png_color background = {0, 0xff, 0}; /* fully saturated green */ if (png_image_finish_read(&image, &background, buffer, - 0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */)) + 0 /*row_stride*/, NULL /*colormap*/)) { /* At this point png_image_finish_read has cleaned up the * allocated data in png_image, and only the buffer needs to be @@ -566,22 +580,24 @@ int main(int argc, const char **argv) * * Perform the remaining operations: */ - if (simpleover_process(&image, buffer, argc-argi, argv+argi)) + if (simpleover_process(&image, buffer, + argc - argi, argv + argi)) { /* Write the output: */ if ((output != NULL && - png_image_write_to_file(&image, output, - 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, - NULL/*colormap*/)) || + png_image_write_to_file( + &image, output, 0 /*convert_to_8bit*/, buffer, + 0 /*row_stride*/, NULL /*colormap*/)) || (output == NULL && - png_image_write_to_stdio(&image, stdout, - 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, - NULL/*colormap*/))) + png_image_write_to_stdio( + &image, stdout, 0 /*convert_to_8bit*/, buffer, + 0 /*row_stride*/, NULL /*colormap*/))) result = 0; else fprintf(stderr, "simpleover: write %s: %s\n", - output == NULL ? "stdout" : output, image.message); + output == NULL ? "stdout" : output, + image.message); } /* else simpleover_process writes an error message */ @@ -589,7 +605,7 @@ int main(int argc, const char **argv) else fprintf(stderr, "simpleover: read %s: %s\n", argv[1], - image.message); + image.message); free(buffer); } @@ -597,7 +613,7 @@ int main(int argc, const char **argv) else { fprintf(stderr, "simpleover: out of memory: %lu bytes\n", - (unsigned long)PNG_IMAGE_SIZE(image)); + (unsigned long)PNG_IMAGE_SIZE(image)); /* This is the only place where a 'free' is required; libpng does * the cleanup on error and success, but in this case we couldn't @@ -617,7 +633,8 @@ int main(int argc, const char **argv) else { /* Usage message */ - fprintf(stderr, + fprintf( + stderr, "simpleover: usage: simpleover background.png [output.png]\n" " Output 'background.png' as a 24-bit RGB PNG file in 'output.png'\n" " or, if not given, stdout. 'background.png' will be composited\n" @@ -628,13 +645,13 @@ int main(int argc, const char **argv) " --sprite=width,height,name {[--at=x,y] {sprite.png}}\n" " Produce a transparent sprite of size (width,height) and with\n" " name 'name'.\n" - " For each sprite.png composite it using a Porter-Duff 'Over'\n" - " operation at offset (x,y) in the sprite (defaulting to (0,0)).\n" + " For each sprite.png composite it is using a Porter-Duff 'Over'\n" + " operation at offset (x,y) in the sprite, defaulting to (0,0).\n" " Input PNGs will be truncated to the area of the sprite.\n" "\n" " --add='name' {x,y}\n" " Optionally, before output, composite a sprite, 'name', which\n" - " must have been previously produced using --sprite, at each\n" + " must have been previously produced using --sprite at each\n" " offset (x,y) in the output image. Each sprite must fit\n" " completely within the output image.\n" "\n" @@ -645,4 +662,3 @@ int main(int argc, const char **argv) return result; } -#endif /* SIMPLIFIED_READ */ diff --git a/contrib/gregbook/rpng-x.c b/contrib/gregbook/rpng-x.c index 92effaa6d2..2fc9272c64 100644 --- a/contrib/gregbook/rpng-x.c +++ b/contrib/gregbook/rpng-x.c @@ -21,7 +21,7 @@ - 1.10: added support for non-default visuals; fixed X pixel-conversion - 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed command-line parsing bug - - 1.12: fixed some small X memory leaks (thanks to Franois Petitjean) + - 1.12: fixed some small X memory leaks (thanks to François Petitjean) - 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche) - 1.14: added support for X resources (thanks to Gerhard Niklasch) - 2.00: dual-licensed (added GNU GPL) diff --git a/contrib/gregbook/rpng2-x.c b/contrib/gregbook/rpng2-x.c index af944c0f2b..1375dc9a6d 100644 --- a/contrib/gregbook/rpng2-x.c +++ b/contrib/gregbook/rpng2-x.c @@ -27,7 +27,7 @@ - 1.11: added -usleep option for demos; fixed command-line parsing bug - 1.12: added -pause option for demos and testing - 1.20: added runtime MMX-enabling/disabling and new -mmx* options - - 1.21: fixed some small X memory leaks (thanks to Franois Petitjean) + - 1.21: fixed some small X memory leaks (thanks to François Petitjean) - 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche) - 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares) - 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp = diff --git a/contrib/libtests/pnggetset.c b/contrib/libtests/pnggetset.c new file mode 100644 index 0000000000..e2c1ca556f --- /dev/null +++ b/contrib/libtests/pnggetset.c @@ -0,0 +1,862 @@ +/* pnggetset.c + * + * Copyright (c) 2026 Cosmin Truta + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * Test getter and setter correctness. + */ + +#include +#include +#include + +#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) +# include +#endif + +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../../png.h" +#endif + +/* Test: get the PLTE, pass it straight back to set, verify roundtrip. */ +static int +test_plte_roundtrip(void) +{ + png_structp png_ptr; + png_infop info_ptr; + png_color palette[4]; + png_colorp got_palette = NULL; + int num_palette = 0; + int i; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_plte_roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* Set up a palette-color image header. */ + png_set_IHDR(png_ptr, info_ptr, 1, 1, 8, PNG_COLOR_TYPE_PALETTE, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + /* Populate with recognizable values. */ + for (i = 0; i < 4; i++) + { + palette[i].red = (png_byte)(i * 10); + palette[i].green = (png_byte)(i * 20); + palette[i].blue = (png_byte)(i * 30); + } + png_set_PLTE(png_ptr, info_ptr, palette, 4); + + /* Get the internal pointer and feed it straight back. */ + png_get_PLTE(png_ptr, info_ptr, &got_palette, &num_palette); + if (got_palette == NULL || num_palette != 4) + { + fprintf(stderr, "pnggetset: png_get_PLTE returned unexpected values\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* This is the critical call: the pointer aliases info_ptr->palette. */ + png_set_PLTE(png_ptr, info_ptr, got_palette, num_palette); + + /* Verify the data survived the roundtrip. */ + got_palette = NULL; + num_palette = 0; + png_get_PLTE(png_ptr, info_ptr, &got_palette, &num_palette); + if (got_palette == NULL || num_palette != 4) + { + fprintf(stderr, "pnggetset: PLTE lost after roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + for (i = 0; i < 4; i++) + { + if ((got_palette[i].red != (png_byte)(i * 10)) + || (got_palette[i].green != (png_byte)(i * 20)) + || (got_palette[i].blue != (png_byte)(i * 30))) + { + fprintf(stderr, + "pnggetset: PLTE entry %d corrupted after roundtrip\n", i); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + } + + png_destroy_write_struct(&png_ptr, &info_ptr); + return 0; +} + +#ifdef PNG_hIST_SUPPORTED +/* Test: get the hIST, pass it straight back to set, verify roundtrip. */ +static int +test_hist_roundtrip(void) +{ + png_structp png_ptr; + png_infop info_ptr; + png_color palette[4]; + png_uint_16 hist[4]; + png_uint_16p got_hist = NULL; + int i; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_hist_roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* Set up a palette-color image header. */ + memset(palette, 0, sizeof palette); + png_set_IHDR(png_ptr, info_ptr, 1, 1, 8, PNG_COLOR_TYPE_PALETTE, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + png_set_PLTE(png_ptr, info_ptr, palette, 4); + + /* Populate with recognizable values. */ + for (i = 0; i < 4; i++) + hist[i] = (png_uint_16)(i * 100 + 42); + + png_set_hIST(png_ptr, info_ptr, hist); + + /* Get the internal pointer and feed it straight back. */ + if (png_get_hIST(png_ptr, info_ptr, &got_hist) == 0 || got_hist == NULL) + { + fprintf(stderr, "pnggetset: png_get_hIST returned unexpected values\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* This is the critical call: the pointer aliases info_ptr->hist. */ + png_set_hIST(png_ptr, info_ptr, got_hist); + + /* Verify the data survived the roundtrip. */ + got_hist = NULL; + if (png_get_hIST(png_ptr, info_ptr, &got_hist) == 0 || got_hist == NULL) + { + fprintf(stderr, "pnggetset: hIST lost after roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + for (i = 0; i < 4; i++) + { + if (got_hist[i] != (png_uint_16)(i * 100 + 42)) + { + fprintf(stderr, + "pnggetset: hIST entry %d corrupted after roundtrip\n", i); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + } + + png_destroy_write_struct(&png_ptr, &info_ptr); + return 0; +} +#endif /* PNG_hIST_SUPPORTED */ + +#ifdef PNG_tRNS_SUPPORTED +/* Test: get the tRNS, pass it straight back to set, verify roundtrip. */ +static int +test_trns_roundtrip(void) +{ + png_structp png_ptr; + png_infop info_ptr; + png_color palette[4]; + png_byte trans_alpha[4]; + png_color_16 trans_color; + png_bytep got_alpha = NULL; + png_color_16p got_color = NULL; + int num_trans = 0; + int i; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_trns_roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* Set up a palette-color image. */ + memset(palette, 0, sizeof palette); + png_set_IHDR(png_ptr, info_ptr, 1, 1, 8, PNG_COLOR_TYPE_PALETTE, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + png_set_PLTE(png_ptr, info_ptr, palette, 4); + + /* Populate tRNS with recognizable values. */ + for (i = 0; i < 4; i++) + trans_alpha[i] = (png_byte)(0xff - i * 0x11); + memset(&trans_color, 0, sizeof trans_color); + + png_set_tRNS(png_ptr, info_ptr, trans_alpha, 4, &trans_color); + + /* Get the internal pointer and feed it straight back. */ + png_get_tRNS(png_ptr, info_ptr, &got_alpha, &num_trans, &got_color); + if (got_alpha == NULL || num_trans != 4) + { + fprintf(stderr, "pnggetset: png_get_tRNS returned unexpected values\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* This is the critical call: the pointer aliases info_ptr->trans_alpha. */ + png_set_tRNS(png_ptr, info_ptr, got_alpha, num_trans, got_color); + + /* Verify the data survived the roundtrip. */ + got_alpha = NULL; + num_trans = 0; + png_get_tRNS(png_ptr, info_ptr, &got_alpha, &num_trans, &got_color); + if (got_alpha == NULL || num_trans != 4) + { + fprintf(stderr, "pnggetset: tRNS lost after roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + for (i = 0; i < 4; i++) + { + if (got_alpha[i] != (png_byte)(0xff - i * 0x11)) + { + fprintf(stderr, + "pnggetset: tRNS entry %d corrupted after roundtrip\n", i); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + } + + png_destroy_write_struct(&png_ptr, &info_ptr); + return 0; +} +#endif /* PNG_tRNS_SUPPORTED */ + +#ifdef PNG_TEXT_SUPPORTED +/* Test: get the text array, pass it straight back to set, verify data. */ +#define TEXT_COUNT 6 /* enough to trigger reallocation on the second set */ +static int +test_text_roundtrip(void) +{ + png_structp png_ptr; + png_infop info_ptr; + png_text text_entries[TEXT_COUNT]; + png_textp got_text = NULL; + int got_num_text = 0; + int i; + + /* Recognizable keys and values. */ + static const char *keys[TEXT_COUNT] = { + "Title", "Author", "Desc", "Copyright", "Source", "Comment" + }; + static const char *vals[TEXT_COUNT] = { + "t0", "t1", "t2", "t3", "t4", "t5" + }; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_text_roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* Populate the text entries. */ + memset(text_entries, 0, sizeof text_entries); + for (i = 0; i < TEXT_COUNT; i++) + { + text_entries[i].compression = PNG_TEXT_COMPRESSION_NONE; + text_entries[i].key = (png_charp)keys[i]; + text_entries[i].text = (png_charp)vals[i]; + } + png_set_text(png_ptr, info_ptr, text_entries, TEXT_COUNT); + + /* Get the internal pointer and feed it straight back (append). */ + png_get_text(png_ptr, info_ptr, &got_text, &got_num_text); + if (got_text == NULL || got_num_text != TEXT_COUNT) + { + fprintf(stderr, "pnggetset: png_get_text returned unexpected values\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* This is the critical call: got_text aliases info_ptr->text. */ + png_set_text(png_ptr, info_ptr, got_text, got_num_text); + + /* Verify the original entries survived. */ + got_text = NULL; + got_num_text = 0; + png_get_text(png_ptr, info_ptr, &got_text, &got_num_text); + if (got_text == NULL || got_num_text != TEXT_COUNT * 2) + { + fprintf(stderr, "pnggetset: text count %d, expected %d after roundtrip\n", + got_num_text, TEXT_COUNT * 2); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + for (i = 0; i < TEXT_COUNT; i++) + { + if (got_text[i].key == NULL || + strcmp(got_text[i].key, keys[i]) != 0 || + got_text[i].text == NULL || + strcmp(got_text[i].text, vals[i]) != 0) + { + fprintf(stderr, + "pnggetset: text entry %d corrupted after roundtrip\n", i); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + } + + png_destroy_write_struct(&png_ptr, &info_ptr); + return 0; +} +#undef TEXT_COUNT +#endif /* PNG_TEXT_SUPPORTED */ + +#ifdef PNG_sPLT_SUPPORTED +/* Test: get the sPLT array, pass it straight back to set, verify data. */ +static int +test_splt_roundtrip(void) +{ + png_structp png_ptr; + png_infop info_ptr; + png_sPLT_t splt; + png_sPLT_entry splt_entries[4]; + png_sPLT_tp got_spalettes = NULL; + int got_num, i; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_splt_roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* Populate with recognizable values. */ + memset(splt_entries, 0, sizeof splt_entries); + for (i = 0; i < 4; i++) + { + splt_entries[i].red = (png_uint_16)(i * 1000); + splt_entries[i].green = (png_uint_16)(i * 2000); + splt_entries[i].blue = (png_uint_16)(i * 3000); + splt_entries[i].alpha = 0xffffU; + splt_entries[i].frequency = (png_uint_16)(i + 1); + } + memset(&splt, 0, sizeof splt); + splt.name = (png_charp)"test_sPLT"; + splt.depth = 16; + splt.entries = splt_entries; + splt.nentries = 4; + + png_set_sPLT(png_ptr, info_ptr, &splt, 1); + + /* Get the internal pointer and feed it straight back (append). */ + got_num = png_get_sPLT(png_ptr, info_ptr, &got_spalettes); + if (got_spalettes == NULL || got_num != 1) + { + fprintf(stderr, "pnggetset: png_get_sPLT returned unexpected values\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* This is the critical call: got_spalettes aliases internal storage. */ + png_set_sPLT(png_ptr, info_ptr, got_spalettes, got_num); + + /* Verify the original entry survived. */ + got_spalettes = NULL; + got_num = png_get_sPLT(png_ptr, info_ptr, &got_spalettes); + if (got_spalettes == NULL || got_num != 2) + { + fprintf(stderr, "pnggetset: sPLT count %d, expected 2 after roundtrip\n", + got_num); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + if (strcmp(got_spalettes[0].name, "test_sPLT") != 0 || + got_spalettes[0].nentries != 4 || + got_spalettes[0].depth != 16) + { + fprintf(stderr, + "pnggetset: sPLT entry 0 corrupted after roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + for (i = 0; i < 4; i++) + { + if (got_spalettes[0].entries[i].red != (png_uint_16)(i * 1000) || + got_spalettes[0].entries[i].green != (png_uint_16)(i * 2000) || + got_spalettes[0].entries[i].blue != (png_uint_16)(i * 3000)) + { + fprintf(stderr, + "pnggetset: sPLT[0] entry %d corrupted after roundtrip\n", i); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + } + + png_destroy_write_struct(&png_ptr, &info_ptr); + return 0; +} +#endif /* PNG_sPLT_SUPPORTED */ + +#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +/* Test: get unknown chunks, pass them straight back to set, verify data. */ +static int +test_unknown_roundtrip(void) +{ + png_structp png_ptr; + png_infop info_ptr; + png_unknown_chunk unk; + png_unknown_chunkp got_unknowns = NULL; + int got_num; + static const png_byte test_data[] = {0xde, 0xad, 0xbe, 0xef}; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, + "pnggetset: libpng error in test_unknown_roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* Set up an unknown chunk with recognizable data. */ + memset(&unk, 0, sizeof unk); + memcpy(unk.name, "teSt", 5); + unk.data = (png_bytep)test_data; + unk.size = sizeof test_data; + unk.location = PNG_HAVE_IHDR; + + png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_ALWAYS, NULL, 0); + png_set_unknown_chunks(png_ptr, info_ptr, &unk, 1); + + /* Get the internal pointer and feed it straight back (append). */ + got_num = png_get_unknown_chunks(png_ptr, info_ptr, &got_unknowns); + if (got_unknowns == NULL || got_num != 1) + { + fprintf(stderr, + "pnggetset: png_get_unknown_chunks returned unexpected values\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + /* This is the critical call: got_unknowns aliases internal storage. */ + png_set_unknown_chunks(png_ptr, info_ptr, got_unknowns, got_num); + + /* Verify the original entry survived. */ + got_unknowns = NULL; + got_num = png_get_unknown_chunks(png_ptr, info_ptr, &got_unknowns); + if (got_unknowns == NULL || got_num != 2) + { + fprintf(stderr, + "pnggetset: unknown_chunks count %d, expected 2 after roundtrip\n", + got_num); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + if (memcmp(got_unknowns[0].name, "teSt", 4) != 0 || + got_unknowns[0].size != sizeof test_data || + memcmp(got_unknowns[0].data, test_data, sizeof test_data) != 0) + { + fprintf(stderr, + "pnggetset: unknown chunk 0 corrupted after roundtrip\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + png_destroy_write_struct(&png_ptr, &info_ptr); + return 0; +} +#endif /* PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED */ + +/* Memory buffer for PNG I/O without temp files. */ +#define MEM_BUF_SIZE 4096 + +typedef struct +{ + png_byte data[MEM_BUF_SIZE]; + size_t len; + size_t pos; +} mem_buf; + +static void PNGCBAPI +mem_write(png_structp png_ptr, png_bytep buf, png_size_t length) +{ + mem_buf *mb = (mem_buf *)png_get_io_ptr(png_ptr); + + if (mb->len + length > MEM_BUF_SIZE) + png_error(png_ptr, "pnggetset: write overflow"); + + memcpy(mb->data + mb->len, buf, length); + mb->len += length; +} + +static void PNGCBAPI +mem_flush(png_structp png_ptr) +{ + (void)png_ptr; +} + +static void PNGCBAPI +mem_read(png_structp png_ptr, png_bytep buf, png_size_t length) +{ + mem_buf *mb = (mem_buf *)png_get_io_ptr(png_ptr); + + if (mb->pos + length > mb->len) + png_error(png_ptr, "pnggetset: read overflow"); + + memcpy(buf, mb->data + mb->pos, length); + mb->pos += length; +} + +/* Palette sync after gamma correction. + * + * When info_ptr->palette and png_ptr->palette are separate buffers, + * in-place gamma correction of png_ptr->palette must be synced back + * to info_ptr->palette so that png_get_PLTE returns the corrected + * values. + */ +#define PLTE_SYNC_NPALETTE 4 + +static const png_color plte_sync_original[PLTE_SYNC_NPALETTE] = +{ + { 64, 96, 128 }, + { 128, 160, 192 }, + { 192, 224, 240 }, + { 32, 48, 64 } +}; + +static int +test_plte_palette_sync(void) +{ + mem_buf buf; + png_structp png_ptr; + png_infop info_ptr; + png_colorp got_palette; + int num_palette; + double file_gamma; + png_byte row[1]; + int i; + int changed; + + /* Write a 1x1 palette PNG with gAMA = 1.0 (linear). */ + buf.len = 0; + buf.pos = 0; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_write_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_write_struct(&png_ptr, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_plte_palette_sync" + " (write)\n"); + png_destroy_write_struct(&png_ptr, &info_ptr); + return 1; + } + + png_set_write_fn(png_ptr, &buf, mem_write, mem_flush); + png_set_IHDR(png_ptr, info_ptr, 1, 1, 8, PNG_COLOR_TYPE_PALETTE, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, + PNG_FILTER_TYPE_BASE); + png_set_PLTE(png_ptr, info_ptr, + (png_colorp)plte_sync_original, PLTE_SYNC_NPALETTE); + png_set_gAMA(png_ptr, info_ptr, 1.0); + png_write_info(png_ptr, info_ptr); + + row[0] = 0; + png_write_row(png_ptr, row); + png_write_end(png_ptr, info_ptr); + png_destroy_write_struct(&png_ptr, &info_ptr); + + /* Read back with gamma correction as the sole transform. */ + buf.pos = 0; + + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (png_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_read_struct failed\n"); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fprintf(stderr, "pnggetset: png_create_info_struct failed\n"); + png_destroy_read_struct(&png_ptr, NULL, NULL); + return 1; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + fprintf(stderr, "pnggetset: libpng error in test_plte_palette_sync" + " (read)\n"); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 1; + } + + png_set_read_fn(png_ptr, &buf, mem_read); + png_read_info(png_ptr, info_ptr); + + if (png_get_gAMA(png_ptr, info_ptr, &file_gamma) == 0) + { + fprintf(stderr, "pnggetset: gAMA chunk not found\n"); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 1; + } + + png_set_gamma(png_ptr, 2.2, file_gamma); + png_read_update_info(png_ptr, info_ptr); + + if (png_get_PLTE(png_ptr, info_ptr, &got_palette, &num_palette) == 0) + { + fprintf(stderr, "pnggetset: png_get_PLTE failed after update\n"); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 1; + } + + if (num_palette != PLTE_SYNC_NPALETTE) + { + fprintf(stderr, "pnggetset: palette size %d, expected %d\n", + num_palette, PLTE_SYNC_NPALETTE); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 1; + } + + /* Every entry must differ from the original after gamma correction + * (file_gamma=1.0, screen_gamma=2.2). If the sync was skipped, + * info_ptr->palette still holds the stale pre-correction values. + */ + changed = 0; + + for (i = 0; i < PLTE_SYNC_NPALETTE; i++) + { + if ((got_palette[i].red != plte_sync_original[i].red) + || (got_palette[i].green != plte_sync_original[i].green) + || (got_palette[i].blue != plte_sync_original[i].blue)) + { + changed++; + } + else + { + fprintf(stderr, + "pnggetset: palette entry %d NOT gamma-corrected: " + "got {%u, %u, %u}, same as original\n", + i, + (unsigned)got_palette[i].red, + (unsigned)got_palette[i].green, + (unsigned)got_palette[i].blue); + } + } + + png_read_row(png_ptr, row, NULL); + png_read_end(png_ptr, NULL); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + + if (changed != PLTE_SYNC_NPALETTE) + { + fprintf(stderr, + "pnggetset: only %d of %d palette entries were " + "gamma-corrected (palette sync failed)\n", + changed, PLTE_SYNC_NPALETTE); + return 1; + } + + return 0; +} + +int +main(void) +{ + int result = 0; + + printf("Testing PLTE get-then-set roundtrip... "); + fflush(stdout); + if (test_plte_roundtrip() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); + +#ifdef PNG_hIST_SUPPORTED + printf("Testing hIST get-then-set roundtrip... "); + fflush(stdout); + if (test_hist_roundtrip() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); +#endif + +#ifdef PNG_tRNS_SUPPORTED + printf("Testing tRNS get-then-set roundtrip... "); + fflush(stdout); + if (test_trns_roundtrip() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); +#endif + +#ifdef PNG_TEXT_SUPPORTED + printf("Testing tEXt get-then-set roundtrip... "); + fflush(stdout); + if (test_text_roundtrip() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); +#endif + +#ifdef PNG_sPLT_SUPPORTED + printf("Testing sPLT get-then-set roundtrip... "); + fflush(stdout); + if (test_splt_roundtrip() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); +#endif + +#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED + printf("Testing unknown chunks get-then-set roundtrip... "); + fflush(stdout); + if (test_unknown_roundtrip() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); +#endif + + printf("Testing PLTE sync after gamma correction... "); + fflush(stdout); + if (test_plte_palette_sync() != 0) + { + printf("FAIL\n"); + result = 1; + } + else + printf("PASS\n"); + + return result; +} diff --git a/contrib/libtests/pngimage.c b/contrib/libtests/pngimage.c index be176b2bc1..382f1b2fc4 100644 --- a/contrib/libtests/pngimage.c +++ b/contrib/libtests/pngimage.c @@ -1,7 +1,6 @@ - /* pngimage.c * - * Copyright (c) 2021 Cosmin Truta + * Copyright (c) 2021-2025 Cosmin Truta * Copyright (c) 2015,2016 John Cunningham Bowler * * This code is released under the libpng license. @@ -40,7 +39,7 @@ /* 1.6.1 added support for the configure test harness, which uses 77 to indicate * a skipped test, in earlier versions we need to succeed on a skipped test, so: */ -#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +#if defined(HAVE_CONFIG_H) # define SKIP 77 #else # define SKIP 0 @@ -374,11 +373,11 @@ struct buffer_list struct buffer { - struct buffer_list *last; /* last buffer in use */ - size_t end_count; /* bytes in the last buffer */ - struct buffer_list *current; /* current buffer being read */ - size_t read_count; /* count of bytes read from current */ - struct buffer_list first; /* the very first buffer */ + struct buffer_list *last; /* last buffer in use */ + size_t end_count; /* bytes in the last buffer */ + struct buffer_list *current; /* current buffer being read */ + size_t read_count; /* count of bytes read from current */ + struct buffer_list first; /* the very first buffer */ }; static void @@ -543,6 +542,7 @@ typedef enum struct display { jmp_buf error_return; /* Where to go to on error */ + error_level error_code; /* Set before longjmp */ const char *filename; /* The name of the original file */ const char *operation; /* Operation being performed */ @@ -763,7 +763,10 @@ display_log(struct display *dp, error_level level, const char *fmt, ...) /* Errors cause this routine to exit to the fail code */ if (level > APP_FAIL || (level > ERRORS && !(dp->options & CONTINUE))) + { + dp->error_code = level; longjmp(dp->error_return, level); + } } /* error handler callbacks for libpng */ @@ -868,7 +871,7 @@ read_png(struct display *dp, struct buffer *bp, const char *operation, int transforms) { png_structp pp; - png_infop ip; + png_infop ip; /* This cleans out any previous read and sets operation and transforms to * empty. @@ -928,7 +931,7 @@ update_display(struct display *dp) */ { png_structp pp; - png_infop ip; + png_infop ip; /* Now perform the initial read with a 0 transform. */ read_png(dp, &dp->original_file, "original read", 0/*no transform*/); @@ -1019,7 +1022,12 @@ compare_read(struct display *dp, int applied_transforms) C(height); C(bit_depth); C(color_type); - C(interlace_method); +# ifdef PNG_WRITE_INTERLACING_SUPPORTED + /* If write interlace has been disabled, the PNG file is still + * written correctly, but as a regular (not-interlaced) PNG. + */ + C(interlace_method); +# endif C(compression_method); C(filter_method); @@ -1566,18 +1574,19 @@ static int do_test(struct display *dp, const char *file) /* Exists solely to isolate the setjmp clobbers */ { - int ret = setjmp(dp->error_return); + dp->error_code = VERBOSE; /* The "lowest" level */ - if (ret == 0) + if (setjmp(dp->error_return) == 0) { test_one_file(dp, file); return 0; } - else if (ret < ERRORS) /* shouldn't longjmp on warnings */ - display_log(dp, INTERNAL_ERROR, "unexpected return code %d", ret); + else if (dp->error_code < ERRORS) /* shouldn't longjmp on warnings */ + display_log(dp, INTERNAL_ERROR, "unexpected return code %d", + dp->error_code); - return ret; + return dp->error_code; } int @@ -1677,7 +1686,11 @@ main(int argc, char **argv) int ret = do_test(&d, argv[i]); if (ret > QUIET) /* abort on user or internal error */ + { + display_clean(&d); + display_destroy(&d); return 99; + } } /* Here on any return, including failures, except user/internal issues diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c index 973e60f525..d5da018df7 100644 --- a/contrib/libtests/pngstest.c +++ b/contrib/libtests/pngstest.c @@ -1,7 +1,6 @@ - /* pngstest.c * - * Copyright (c) 2021 Cosmin Truta + * Copyright (c) 2021-2026 Cosmin Truta * Copyright (c) 2013-2017 John Cunningham Bowler * * This code is released under the libpng license. @@ -38,7 +37,7 @@ /* 1.6.1 added support for the configure test harness, which uses 77 to indicate * a skipped test, in earlier versions we need to succeed on a skipped test, so: */ -#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +#if defined(HAVE_CONFIG_H) # define SKIP 77 #else # define SKIP 0 @@ -84,7 +83,7 @@ static char tmpf[23] = "TMP"; * Hill, "The Art of Electronics". */ static void -make_random_bytes(png_uint_32* seed, void* pv, size_t size) +make_random_bytes(png_uint_32 *seed, void *pv, size_t size) { png_uint_32 u0 = seed[0], u1 = seed[1]; png_bytep bytes = voidcast(png_bytep, pv); @@ -324,18 +323,19 @@ compare_16bit(int v1, int v2, int error_limit, int multiple_algorithms) } #endif /* unused */ -#define USE_FILE 1 /* else memory */ -#define USE_STDIO 2 /* else use file name */ -#define STRICT 4 /* fail on warnings too */ +#define USE_FILE 1 /* else memory */ +#define USE_STDIO 2 /* else use file name */ +#define STRICT 4 /* fail on warnings too */ #define VERBOSE 8 -#define KEEP_TMPFILES 16 /* else delete temporary files */ +#define KEEP_TMPFILES 16 /* else delete temporary files */ #define KEEP_GOING 32 #define ACCUMULATE 64 #define FAST_WRITE 128 #define sRGB_16BIT 256 -#define NO_RESEED 512 /* do not reseed on each new file */ -#define GBG_ERROR 1024 /* do not ignore the gamma+background_rgb_to_gray - * libpng warning. */ +#define NO_RESEED 512 /* do not reseed on each new file */ +#define GBG_ERROR 1024 /* do not ignore the gamma+background_rgb_to_gray + * warning. */ +#define NEGATIVE_STRIDE 2048 /* negate row stride for bottom-up layout */ static void print_opts(png_uint_32 opts) @@ -364,6 +364,8 @@ print_opts(png_uint_32 opts) if (opts & GBG_ERROR) printf(" --fault-gbg-warning"); #endif + if (opts & NEGATIVE_STRIDE) + printf(" --negative-stride"); } #define FORMAT_NO_CHANGE 0x80000000 /* additional flag */ @@ -476,7 +478,8 @@ typedef struct } format_list; -static void format_init(format_list *pf) +static void +format_init(format_list *pf) { int i; for (i=0; ibits[format >> 5] |= ((png_uint_32)1) << (format & 31); @@ -511,7 +517,8 @@ static int format_set(format_list *pf, png_uint_32 format) } #if 0 /* currently unused */ -static int format_unset(format_list *pf, png_uint_32 format) +static int +format_unset(format_list *pf, png_uint_32 format) { if (format < FORMAT_COUNT) return pf->bits[format >> 5] &= ~((png_uint_32)1) << (format & 31); @@ -520,13 +527,15 @@ static int format_unset(format_list *pf, png_uint_32 format) } #endif -static int format_isset(format_list *pf, png_uint_32 format) +static int +format_isset(format_list *pf, png_uint_32 format) { return format < FORMAT_COUNT && (pf->bits[format >> 5] & (((png_uint_32)1) << (format & 31))) != 0; } -static void format_default(format_list *pf, int redundant) +static void +format_default(format_list *pf, int redundant) { if (redundant) { @@ -596,7 +605,8 @@ newimage(Image *image) memset(image, 0, sizeof *image); } -/* Reset the image to be read again - only needs to rewind the FILE* at present. +/* Reset the image to be read again - only needs to rewind the FILE object at + * present. */ static void resetimage(Image *image) @@ -649,7 +659,8 @@ freeimage(Image *image) /* This is actually a re-initializer; allows an image structure to be re-used by * freeing everything that relates to an old image. */ -static void initimage(Image *image, png_uint_32 opts, const char *file_name, +static void +initimage(Image *image, png_uint_32 opts, const char *file_name, int stride_extra) { freeimage(image); @@ -2656,7 +2667,7 @@ compare_two_images(Image *a, Image *b, int via_linear, * of the loop until the end; this validates the color-mapped data to * ensure all pixels are valid color-map indexes. */ - for (y=0, match=1; y amax) amax = aval; } + + /* Increment with care! + * With negative strides, an unguarded final increment would produce + * a pointer before the allocated object, which is undefined behavior. + * Standard C allows one-after-end pointers, not one-before-beginning + * pointers, and this restriction stands regardless of whether the + * pointers are dereferenced or not. + */ + if (y+1 < height) + { + ppa += stridea; + ppb += strideb; + } } /* If the buffers match then the colormaps must too. */ @@ -2784,7 +2808,7 @@ compare_two_images(Image *a, Image *b, int via_linear, * If an alpha channel has been *added* then it must have the relevant opaque * value (255 or 65535). * - * The fist two the tests (in the order given above) (using the boolean + * The first two tests (in the order given above) (using the boolean * equivalence !a && !b == !(a || b)) */ if (!(((formata ^ formatb) & PNG_FORMAT_FLAG_LINEAR) | @@ -2851,7 +2875,7 @@ compare_two_images(Image *a, Image *b, int via_linear, btoa[3] = btoa[2] = btoa[1] = btoa[0] = 4; /* 4 == not present */ } - for (y=0; yopts & KEEP_GOING) == 0) return 0; /* error case */ } + + /* Increment with care! + * (See the previous comment about preventing negative strides from + * causing undefined behavior.) + */ + if (y+1 < height) + { + rowa += stridea; + rowb += strideb; + } } /* If requested, copy the error values back from the Transform. */ @@ -3034,6 +3068,9 @@ read_file(Image *image, png_uint_32 format, png_const_colorp background) image->stride = PNG_IMAGE_ROW_STRIDE(image->image) + image->stride_extra; allocbuffer(image); + if (image->opts & NEGATIVE_STRIDE) + image->stride = -image->stride; + result = png_image_finish_read(&image->image, background, image->buffer+16, (png_int_32)image->stride, image->colormap); @@ -3500,7 +3537,7 @@ main(int argc, char **argv) int retval = 0; int c; -#if PNG_LIBPNG_VER >= 10700 +#if PNG_LIBPNG_VER == 10700 /* This error should not exist in 1.7 or later: */ opts |= GBG_ERROR; #endif @@ -3571,6 +3608,35 @@ main(int argc, char **argv) opts |= NO_RESEED; else if (strcmp(arg, "--fault-gbg-warning") == 0) opts |= GBG_ERROR; + else if (strcmp(arg, "--negative-stride") == 0) + opts |= NEGATIVE_STRIDE; + else if (strcmp(arg, "--stride-extra") == 0) + { + if (c+1 < argc) + { + char *ep; + unsigned long val = strtoul(argv[++c], &ep, 0); + + if (ep > argv[c] && *ep == 0 && val <= 65535) + stride_extra = (int)val; + + else + { + fflush(stdout); + fprintf(stderr, "%s: bad argument for --stride-extra: %s\n", + argv[0], argv[c]); + exit(99); + } + } + + else + { + fflush(stdout); + fprintf(stderr, "%s: missing argument for --stride-extra\n", + argv[0]); + exit(99); + } + } else if (strcmp(arg, "--tmpfile") == 0) { if (c+1 < argc) @@ -3823,7 +3889,8 @@ main(int argc, char **argv) } #else /* !PNG_SIMPLIFIED_READ_SUPPORTED */ -int main(void) +int +main(void) { fprintf(stderr, "pngstest: no read support in libpng, test skipped\n"); /* So the test is skipped: */ diff --git a/contrib/libtests/pngunknown.c b/contrib/libtests/pngunknown.c index dfa9d10a1a..2fc7a7962c 100644 --- a/contrib/libtests/pngunknown.c +++ b/contrib/libtests/pngunknown.c @@ -1,7 +1,6 @@ - /* pngunknown.c - test the read side unknown chunk handling * - * Copyright (c) 2021 Cosmin Truta + * Copyright (c) 2021-2025 Cosmin Truta * Copyright (c) 2015,2017 Glenn Randers-Pehrson * Written by John Cunningham Bowler * @@ -33,7 +32,7 @@ /* 1.6.1 added support for the configure test harness, which uses 77 to indicate * a skipped test, in earlier versions we need to succeed on a skipped test, so: */ -#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +#if defined(HAVE_CONFIG_H) # define SKIP 77 #else # define SKIP 0 @@ -55,48 +54,7 @@ #if defined(PNG_READ_USER_CHUNKS_SUPPORTED) ||\ defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED) -#if PNG_LIBPNG_VER < 10500 -/* This deliberately lacks the const. */ -typedef png_byte *png_const_bytep; - -/* This is copied from 1.5.1 png.h: */ -#define PNG_INTERLACE_ADAM7_PASSES 7 -#define PNG_PASS_START_ROW(pass) (((1U&~(pass))<<(3-((pass)>>1)))&7) -#define PNG_PASS_START_COL(pass) (((1U& (pass))<<(3-(((pass)+1)>>1)))&7) -#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) -#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) -#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) -#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) -#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \ - (((yIn)<>(((7-(off))-(pass))<<2)) & 0xFU) | \ - ((0x01145AF0U>>(((7-(off))-(pass))<<2)) & 0xF0U)) -#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ - ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) -#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ - ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) - -/* These are needed too for the default build: */ -#define PNG_WRITE_16BIT_SUPPORTED -#define PNG_READ_16BIT_SUPPORTED - -/* 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)) -#endif -#if PNG_LIBPNG_VER < 10600 - /* 1.6.0 constifies many APIs. The following exists to allow pngvalid to be - * compiled against earlier versions. - */ -# define png_const_structp png_structp -#endif #if PNG_LIBPNG_VER < 10700 /* Copied from libpng 1.7.0 png.h */ @@ -114,6 +72,8 @@ typedef png_byte *png_const_bytep; #define png_PLTE PNG_U32( 80, 76, 84, 69) #define png_bKGD PNG_U32( 98, 75, 71, 68) #define png_cHRM PNG_U32( 99, 72, 82, 77) +#define png_cICP PNG_U32( 99, 73, 67, 80) /* PNGv3 */ +#define png_cLLI PNG_U32( 99, 76, 76, 73) /* PNGv3 */ #define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */ #define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ #define png_gAMA PNG_U32(103, 65, 77, 65) @@ -123,6 +83,7 @@ typedef png_byte *png_const_bytep; #define png_hIST PNG_U32(104, 73, 83, 84) #define png_iCCP PNG_U32(105, 67, 67, 80) #define png_iTXt PNG_U32(105, 84, 88, 116) +#define png_mDCV PNG_U32(109, 68, 67, 86) /* PNGv3 */ #define png_oFFs PNG_U32(111, 70, 70, 115) #define png_pCAL PNG_U32(112, 67, 65, 76) #define png_pHYs PNG_U32(112, 72, 89, 115) @@ -209,6 +170,20 @@ static struct 0, # else 1, +# endif + 1, START, 0 }, + { "cICP", PNG_INFO_cICP, png_cICP, +# ifdef PNG_READ_cICP_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "cLLI", PNG_INFO_cLLI, png_cLLI, +# ifdef PNG_READ_cLLI_SUPPORTED + 0, +# else + 1, # endif 1, START, 0 }, { "eXIf", PNG_INFO_eXIf, png_eXIf, @@ -246,6 +221,13 @@ static struct 1, # endif 1, ABSENT, 0 }, + { "mDCV", PNG_INFO_mDCV, png_mDCV, +# ifdef PNG_READ_mDCV_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, { "oFFs", PNG_INFO_oFFs, png_oFFs, # ifdef PNG_READ_oFFs_SUPPORTED 0, @@ -397,7 +379,8 @@ typedef struct { jmp_buf error_return; png_structp png_ptr; - png_infop info_ptr, end_ptr; + png_infop info_ptr; + png_infop end_ptr; png_uint_32 before_IDAT; png_uint_32 after_IDAT; int error_count; diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 3d66154dd4..97718dbd0f 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -1,7 +1,6 @@ - /* pngvalid.c - validate libpng by constructing then reading png files. * - * Copyright (c) 2021 Cosmin Truta + * Copyright (c) 2021-2025 Cosmin Truta * Copyright (c) 2014-2017 John Cunningham Bowler * * This code is released under the libpng license. @@ -63,7 +62,7 @@ /* 1.6.1 added support for the configure test harness, which uses 77 to indicate * a skipped test, in earlier versions we need to succeed on a skipped test, so: */ -#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +#if defined(HAVE_CONFIG_H) # define SKIP 77 #else # define SKIP 0 @@ -77,48 +76,7 @@ (defined PNG_PROGRESSIVE_READ_SUPPORTED) &&\ (defined PNG_FIXED_POINT_SUPPORTED || defined PNG_FLOATING_POINT_SUPPORTED) -#if PNG_LIBPNG_VER < 10500 -/* This deliberately lacks the const. */ -typedef png_byte *png_const_bytep; - -/* This is copied from 1.5.1 png.h: */ -#define PNG_INTERLACE_ADAM7_PASSES 7 -#define PNG_PASS_START_ROW(pass) (((1U&~(pass))<<(3-((pass)>>1)))&7) -#define PNG_PASS_START_COL(pass) (((1U& (pass))<<(3-(((pass)+1)>>1)))&7) -#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) -#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) -#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) -#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) -#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \ - (((yIn)<>(((7-(off))-(pass))<<2)) & 0xFU) | \ - ((0x01145AF0U>>(((7-(off))-(pass))<<2)) & 0xF0U)) -#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ - ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) -#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ - ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) - -/* These are needed too for the default build: */ -#define PNG_WRITE_16BIT_SUPPORTED -#define PNG_READ_16BIT_SUPPORTED - -/* 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)) -#endif -#if PNG_LIBPNG_VER < 10600 - /* 1.6.0 constifies many APIs, the following exists to allow pngvalid to be - * compiled against earlier versions. - */ -# define png_const_structp png_structp -#endif #ifndef RELEASE_BUILD /* RELEASE_BUILD is true for releases and release candidates: */ @@ -214,8 +172,8 @@ define_exception_type(struct png_store*); * common class of errors in error handlers - attempting to format error or * warning messages into buffers that are too small. */ -static size_t safecat(char *buffer, size_t bufsize, size_t pos, - const char *cat) +static size_t +safecat(char *buffer, size_t bufsize, size_t pos, const char *cat) { while (pos < bufsize && cat != NULL && *cat != 0) buffer[pos++] = *cat++; @@ -227,7 +185,8 @@ static size_t safecat(char *buffer, size_t bufsize, size_t pos, return pos; } -static size_t safecatn(char *buffer, size_t bufsize, size_t pos, int n) +static size_t +safecatn(char *buffer, size_t bufsize, size_t pos, int n) { char number[64]; sprintf(number, "%d", n); @@ -235,8 +194,8 @@ static size_t safecatn(char *buffer, size_t bufsize, size_t pos, int n) } #ifdef PNG_READ_TRANSFORMS_SUPPORTED -static size_t safecatd(char *buffer, size_t bufsize, size_t pos, double d, - int precision) +static size_t +safecatd(char *buffer, size_t bufsize, size_t pos, double d, int precision) { char number[64]; sprintf(number, "%.*f", precision, d); @@ -271,7 +230,7 @@ fix(double d) * Generation.) */ static void -make_random_bytes(png_uint_32* seed, void* pv, size_t size) +make_random_bytes(png_uint_32 *seed, void *pv, size_t size) { png_uint_32 u0 = seed[0], u1 = seed[1]; png_bytep bytes = voidcast(png_bytep, pv); @@ -296,7 +255,7 @@ make_random_bytes(png_uint_32* seed, void* pv, size_t size) } static void -make_four_random_bytes(png_uint_32* seed, png_bytep bytes) +make_four_random_bytes(png_uint_32 *seed, png_bytep bytes) { make_random_bytes(seed, bytes, 4); } @@ -304,20 +263,20 @@ make_four_random_bytes(png_uint_32* seed, png_bytep bytes) #if defined PNG_READ_SUPPORTED || defined PNG_WRITE_tRNS_SUPPORTED ||\ defined PNG_WRITE_FILTER_SUPPORTED static void -randomize(void *pv, size_t size) +randomize_bytes(void *pv, size_t size) { static png_uint_32 random_seed[2] = {0x56789abc, 0xd}; make_random_bytes(random_seed, pv, size); } -#define R8(this) randomize(&(this), sizeof (this)) +#define R8(this) randomize_bytes(&(this), sizeof (this)) #ifdef PNG_READ_SUPPORTED static png_byte random_byte(void) { unsigned char b1[1]; - randomize(b1, sizeof b1); + randomize_bytes(b1, sizeof b1); return b1[0]; } #endif /* READ */ @@ -326,7 +285,7 @@ static png_uint_16 random_u16(void) { unsigned char b2[2]; - randomize(b2, sizeof b2); + randomize_bytes(b2, sizeof b2); return png_get_uint_16(b2); } @@ -336,7 +295,7 @@ static png_uint_32 random_u32(void) { unsigned char b4[4]; - randomize(b4, sizeof b4); + randomize_bytes(b4, sizeof b4); return png_get_uint_32(b4); } #endif /* READ_FILLER || READ_RGB_TO_GRAY */ @@ -648,34 +607,8 @@ row_copy(png_bytep toBuffer, png_const_bytep fromBuffer, unsigned int bitWidth, static int pixel_cmp(png_const_bytep pa, png_const_bytep pb, png_uint_32 bit_width) { -#if PNG_LIBPNG_VER < 10506 - if (memcmp(pa, pb, bit_width>>3) == 0) - { - png_uint_32 p; - - if ((bit_width & 7) == 0) return 0; - - /* Ok, any differences? */ - p = pa[bit_width >> 3]; - p ^= pb[bit_width >> 3]; - - if (p == 0) return 0; - - /* There are, but they may not be significant, remove the bits - * after the end (the low order bits in PNG.) - */ - bit_width &= 7; - p >>= 8-bit_width; - - if (p == 0) return 0; - } -#else - /* From libpng-1.5.6 the overwrite should be fixed, so compare the trailing - * bits too: - */ if (memcmp(pa, pb, (bit_width+7)>>3) == 0) return 0; -#endif /* Return the index of the changed byte. */ { @@ -695,7 +628,7 @@ pixel_cmp(png_const_bytep pa, png_const_bytep pb, png_uint_32 bit_width) #define STORE_BUFFER_SIZE 500 /* arbitrary */ typedef struct png_store_buffer { - struct png_store_buffer* prev; /* NOTE: stored in reverse order */ + struct png_store_buffer *prev; /* NOTE: stored in reverse order */ png_byte buffer[STORE_BUFFER_SIZE]; } png_store_buffer; @@ -711,7 +644,7 @@ typedef struct store_palette_entry /* record of a single palette entry */ typedef struct png_store_file { - struct png_store_file* next; /* as many as you like... */ + struct png_store_file *next; /* as many as you like... */ char name[FILE_NAME_SIZE]; unsigned int IDAT_bits; /* Number of bits in IDAT size */ png_uint_32 IDAT_size; /* Total size of IDAT data */ @@ -719,7 +652,7 @@ typedef struct png_store_file 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 */ + store_palette_entry *palette; /* May be NULL */ } png_store_file; /* The following is a pool of memory allocated by a single libpng read or write @@ -780,10 +713,10 @@ typedef struct png_store /* Read fields */ png_structp pread; /* Used to read a saved file */ png_infop piread; - png_store_file* current; /* Set when reading */ - png_store_buffer* next; /* Set when reading */ + png_store_file *current; /* Set when reading */ + png_store_buffer *next; /* Set when reading */ size_t readpos; /* Position in *next */ - png_byte* image; /* Buffer for reading interlaced images */ + png_byte *image; /* Buffer for reading interlaced images */ size_t cb_image; /* Size of this buffer */ size_t cb_row; /* Row size of the image(s) */ uLong IDAT_crc; @@ -793,14 +726,14 @@ typedef struct png_store store_pool read_memory_pool; /* Write fields */ - png_store_file* saved; + png_store_file *saved; png_structp pwrite; /* Used when writing a new file */ png_infop piwrite; 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; - store_palette_entry* palette; + store_palette_entry *palette; int npalette; } png_store; @@ -820,7 +753,6 @@ store_pool_mark(png_bytep mark) static png_uint_32 random_32(void) { - for (;;) { png_byte mark[4]; @@ -1926,7 +1858,7 @@ store_malloc(png_structp ppIn, png_alloc_size_t cb) new->size = cb; memcpy(new->mark, pool->mark, sizeof new->mark); - memcpy((png_byte*)(new+1) + cb, pool->mark, sizeof pool->mark); + memcpy((png_byte *)(new+1) + cb, pool->mark, sizeof pool->mark); new->pool = pool; new->next = pool->list; pool->list = new; @@ -2501,7 +2433,8 @@ typedef struct png_modifier /* This returns true if the test should be stopped now because it has already * failed and it is running silently. */ -static int fail(png_modifier *pm) +static int +fail(png_modifier *pm) { return !pm->log && !pm->this.verbose && (pm->this.nerrors > 0 || (pm->this.treat_warnings_as_errors && pm->this.nwarnings > 0)); @@ -2574,7 +2507,7 @@ modifier_init(png_modifier *pm) * in the rgb_to_gray check, replacing it with an exact copy of the libpng 1.5 * algorithm. */ -#define DIGITIZE PNG_LIBPNG_VER < 10700 +#define DIGITIZE PNG_LIBPNG_VER != 10700 /* If pm->calculations_use_input_precision is set then operations will happen * with the precision of the input, not the precision of the output depth. @@ -2586,7 +2519,8 @@ modifier_init(png_modifier *pm) */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED #if DIGITIZE -static double digitize(double value, int depth, int do_round) +static double +digitize(double value, int depth, int do_round) { /* 'value' is in the range 0 to 1, the result is the same value rounded to a * multiple of the digitization factor - 8 or 16 bits depending on both the @@ -2613,7 +2547,8 @@ static double digitize(double value, int depth, int do_round) #endif /* RGB_TO_GRAY */ #ifdef PNG_READ_GAMMA_SUPPORTED -static double abserr(const png_modifier *pm, int in_depth, int out_depth) +static double +abserr(const png_modifier *pm, int in_depth, int out_depth) { /* Absolute error permitted in linear values - affected by the bit depth of * the calculations. @@ -2625,7 +2560,8 @@ static double abserr(const png_modifier *pm, int in_depth, int out_depth) return pm->maxabs8; } -static double calcerr(const png_modifier *pm, int in_depth, int out_depth) +static double +calcerr(const png_modifier *pm, int in_depth, int out_depth) { /* Error in the linear composition arithmetic - only relevant when * composition actually happens (0 < alpha < 1). @@ -2638,7 +2574,8 @@ static double calcerr(const png_modifier *pm, int in_depth, int out_depth) return pm->maxcalc8; } -static double pcerr(const png_modifier *pm, int in_depth, int out_depth) +static double +pcerr(const png_modifier *pm, int in_depth, int out_depth) { /* Percentage error permitted in the linear values. Note that the specified * value is a percentage but this routine returns a simple number. @@ -2661,7 +2598,8 @@ static double pcerr(const png_modifier *pm, int in_depth, int out_depth) * The specified parameter does *not* include the base .5 digitization error but * it is added here. */ -static double outerr(const png_modifier *pm, int in_depth, int out_depth) +static double +outerr(const png_modifier *pm, int in_depth, int out_depth) { /* There is a serious error in the 2 and 4 bit grayscale transform because * the gamma table value (8 bits) is simply shifted, not rounded, so the @@ -2693,7 +2631,8 @@ static double outerr(const png_modifier *pm, int in_depth, int out_depth) * rather than raising a warning. This is useful for debugging to track down * exactly what set of parameters cause high error values. */ -static double outlog(const png_modifier *pm, int in_depth, int out_depth) +static double +outlog(const png_modifier *pm, int in_depth, int out_depth) { /* The command line parameters are either 8 bit (0..255) or 16 bit (0..65535) * and so must be adjusted for low bit depth grayscale: @@ -2731,8 +2670,8 @@ static double outlog(const png_modifier *pm, int in_depth, int out_depth) * but in the 8 bit calculation case it's actually quantization to a multiple of * 257! */ -static int output_quantization_factor(const png_modifier *pm, int in_depth, - int out_depth) +static int +output_quantization_factor(const png_modifier *pm, int in_depth, int out_depth) { if (out_depth == 16 && in_depth != 16 && pm->calculations_use_input_precision) @@ -3986,10 +3925,10 @@ transform_row(png_const_structp pp, png_byte buffer[TRANSFORM_ROWMAX], # define check_interlace_type(type) ((void)(type)) # define set_write_interlace_handling(pp,type) png_set_interlace_handling(pp) # define do_own_interlace 0 -#elif PNG_LIBPNG_VER < 10700 +#elif PNG_LIBPNG_VER != 10700 # define set_write_interlace_handling(pp,type) (1) static void -check_interlace_type(int const interlace_type) +check_interlace_type(int interlace_type) { /* Prior to 1.7.0 libpng does not support the write of an interlaced image * unless PNG_WRITE_INTERLACING_SUPPORTED, even with do_interlace so the @@ -4014,7 +3953,7 @@ check_interlace_type(int const interlace_type) # define do_own_interlace 1 #endif /* WRITE_INTERLACING tests */ -#if PNG_LIBPNG_VER >= 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED +#if PNG_LIBPNG_VER == 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED # define CAN_WRITE_INTERLACE 1 #else # define CAN_WRITE_INTERLACE 0 @@ -4106,9 +4045,8 @@ choose_random_filter(png_structp pp, int start) #endif /* !WRITE_FILTER */ static void -make_transform_image(png_store* const ps, png_byte const colour_type, - png_byte const bit_depth, unsigned int palette_number, - int interlace_type, png_const_charp name) +make_transform_image(png_store* ps, png_byte colour_type, png_byte bit_depth, + unsigned int palette_number, int interlace_type, png_const_charp name) { context(ps, fault); @@ -4325,10 +4263,8 @@ size_row(png_byte buffer[SIZE_ROWMAX], png_uint_32 bit_width, png_uint_32 y) } static void -make_size_image(png_store* const ps, png_byte const colour_type, - png_byte const bit_depth, int const interlace_type, - png_uint_32 const w, png_uint_32 const h, - int const do_interlace) +make_size_image(png_store* ps, png_byte colour_type, png_byte bit_depth, + int interlace_type, png_uint_32 w, png_uint_32 h, int do_interlace) { context(ps, fault); @@ -4522,8 +4458,7 @@ make_size_image(png_store* const ps, png_byte const colour_type, } static void -make_size(png_store* const ps, png_byte const colour_type, int bdlo, - int const bdhi) +make_size(png_store* ps, png_byte colour_type, int bdlo, int bdhi) { for (; bdlo <= bdhi; ++bdlo) { @@ -4633,15 +4568,15 @@ static const struct { /* no warnings makes these errors undetectable prior to 1.7.0 */ { sBIT0_error_fn, "sBIT(0): failed to detect error", - PNG_LIBPNG_VER < 10700 }, + PNG_LIBPNG_VER != 10700 }, { sBIT_error_fn, "sBIT(too big): failed to detect error", - PNG_LIBPNG_VER < 10700 }, + PNG_LIBPNG_VER != 10700 }, }; static void -make_error(png_store* const ps, png_byte const colour_type, - png_byte bit_depth, int interlace_type, int test, png_const_charp name) +make_error(png_store* ps, png_byte colour_type, png_byte bit_depth, + int interlace_type, int test, png_const_charp name) { context(ps, fault); @@ -4779,8 +4714,7 @@ make_error(png_store* const ps, png_byte const colour_type, } static int -make_errors(png_modifier* const pm, png_byte const colour_type, - int bdlo, int const bdhi) +make_errors(png_modifier* pm, png_byte colour_type, int bdlo, int bdhi) { for (; bdlo <= bdhi; ++bdlo) { @@ -4852,9 +4786,7 @@ perform_formatting_test(png_store *ps) { png_const_charp correct = "29 Aug 2079 13:53:60 +0000"; png_const_charp result; -# if PNG_LIBPNG_VER >= 10600 - char timestring[29]; -# endif + char timestring[29]; png_structp pp; png_time pt; @@ -4938,7 +4870,7 @@ perform_formatting_test(png_store *ps) */ typedef struct standard_display { - png_store* ps; /* Test parameters (passed to the function) */ + png_store *ps; /* Test parameters (passed to the function) */ png_byte colour_type; png_byte bit_depth; png_byte red_sBIT; /* Input data sBIT values. */ @@ -5728,7 +5660,7 @@ standard_end(png_structp ppIn, png_infop pi) /* A single test run checking the standard image to ensure it is not damaged. */ static void -standard_test(png_store* const psIn, png_uint_32 const id, +standard_test(png_store* psIn, png_uint_32 id, int do_interlace, int use_update_info) { standard_display d; @@ -5816,8 +5748,7 @@ standard_test(png_store* const psIn, png_uint_32 const id, } static int -test_standard(png_modifier* const pm, png_byte const colour_type, - int bdlo, int const bdhi) +test_standard(png_modifier* pm, png_byte colour_type, int bdlo, int bdhi) { for (; bdlo <= bdhi; ++bdlo) { @@ -5863,8 +5794,7 @@ perform_standard_test(png_modifier *pm) /********************************** SIZE TESTS ********************************/ static int -test_size(png_modifier* const pm, png_byte const colour_type, - int bdlo, int const bdhi) +test_size(png_modifier* pm, png_byte colour_type, int bdlo, int bdhi) { /* Run the tests on each combination. * @@ -6236,7 +6166,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display, { if (this->colour_type == PNG_COLOR_TYPE_GRAY) { -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 if (!for_background && this->bit_depth < 8) this->bit_depth = this->sample_depth = 8; # endif @@ -6246,7 +6176,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display, /* After 1.7 the expansion of bit depth only happens if there is a * tRNS chunk to expand at this point. */ -# if PNG_LIBPNG_VER >= 10700 +# if PNG_LIBPNG_VER == 10700 if (!for_background && this->bit_depth < 8) this->bit_depth = this->sample_depth = 8; # endif @@ -6254,7 +6184,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display, this->have_tRNS = 0; /* Check the input, original, channel value here against the - * original tRNS gray chunk valie. + * original tRNS gray chunk value. */ if (this->red == display->transparent.red) this->alphaf = 0; @@ -6361,8 +6291,8 @@ typedef struct transform_display standard_display this; /* Parameters */ - png_modifier* pm; - const image_transform* transform_list; + png_modifier *pm; + const image_transform *transform_list; unsigned int max_gamma_8; /* Local variables */ @@ -6834,7 +6764,7 @@ transform_image_validate(transform_display *dp, png_const_structp pp, for (y=0; ythis, fault); @@ -7127,7 +7057,7 @@ image_transform_png_set_tRNS_to_alpha_mod(const image_transform *this, image_pixel *that, png_const_structp pp, const transform_display *display) { -#if PNG_LIBPNG_VER < 10700 +#if PNG_LIBPNG_VER != 10700 /* LIBPNG BUG: this always forces palette images to RGB. */ if (that->colour_type == PNG_COLOR_TYPE_PALETTE) image_pixel_convert_PLTE(that); @@ -7137,13 +7067,13 @@ image_transform_png_set_tRNS_to_alpha_mod(const image_transform *this, * convert to an alpha channel. */ if (that->have_tRNS) -# if PNG_LIBPNG_VER >= 10700 +# if PNG_LIBPNG_VER == 10700 if (that->colour_type != PNG_COLOR_TYPE_PALETTE && (that->colour_type & PNG_COLOR_MASK_ALPHA) == 0) # endif image_pixel_add_alpha(that, &display->this, 0/*!for background*/); -#if PNG_LIBPNG_VER < 10700 +#if PNG_LIBPNG_VER != 10700 /* LIBPNG BUG: otherwise libpng still expands to 8 bits! */ else { @@ -7172,7 +7102,7 @@ image_transform_png_set_tRNS_to_alpha_add(image_transform *this, * any action on a palette image. */ return -# if PNG_LIBPNG_VER >= 10700 +# if PNG_LIBPNG_VER == 10700 colour_type != PNG_COLOR_TYPE_PALETTE && # endif (colour_type & PNG_COLOR_MASK_ALPHA) == 0; @@ -7313,7 +7243,7 @@ image_transform_png_set_expand_gray_1_2_4_to_8_mod( const image_transform *this, image_pixel *that, png_const_structp pp, const transform_display *display) { -#if PNG_LIBPNG_VER < 10700 +#if PNG_LIBPNG_VER != 10700 image_transform_png_set_expand_mod(this, that, pp, display); #else /* Only expand grayscale of bit depth less than 8: */ @@ -7329,7 +7259,7 @@ static int image_transform_png_set_expand_gray_1_2_4_to_8_add(image_transform *this, const image_transform **that, png_byte colour_type, png_byte bit_depth) { -#if PNG_LIBPNG_VER < 10700 +#if PNG_LIBPNG_VER != 10700 return image_transform_png_set_expand_add(this, that, colour_type, bit_depth); #else @@ -7359,7 +7289,7 @@ image_transform_png_set_expand_16_set(const image_transform *this, png_set_expand_16(pp); /* NOTE: prior to 1.7 libpng does SET_EXPAND as well, so tRNS is expanded. */ -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 if (that->this.has_tRNS) that->this.is_transparent = 1; # endif @@ -7412,7 +7342,7 @@ image_transform_png_set_scale_16_set(const image_transform *this, transform_display *that, png_structp pp, png_infop pi) { png_set_scale_16(pp); -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 /* libpng will limit the gamma table size: */ that->max_gamma_8 = PNG_MAX_GAMMA_8; # endif @@ -7460,7 +7390,7 @@ image_transform_png_set_strip_16_set(const image_transform *this, transform_display *that, png_structp pp, png_infop pi) { png_set_strip_16(pp); -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 /* libpng will limit the gamma table size: */ that->max_gamma_8 = PNG_MAX_GAMMA_8; # endif @@ -7485,22 +7415,7 @@ image_transform_png_set_strip_16_mod(const image_transform *this, * 'scale' API (above) must be used. */ # ifdef PNG_READ_ACCURATE_SCALE_SUPPORTED -# if PNG_LIBPNG_VER >= 10504 -# error PNG_READ_ACCURATE_SCALE should not be set -# endif - - /* The strip 16 algorithm drops the low 8 bits rather than calculating - * 1/257, so we need to adjust the permitted errors appropriately: - * Notice that this is only relevant prior to the addition of the - * png_set_scale_16 API in 1.5.4 (but 1.5.4+ always defines the above!) - */ - { - const double d = (255-128.5)/65535; - that->rede += d; - that->greene += d; - that->bluee += d; - that->alphae += d; - } +# error PNG_READ_ACCURATE_SCALE should not be set # endif } @@ -7604,7 +7519,7 @@ static struct double green_coefficient; double blue_coefficient; - /* Set if the coeefficients have been overridden. */ + /* Set if the coefficients have been overridden. */ int coefficients_overridden; } data; @@ -7647,7 +7562,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this, else { /* The default (built in) coefficients, as above: */ -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 data.red_coefficient = 6968 / 32768.; data.green_coefficient = 23434 / 32768.; data.blue_coefficient = 2366 / 32768.; @@ -7730,7 +7645,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this, * conversion adds another +/-2 in the 16-bit case and * +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case. */ -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 if (that->this.bit_depth < 16) that->max_gamma_8 = PNG_MAX_GAMMA_8; # endif @@ -7907,7 +7822,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this, { double gray, err; -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 if (that->colour_type == PNG_COLOR_TYPE_PALETTE) image_pixel_convert_PLTE(that); # endif @@ -8094,7 +8009,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this, double b = that->bluef; double be = that->bluee; -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 /* The true gray case involves no math in earlier versions (not * true, there was some if gamma correction was happening too.) */ @@ -9078,7 +8993,7 @@ image_transform_test_counter(png_uint_32 counter, unsigned int max) /* For max 0 or 1 continue until the counter overflows: */ counter >>= 1; - /* Continue if any entry hasn't reacked the max. */ + /* Continue if any entry hasn't reached the max. */ if (max > 1 && next->local_use < max) return 1; next = next->list; @@ -9221,7 +9136,7 @@ typedef struct gamma_display standard_display this; /* Parameters */ - png_modifier* pm; + png_modifier *pm; double file_gamma; double screen_gamma; double background_gamma; @@ -9764,7 +9679,7 @@ gamma_component_validate(const char *name, const validate_info *vi, * od: encoded result from libpng */ - /* Now we have the numbers for real errors, both absolute values as as a + /* Now we have the numbers for real errors, both absolute values as a * percentage of the correct value (output): */ error = fabs(input_sample-output); @@ -9873,7 +9788,7 @@ gamma_component_validate(const char *name, const validate_info *vi, * lost. This can result in up to a +/-1 error in the presence of * an sbit less than the bit depth. */ -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 # define SBIT_ERROR .5 # else # define SBIT_ERROR 1. @@ -9933,47 +9848,6 @@ gamma_component_validate(const char *name, const validate_info *vi, * (chop) method of scaling was used. */ # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# if PNG_LIBPNG_VER < 10504 - /* This may be required for other components in the future, - * but at present the presence of gamma correction effectively - * prevents the errors in the component scaling (I don't quite - * understand why, but since it's better this way I care not - * to ask, JB 20110419.) - */ - if (pass == 0 && alpha < 0 && vi->scale16 && vi->sbit > 8 && - vi->sbit + vi->isbit_shift == 16) - { - tmp = ((id >> 8) - .5)/255; - - if (tmp > 0) - { - is_lo = ceil(outmax * tmp - vi->maxout_total); - if (is_lo < 0) is_lo = 0; - } - - else - is_lo = 0; - - tmp = ((id >> 8) + .5)/255; - - if (tmp < 1) - { - is_hi = floor(outmax * tmp + vi->maxout_total); - if (is_hi > outmax) is_hi = outmax; - } - - else - is_hi = outmax; - - if (!(od < is_lo || od > is_hi)) - { - if (encoded_error < vi->outlog) - return i; - - pass = "within 8 bit limits:\n"; - } - } -# endif # endif } else /* !use_input_precision */ @@ -10564,7 +10438,8 @@ gamma_test(png_modifier *pmIn, png_byte colour_typeIn, modifier_reset(voidcast(png_modifier*,(void*)fault)); } -static void gamma_threshold_test(png_modifier *pm, png_byte colour_type, +static void +gamma_threshold_test(png_modifier *pm, png_byte colour_type, png_byte bit_depth, int interlace_type, double file_gamma, double screen_gamma) { @@ -10620,12 +10495,12 @@ perform_gamma_threshold_tests(png_modifier *pm) } } -static void gamma_transform_test(png_modifier *pm, - 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) +static void +gamma_transform_test(png_modifier *pm, + 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]; @@ -10652,7 +10527,8 @@ static void gamma_transform_test(png_modifier *pm, scale16, pm->test_gamma_expand16, 0 , 0, 0); } -static void perform_gamma_transform_tests(png_modifier *pm) +static void +perform_gamma_transform_tests(png_modifier *pm) { png_byte colour_type = 0; png_byte bit_depth = 0; @@ -10681,7 +10557,8 @@ static void perform_gamma_transform_tests(png_modifier *pm) } } -static void perform_gamma_sbit_tests(png_modifier *pm) +static void +perform_gamma_sbit_tests(png_modifier *pm) { png_byte sbit; @@ -10728,12 +10605,13 @@ static void perform_gamma_sbit_tests(png_modifier *pm) * generated if DO_16BIT is defined. */ #ifdef DO_16BIT -static void perform_gamma_scale16_tests(png_modifier *pm) +static void +perform_gamma_scale16_tests(png_modifier *pm) { # ifndef PNG_MAX_GAMMA_8 # define PNG_MAX_GAMMA_8 11 # endif -# if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER < 10700 +# if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER != 10700 # define SBIT_16_TO_8 PNG_MAX_GAMMA_8 # else # define SBIT_16_TO_8 16 @@ -10789,13 +10667,14 @@ 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, - png_byte colour_type, png_byte bit_depth, - int palette_number, - int interlace_type, const double file_gamma, - const double screen_gamma, - int use_input_precision, int do_background, - int expand_16) +static void +gamma_composition_test(png_modifier *pm, + png_byte colour_type, png_byte bit_depth, + int palette_number, + int interlace_type, const double file_gamma, + const double screen_gamma, + int use_input_precision, int do_background, + int expand_16) { size_t pos = 0; png_const_charp base; @@ -10944,7 +10823,7 @@ static void gamma_composition_test(png_modifier *pm, static void perform_gamma_composition_tests(png_modifier *pm, int do_background, - int expand_16) + int expand_16) { png_byte colour_type = 0; png_byte bit_depth = 0; @@ -11617,9 +11496,9 @@ static const color_encoding test_encodings[] = */ static png_modifier pm; -static void signal_handler(int signum) +static void +signal_handler(int signum) { - size_t pos = 0; char msg[64]; @@ -11675,7 +11554,8 @@ static void signal_handler(int signum) } /* main program */ -int main(int argc, char **argv) +int +main(int argc, char **argv) { int summary = 1; /* Print the error summary at the end */ int memstats = 0; /* Print memory statistics at the end */ @@ -11736,7 +11616,7 @@ int main(int argc, char **argv) * code that 16-bit arithmetic is used for 8-bit samples when it would make a * difference. */ - pm.assume_16_bit_calculations = PNG_LIBPNG_VER >= 10700; + pm.assume_16_bit_calculations = PNG_LIBPNG_VER == 10700; /* Currently 16 bit expansion happens at the end of the pipeline, so the * calculations are done in the input bit depth not the output. @@ -11756,24 +11636,24 @@ int main(int argc, char **argv) # ifdef PNG_WRITE_tRNS_SUPPORTED pm.test_tRNS = 1; # endif - pm.test_lbg = PNG_LIBPNG_VER >= 10600; + pm.test_lbg = 1; /* PNG_LIBPNG_VER >= 10600 */ pm.test_lbg_gamma_threshold = 1; - pm.test_lbg_gamma_transform = PNG_LIBPNG_VER >= 10600; + pm.test_lbg_gamma_transform = 1; /* PNG_LIBPNG_VER >= 10600 */ pm.test_lbg_gamma_sbit = 1; - pm.test_lbg_gamma_composition = PNG_LIBPNG_VER >= 10700; + pm.test_lbg_gamma_composition = PNG_LIBPNG_VER == 10700; /* And the test encodings */ pm.encodings = test_encodings; pm.nencodings = ARRAY_SIZE(test_encodings); -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 pm.sbitlow = 8U; /* because libpng doesn't do sBIT below 8! */ # else pm.sbitlow = 1U; # endif /* 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 + * transformed range [input-.5,input+.5]; this is required because of the * way libpng treats the 16_TO_8 flag when building the gamma tables in * releases up to 1.6.0. * @@ -11796,7 +11676,7 @@ int main(int argc, char **argv) pm.maxout16 = .499; /* Error in *encoded* value */ pm.maxabs16 = .00005;/* 1/20000 */ pm.maxcalc16 =1./65535;/* +/-1 in 16 bits for compose errors */ -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER != 10700 pm.maxcalcG = 1./((1< 0) { diff --git a/contrib/libtests/timepng.c b/contrib/libtests/timepng.c index 0093a4548e..a66f51345f 100644 --- a/contrib/libtests/timepng.c +++ b/contrib/libtests/timepng.c @@ -1,4 +1,3 @@ - /* timepng.c * * Copyright (c) 2013,2016 John Cunningham Bowler diff --git a/contrib/mips-mmi/linux.c b/contrib/mips-mmi/linux.c index 31525fde9a..1db6653204 100644 --- a/contrib/mips-mmi/linux.c +++ b/contrib/mips-mmi/linux.c @@ -1,4 +1,3 @@ - /* contrib/mips-mmi/linux.c * * Copyright (c) 2024 Cosmin Truta @@ -58,12 +57,14 @@ __asm__(".macro parse_r var r\n\t" #define HWCAP_LOONGSON_CPUCFG (1 << 14) -static int cpucfg_available(void) +static int +cpucfg_available(void) { return getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG; } -static int strstart(const char *str, const char *pfx, const char **ptr) +static int +strstart(const char *str, const char *pfx, const char **ptr) { while (*pfx && *pfx == *str) { pfx++; @@ -75,7 +76,8 @@ static int strstart(const char *str, const char *pfx, const char **ptr) } /* Most toolchains have no CPUCFG support yet */ -static uint32_t read_cpucfg(uint32_t reg) +static uint32_t +read_cpucfg(uint32_t reg) { uint32_t __res; @@ -95,7 +97,8 @@ static uint32_t read_cpucfg(uint32_t reg) #define LOONGSON_CFG1_MMI (1 << 4) -static int cpu_flags_cpucfg(void) +static int +cpu_flags_cpucfg(void) { int flags = 0; uint32_t cfg1 = read_cpucfg(LOONGSON_CFG1); @@ -106,7 +109,8 @@ static int cpu_flags_cpucfg(void) return flags; } -static int cpu_flags_cpuinfo(void) +static int +cpu_flags_cpuinfo(void) { FILE *f = fopen("/proc/cpuinfo", "r"); char buf[200]; @@ -132,7 +136,8 @@ static int cpu_flags_cpuinfo(void) return flags; } -static int png_have_mmi() +static int +png_have_mmi() { if (cpucfg_available()) return cpu_flags_cpucfg(); diff --git a/contrib/mips-msa/linux.c b/contrib/mips-msa/linux.c index cae8ca50ff..5651df707e 100644 --- a/contrib/mips-msa/linux.c +++ b/contrib/mips-msa/linux.c @@ -1,4 +1,3 @@ - /* contrib/mips-msa/linux.c * * Copyright (c) 2020-2023 Cosmin Truta diff --git a/contrib/oss-fuzz/build.sh b/contrib/oss-fuzz/build.sh index 7b8f026397..420a25b9e2 100755 --- a/contrib/oss-fuzz/build.sh +++ b/contrib/oss-fuzz/build.sh @@ -22,29 +22,57 @@ # 3. Build zlib alongside libpng ################################################################################ -# Disable logging via library build configuration control. +# Disable logging via pnglibconf. cat scripts/pnglibconf.dfa | \ - sed -e "s/option STDIO/option STDIO disabled/" \ - -e "s/option WARNING /option WARNING disabled/" \ - -e "s/option WRITE enables WRITE_INT_FUNCTIONS/option WRITE disabled/" \ -> scripts/pnglibconf.dfa.temp + sed -e "s/option STDIO/option STDIO disabled/" \ + -e "s/option WARNING /option WARNING disabled/" \ + -e "s/option WRITE enables WRITE_INT_FUNCTIONS/option WRITE disabled/" \ + > scripts/pnglibconf.dfa.temp mv scripts/pnglibconf.dfa.temp scripts/pnglibconf.dfa -# build the libpng library. +# Build the libpng library. autoreconf -f -i ./configure --with-libpng-prefix=OSS_FUZZ_ make -j$(nproc) clean make -j$(nproc) libpng16.la -# build libpng_read_fuzzer. -$CXX $CXXFLAGS -std=c++11 -I. \ - $SRC/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc \ - -o $OUT/libpng_read_fuzzer \ - -lFuzzingEngine .libs/libpng16.a -lz +for f in libpng_read_fuzzer \ + libpng_colormap_fuzzer \ + libpng_readapi_fuzzer \ + libpng_transformations_fuzzer; +do + # Build the fuzzer. + $CXX $CXXFLAGS -std=c++11 -I. \ + $SRC/libpng/contrib/oss-fuzz/${f}.cc \ + -o $OUT/${f} \ + -lFuzzingEngine .libs/libpng16.a -lz -# add seed corpus. -find $SRC/libpng -name "*.png" | grep -v crashers | \ - xargs zip $OUT/libpng_read_fuzzer_seed_corpus.zip + # Only libfuzzer can run the nalloc targets. + if test "x$FUZZING_ENGINE" == 'xlibfuzzer' + then + + if grep -q "nalloc_init" $SRC/libpng/contrib/oss-fuzz/${f}.cc + then + # Generate a wrapper that runs the fuzzer with NALLOC_FREQ=32 + # (allocation failures enabled). + cat << EOF > $OUT/${f}@nalloc +#!/bin/bash +# LLVMFuzzerTestOneInput for fuzzer detection. +this_dir=\$(dirname "\$0") +NALLOC_FREQ=32 \$this_dir/${f} \$@ +EOF + chmod +x $OUT/${f}@nalloc + fi + + # Add seed corpus. + find $SRC/libpng -name "*.png" | \ + xargs zip $OUT/${f}_seed_corpus.zip + + fi + cp $SRC/libpng/contrib/oss-fuzz/png.dict $OUT/${f}.dict +done cp $SRC/libpng/contrib/oss-fuzz/*.dict \ - $SRC/libpng/contrib/oss-fuzz/*.options $OUT/ + $SRC/libpng/contrib/oss-fuzz/*.options $OUT/ + +# end diff --git a/contrib/oss-fuzz/libpng_colormap_fuzzer.cc b/contrib/oss-fuzz/libpng_colormap_fuzzer.cc new file mode 100644 index 0000000000..8b542b6185 --- /dev/null +++ b/contrib/oss-fuzz/libpng_colormap_fuzzer.cc @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include + +/* Test png_image API and colormap functions */ +static void test_png_image_colormap(const uint8_t *data, size_t size) { + png_image image; + memset(&image, 0, sizeof(image)); + image.version = PNG_IMAGE_VERSION; + + if (!png_image_begin_read_from_memory(&image, data, size)) { + return; + } + + /* Limit image size for performance */ + if (image.width > 1024 || image.height > 1024) { + png_image_free(&image); + return; + } + + /* Test different colormap formats to trigger uncovered functions */ + png_uint_32 formats[] = { + PNG_FORMAT_GRAY, + PNG_FORMAT_GA, + PNG_FORMAT_RGB, + PNG_FORMAT_RGBA, + PNG_FORMAT_RGB_COLORMAP, + PNG_FORMAT_RGBA_COLORMAP + }; + + int i; + for (i = 0; i < 6; i++) { + image.format = formats[i]; + + size_t buffer_size = PNG_IMAGE_SIZE(image); + if (buffer_size > 0 && buffer_size < 5*1024*1024) { /* Limit to 5MB */ + void *img_buffer = malloc(buffer_size); + if (img_buffer) { + if (image.format & PNG_FORMAT_FLAG_COLORMAP) { + png_bytep colormap = (png_bytep)malloc(PNG_IMAGE_COLORMAP_SIZE(image)); + if (colormap) { + /* This triggers png_image_finish_read and colormap generation */ + png_image_finish_read(&image, NULL, img_buffer, 0, colormap); + free(colormap); + } + } else { + png_image_finish_read(&image, NULL, img_buffer, 0, NULL); + } + free(img_buffer); + } + } + + /* Reset for next format */ + if (i < 5) { + png_image_free(&image); + memset(&image, 0, sizeof(image)); + image.version = PNG_IMAGE_VERSION; + if (!png_image_begin_read_from_memory(&image, data, size)) { + break; + } + } + } + + png_image_free(&image); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + if (size < 8) return 0; + + /* Test 2: PNG image API with colormap processing */ + test_png_image_colormap(data, size); + + return 0; +} diff --git a/contrib/oss-fuzz/libpng_read_fuzzer.cc b/contrib/oss-fuzz/libpng_read_fuzzer.cc index 0190cf7865..9afe3c3664 100644 --- a/contrib/oss-fuzz/libpng_read_fuzzer.cc +++ b/contrib/oss-fuzz/libpng_read_fuzzer.cc @@ -1,4 +1,3 @@ - // libpng_read_fuzzer.cc // Copyright 2017-2018 Glenn Randers-Pehrson // Copyright 2015 The Chromium Authors. All rights reserved. @@ -22,8 +21,10 @@ #define PNG_INTERNAL #include "png.h" +#include "nalloc.h" #define PNG_CLEANUP \ + nalloc_end(); \ if(png_handler.png_ptr) \ { \ if (png_handler.row_ptr) \ @@ -102,6 +103,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size < kPngHeaderSize) { return 0; } + nalloc_init(nullptr); std::vector v(data, data + size); if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) { @@ -121,6 +123,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } + nalloc_start(data, size); png_handler.info_ptr = png_create_info_struct(png_handler.png_ptr); if (!png_handler.info_ptr) { PNG_CLEANUP @@ -204,5 +207,21 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { png_read_end(png_handler.png_ptr, png_handler.end_info_ptr); PNG_CLEANUP + +#ifdef PNG_SIMPLIFIED_READ_SUPPORTED + // Simplified READ API + png_image image; + memset(&image, 0, (sizeof image)); + image.version = PNG_IMAGE_VERSION; + + if (!png_image_begin_read_from_memory(&image, data, size)) { + return 0; + } + + image.format = PNG_FORMAT_RGBA; + std::vector buffer(PNG_IMAGE_SIZE(image)); + png_image_finish_read(&image, NULL, buffer.data(), 0, NULL); +#endif + return 0; } diff --git a/contrib/oss-fuzz/libpng_readapi_fuzzer.cc b/contrib/oss-fuzz/libpng_readapi_fuzzer.cc new file mode 100644 index 0000000000..4c04637a5a --- /dev/null +++ b/contrib/oss-fuzz/libpng_readapi_fuzzer.cc @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include + +/* Memory buffer structure for PNG reading */ +struct png_mem_buffer { + const uint8_t *data; + size_t size; + size_t pos; +}; + +/* Custom read function for memory buffer */ +static void png_read_from_buffer(png_structp png_ptr, png_bytep data, png_size_t length) { + struct png_mem_buffer *buf = (struct png_mem_buffer*)png_get_io_ptr(png_ptr); + if (buf->pos + length > buf->size) { + png_error(png_ptr, "Read error"); + } + memcpy(data, buf->data + buf->pos, length); + buf->pos += length; +} + +/* Test png_read_png API */ +static void test_png_read_png_api(const uint8_t *data, size_t size) { + png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png_ptr) return; + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_read_struct(&png_ptr, NULL, NULL); + return; + } + + if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return; + } + + struct png_mem_buffer buffer = {data, size, 0}; + png_set_read_fn(png_ptr, &buffer, png_read_from_buffer); + + /* Use png_read_png with transform flags */ + png_read_png(png_ptr, info_ptr, + PNG_TRANSFORM_SCALE_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND, + NULL); + + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + if (size < 8) return 0; + + /* Test 3: png_read_png API */ + test_png_read_png_api(data, size); + + return 0; +} diff --git a/contrib/oss-fuzz/libpng_transformations_fuzzer.cc b/contrib/oss-fuzz/libpng_transformations_fuzzer.cc new file mode 100644 index 0000000000..ee33ce71af --- /dev/null +++ b/contrib/oss-fuzz/libpng_transformations_fuzzer.cc @@ -0,0 +1,121 @@ +#include +#include +#include +#include +#include + +/* Memory buffer structure for PNG reading */ +struct png_mem_buffer { + const uint8_t *data; + size_t size; + size_t pos; +}; + +/* Custom read function for memory buffer */ +static void png_read_from_buffer(png_structp png_ptr, png_bytep data, png_size_t length) { + struct png_mem_buffer *buf = (struct png_mem_buffer*)png_get_io_ptr(png_ptr); + if (buf->pos + length > buf->size) { + png_error(png_ptr, "Read error"); + } + memcpy(data, buf->data + buf->pos, length); + buf->pos += length; +} + +/* Test PNG transformations to trigger uncovered code paths */ +static void test_png_transformations(const uint8_t *data, size_t size) { + png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png_ptr) return; + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_read_struct(&png_ptr, NULL, NULL); + return; + } + + /* Declare heap pointers before setjmp so they can be freed on longjmp. + Must be volatile per C standard §7.13.2.1: non-volatile locals modified + between setjmp and longjmp have indeterminate values after longjmp. */ + volatile png_bytep row = NULL; + volatile png_colorp palette = NULL; + + if (setjmp(png_jmpbuf(png_ptr))) { + free((void*)row); + free((void*)palette); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return; + } + + struct png_mem_buffer buffer = {data, size, 0}; + png_set_read_fn(png_ptr, &buffer, png_read_from_buffer); + + png_read_info(png_ptr, info_ptr); + + int width = png_get_image_width(png_ptr, info_ptr); + int height = png_get_image_height(png_ptr, info_ptr); + int color_type = png_get_color_type(png_ptr, info_ptr); + int bit_depth = png_get_bit_depth(png_ptr, info_ptr); + + /* Sanity check dimensions */ + if (width <= 0 || height <= 0 || width > 2048 || height > 2048) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return; + } + + /* Target 1: 16-bit depth processing (triggers png_do_chop) */ + if (bit_depth == 16) { + png_set_scale_16(png_ptr); + } + + /* Target 2: Color quantization (triggers png_do_quantize) */ + if (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_RGB_ALPHA) { + palette = (png_colorp)malloc(256 * sizeof(png_color)); + if (palette) { + int i; + for (i = 0; i < 256; i++) { + palette[i].red = palette[i].green = palette[i].blue = (png_byte)i; + } + png_set_quantize(png_ptr, palette, 256, 256, NULL, 0); + free((void*)palette); + palette = NULL; + } + } + + /* Target 3: Alpha channel transformations */ + if (color_type & PNG_COLOR_MASK_ALPHA) { + png_set_invert_alpha(png_ptr); /* png_do_read_invert_alpha */ + png_set_swap_alpha(png_ptr); /* png_do_read_swap_alpha */ + } + + /* Target 4: Bit shifting (triggers png_do_unshift) */ + if (bit_depth < 8) { + png_set_packing(png_ptr); + } + + /* Target 5: Alpha encoding (triggers png_do_encode_alpha) */ + png_set_alpha_mode(png_ptr, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); + + /* Update transformations */ + png_read_update_info(png_ptr, info_ptr); + + /* Read image data to execute transformations */ + size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr); + row = (png_bytep)malloc(rowbytes); + if (row) { + int y; + for (y = 0; y < height && y < 100; y++) { /* Limit rows for performance */ + png_read_row(png_ptr, row, NULL); + } + } + + free((void*)row); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + if (size < 8) return 0; + + /* Test 1: Standard PNG reading with transformations */ + test_png_transformations(data, size); + + return 0; +} diff --git a/contrib/oss-fuzz/nalloc.h b/contrib/oss-fuzz/nalloc.h new file mode 100644 index 0000000000..20872d4291 --- /dev/null +++ b/contrib/oss-fuzz/nalloc.h @@ -0,0 +1,345 @@ +/* + MIT License + + Copyright (c) 2025 Catena cyber + + 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. +*/ + +#ifndef NALLOC_H_ +#define NALLOC_H_ + +#define FUZZER_ENABLE_NALLOC 1 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#undef FUZZER_ENABLE_NALLOC +#endif +#endif + +#if !defined(FUZZER_ENABLE_NALLOC) +#define nalloc_init(x) +#define nalloc_restrict_file_prefix(x) +#define nalloc_start(x, y) +#define nalloc_end() +#else + +#if defined(__clang__) && defined(__has_feature) +#if __has_feature(address_sanitizer) +#define NALLOC_ASAN 1 +#endif +#endif + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static const uint32_t nalloc_crc32_table[] = { + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, + 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, + 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, + 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, + 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, + 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, + 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, + 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, + 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, + 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, + 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, + 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, + 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, + 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, + 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, + 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, + 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, + 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, + 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, + 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, + 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, + 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 +}; + +// Nallocfuzz data to take a decision +uint32_t nalloc_random_state = 0; +__thread unsigned int nalloc_running = 0; +bool nalloc_initialized = false; +uint32_t nalloc_runs = 0; + +// Nalloc fuzz parameters +uint32_t nalloc_bitmask = 0xFF; +bool nalloc_random_bitmask = true; +uint32_t nalloc_magic = 0x294cee63; +bool nalloc_verbose = false; + +#ifdef NALLOC_ASAN +extern void __sanitizer_print_stack_trace(void); +#endif + +// Generic init, using env variables to get parameters +void nalloc_init(const char *prog) { + if (nalloc_initialized) { + return; + } + nalloc_initialized = true; + char *bitmask = getenv("NALLOC_FREQ"); + if (bitmask) { + int shift = atoi(bitmask); + if (shift > 0 && shift < 31) { + nalloc_bitmask = 1 << shift; + nalloc_random_bitmask = false; + } else if (shift == 0) { + nalloc_random_bitmask = false; + nalloc_bitmask = 0; + } + } else if (prog == NULL || strstr(prog, "nalloc") == NULL) { + nalloc_random_bitmask = false; + nalloc_bitmask = 0; + return; + } + + char *magic = getenv("NALLOC_MAGIC"); + if (magic) { + nalloc_magic = (uint32_t)strtol(magic, NULL, 0); + } + + char *verbose = getenv("NALLOC_VERBOSE"); + if (verbose) { + nalloc_verbose = true; + } +} + +// add one byte to the CRC +static inline void nalloc_random_update(uint8_t b) { + nalloc_random_state = + ((uint32_t)((uint32_t)nalloc_random_state << 8)) ^ + nalloc_crc32_table[((nalloc_random_state >> 24) ^ b) & 0xFF]; +} + +// Start the failure injections, using a buffer as seed +static int nalloc_start(const uint8_t *data, size_t size) { + if (nalloc_random_bitmask) { + if (nalloc_random_state & 0x10) { + nalloc_bitmask = 0xFFFFFFFF; + } else { + nalloc_bitmask = 1 << (5 + (nalloc_random_state & 0xF)); + } + } else if (nalloc_bitmask == 0) { + // nalloc disabled + return 0; + } + nalloc_random_state = 0; + for (size_t i = 0; i < size; i++) { + nalloc_random_update(data[i]); + } + if (__sync_fetch_and_add(&nalloc_running, 1)) { + __sync_fetch_and_sub(&nalloc_running, 1); + return 0; + } + nalloc_runs++; + return 1; +} + +// Stop the failure injections +static void nalloc_end() { __sync_fetch_and_sub(&nalloc_running, 1); } + +static bool nalloc_backtrace_exclude(size_t size, const char *op) { + if (nalloc_verbose) { + fprintf(stderr, "failed %s(%zu) \n", op, size); +#ifdef NALLOC_ASAN + __sanitizer_print_stack_trace(); +#endif + } + + return false; +} + +// +static bool nalloc_fail(size_t size, const char *op) { + // do not fail before thread init + if (nalloc_runs == 0) { + return false; + } + if (__sync_fetch_and_add(&nalloc_running, 1) != 1) { + // do not fail allocations outside of fuzzer input + // and do not fail inside of this function + __sync_fetch_and_sub(&nalloc_running, 1); + return false; + } + nalloc_random_update((uint8_t)size); + if (size >= 0x100) { + nalloc_random_update((uint8_t)(size >> 8)); + if (size >= 0x10000) { + nalloc_random_update((uint8_t)(size >> 16)); + // bigger may already fail or oom + } + } + if (((nalloc_random_state ^ nalloc_magic) & nalloc_bitmask) == 0) { + if (nalloc_backtrace_exclude(size, op)) { + __sync_fetch_and_sub(&nalloc_running, 1); + return false; + } + __sync_fetch_and_sub(&nalloc_running, 1); + return true; + } + __sync_fetch_and_sub(&nalloc_running, 1); + return false; +} + +// ASAN interceptor for libc routines +#ifdef NALLOC_ASAN +extern void *__interceptor_malloc(size_t); +extern void *__interceptor_calloc(size_t, size_t); +extern void *__interceptor_realloc(void *, size_t); +extern void *__interceptor_reallocarray(void *, size_t, size_t); + +extern ssize_t __interceptor_read(int, void *, size_t); +extern ssize_t __interceptor_write(int, const void *, size_t); +extern ssize_t __interceptor_recv(int, void *, size_t, int); +extern ssize_t __interceptor_send(int, const void *, size_t, int); + +#define nalloc_malloc(s) __interceptor_malloc(s) +#define nalloc_calloc(s, n) __interceptor_calloc(s, n) +#define nalloc_realloc(p, s) __interceptor_realloc(p, s) +#define nalloc_reallocarray(p, s, n) __interceptor_reallocarray(p, s, n) + +#define nalloc_read(f, b, s) __interceptor_read(f, b, s) +#define nalloc_write(f, b, s) __interceptor_write(f, b, s) +#define nalloc_recv(f, b, s, x) __interceptor_recv(f, b, s, x) +#define nalloc_send(f, b, s, x) __interceptor_send(f, b, s, x) + +#else +extern void *__libc_malloc(size_t); +extern void *__libc_calloc(size_t, size_t); +extern void *__libc_realloc(void *, size_t); +extern void *__libc_reallocarray(void *, size_t, size_t); + +extern ssize_t __read(int, void *, size_t); +extern ssize_t __write(int, const void *, size_t); +extern ssize_t __recv(int, void *, size_t, int); +extern ssize_t __send(int, const void *, size_t, int); + +#define nalloc_malloc(s) __libc_malloc(s) +#define nalloc_calloc(s, n) __libc_calloc(s, n) +#define nalloc_realloc(p, s) __libc_realloc(p, s) +#define nalloc_reallocarray(p, s, n) __libc_reallocarray(p, s, n) + +#define nalloc_read(f, b, s) __read(f, b, s) +#define nalloc_write(f, b, s) __write(f, b, s) +#define nalloc_recv(f, b, s, x) __recv(f, b, s, x) +#define nalloc_send(f, b, s, x) __send(f, b, s, x) +#endif + +// nalloc standard function overwrites with pseudo-random failures +ssize_t read(int fd, void *buf, size_t count) { + if (nalloc_fail(count, "read")) { + errno = EIO; + return -1; + } + return nalloc_read(fd, buf, count); +} + +ssize_t write(int fd, const void *buf, size_t count) { + if (nalloc_fail(count, "write")) { + errno = EIO; + return -1; + } + return nalloc_write(fd, buf, count); +} + +ssize_t recv(int fd, void *buf, size_t count, int flags) { + if (nalloc_fail(count, "recv")) { + errno = EIO; + return -1; + } + return nalloc_recv(fd, buf, count, flags); +} + +ssize_t send(int fd, const void *buf, size_t count, int flags) { + if (nalloc_fail(count, "send")) { + errno = EIO; + return -1; + } + return nalloc_send(fd, buf, count, flags); +} + +void *calloc(size_t nmemb, size_t size) { + if (nalloc_fail(size, "calloc")) { + errno = ENOMEM; + return NULL; + } + return nalloc_calloc(nmemb, size); +} + +void *malloc(size_t size) { + if (nalloc_fail(size, "malloc")) { + errno = ENOMEM; + return NULL; + } + return nalloc_malloc(size); +} + +void *realloc(void *ptr, size_t size) { + if (nalloc_fail(size, "realloc")) { + errno = ENOMEM; + return NULL; + } + return nalloc_realloc(ptr, size); +} + +void *reallocarray(void *ptr, size_t nmemb, size_t size) { + if (nalloc_fail(size, "reallocarray")) { + errno = ENOMEM; + return NULL; + } + return nalloc_reallocarray(ptr, nmemb, size); +} + +#ifdef __cplusplus +} // extern "C" { +#endif + +#endif // FUZZER_ENABLE_NALLOC +#endif // NALLOC_H_ diff --git a/contrib/pngexif/.editorconfig b/contrib/pngexif/.editorconfig new file mode 100644 index 0000000000..e00082696d --- /dev/null +++ b/contrib/pngexif/.editorconfig @@ -0,0 +1,12 @@ +# https://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = space +insert_final_newline = true +max_doc_length = 79 +max_line_length = 79 +trim_trailing_whitespace = true diff --git a/contrib/pngexif/.gitignore b/contrib/pngexif/.gitignore new file mode 100644 index 0000000000..016f70a803 --- /dev/null +++ b/contrib/pngexif/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +*.py[co] +*$py.class diff --git a/contrib/pngexif/.pylintrc b/contrib/pngexif/.pylintrc new file mode 100644 index 0000000000..50cf1152da --- /dev/null +++ b/contrib/pngexif/.pylintrc @@ -0,0 +1,8 @@ +[COMPATIBILITY] +disable=consider-using-f-string + +[COMPLEXITY] +disable=too-many-branches,too-many-instance-attributes + +[STYLE] +disable=consider-using-in diff --git a/contrib/pngexif/LICENSE_MIT.txt b/contrib/pngexif/LICENSE_MIT.txt new file mode 100644 index 0000000000..9cf106272a --- /dev/null +++ b/contrib/pngexif/LICENSE_MIT.txt @@ -0,0 +1,19 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/contrib/pngexif/README.md b/contrib/pngexif/README.md new file mode 100644 index 0000000000..c9ff88b647 --- /dev/null +++ b/contrib/pngexif/README.md @@ -0,0 +1,20 @@ +pngexifinfo +=========== + +Show the EXIF information embedded in a PNG file. + + +Sample usage +------------ + +Show the EXIF info inside a PNG file: + + pngexifinfo /path/to/file.png + +Show the EXIF info inside a raw `.exif` file, using base 16 for the EXIF tags: + + pngexifinfo --hex /path/to/file.exif + +Show the help text: + + pngexifinfo --help diff --git a/contrib/pngexif/bytepack.py b/contrib/pngexif/bytepack.py new file mode 100755 index 0000000000..93af21994a --- /dev/null +++ b/contrib/pngexif/bytepack.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +""" +Byte packing and unpacking utilities. + +Copyright (C) 2017-2020 Cosmin Truta. + +Use, modification and distribution are subject to the MIT License. +Please see the accompanying file LICENSE_MIT.txt +""" + +from __future__ import absolute_import, division, print_function + +import struct + + +def unpack_uint32be(buffer, offset=0): + """Unpack an unsigned int from its 32-bit big-endian representation.""" + return struct.unpack(">I", buffer[offset:offset + 4])[0] + + +def unpack_uint32le(buffer, offset=0): + """Unpack an unsigned int from its 32-bit little-endian representation.""" + return struct.unpack("H", buffer[offset:offset + 2])[0] + + +def unpack_uint16le(buffer, offset=0): + """Unpack an unsigned int from its 16-bit little-endian representation.""" + return struct.unpack(" "ascii" + value_or_offset >>= 24 + elif tag_type == 3: + # 3 --> "short" + value_or_offset >>= 16 + else: + # ... FIXME + pass + if count == 0: + raise RuntimeError("unsupported count=0 in tag 0x%x" % tag_id) + if tag_id == _TIFF_EXIF_IFD: + if tag_type != 4: + raise RuntimeError("incorrect tag type for EXIF IFD") + self._exif_ifd_offset = value_or_offset + elif tag_id == _GPS_IFD: + if tag_type != 4: + raise RuntimeError("incorrect tag type for GPS IFD") + self._gps_ifd_offset = value_or_offset + elif tag_id == _INTEROPERABILITY_IFD: + if tag_type != 4: + raise RuntimeError("incorrect tag type for Interop IFD") + self._interoperability_ifd_offset = value_or_offset + yield (tag_id, tag_type, count, value_or_offset) + + def tags(self): + """Yield all TIFF/EXIF tags.""" + if self._verbose: + print("TIFF IFD : 0x%08x" % self._global_ifd_offset) + for tag in self._tags_for_ifd(self._global_ifd_offset): + yield tag + if self._exif_ifd_offset > 0: + if self._verbose: + print("EXIF IFD : 0x%08x" % self._exif_ifd_offset) + for tag in self._tags_for_ifd(self._exif_ifd_offset): + yield tag + if self._gps_ifd_offset > 0: + if self._verbose: + print("GPS IFD : 0x%08x" % self._gps_ifd_offset) + for tag in self._tags_for_ifd(self._gps_ifd_offset): + yield tag + if self._interoperability_ifd_offset > 0: + if self._verbose: + print("Interoperability IFD : 0x%08x" % + self._interoperability_ifd_offset) + for tag in self._tags_for_ifd(self._interoperability_ifd_offset): + yield tag + + def tagid2str(self, tag_id): + """Return an informative string representation of a TIFF tag id.""" + idstr = _TIFF_TAGS.get(tag_id, "[Unknown]") + if self._hex: + idnum = "0x%04x" % tag_id + else: + idnum = "%d" % tag_id + return "%s (%s)" % (idstr, idnum) + + @staticmethod + def tagtype2str(tag_type): + """Return an informative string representation of a TIFF tag type.""" + typestr = _TIFF_TAG_TYPES.get(tag_type, "[unknown]") + return "%d:%s" % (tag_type, typestr) + + def tag2str(self, tag_id, tag_type, count, value_or_offset): + """Return an informative string representation of a TIFF tag tuple.""" + return "%s (type=%s) (count=%d) : 0x%08x" \ + % (self.tagid2str(tag_id), self.tagtype2str(tag_type), count, + value_or_offset) + + def _ui32(self): + """Decode a 32-bit unsigned int found at the current offset; + advance the offset by 4. + """ + if self._offset + 4 > len(self._buffer): + raise RuntimeError("out-of-bounds uint32 access in EXIF") + if self._endian == "MM": + result = unpack_uint32be(self._buffer, self._offset) + else: + result = unpack_uint32le(self._buffer, self._offset) + self._offset += 4 + return result + + def _ui16(self): + """Decode a 16-bit unsigned int found at the current offset; + advance the offset by 2. + """ + if self._offset + 2 > len(self._buffer): + raise RuntimeError("out-of-bounds uint16 access in EXIF") + if self._endian == "MM": + result = unpack_uint16be(self._buffer, self._offset) + else: + result = unpack_uint16le(self._buffer, self._offset) + self._offset += 2 + return result + + def _ui8(self): + """Decode an 8-bit unsigned int found at the current offset; + advance the offset by 1. + """ + if self._offset + 1 > len(self._buffer): + raise RuntimeError("out-of-bounds uint8 access in EXIF") + result = unpack_uint8(self._buffer, self._offset) + self._offset += 1 + return result + + +def print_raw_exif_info(buffer, **kwargs): + """Print the EXIF information found in a raw byte stream.""" + lister = ExifInfo(buffer, **kwargs) + print("EXIF (endian=%s)" % lister.endian()) + for (tag_id, tag_type, count, value_or_offset) in lister.tags(): + print(lister.tag2str(tag_id=tag_id, + tag_type=tag_type, + count=count, + value_or_offset=value_or_offset)) + + +if __name__ == "__main__": + # For testing only. + for arg in sys.argv[1:]: + with open(arg, "rb") as test_stream: + test_buffer = test_stream.read(_READ_DATA_SIZE_MAX) + print_raw_exif_info(test_buffer, hex=True, verbose=True) diff --git a/contrib/pngexif/pngexifinfo b/contrib/pngexif/pngexifinfo new file mode 100755 index 0000000000..16f8eaab14 --- /dev/null +++ b/contrib/pngexif/pngexifinfo @@ -0,0 +1,10 @@ +#!/bin/sh +set -eu + +my_python="$(command -v python3 || command -v python)" || { + echo >&2 "error: program not found: Python interpreter" + exit 127 +} +my_python_flags="-BES" + +exec "$my_python" "$my_python_flags" "$(dirname "$0")/pngexifinfo.py" "$@" diff --git a/contrib/pngexif/pngexifinfo.bat b/contrib/pngexif/pngexifinfo.bat new file mode 100644 index 0000000000..ab8bd358cc --- /dev/null +++ b/contrib/pngexif/pngexifinfo.bat @@ -0,0 +1,4 @@ +@echo off +@setlocal enableextensions + +python.exe -BES %~dp0.\pngexifinfo.py %* diff --git a/contrib/pngexif/pngexifinfo.py b/contrib/pngexif/pngexifinfo.py new file mode 100755 index 0000000000..37d4c4bcd8 --- /dev/null +++ b/contrib/pngexif/pngexifinfo.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python + +""" +Show the PNG EXIF information. + +Copyright (C) 2017-2020 Cosmin Truta. + +Use, modification and distribution are subject to the MIT License. +Please see the accompanying file LICENSE_MIT.txt +""" + +from __future__ import absolute_import, division, print_function + +import argparse +import io +import re +import sys +import zlib + +from bytepack import unpack_uint32be, unpack_uint8 +from exifinfo import print_raw_exif_info + +_PNG_SIGNATURE = b"\x89PNG\x0d\x0a\x1a\x0a" +_PNG_CHUNK_SIZE_MAX = 0x7fffffff +_READ_DATA_SIZE_MAX = 0x3ffff + + +def print_error(msg): + """Print an error message to stderr.""" + sys.stderr.write("%s: error: %s\n" % (sys.argv[0], msg)) + + +def print_debug(msg): + """Print a debug message to stderr.""" + sys.stderr.write("%s: debug: %s\n" % (sys.argv[0], msg)) + + +def _check_png(condition, chunk_sig=None): + """Check a PNG-specific assertion.""" + if condition: + return + if chunk_sig is None: + raise RuntimeError("bad PNG data") + raise RuntimeError("bad PNG data in '%s'" % chunk_sig) + + +def _check_png_crc(data, checksum, chunk_sig): + """Check a CRC32 value inside a PNG stream.""" + if unpack_uint32be(data) == (checksum & 0xffffffff): + return + raise RuntimeError("bad PNG checksum in '%s'" % chunk_sig) + + +def _extract_png_exif(data, **kwargs): + """Extract the EXIF header and data from a PNG chunk.""" + debug = kwargs.get("debug", False) + if unpack_uint8(data, 0) == 0: + if debug: + print_debug("found compressed EXIF, compression method 0") + if (unpack_uint8(data, 1) & 0x0f) == 0x08: + data = zlib.decompress(data[1:]) + elif unpack_uint8(data, 1) == 0 \ + and (unpack_uint8(data, 5) & 0x0f) == 0x08: + if debug: + print_debug("found uncompressed-length EXIF field") + data_len = unpack_uint32be(data, 1) + data = zlib.decompress(data[5:]) + if data_len != len(data): + raise RuntimeError( + "incorrect uncompressed-length field in PNG EXIF") + else: + raise RuntimeError("invalid compression method in PNG EXIF") + if data.startswith(b"MM\x00\x2a") or data.startswith(b"II\x2a\x00"): + return data + raise RuntimeError("invalid TIFF/EXIF header in PNG EXIF") + + +def print_png_exif_info(instream, **kwargs): + """Print the EXIF information found in the given PNG datastream.""" + debug = kwargs.get("debug", False) + has_exif = False + while True: + chunk_hdr = instream.read(8) + _check_png(len(chunk_hdr) == 8) + chunk_len = unpack_uint32be(chunk_hdr, offset=0) + chunk_sig = chunk_hdr[4:8].decode("latin_1", errors="ignore") + _check_png(re.search(r"^[A-Za-z]{4}$", chunk_sig), chunk_sig=chunk_sig) + _check_png(chunk_len < _PNG_CHUNK_SIZE_MAX, chunk_sig=chunk_sig) + if debug: + print_debug("processing chunk: %s" % chunk_sig) + if chunk_len <= _READ_DATA_SIZE_MAX: + # The chunk size does not exceed an arbitrary, reasonable limit. + chunk_data = instream.read(chunk_len) + chunk_crc = instream.read(4) + _check_png(len(chunk_data) == chunk_len and len(chunk_crc) == 4, + chunk_sig=chunk_sig) + checksum = zlib.crc32(chunk_hdr[4:8]) + checksum = zlib.crc32(chunk_data, checksum) + _check_png_crc(chunk_crc, checksum, chunk_sig=chunk_sig) + else: + # The chunk is too big. Skip it. + instream.seek(chunk_len + 4, io.SEEK_CUR) + continue + if chunk_sig == "IEND": + _check_png(chunk_len == 0, chunk_sig=chunk_sig) + break + if chunk_sig.lower() in ["exif", "zxif"] and chunk_len > 8: + has_exif = True + exif_data = _extract_png_exif(chunk_data, **kwargs) + print_raw_exif_info(exif_data, **kwargs) + if not has_exif: + raise RuntimeError("no EXIF data in PNG stream") + + +def print_exif_info(file, **kwargs): + """Print the EXIF information found in the given file.""" + with open(file, "rb") as stream: + header = stream.read(4) + if header == _PNG_SIGNATURE[0:4]: + if stream.read(4) != _PNG_SIGNATURE[4:8]: + raise RuntimeError("corrupted PNG file") + print_png_exif_info(instream=stream, **kwargs) + elif header == b"II\x2a\x00" or header == b"MM\x00\x2a": + data = header + stream.read(_READ_DATA_SIZE_MAX) + print_raw_exif_info(data, **kwargs) + else: + raise RuntimeError("not a PNG file") + + +def main(): + """The main function.""" + parser = argparse.ArgumentParser( + prog="pngexifinfo", + usage="%(prog)s [options] [--] files...", + description="Show the PNG EXIF information.") + parser.add_argument("files", + metavar="file", + nargs="*", + help="a PNG file or a raw EXIF blob") + parser.add_argument("-x", + "--hex", + dest="hex", + action="store_true", + help="show EXIF tags in base 16") + parser.add_argument("-v", + "--verbose", + dest="verbose", + action="store_true", + help="run in verbose mode") + parser.add_argument("--debug", + dest="debug", + action="store_true", + help="run in debug mode") + args = parser.parse_args() + if not args.files: + parser.error("missing file operand") + result = 0 + for file in args.files: + try: + print_exif_info(file, + hex=args.hex, + debug=args.debug, + verbose=args.verbose) + except (IOError, OSError) as err: + print_error(str(err)) + result = 66 # os.EX_NOINPUT + except RuntimeError as err: + print_error("%s: %s" % (file, str(err))) + result = 69 # os.EX_UNAVAILABLE + parser.exit(result) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.stderr.write("INTERRUPTED\n") + sys.exit(130) # SIGINT diff --git a/contrib/pngminim/README b/contrib/pngminim/README index e17fe35b6a..51d5a3c230 100644 --- a/contrib/pngminim/README +++ b/contrib/pngminim/README @@ -1,4 +1,3 @@ - This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa to build minimal decoder, encoder, and progressive reader applications. diff --git a/contrib/pngminim/decoder/makefile b/contrib/pngminim/decoder/makefile index 4acf3c1779..bbacea4bb8 100644 --- a/contrib/pngminim/decoder/makefile +++ b/contrib/pngminim/decoder/makefile @@ -54,7 +54,7 @@ ZOBJS = adler32$(O) crc32$(O) \ PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \ pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \ pngset$(C) pngtrans$(C) - + # Standard headers PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h diff --git a/contrib/pngminus/.editorconfig b/contrib/pngminus/.editorconfig new file mode 100644 index 0000000000..8504b495ea --- /dev/null +++ b/contrib/pngminus/.editorconfig @@ -0,0 +1,29 @@ +# https://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = unset +indent_size = unset +indent_style = space +insert_final_newline = true +max_doc_length = 79 +max_line_length = 79 +trim_trailing_whitespace = true + +[*.[ch]] +indent_size = 2 +indent_style = space + +[CMakeLists.txt] +indent_size = 4 +indent_style = space +max_doc_length = 79 +max_line_length = 99 + +[{Makefile,makevms.com}] +indent_size = unset +indent_style = unset +max_doc_length = 79 +max_line_length = 99 diff --git a/contrib/pngminus/CHANGES.txt b/contrib/pngminus/CHANGES.txt index 85e590a4a2..b4b1a9a8b3 100644 --- a/contrib/pngminus/CHANGES.txt +++ b/contrib/pngminus/CHANGES.txt @@ -1,4 +1,3 @@ - pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file copyright (C) 1999-2019 by Willem van Schaik @@ -12,3 +11,4 @@ version 1.0 - 1999.10.15 - First version. 1.6 - 2018.08.05 - Improve portability and fix style (Cosmin Truta) 1.7 - 2019.01.22 - Change license to MIT (Willem van Schaik) 1.8 - 2024.01.09 - Fix, improve, modernize (Cosmin Truta) + 1.9 - 2025.01.10 - Delete conditionally-compiled code (Cosmin Truta) diff --git a/contrib/pngminus/CMakeLists.txt b/contrib/pngminus/CMakeLists.txt index d7893648a7..8d69b5e7a6 100644 --- a/contrib/pngminus/CMakeLists.txt +++ b/contrib/pngminus/CMakeLists.txt @@ -1,9 +1,9 @@ -# Copyright (c) 2018-2024 Cosmin Truta +# Copyright (c) 2018-2025 Cosmin Truta # # This software is released under the MIT license. For conditions of # distribution and use, see the LICENSE file part of this package. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.14) project(PNGMINUS C) diff --git a/contrib/pngminus/LICENSE.txt b/contrib/pngminus/LICENSE.txt index a8d4137280..6bdb4f8798 100644 --- a/contrib/pngminus/LICENSE.txt +++ b/contrib/pngminus/LICENSE.txt @@ -1,4 +1,3 @@ - pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file copyright (C) 1999-2019 by Willem van Schaik diff --git a/contrib/pngminus/README.txt b/contrib/pngminus/README.txt index f7f6ecb3a5..eb168c3d6e 100644 --- a/contrib/pngminus/README.txt +++ b/contrib/pngminus/README.txt @@ -53,7 +53,7 @@ program are some elementary routines to read / write pgm- and ppm-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 +The downside of this approach is that you cannot use them on images that require blocks of memory bigger than 64k (the DOS version). For larger images you will get an out-of-memory error. diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c index f9d5138b7e..3c47b91df5 100644 --- a/contrib/pngminus/png2pnm.c +++ b/contrib/pngminus/png2pnm.c @@ -66,7 +66,7 @@ int main (int argc, char *argv[]) if ((fp_al = fopen (argv[argi], "wb")) == NULL) { fname_al = argv[argi]; - fprintf (stderr, "PNM2PNG\n"); + fprintf (stderr, "PNG2PNM\n"); fprintf (stderr, "Error: cannot create alpha-channel file %s\n", argv[argi]); exit (1); @@ -235,22 +235,6 @@ BOOL do_png2pnm (png_struct *png_ptr, png_info *info_ptr, /* set up (if applicable) the expansion of grayscale images to bit-depth 8 */ png_set_expand_gray_1_2_4_to_8 (png_ptr); -#ifdef NJET - /* downgrade 16-bit images to 8-bit */ - if (bit_depth == 16) - 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) - png_set_gray_to_rgb (png_ptr); - /* if the PNG image has a gAMA chunk then gamma-correct the output image */ - { - double file_gamma; - if (png_get_gAMA (png_ptr, info_ptr, &file_gamma)) - png_set_gamma (png_ptr, (double) 2.2, file_gamma); - } -#endif - /* read the image file, with all of the above image transforms applied */ png_read_png (png_ptr, info_ptr, 0, NULL); diff --git a/contrib/pngsuite/README b/contrib/pngsuite/README index d236b02e7c..25f0f54fda 100644 --- a/contrib/pngsuite/README +++ b/contrib/pngsuite/README @@ -1,4 +1,3 @@ - pngsuite -------- Copyright (c) Willem van Schaik, 1999, 2011, 2012 diff --git a/contrib/pngsuite/interlaced/README b/contrib/pngsuite/interlaced/README index f171eee01a..296fffba6f 100644 --- a/contrib/pngsuite/interlaced/README +++ b/contrib/pngsuite/interlaced/README @@ -1,2 +1 @@ - These images fail the "pngimage-quick" and "pngimage-full" tests. diff --git a/contrib/testpngs/png-3/cicp-display-p3_reencoded.png b/contrib/testpngs/png-3/cicp-display-p3_reencoded.png new file mode 100644 index 0000000000..91d8e6bc48 Binary files /dev/null and b/contrib/testpngs/png-3/cicp-display-p3_reencoded.png differ diff --git a/contrib/tools/chkfmt.sh b/contrib/tools/chkfmt.sh deleted file mode 100755 index 8810aa7b5d..0000000000 --- a/contrib/tools/chkfmt.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh - -# chkfmt.sh -# -# 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. The author published this work -# from the United States. -# -# 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. - -script_name=`basename "$0"` - -verbose= -edit= -vers= -test "$1" = "-v" && { - shift - verbose=yes -} -test "$1" = "-e" && { - shift - if test -n "$EDITOR" - then - edit=yes - - # Copy the standard streams for the editor - exec 3>&0 4>&1 5>&2 - else - 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). -doed(){ - cp "$file" "$file".orig - "$EDITOR" "$file" 0>&3 1>&4 2>&5 3>&- 4>&- 5>&- || exit 1 - if cmp -s "$file".orig "$file" - then - rm "$file".orig - echo -n "$file: file not changed, type anything to continue: " >&5 - read ans 0>&3 - test -n "$ans" || return 1 - fi - 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, 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 "$script_name: checking version $vers" -fi -if test -z "$vers" -then - echo "$script_name: png.h not found, ignoring version number" >&2 -fi - -test -n "$1" || set -- . -find "$@" \( -type d \( -name '.git' -o -name '.libs' -o -name 'projects' \) \ - -prune \) -o \( -type f \ - ! -name '*.[oa]' ! -name '*.l[oa]' ! -name '*.png' ! -name '*.out' \ - ! -name '*.jpg' ! -name '*.patch' ! -name '*.obj' ! -name '*.exe' \ - ! -name '*.com' ! -name '*.tar.*' ! -name '*.zip' ! -name '*.ico' \ - ! -name '*.res' ! -name '*.rc' ! -name '*.mms' ! -name '*.rej' \ - ! -name '*.dsp' ! -name '*.orig' ! -name '*.dfn' ! -name '*.swp' \ - ! -name '~*' ! -name '*.3' \ - ! -name 'missing' ! -name 'mkinstalldirs' ! -name 'depcomp' \ - ! -name 'aclocal.m4' ! -name 'install-sh' ! -name 'Makefile.in' \ - ! -name 'ltmain.sh' ! -name 'config*' -print \) | { - st=0 - while read file - do - case "$file" in - *.mak|*[Mm]akefile.*|*[Mm]akefile) - # Makefiles require tabs, dependency lines can be this long. - check_tabs= - line_length=100;; - *.awk) - # Allow literal tabs. - check_tabs= - # Mainframe line printer, anyone? - line_length=132;; - */ci_*.sh) - check_tabs=yes - line_length=100;; - *contrib/*/*.[ch]) - check_tabs=yes - line_length=100;; - *) - check_tabs=yes - line_length=80;; - esac - - # Note that vers can only contain 0-9, . and a-z - if test -n "$vers" - then - sed -e "s/$vers/a.b.cc/g" "$file" >"$file".$$ - else - cp "$file" "$file".$$ - fi - splt="`fold -$line_length "$file".$$ | diff -c "$file".$$ -`" - rm "$file".$$ - - if test -n "$splt" - then - echo "$file: lines too long" - st=1 - if test -n "$EDITOR" -a -n "$edit" - then - doed "$file" || exit 1 - elif test -n "$verbose" - then - echo "$splt" - fi - fi - if test -n "$check_tabs" - then - tab="`tr -c -d '\t' <"$file"`" - if test -n "$tab" - then - echo "$file: file contains tab characters" - st=1 - if test -n "$EDITOR" -a -n "$edit" - then - doed "$file" || exit 1 - elif test -n "$verbose" - then - echo "$splt" - fi - fi - fi - done - exit $st -} diff --git a/contrib/tools/pngfix.c b/contrib/tools/pngfix.c index 8d5dc46c22..3c0e18fd8d 100644 --- a/contrib/tools/pngfix.c +++ b/contrib/tools/pngfix.c @@ -32,7 +32,7 @@ #endif #if PNG_LIBPNG_VER < 10603 /* 1.6.3 */ -# error "pngfix will not work with libpng prior to 1.6.3" +# error pngfix requires libpng version 1.6.3 or newer #endif #ifdef PNG_SETJMP_SUPPORTED @@ -68,7 +68,7 @@ #endif #ifndef PNG_MAXIMUM_INFLATE_WINDOW -# error "pngfix not supported in this libpng version" +# error pngfix requires libpng with PNG_MAXIMUM_INFLATE_WINDOW supported #endif #if ZLIB_VERNUM >= 0x1240 @@ -427,7 +427,7 @@ uarb_print(uarb num, int digits, FILE *out) * (Copied from contrib/libtests/pngvalid.c) */ static void -make_random_bytes(png_uint_32* seed, void* pv, size_t size) +make_random_bytes(png_uint_32 *seed, void *pv, size_t size) { png_uint_32 u0 = seed[0], u1 = seed[1]; png_bytep bytes = voidcast(png_bytep, pv); @@ -706,7 +706,6 @@ struct global static int global_end(struct global *global) { - int rc; IDAT_list_end(&global->idat_cache); @@ -1476,7 +1475,7 @@ calc_image_size(struct file *file) if (pw > 0) { - int digits; + int digits; /* calculate 1+((pw*pd+7)>>3) in row_bytes */ digits = uarb_mult_digit(row_bytes, uarb_set(row_bytes, 7), @@ -1498,7 +1497,7 @@ calc_image_size(struct file *file) case PNG_INTERLACE_NONE: { - int digits; + int digits; udigit row_width[2], row_bytes[3]; /* As above, but use image_width in place of the pass width: */ @@ -1569,7 +1568,7 @@ chunk_end(struct chunk **chunk_var) } static void -chunk_init(struct chunk * const chunk, struct file * const file) +chunk_init(struct chunk *chunk, struct file *file) /* When a chunk is initialized the file length/type/pos are copied into the * corresponding chunk fields and the new chunk is registered in the file * structure. There can only be one chunk at a time. @@ -1778,7 +1777,7 @@ IDAT_end(struct IDAT **idat_var) } static void -IDAT_init(struct IDAT * const idat, struct file * const file) +IDAT_init(struct IDAT *idat, struct file *file) /* When the chunk is png_IDAT instantiate an IDAT control structure in place * of a chunk control structure. The IDAT will instantiate a chunk control * structure using the file alloc routine. @@ -2492,7 +2491,7 @@ zlib_run(struct zlib *zlib) { struct IDAT_list *list = zlib->idat->idat_list_head; struct IDAT_list *last = zlib->idat->idat_list_tail; - int skip = 0; + int skip = 0; /* 'rewrite_offset' is the offset of the LZ data within the chunk, for * IDAT it should be 0: @@ -3848,11 +3847,11 @@ int main(int argc, const char **argv) { char temp_name[FILENAME_MAX+1]; - const char * prog = *argv; - const char * outfile = NULL; - const char * suffix = NULL; - const char * prefix = NULL; - int done = 0; /* if at least one file is processed */ + const char *prog = *argv; + const char *outfile = NULL; + const char *suffix = NULL; + const char *prefix = NULL; + int done = 0; /* if at least one file is processed */ struct global global; global_init(&global); diff --git a/contrib/visupng/.editorconfig b/contrib/visupng/.editorconfig new file mode 100644 index 0000000000..d5bcb53121 --- /dev/null +++ b/contrib/visupng/.editorconfig @@ -0,0 +1,23 @@ +# https://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = unset +indent_size = 4 +indent_style = space +insert_final_newline = true +max_doc_length = 80 +max_line_length = 100 +trim_trailing_whitespace = true + +[*.rc] +end_of_line = crlf +trim_trailing_whitespace = unset + +[*.ds[pw]] +end_of_line = crlf +max_doc_length = unset +max_line_length = unset +trim_trailing_whitespace = unset diff --git a/contrib/visupng/VisualPng.c b/contrib/visupng/VisualPng.c index 6f7b1dfe58..8c93e6b813 100644 --- a/contrib/visupng/VisualPng.c +++ b/contrib/visupng/VisualPng.c @@ -832,7 +832,7 @@ BOOL FillBitmap ( cxNewSize = cxWinSize - 2 * MARGIN; cyNewSize = cyWinSize - 2 * MARGIN; - /* stretch the image to it's window determined size */ + /* stretch the image to its window determined size */ /* the following two are mathematically the same, but the first * has side-effects because of rounding diff --git a/depcomp b/depcomp index 715e34311e..9f6725b9e0 100755 --- a/depcomp +++ b/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2018-03-07.03; # UTC +scriptversion=2025-06-18.21; # UTC -# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Copyright (C) 1999-2025 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 @@ -47,11 +47,13 @@ Environment variables: libtool Whether libtool is used (yes/no). Report bugs to . +GNU Automake home page: . +General help using GNU software: . EOF exit $? ;; -v | --v*) - echo "depcomp $scriptversion" + echo "depcomp (GNU Automake) $scriptversion" exit $? ;; esac @@ -113,7 +115,6 @@ nl=' # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then @@ -128,7 +129,7 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" -# Avoid interferences from the environment. +# Avoid interference from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We @@ -198,8 +199,8 @@ gcc3) ;; gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. +## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: @@ -783,9 +784,9 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/example.c b/example.c index 3465fbb372..6af8f6f90d 100644 --- a/example.c +++ b/example.c @@ -1,9 +1,8 @@ - #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng * - * Maintained 2018-2024 Cosmin Truta + * Maintained 2018-2025 Cosmin Truta * Maintained 1998-2016 Glenn Randers-Pehrson * Maintained 1996-1997 Andreas Dilger * Written 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -180,11 +179,11 @@ int main(int argc, const char **argv) * components. * * You do not have to read directly from a file. You can read from memory or, - * on systems that support it, from a 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. + * on systems that support , from a FILE object. This is controlled + * by the particular png_image_begin_read_from_ function you call at the start. + * Likewise, on write, you can write to a FILE object if your system supports + * . The macro PNG_STDIO_SUPPORTED indicates if stdio is available + * and accessible from 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 diff --git a/install-sh b/install-sh index 7c56c9c015..1d8d966964 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2023-11-23.18; # UTC +scriptversion=2025-06-18.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -170,7 +170,7 @@ while test $# -ne 0; do -T) is_target_a_directory=never;; - --version) echo "$0 $scriptversion"; exit $?;; + --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;; --) shift break;; @@ -345,7 +345,7 @@ do ' 0 # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directly in world-writable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && @@ -353,7 +353,7 @@ do exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. + # Check for POSIX incompatibility 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. @@ -533,9 +533,9 @@ do done # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # 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 d3c0fe9e2d..0f3c97a52c 100644 --- a/intel/filter_sse2_intrinsics.c +++ b/intel/filter_sse2_intrinsics.c @@ -1,4 +1,3 @@ - /* filter_sse2_intrinsics.c - SSE2 optimized filter functions * * Copyright (c) 2018 Cosmin Truta @@ -27,30 +26,39 @@ * whichever of a, b, or c is closest to p=a+b-c. */ -static __m128i load4(const void* p) { +static __m128i +load4(const void *p) +{ int tmp; memcpy(&tmp, p, sizeof(tmp)); return _mm_cvtsi32_si128(tmp); } -static void store4(void* p, __m128i v) { +static void +store4(void *p, __m128i v) +{ int tmp = _mm_cvtsi128_si32(v); memcpy(p, &tmp, sizeof(int)); } -static __m128i load3(const void* p) { +static __m128i +load3(const void *p) +{ png_uint_32 tmp = 0; memcpy(&tmp, p, 3); return _mm_cvtsi32_si128(tmp); } -static void store3(void* p, __m128i v) { +static void +store3(void *p, __m128i v) +{ 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, - png_const_bytep prev) +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. @@ -82,8 +90,9 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row, PNG_UNUSED(prev) } -void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row, - png_const_bytep prev) +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. @@ -107,8 +116,9 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row, PNG_UNUSED(prev) } -void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, - png_const_bytep prev) +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 @@ -120,7 +130,7 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, const __m128i zero = _mm_setzero_si128(); - __m128i b; + __m128i b; __m128i a, d = zero; png_debug(1, "in png_read_filter_row_avg3_sse2"); @@ -162,8 +172,9 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row, - png_const_bytep prev) +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 @@ -172,7 +183,7 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row, */ size_t rb; const __m128i zero = _mm_setzero_si128(); - __m128i b; + __m128i b; __m128i a, d = zero; png_debug(1, "in png_read_filter_row_avg4_sse2"); @@ -199,7 +210,9 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row, } /* Returns |x| for 16-bit lanes. */ -static __m128i abs_i16(__m128i x) { +static __m128i +abs_i16(__m128i x) +{ #if PNG_INTEL_SSE_IMPLEMENTATION >= 2 return _mm_abs_epi16(x); #else @@ -218,7 +231,9 @@ static __m128i abs_i16(__m128i x) { } /* Bytewise c ? t : e. */ -static __m128i if_then_else(__m128i c, __m128i t, __m128i 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 @@ -226,8 +241,9 @@ static __m128i if_then_else(__m128i c, __m128i t, __m128i e) { #endif } -void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row, - png_const_bytep prev) +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: @@ -325,8 +341,9 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row, - png_const_bytep prev) +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: diff --git a/intel/intel_init.c b/intel/intel_init.c index 2f8168b7c4..9e4610d25b 100644 --- a/intel/intel_init.c +++ b/intel/intel_init.c @@ -1,4 +1,3 @@ - /* intel_init.c - SSE2 optimized filter functions * * Copyright (c) 2018 Cosmin Truta diff --git a/libpng-manual.txt b/libpng-manual.txt index eb24ef4831..4413ce9901 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - Copyright (c) 2018-2024 Cosmin Truta + Copyright (c) 2018-2026 Cosmin Truta Copyright (c) 1998-2018 Glenn Randers-Pehrson This document is released under the libpng license. @@ -9,9 +9,9 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng version 1.6.36, December 2018, through 1.6.42 - January 2024 + libpng version 1.6.36, December 2018, through 1.6.58 - April 2026 Updated and distributed by Cosmin Truta - Copyright (c) 2018-2024 Cosmin Truta + Copyright (c) 2018-2026 Cosmin Truta libpng versions 0.97, January 1998, through 1.6.35 - July 2018 Updated and distributed by Glenn Randers-Pehrson @@ -65,18 +65,22 @@ Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -The PNG specification (second edition), November 2003, is available as +The PNG specification (Third Edition), June 2025, is available as +a W3C Recommendation at +. + +The PNG specification (Second Edition), November 2003, is available as a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at . The W3C and ISO documents have identical technical content. The PNG-1.2 specification is available at -. -It is technically equivalent -to the PNG specification (second edition) but has some additional material. +. +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 at - and as a + and as a W3C Recommendation at . Some additional chunks are described in the special-purpose public chunks @@ -1178,11 +1182,11 @@ where row_pointers is an array of pointers to the pixel data for each row: If you know your image size and pixel size ahead of time, you can allocate row_pointers prior to calling png_read_png() with - if (height > PNG_UINT_32_MAX/(sizeof (png_byte))) + if (height > PNG_UINT_32_MAX / (sizeof (png_bytep))) png_error(png_ptr, "Image is too tall to process in memory"); - if (width > PNG_UINT_32_MAX/pixel_size) + if (width > PNG_UINT_32_MAX / pixel_size) png_error(png_ptr, "Image is too wide to process in memory"); @@ -2314,7 +2318,7 @@ libpng provides two macros to help you in 1.5 and later versions: png_uint_32 height = PNG_PASS_ROWS(image_height, pass_number); Respectively these tell you the width and height of the sub-image -corresponding to the numbered pass. 'pass' is in in the range 0 to 6 - +corresponding to the numbered pass. 'pass' is in the range 0 to 6 - this can be confusing because the specification refers to the same passes as 1 to 7! Be careful, you must check both the width and height before calling png_read_rows() and not call it for that pass if either is zero. @@ -2453,7 +2457,7 @@ point to libpng-allocated storage with the following function: This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those cases do nothing. +by the user and not by libpng, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not -1, and multiple items are allowed for the data type identified in the mask, such as text or @@ -3288,7 +3292,7 @@ disclaimer until after, so viewers working over modem connections don't have to wait for the disclaimer to go over the modem before they start seeing the image. Finally, keywords should be full words, not abbreviations. Keywords and text are in the ISO 8859-1 -(Latin-1) character set (a superset of regular ASCII) and can not +(Latin-1) character set (a superset of regular ASCII) and cannot contain NUL characters, and should not contain control or other unprintable characters. To make the comments widely readable, stick with basic ASCII, and avoid machine specific character set extensions @@ -3351,19 +3355,6 @@ Here is an example of writing two private chunks, prVt and miNE: /* Needed because miNE is not safe-to-copy */ png_set_keep_unknown_chunks(png, PNG_HANDLE_CHUNK_ALWAYS, (png_bytep) "miNE", 1); - # if PNG_LIBPNG_VER < 10600 - /* Deal with unknown chunk location bug in 1.5.x and earlier */ - png_set_unknown_chunk_location(png, info, 0, PNG_HAVE_IHDR); - png_set_unknown_chunk_location(png, info, 1, PNG_AFTER_IDAT); - # endif - # if PNG_LIBPNG_VER < 10500 - /* PNG_AFTER_IDAT writes two copies of the chunk prior to libpng-1.5.0, - * one before IDAT and another after IDAT, so don't use it; only use - * PNG_HAVE_IHDR location. This call resets the location previously - * set by assignment and png_set_unknown_chunk_location() for chunk 1. - */ - png_set_unknown_chunk_location(png, info, 1, PNG_HAVE_IHDR); - # endif #endif The high-level write interface @@ -3703,7 +3694,7 @@ point to libpng-allocated storage with the following function: This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those cases do nothing. +by the user and not by libpng, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not -1, and multiple items are allowed for the data type identified in the mask, such as text or @@ -4089,7 +4080,7 @@ READ APIs is filled in from the PNG header in the file. int png_image_begin_read_from_stdio (png_imagep image, - FILE* file) + FILE *file) The PNG header is read from the stdio FILE object. @@ -4164,7 +4155,7 @@ be written: int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap) - Write the image to the given (FILE*). + Write the image to the given FILE object. With all write APIs if image is in one of the linear formats with (png_uint_16) data then setting convert_to_8_bit will cause the output to be @@ -5173,7 +5164,7 @@ a pre-existing bug where the per-chunk 'keep' setting is ignored, and makes it possible to skip IDAT chunks in the sequential reader. The machine-generated configure files are no longer included in branches -libpng16 and later of the GIT repository. They continue to be included +libpng17 and later of the GIT repository. They continue to be included in the tarball releases, however. Libpng-1.6.0 through 1.6.2 used the CMF bytes at the beginning of the IDAT diff --git a/libpng.3 b/libpng.3 index 57d06f2db6..8100402cc0 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "January 29, 2024" +.TH LIBPNG 3 "April 15, 2026" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.42 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.58 .SH SYNOPSIS \fB#include \fP @@ -223,7 +223,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.42 \fBint png_image_begin_read_from_file (png_imagep \fP\fIimage\fP\fB, const char \fI*file_name\fP\fB);\fP -\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE* \fIfile\fP\fB);\fP +\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, size_t \fIsize\fP\fB);\fP @@ -519,7 +519,7 @@ 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 - Copyright (c) 2018-2024 Cosmin Truta + Copyright (c) 2018-2026 Cosmin Truta Copyright (c) 1998-2018 Glenn Randers-Pehrson This document is released under the libpng license. @@ -528,9 +528,9 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng version 1.6.36, December 2018, through 1.6.42 - January 2024 + libpng version 1.6.36, December 2018, through 1.6.58 - April 2026 Updated and distributed by Cosmin Truta - Copyright (c) 2018-2024 Cosmin Truta + Copyright (c) 2018-2026 Cosmin Truta libpng versions 0.97, January 1998, through 1.6.35 - July 2018 Updated and distributed by Glenn Randers-Pehrson @@ -584,18 +584,22 @@ Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -The PNG specification (second edition), November 2003, is available as +The PNG specification (Third Edition), June 2025, is available as +a W3C Recommendation at +. + +The PNG specification (Second Edition), November 2003, is available as a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at . The W3C and ISO documents have identical technical content. The PNG-1.2 specification is available at -. -It is technically equivalent -to the PNG specification (second edition) but has some additional material. +. +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 at - and as a + and as a W3C Recommendation at . Some additional chunks are described in the special-purpose public chunks @@ -1697,11 +1701,11 @@ where row_pointers is an array of pointers to the pixel data for each row: If you know your image size and pixel size ahead of time, you can allocate row_pointers prior to calling png_read_png() with - if (height > PNG_UINT_32_MAX/(sizeof (png_byte))) + if (height > PNG_UINT_32_MAX / (sizeof (png_bytep))) png_error(png_ptr, "Image is too tall to process in memory"); - if (width > PNG_UINT_32_MAX/pixel_size) + if (width > PNG_UINT_32_MAX / pixel_size) png_error(png_ptr, "Image is too wide to process in memory"); @@ -2833,7 +2837,7 @@ libpng provides two macros to help you in 1.5 and later versions: png_uint_32 height = PNG_PASS_ROWS(image_height, pass_number); Respectively these tell you the width and height of the sub-image -corresponding to the numbered pass. 'pass' is in in the range 0 to 6 - +corresponding to the numbered pass. 'pass' is in the range 0 to 6 - this can be confusing because the specification refers to the same passes as 1 to 7! Be careful, you must check both the width and height before calling png_read_rows() and not call it for that pass if either is zero. @@ -2972,7 +2976,7 @@ point to libpng-allocated storage with the following function: This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those cases do nothing. +by the user and not by libpng, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not \-1, and multiple items are allowed for the data type identified in the mask, such as text or @@ -3807,7 +3811,7 @@ disclaimer until after, so viewers working over modem connections don't have to wait for the disclaimer to go over the modem before they start seeing the image. Finally, keywords should be full words, not abbreviations. Keywords and text are in the ISO 8859-1 -(Latin-1) character set (a superset of regular ASCII) and can not +(Latin-1) character set (a superset of regular ASCII) and cannot contain NUL characters, and should not contain control or other unprintable characters. To make the comments widely readable, stick with basic ASCII, and avoid machine specific character set extensions @@ -3870,19 +3874,6 @@ Here is an example of writing two private chunks, prVt and miNE: /* Needed because miNE is not safe-to-copy */ png_set_keep_unknown_chunks(png, PNG_HANDLE_CHUNK_ALWAYS, (png_bytep) "miNE", 1); - # if PNG_LIBPNG_VER < 10600 - /* Deal with unknown chunk location bug in 1.5.x and earlier */ - png_set_unknown_chunk_location(png, info, 0, PNG_HAVE_IHDR); - png_set_unknown_chunk_location(png, info, 1, PNG_AFTER_IDAT); - # endif - # if PNG_LIBPNG_VER < 10500 - /* PNG_AFTER_IDAT writes two copies of the chunk prior to libpng-1.5.0, - * one before IDAT and another after IDAT, so don't use it; only use - * PNG_HAVE_IHDR location. This call resets the location previously - * set by assignment and png_set_unknown_chunk_location() for chunk 1. - */ - png_set_unknown_chunk_location(png, info, 1, PNG_HAVE_IHDR); - # endif #endif .SS The high-level write interface @@ -4222,7 +4213,7 @@ point to libpng-allocated storage with the following function: This function may be safely called when the relevant storage has already been freed, or has not yet been allocated, or was allocated -by the user and not by libpng, and will in those cases do nothing. +by the user and not by libpng, and will in those cases do nothing. The "seq" parameter is ignored if only one item of the selected data type, such as PLTE, is allowed. If "seq" is not \-1, and multiple items are allowed for the data type identified in the mask, such as text or @@ -4608,7 +4599,7 @@ READ APIs is filled in from the PNG header in the file. int png_image_begin_read_from_stdio (png_imagep image, - FILE* file) + FILE *file) The PNG header is read from the stdio FILE object. @@ -4683,7 +4674,7 @@ be written: int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap) - Write the image to the given (FILE*). + Write the image to the given FILE object. With all write APIs if image is in one of the linear formats with (png_uint_16) data then setting convert_to_8_bit will cause the output to be @@ -5692,7 +5683,7 @@ a pre-existing bug where the per-chunk 'keep' setting is ignored, and makes it possible to skip IDAT chunks in the sequential reader. The machine-generated configure files are no longer included in branches -libpng16 and later of the GIT repository. They continue to be included +libpng17 and later of the GIT repository. They continue to be included in the tarball releases, however. Libpng-1.6.0 through 1.6.2 used the CMF bytes at the beginning of the IDAT diff --git a/libpngpf.3 b/libpngpf.3 index a469205030..4d486d7bdf 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,24 +1,17 @@ -.TH LIBPNGPF 3 "January 29, 2024" +.TH LIBPNGPF 3 "April 15, 2026" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.42 -(private functions) +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.58 .SH SYNOPSIS -\fB#include \fI"pngpriv.h" - -\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. +\fB#include "pngpriv.h"\fP .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. +As of libpng version 1.5.1, this manual is no longer maintained. The private +function prototypes, declared in private header files, should not be accessed +by applications. .SH "SEE ALSO" -.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5) +.BR "libpng"(3) .SH AUTHORS Cosmin Truta, Glenn Randers-Pehrson diff --git a/loongarch/.editorconfig b/loongarch/.editorconfig index b142d823b1..de2e98ab42 100644 --- a/loongarch/.editorconfig +++ b/loongarch/.editorconfig @@ -4,4 +4,5 @@ root = false # FIXME [*.[ch]] +max_doc_length = unset max_line_length = unset diff --git a/loongarch/filter_lsx_intrinsics.c b/loongarch/filter_lsx_intrinsics.c index af6cc763a0..8dc5319d56 100644 --- a/loongarch/filter_lsx_intrinsics.c +++ b/loongarch/filter_lsx_intrinsics.c @@ -102,8 +102,9 @@ out0 = __lsx_vadd_b(out0, _in3); \ } -void png_read_filter_row_up_lsx(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_up_lsx(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) { size_t n = row_info->rowbytes; png_bytep rp = row; @@ -165,8 +166,9 @@ void png_read_filter_row_up_lsx(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_sub3_lsx(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_sub3_lsx(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) { size_t n = row_info->rowbytes; png_uint_32 tmp; @@ -199,8 +201,9 @@ void png_read_filter_row_sub3_lsx(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_sub4_lsx(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_sub4_lsx(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) { size_t n = row_info->rowbytes; __m128i vec_0, vec_1; @@ -222,8 +225,9 @@ void png_read_filter_row_sub4_lsx(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_avg3_lsx(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_avg3_lsx(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) { size_t n = row_info->rowbytes; png_bytep nxt = row; @@ -275,8 +279,9 @@ void png_read_filter_row_avg3_lsx(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_avg4_lsx(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_avg4_lsx(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) { size_t n = row_info->rowbytes; __m128i vec_0, vec_1, vec_2; @@ -306,9 +311,9 @@ void png_read_filter_row_avg4_lsx(png_row_infop row_info, png_bytep row, } } -void png_read_filter_row_paeth3_lsx(png_row_infop row_info, - png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_paeth3_lsx(png_row_infop row_info, + png_bytep row, png_const_bytep prev_row) { size_t n = row_info->rowbytes; png_bytep nxt = row; @@ -371,9 +376,9 @@ void png_read_filter_row_paeth3_lsx(png_row_infop row_info, } } -void png_read_filter_row_paeth4_lsx(png_row_infop row_info, - png_bytep row, - png_const_bytep prev_row) +void +png_read_filter_row_paeth4_lsx(png_row_infop row_info, + png_bytep row, png_const_bytep prev_row) { size_t n = row_info->rowbytes; __m128i vec_a, vec_b, vec_c, vec_d; diff --git a/loongarch/loongarch_lsx_init.c b/loongarch/loongarch_lsx_init.c index 2c80fe81b6..7dde245519 100644 --- a/loongarch/loongarch_lsx_init.c +++ b/loongarch/loongarch_lsx_init.c @@ -17,7 +17,8 @@ #include #define LA_HWCAP_LSX (1<<4) -static int png_has_lsx(void) +static int +png_has_lsx(void) { int flags = 0; int flag = (int)getauxval(AT_HWCAP); diff --git a/ltmain.sh b/ltmain.sh index 2a50d7f6f7..3e6a3db3a5 100755 --- a/ltmain.sh +++ b/ltmain.sh @@ -2,11 +2,11 @@ ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.7 +# libtool (GNU libtool) 2.5.4 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2024 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.7 -package_revision=2.4.7 +VERSION=2.5.4 +package_revision=2.5.4 ## ------ ## @@ -72,11 +72,11 @@ scriptversion=2019-02-19.15; # UTC # 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 +# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license -# , and GPL version 2 or later -# . You must apply one of +# , and GPL version 2 or later +# . 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. @@ -143,7 +143,7 @@ nl=' ' IFS="$sp $nl" -# There are apparently some retarded systems that use ';' as a PATH separator! +# There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { @@ -589,7 +589,7 @@ func_require_term_colors () # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. + # usable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes @@ -739,7 +739,7 @@ eval 'func_dirname () # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. -# value retuned in "$func_basename_result" +# value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () @@ -897,7 +897,7 @@ func_mkdir_p () # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. + # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done @@ -1536,11 +1536,11 @@ func_lt_ver () # 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 +# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license -# , and GPL version 2 or later -# . You must apply one of +# , and GPL version 2 or later +# . 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. @@ -2215,7 +2215,30 @@ func_version () # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.7' +scriptversion='(GNU libtool) 2.5.4' + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + year=`date +%Y` + + cat < +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Originally written by Gordon Matzigkeit, 1996 +(See AUTHORS for complete contributor listing) +EOF + + exit $? +} # func_echo ARG... @@ -2238,18 +2261,6 @@ func_echo () } -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd - - $warning_func ${1+"$@"} -} - - ## ---------------- ## ## Options parsing. ## ## ---------------- ## @@ -2261,19 +2272,23 @@ usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information + --finish use operation '--mode=finish' + --mode=MODE use operation mode MODE + --no-finish don't update shared library cache + --no-quiet, --no-silent print default informational messages + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --reorder-cache=DIRS reorder shared library cache for preferred DIRS + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. @@ -2306,13 +2321,13 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.7 + version: $progname $scriptversion automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . -General help using GNU software: ." +GNU libtool home page: . +General help using GNU software: ." exit 0 } @@ -2502,8 +2517,11 @@ libtool_options_prep () opt_dry_run=false opt_help=false opt_mode= + opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false + opt_finishing=true + opt_warning= nonopt= preserve_args= @@ -2593,14 +2611,18 @@ libtool_parse_options () clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" + *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit - break ;; esac shift ;; + --no-finish) + opt_finishing=false + func_append preserve_args " $_G_opt" + ;; + --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" @@ -2616,6 +2638,24 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; + --reorder-cache) + opt_reorder_cache=true + shared_lib_dirs=$1 + if test -n "$shared_lib_dirs"; then + case $1 in + # Must begin with /: + /*) ;; + + # Catch anything else as an error (relative paths) + *) func_error "invalid argument '$1' for $_G_opt" + func_error "absolute paths are required for $_G_opt" + exit_cmd=exit + ;; + esac + fi + shift + ;; + --silent|--quiet) opt_quiet=: opt_verbose=false @@ -2652,6 +2692,18 @@ libtool_parse_options () func_add_hook func_parse_options libtool_parse_options +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + if $opt_warning; then + $debug_cmd + $warning_func ${1+"$@"} + fi +} + # libtool_validate_options [ARG]... # --------------------------------- @@ -2668,10 +2720,10 @@ libtool_validate_options () # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in + case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -3003,7 +3055,7 @@ EOF # func_convert_core_file_wine_to_w32 ARG # Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. # @@ -3035,9 +3087,10 @@ func_convert_core_file_wine_to_w32 () # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. +# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. Assumes ARG has no leading or trailing path separator +# characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. @@ -3180,6 +3233,15 @@ func_convert_path_front_back_pathsep () # end func_convert_path_front_back_pathsep +# func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER +# Replaces a delimiter for a given path. +func_convert_delimited_path () +{ + converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` +} +# end func_convert_delimited_path + + ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## @@ -3514,6 +3576,65 @@ func_dll_def_p () } +# func_reorder_shared_lib_cache DIRS +# Reorder the shared library cache by unconfiguring previous shared library cache +# and configuring preferred search directories before previous search directories. +# Previous shared library cache: /usr/lib /usr/local/lib +# Preferred search directories: /tmp/testing +# Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib +func_reorder_shared_lib_cache () +{ + $debug_cmd + + case $host_os in + openbsd*) + get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` + func_convert_delimited_path "$get_search_directories" ':' '\ ' + save_search_directories=$converted_path + func_convert_delimited_path "$1" ':' '\ ' + + # Ensure directories exist + for dir in $converted_path; do + # Ensure each directory is an absolute path + case $dir in + /*) ;; + *) func_error "Directory '$dir' is not an absolute path" + exit $EXIT_FAILURE ;; + esac + # Ensure no trailing slashes + func_stripname '' '/' "$dir" + dir=$func_stripname_result + if test -d "$dir"; then + if test -n "$preferred_search_directories"; then + preferred_search_directories="$preferred_search_directories $dir" + else + preferred_search_directories=$dir + fi + else + func_error "Directory '$dir' does not exist" + exit $EXIT_FAILURE + fi + done + + PATH="$PATH:/sbin" ldconfig -U $save_search_directories + PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories + get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` + func_convert_delimited_path "$get_search_directories" ':' '\ ' + reordered_search_directories=$converted_path + + $ECHO "Original: $save_search_directories" + $ECHO "Reordered: $reordered_search_directories" + exit $EXIT_SUCCESS + ;; + *) + func_error "--reorder-cache is not supported for host_os=$host_os." + exit $EXIT_FAILURE + ;; + esac +} +# end func_reorder_shared_lib_cache + + # func_mode_compile arg... func_mode_compile () { @@ -3692,7 +3813,7 @@ func_mode_compile () # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) + cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac @@ -4086,6 +4207,12 @@ if $opt_help; then fi +# If option '--reorder-cache', reorder the shared library cache and exit. +if $opt_reorder_cache; then + func_reorder_shared_lib_cache $shared_lib_dirs +fi + + # func_mode_execute arg... func_mode_execute () { @@ -4270,7 +4397,7 @@ func_mode_finish () fi fi - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -4295,6 +4422,12 @@ func_mode_finish () for libdir in $libdirs; do $ECHO " $libdir" done + if test "false" = "$opt_finishing"; then + echo + echo "NOTE: finish_cmds were not executed during testing, so you must" + echo "manually run ldconfig to add a given test directory, LIBDIR, to" + echo "the search path for generated executables." + fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" @@ -4531,8 +4664,15 @@ func_mode_install () func_append dir "$objdir" if test -n "$relink_command"; then + # Strip any trailing slash from the destination. + func_stripname '' '/' "$libdir" + destlibdir=$func_stripname_result + + func_stripname '' '/' "$destdir" + s_destdir=$func_stripname_result + # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -4569,7 +4709,7 @@ func_mode_install () 'exit $?' tstripme=$stripme case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= @@ -4682,7 +4822,7 @@ func_mode_install () # Do a test to see if this is really a libtool program. case $host in - *cygwin* | *mingw*) + *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result @@ -4910,7 +5050,7 @@ extern \"C\" { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; @@ -4922,7 +5062,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -4936,7 +5076,7 @@ extern \"C\" { func_basename "$dlprefile" name=$func_basename_result case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" @@ -4962,8 +5102,16 @@ extern \"C\" { eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + case $host in + i[3456]86-*-mingw32*) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + ;; + *) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" + ;; + esac } else # not an import lib $opt_dry_run || { @@ -5111,7 +5259,7 @@ static const void *lt_preloaded_setup() { # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` @@ -5187,7 +5335,7 @@ func_win32_libid () *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || @@ -5454,7 +5602,7 @@ func_extract_archives () # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw +# incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. @@ -5462,7 +5610,7 @@ func_extract_archives () # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific +# the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { @@ -5587,7 +5735,7 @@ func_exec_program_core () " case $host in # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) + *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 @@ -5655,7 +5803,7 @@ func_exec_program () file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done - # Usually 'no', except on cygwin/mingw when embedded into + # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then @@ -5787,7 +5935,7 @@ EOF #endif #include #include -#ifdef _MSC_VER +#if defined _WIN32 && !defined __GNUC__ # include # include # include @@ -5812,7 +5960,7 @@ EOF /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ -int _putenv (const char *); +_CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ @@ -6010,7 +6158,7 @@ main (int argc, char *argv[]) { EOF case $host in - *mingw* | *cygwin* ) + *mingw* | *windows* | *cygwin* ) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; @@ -6029,7 +6177,7 @@ EOF { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then + have already dealt with, above (including dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll @@ -6113,7 +6261,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" { char* p; @@ -6155,7 +6303,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); @@ -6574,7 +6722,7 @@ lt_update_lib_path (const char *name, const char *value) EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). @@ -6749,7 +6897,7 @@ func_mode_link () $debug_cmd case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra @@ -6773,6 +6921,7 @@ func_mode_link () finalize_command=$nonopt compile_rpath= + compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= @@ -6813,10 +6962,12 @@ func_mode_link () xrpath= perm_rpath= temp_rpath= + temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= + rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile @@ -7079,7 +7230,7 @@ func_mode_link () case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) - func_fatal_error "only absolute run-paths are allowed" + func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then @@ -7255,7 +7406,7 @@ func_mode_link () ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; @@ -7275,7 +7426,7 @@ func_mode_link () -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -7283,7 +7434,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* | *-*-midnightbsd*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7303,7 +7454,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7326,7 +7477,8 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) + # -q