mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
95 Commits
master
...
v1.7.0beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
936a3e8308 | ||
|
|
fc447311aa | ||
|
|
8e30e43587 | ||
|
|
0403ccf1de | ||
|
|
1a321cc088 | ||
|
|
c9f99f487b | ||
|
|
8360e60abc | ||
|
|
2799f74489 | ||
|
|
7363babe4f | ||
|
|
e3a526f789 | ||
|
|
8f0935b8dc | ||
|
|
ae6503fe0e | ||
|
|
851a6265a8 | ||
|
|
ffa24d4108 | ||
|
|
206f4d2678 | ||
|
|
bb040784c2 | ||
|
|
70e1af50ed | ||
|
|
eb4a645eda | ||
|
|
9f7f03a3c4 | ||
|
|
395ddbd318 | ||
|
|
9f0d36c85f | ||
|
|
e9760e5e95 | ||
|
|
b96b2b7e90 | ||
|
|
9bb705e0a8 | ||
|
|
e860f77393 | ||
|
|
b5a7565908 | ||
|
|
e88e221d91 | ||
|
|
b10867cdc2 | ||
|
|
bf7084b80d | ||
|
|
6afcee826f | ||
|
|
f15a5006c8 | ||
|
|
cdbd5174bd | ||
|
|
7a9b6203ef | ||
|
|
803493e19c | ||
|
|
4245e6b1b2 | ||
|
|
81892f6b90 | ||
|
|
862993827d | ||
|
|
d304125332 | ||
|
|
9124f3e29a | ||
|
|
2969375aa6 | ||
|
|
5e8ba1cbbf | ||
|
|
8aee43d10a | ||
|
|
e355657bbe | ||
|
|
fb6ba9acf4 | ||
|
|
815173a0b5 | ||
|
|
7f489a77bb | ||
|
|
8ec8e8fcd5 | ||
|
|
a4e606dd5f | ||
|
|
646de7962b | ||
|
|
4accd423c2 | ||
|
|
f62caaf4dc | ||
|
|
b789bb84bb | ||
|
|
ce60ad642b | ||
|
|
ab097b1168 | ||
|
|
3a737d86c7 | ||
|
|
a1337e57a8 | ||
|
|
247b3fcf49 | ||
|
|
f01273b25c | ||
|
|
8cb1a2ac6d | ||
|
|
e6e5ac8cb7 | ||
|
|
a4798fb83e | ||
|
|
46369f35c5 | ||
|
|
e699993d70 | ||
|
|
5a0afcfa63 | ||
|
|
3fc9cbf126 | ||
|
|
36b628b19e | ||
|
|
2c31365fd4 | ||
|
|
e1e3c1a2a2 | ||
|
|
b940e5dc5d | ||
|
|
fbbbc620b8 | ||
|
|
9b99600c4d | ||
|
|
3129d7426e | ||
|
|
325ceea971 | ||
|
|
ac39fc3024 | ||
|
|
99343407e6 | ||
|
|
3e23f45ba9 | ||
|
|
72389dec42 | ||
|
|
1f0853f47e | ||
|
|
32a60a4885 | ||
|
|
5e07dc6970 | ||
|
|
4b90a8d416 | ||
|
|
d59c19b64c | ||
|
|
bbabd977d1 | ||
|
|
0cf9c7d63d | ||
|
|
b4e241559e | ||
|
|
1e15aee6be | ||
|
|
d59e60d0fb | ||
|
|
ec1d13a1d4 | ||
|
|
d9002f94cb | ||
|
|
1fa858db48 | ||
|
|
0f2a5bac64 | ||
|
|
eac85878bf | ||
|
|
240ac287eb | ||
|
|
3e42c81193 | ||
|
|
ac3b4d9b69 |
@@ -1,81 +0,0 @@
|
|||||||
version: 1.6.x-{build}
|
|
||||||
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /libpng[0-1][0-8]/
|
|
||||||
- /v[0-1][.][0-8][.][0-9]+/
|
|
||||||
|
|
||||||
image:
|
|
||||||
- Visual Studio 2022
|
|
||||||
|
|
||||||
shallow_clone: true
|
|
||||||
|
|
||||||
environment:
|
|
||||||
matrix:
|
|
||||||
- TOOLCHAIN: vstudio
|
|
||||||
AUTOMATION: cmake
|
|
||||||
ARCH: x86
|
|
||||||
- TOOLCHAIN: vstudio
|
|
||||||
AUTOMATION: cmake
|
|
||||||
ARCH: x64
|
|
||||||
- TOOLCHAIN: vstudio
|
|
||||||
AUTOMATION: cmake
|
|
||||||
ARCH: arm64
|
|
||||||
- TOOLCHAIN: llvm
|
|
||||||
AUTOMATION: cmake
|
|
||||||
ARCH: x64
|
|
||||||
- TOOLCHAIN: msys2
|
|
||||||
AUTOMATION: cmake
|
|
||||||
ARCH: i686
|
|
||||||
- TOOLCHAIN: msys2
|
|
||||||
AUTOMATION: cmake
|
|
||||||
ARCH: x86_64
|
|
||||||
- TOOLCHAIN: msys2
|
|
||||||
AUTOMATION: configure
|
|
||||||
ARCH: i686
|
|
||||||
- TOOLCHAIN: msys2
|
|
||||||
AUTOMATION: configure
|
|
||||||
ARCH: x86_64
|
|
||||||
- TOOLCHAIN: msys2
|
|
||||||
AUTOMATION: makefiles
|
|
||||||
ARCH: i686
|
|
||||||
- TOOLCHAIN: msys2
|
|
||||||
AUTOMATION: makefiles
|
|
||||||
ARCH: x86_64
|
|
||||||
|
|
||||||
install:
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
|
|
||||||
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
|
|
||||||
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
|
|
||||||
- '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'
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
|
|
||||||
- 'if "%TOOLCHAIN%"=="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'
|
|
||||||
- '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'
|
|
||||||
- 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
|
||||||
- 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
|
||||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
|
||||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
|
|
||||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'
|
|
||||||
|
|
||||||
cache:
|
|
||||||
- 'C:\tools\vcpkg\installed'
|
|
||||||
- 'C:\msys64\var\cache\pacman'
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
# 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
|
|
||||||
# <tab_size> 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 <fractional_tab_policy>
|
|
||||||
use_tabchars: false
|
|
||||||
|
|
||||||
# If <use_tabchars> 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
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
# https://editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.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_doc_length = 80
|
|
||||||
max_line_length = 80
|
|
||||||
|
|
||||||
[*.awk]
|
|
||||||
indent_size = 3
|
|
||||||
indent_style = space
|
|
||||||
max_doc_length = 80
|
|
||||||
max_line_length = 100
|
|
||||||
|
|
||||||
[*.cmake]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
max_doc_length = 80
|
|
||||||
max_line_length = 100
|
|
||||||
|
|
||||||
[*.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
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"Disable": {
|
|
||||||
"IndentSize": true
|
|
||||||
},
|
|
||||||
"Exclude": [
|
|
||||||
".git/",
|
|
||||||
"out/"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
31
.github/workflows/lint.yml
vendored
31
.github/workflows/lint.yml
vendored
@@ -1,31 +0,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
|
|
||||||
159
.gitignore
vendored
159
.gitignore
vendored
@@ -1,159 +0,0 @@
|
|||||||
# Prerequisites
|
|
||||||
*.d
|
|
||||||
|
|
||||||
# Precompiled headers
|
|
||||||
*.gch
|
|
||||||
*.pch
|
|
||||||
|
|
||||||
# Object files
|
|
||||||
*.slo
|
|
||||||
*.lo
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
|
|
||||||
# Linker output files
|
|
||||||
*.exp
|
|
||||||
*.ilk
|
|
||||||
*.map
|
|
||||||
|
|
||||||
# Compiled dynamic libraries
|
|
||||||
*.dll
|
|
||||||
*.dylib
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
|
|
||||||
# Compiled static libraries
|
|
||||||
*.a
|
|
||||||
*.la
|
|
||||||
*.lai
|
|
||||||
*.lib
|
|
||||||
|
|
||||||
# Compiled executables
|
|
||||||
*.app/
|
|
||||||
*.exe
|
|
||||||
a.out
|
|
||||||
|
|
||||||
# Debug files
|
|
||||||
*.dSYM/
|
|
||||||
*.idb
|
|
||||||
*.pdb
|
|
||||||
*.su
|
|
||||||
|
|
||||||
# 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
|
|
||||||
.vs/
|
|
||||||
### Visual Studio user files
|
|
||||||
*.rsuser
|
|
||||||
*.sln.docstates
|
|
||||||
*.suo
|
|
||||||
*.user
|
|
||||||
*.userprefs
|
|
||||||
### Visual Studio cache files (for older versions)
|
|
||||||
*.aps
|
|
||||||
*.ncb
|
|
||||||
*.opensdf
|
|
||||||
*.sdf
|
|
||||||
*.VC.db
|
|
||||||
*.VC.opendb
|
|
||||||
ipch/
|
|
||||||
## Visual Studio Code
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
## (Various)
|
|
||||||
*.*cache
|
|
||||||
*.cache*
|
|
||||||
[._]*_history
|
|
||||||
.history/
|
|
||||||
[Bb]ackup*/
|
|
||||||
|
|
||||||
# Build, test and CI output directories
|
|
||||||
*[Dd]ebug/
|
|
||||||
[Dd]ebug*/
|
|
||||||
*[Rr]elease/
|
|
||||||
[Rr]elease*/
|
|
||||||
[._]build*/
|
|
||||||
/[Bb]uild*/
|
|
||||||
/[Oo]ut/
|
|
||||||
|
|
||||||
# Libpng configuration and auxiliary build artifacts
|
|
||||||
*.out
|
|
||||||
*out.png
|
|
||||||
[._]deps/
|
|
||||||
[._]libs/
|
|
||||||
.dirstamp
|
|
||||||
/Makefile
|
|
||||||
/autom4te.cache/
|
|
||||||
/config*~
|
|
||||||
/config.h
|
|
||||||
/config.log
|
|
||||||
/config.status
|
|
||||||
/install*~
|
|
||||||
/libpng*-config
|
|
||||||
/libpng*.pc
|
|
||||||
/libpng.vers
|
|
||||||
/libtool
|
|
||||||
/stamp-h1
|
|
||||||
CMake*.json
|
|
||||||
!CMakePresets.json
|
|
||||||
CMakeLists.txt.*
|
|
||||||
pnglibconf.[ch]
|
|
||||||
pnglibconf.dfn
|
|
||||||
pnglibconf.pre
|
|
||||||
pngprefix.h
|
|
||||||
|
|
||||||
# Libpng test programs, scripts and artifacts
|
|
||||||
/test-suite.log
|
|
||||||
/tests/*.log
|
|
||||||
/tests/*.trs
|
|
||||||
/png-fix-itxt
|
|
||||||
/pngcp
|
|
||||||
/pngfix
|
|
||||||
/pngimage
|
|
||||||
/pngstest
|
|
||||||
/pngtest
|
|
||||||
/pngunknown
|
|
||||||
/pngvalid
|
|
||||||
/timepng
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
extends: default
|
|
||||||
rules:
|
|
||||||
document-start: disable
|
|
||||||
document-end: disable
|
|
||||||
line-length: disable
|
|
||||||
truthy:
|
|
||||||
check-keys: false
|
|
||||||
223
ANNOUNCE
223
ANNOUNCE
@@ -1,53 +1,202 @@
|
|||||||
libpng 1.6.51.git
|
|
||||||
=================
|
|
||||||
|
|
||||||
This is a development version, not intended to be a public release.
|
Libpng 1.7.0beta04 - February 27, 2013
|
||||||
It will be replaced by a public release, or by another development
|
|
||||||
version, at a later time.
|
|
||||||
|
|
||||||
|
This is not intended to be a public release. It will be replaced
|
||||||
|
within a few weeks by a public version or by another test version.
|
||||||
|
|
||||||
libpng 1.6.50 - July 1, 2025
|
Files available for download:
|
||||||
============================
|
|
||||||
|
|
||||||
This is a public release of libpng, intended for use in production code.
|
Source files with LF line endings (for Unix/Linux) and with a
|
||||||
|
"configure" script
|
||||||
|
|
||||||
|
1.7.0beta04.tar.xz (LZMA-compressed, recommended)
|
||||||
|
1.7.0beta04.tar.gz
|
||||||
|
|
||||||
Files available for download
|
Source files with CRLF line endings (for Windows), without the
|
||||||
----------------------------
|
"configure" script
|
||||||
|
|
||||||
Source files with LF line endings (for Unix/Linux):
|
lp170b04.7z (LZMA-compressed, recommended)
|
||||||
|
lp170b04.zip
|
||||||
* libpng-1.6.50.tar.xz (LZMA-compressed, recommended)
|
|
||||||
* libpng-1.6.50.tar.gz (deflate-compressed)
|
|
||||||
|
|
||||||
Source files with CRLF line endings (for Windows):
|
|
||||||
|
|
||||||
* lpng1650.7z (LZMA-compressed, recommended)
|
|
||||||
* lpng1650.zip (deflate-compressed)
|
|
||||||
|
|
||||||
Other information:
|
Other information:
|
||||||
|
|
||||||
* README.md
|
1.7.0beta04-README.txt
|
||||||
* LICENSE.md
|
1.7.0beta04-LICENSE.txt
|
||||||
* AUTHORS.md
|
|
||||||
* TRADEMARK.md
|
|
||||||
|
|
||||||
|
Changes since the last public release (1.6.0):
|
||||||
|
|
||||||
Changes from version 1.6.49 to version 1.6.50
|
Version 1.7.0alpha01 [December 15, 2012]
|
||||||
---------------------------------------------
|
Started 1.7.0 branch from libpng-1.6.0beta33.
|
||||||
|
Made 8-bit compose and rgb_to_grayscale accuracy improvements. These
|
||||||
|
changes cause 16-bit arithmetic to be used for 8-bit data in the gamma
|
||||||
|
corrected compose and grayscale operations. The arithmetic errors have
|
||||||
|
three sources all of which are fixed in this commit:
|
||||||
|
1) 8-bit linear calculations produce massive errors for lower intensity
|
||||||
|
values.
|
||||||
|
2) The old 16-bit "16 to 8" gamma table code erroneously wrote the lowest
|
||||||
|
output value into a table entry which corresponded to multiple output
|
||||||
|
values (so where the value written should have been the closest to the
|
||||||
|
transformed input value.)
|
||||||
|
3) In a number of cases the code to access the 16-bit table did not round;
|
||||||
|
it did a simple shift, which was wrong and made the side effects of (2)
|
||||||
|
even worse.
|
||||||
|
The new gamma code does not have the 16-to-8 problem at the cost of slightly
|
||||||
|
more calculations and the algorithm used to minimize the number of
|
||||||
|
calculations has been extended to all the 16-bit tables; it has advantages
|
||||||
|
for any significant gamma correction.
|
||||||
|
Rearranged png_struct, remove unused members, change png_set_filter handling
|
||||||
|
png_struct members rearranged - partly to reorder to avoid packing, partly
|
||||||
|
to put frequently accessed members at the start and partly to make
|
||||||
|
the grouping more clear. png_set_filter code has been rewritten and the
|
||||||
|
code shared with png_write_start_row moved to a common function. Comments
|
||||||
|
in png.h have been made more clear. Minor fixes to
|
||||||
|
contrib/libtests/timepng.c and some of the png_*_tRNS logic, including
|
||||||
|
more error detection in png_set_tRNS.
|
||||||
|
Cleaned up USER_LIMITS feature, removing members from png_struct when not
|
||||||
|
required.
|
||||||
|
Rearranged ARM-NEON optimizations to isolate the machine specific code to
|
||||||
|
the hardware subdirectory, and add comments to pngrutil.c so that
|
||||||
|
implementors of other optimizations will know what to do.
|
||||||
|
Fixed cases of unquoted DESTDIR in Makefile.am.
|
||||||
|
Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
|
||||||
|
|
||||||
* Improved the detection of the RVV Extension on the RISC-V platform.
|
Version 1.7.0alpha02 [December 17, 2012]
|
||||||
(Contributed by Filip Wasil)
|
Removed functions that were deprecated in libpng-1.6.0:
|
||||||
* Replaced inline ASM with C intrinsics in the RVV code.
|
png_reset_zstream(), png_info_init_3(), and png_data_freer() and its
|
||||||
(Contributed by Filip Wasil)
|
associated flags.
|
||||||
* Fixed a decoder defect in which unknown chunks trailing IDAT, set
|
Removed some duplicated lines from contrib/tools/scale.c and png.c.
|
||||||
to go through the unknown chunk handler, incorrectly triggered
|
Changed some instances of png_warning() to png_app_error().
|
||||||
out-of-place IEND errors.
|
Updated some left over "1.6.0beta32" in code sources.
|
||||||
(Contributed by John Bowler)
|
Fixed a "png_structp" prototype (should be png_structrp) in arm_init.c
|
||||||
* Fixed the CMake file for cross-platform builds that require `libm`.
|
Updated the version-number hack in pngvalid.c
|
||||||
|
|
||||||
|
Version 1.7.0alpha03 [December 19, 2012]
|
||||||
|
Cleaned up and enhanced the configure option; libpng now correctly
|
||||||
|
links and tests against zlib with a prefix; tests have been clarified; and
|
||||||
|
irrelevant or obsolete things (as defined by the autotools man page) have
|
||||||
|
been removed.
|
||||||
|
Documented new PNG_ABORT behavior in the manual and commentary in pngerror.c
|
||||||
|
Cleaned up whitespace in the synopsis portion of the manpage "libpng.3"
|
||||||
|
Fixed previous support for Z_PREFIX in configure builds, corrected sCAL APIs;
|
||||||
|
some of these use floating point arithmetic so they need to be disabled if
|
||||||
|
floating point arithmetic is switched off. This is a quiet API change -
|
||||||
|
previously it appeared that the APIs were supported if fixed point
|
||||||
|
arithmetic was used internally, however they required certain APIs (floor,
|
||||||
|
modf, frexp, atof) that are part of C floating point support. Changed
|
||||||
|
png_fixed and the gamma code specific version of the same to avoid floor(),
|
||||||
|
which may be a library function (not an intrinsic). Removed unused #if 0
|
||||||
|
code.
|
||||||
|
Disassembled the version number in scripts/options.awk (necessary for
|
||||||
|
building on SunOs).
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
Version 1.7.0alpha04 [December 23, 2012]
|
||||||
Subscription is required; visit
|
Added scripts/makefile.msys contributed by Christopher M. Wheeler
|
||||||
|
Made default Zlib compression settings be configurable. This adds #defines to
|
||||||
|
pnglibconf.h to control the defaults.
|
||||||
|
Fixed Windows build issues, enabled ARM compilation. Various warnings issued
|
||||||
|
by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old
|
||||||
|
GCCs.) ARM support is enabled by default in zlib.props (unsupported by
|
||||||
|
Microsoft) and ARM compilation is made possible by deleting the check for
|
||||||
|
x86. The test programs cannot be run because they are not signed.
|
||||||
|
|
||||||
|
Version 1.7.0alpha05 [December 24, 2012]
|
||||||
|
Discontinued distributing libpng-1.x.x.tar.bz2.
|
||||||
|
Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
|
||||||
|
|
||||||
|
Version 1.7.0alpha06 [January 1, 2013]
|
||||||
|
Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
|
||||||
|
|
||||||
|
Version 1.7.0alpha07 [January 10, 2013]
|
||||||
|
Fixed conceivable but difficult to repro overflow. Also added two test
|
||||||
|
programs to generate and test a PNG which should have the problem.
|
||||||
|
|
||||||
|
Version 1.7.0alpha08 [January 17, 2013]
|
||||||
|
Corrected previous attempt at overflow detection in png_set_unknown_chunks().
|
||||||
|
|
||||||
|
Version 1.7.0alpha09 [January 21, 2013]
|
||||||
|
Pulled changes to multi-chunk handling from libpng-1.6.0beta40.
|
||||||
|
|
||||||
|
Version 1.7.0alpha10 [February 5, 2013]
|
||||||
|
Make symbol prefixing work with the ARM neon optimizations. Also
|
||||||
|
allow pngpriv.h to be included for preprocessor definitions only, so
|
||||||
|
it can be used in non-C/C++ files.
|
||||||
|
Added png_get_palette_max() function.
|
||||||
|
Changed png_size_t to size_t throughout headers, make sRGB check numbers
|
||||||
|
consistent.
|
||||||
|
Fixed ARM support (Mans Rullgard).
|
||||||
|
Removed stray out-of-order #endif and #ifdef (Mans Rullgard).
|
||||||
|
Ported libpng 1.5 options.awk/dfn file handling to 1.7, fixed one bug.
|
||||||
|
Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.13.
|
||||||
|
Minor fixes to assembler changes, verified with a dummy .S file
|
||||||
|
Removed cc -E workround, corrected png_get_palette_max API. Tested on
|
||||||
|
SUN OS cc 5.9, which demonstrates the tokenization problem previously
|
||||||
|
avoided by using /lib/cpp. Since all .dfn output is now protected
|
||||||
|
in double quotes unless it is to be macro substituted the fix should work
|
||||||
|
everywhere.
|
||||||
|
|
||||||
|
Version 1.7.0beta01 [February 15, 2013]
|
||||||
|
Enable parallel tests and rearrange TESTS order to take advantage of
|
||||||
|
the massive speed improvements use a make capable of parallel builds
|
||||||
|
on a multi-CPU machine and pass the right arguments to make (-j10000
|
||||||
|
for GNU make) to get the build to run in parallel.
|
||||||
|
Fixed previous support for Z_PREFIX in configure builds, corrected
|
||||||
|
sCAL APIs; some of these use floating point arithmetic so need to be
|
||||||
|
disabled if floating point arithmetic is switched off. This is a quiet API
|
||||||
|
change - previously it appeared that the APIs were supported if fixed point
|
||||||
|
arithmetic was used internally, however they required certain APIs (floor,
|
||||||
|
modf, frexp, atof) that are part of C floating point support. Changed
|
||||||
|
png_fixed and the gamma code specific version of the same to avoid floor(),
|
||||||
|
which may be a library function (not an intrinsic). Removed unused #if 0
|
||||||
|
code.
|
||||||
|
Fixed make distcheck to skip over the test result files. They were
|
||||||
|
being included because the whole of the 'tests' directory is included,
|
||||||
|
fixed to just include the actual test files and tests/pngstest. Also
|
||||||
|
reverted the previous erroneous change to remove the ${srcdir} from the
|
||||||
|
front of contrib, scripts, projects and added an explanation of what is
|
||||||
|
going on to Makefile.am
|
||||||
|
Fixed missing dependency in --prefix builds. The intermediate
|
||||||
|
internal 'prefix.h' file can only be generated correctly after pnglibconf.h,
|
||||||
|
however the dependency was not in Makefile.am. The symptoms are
|
||||||
|
unpredictable depending on the order make chooses to build pngprefix.h and
|
||||||
|
pnglibconf.h, often the error goes unnoticed because there is a system
|
||||||
|
pnglibconf.h to use instead.
|
||||||
|
Accept "," as a separator in pnglibconf.dfa and allow for
|
||||||
|
continuation lines. This adds to the syntax of "option" and "chunk" lines,
|
||||||
|
allowing the elements to be separated by a "," at the end of an element and
|
||||||
|
interpreting a "," at end of line as a continuation - so the following line
|
||||||
|
is read. The new syntax is optional and solely provided for readability.
|
||||||
|
Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED
|
||||||
|
block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.
|
||||||
|
|
||||||
|
Version 1.7.0beta02 [February 18, 2013]
|
||||||
|
Fixed a race condition in the creation of the build 'scripts' directory
|
||||||
|
while building with a parallel make.
|
||||||
|
Use approved/supported Android method to check for NEON, use Linux/POSIX
|
||||||
|
1003.1 API to check /proc/self/auxv avoiding buffer allocation and other
|
||||||
|
library calls (ported from libpng15).
|
||||||
|
Use parentheses more consistently in "#if defined(MACRO)" tests.
|
||||||
|
Folded long lines.
|
||||||
|
|
||||||
|
Version 1.7.0beta03 [February 22, 2013]
|
||||||
|
Reenabled code to allow zero length PLTE chunks for MNG.
|
||||||
|
Fixed ALIGNED_MEMORY support.
|
||||||
|
Allow run-time ARM NEON checking to be disabled. A new configure option:
|
||||||
|
--enable-arm-neon=always will stop the run-time checks. New checks
|
||||||
|
within arm/arm_init.c will cause the code not to be compiled unless
|
||||||
|
__ARM_NEON__ is set. This should make it fail safe (if someone asks
|
||||||
|
for it on then the build will fail if it can't be done.)
|
||||||
|
Updated the INSTALL document.
|
||||||
|
|
||||||
|
Version 1.7.0beta04 [February 27, 2013]
|
||||||
|
Revised INSTALL to recommend using CPPFLAGS instead of INCLUDES.
|
||||||
|
Revised scripts/makefile.freebsd to respect ZLIBDIR and ZLIBINC.
|
||||||
|
Revised scripts/dfn.awk to work with the buggy MSYS awk that has trouble
|
||||||
|
with CRLF line endings.
|
||||||
|
|
||||||
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
|
(subscription required; visit
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
to subscribe.
|
to subscribe)
|
||||||
|
or to glennrp at users.sourceforge.net
|
||||||
|
|
||||||
|
Glenn R-P
|
||||||
|
|||||||
66
AUTHORS
66
AUTHORS
@@ -1,66 +0,0 @@
|
|||||||
PNG REFERENCE LIBRARY AUTHORS
|
|
||||||
=============================
|
|
||||||
|
|
||||||
This is the list of PNG Reference Library ("libpng") Contributing
|
|
||||||
Authors, for copyright and licensing purposes.
|
|
||||||
|
|
||||||
* Adam Richter
|
|
||||||
* Andreas Dilger
|
|
||||||
* Chris Blume
|
|
||||||
* Cosmin Truta
|
|
||||||
* Dave Martindale
|
|
||||||
* Eric S. Raymond
|
|
||||||
* Gilles Vollant
|
|
||||||
* Glenn Randers-Pehrson
|
|
||||||
* Greg Roelofs
|
|
||||||
* Guy Eric Schalnat
|
|
||||||
* James Yu
|
|
||||||
* John Bowler
|
|
||||||
* Kevin Bracey
|
|
||||||
* Lucas Chollet
|
|
||||||
* Magnus Holmgren
|
|
||||||
* Mandar Sahastrabuddhe
|
|
||||||
* Manfred Schlaegl
|
|
||||||
* Mans Rullgard
|
|
||||||
* Matt Sarett
|
|
||||||
* Mike Klein
|
|
||||||
* Pascal Massimino
|
|
||||||
* Paul Schmidt
|
|
||||||
* Philippe Antoine
|
|
||||||
* Qiang Zhou
|
|
||||||
* Sam Bushell
|
|
||||||
* Samuel Williams
|
|
||||||
* Simon-Pierre Cadieux
|
|
||||||
* Tim Wegner
|
|
||||||
* Tom Lane
|
|
||||||
* Tom Tanner
|
|
||||||
* Vadim Barkov
|
|
||||||
* Willem van Schaik
|
|
||||||
* Zhijie Liang
|
|
||||||
* Apple Inc.
|
|
||||||
- Zixu Wang (王子旭)
|
|
||||||
* Arm Holdings
|
|
||||||
- Richard Townsend
|
|
||||||
* Google LLC
|
|
||||||
- Dan Field
|
|
||||||
- Dragoș Tiselice
|
|
||||||
- Leon Scroggins III
|
|
||||||
- Matt Sarett
|
|
||||||
- Mike Klein
|
|
||||||
- Sami Boukortt
|
|
||||||
- Wan-Teh Chang
|
|
||||||
* Loongson Technology Corporation Ltd.
|
|
||||||
- GuXiWei (顾希伟)
|
|
||||||
- JinBo (金波)
|
|
||||||
- ZhangLixia (张利霞)
|
|
||||||
* Samsung Group
|
|
||||||
- Filip Wasil
|
|
||||||
|
|
||||||
The build projects, the build scripts, the test scripts, and other
|
|
||||||
files in the "projects", "scripts" and "tests" directories, have
|
|
||||||
other copyright owners, but are released under the libpng license.
|
|
||||||
|
|
||||||
Some files in the "ci" and "contrib" directories, as well as some
|
|
||||||
of the tools-generated files that are distributed with libpng, have
|
|
||||||
other copyright owners, and are released under other open source
|
|
||||||
licenses.
|
|
||||||
1345
CMakeLists.txt
1345
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
419
INSTALL
419
INSTALL
@@ -1,27 +1,5 @@
|
|||||||
Installing libpng
|
|
||||||
|
|
||||||
Contents
|
Installing libpng
|
||||||
|
|
||||||
I. Simple installation
|
|
||||||
II. Rebuilding the configure scripts
|
|
||||||
III. Using scripts/makefile*
|
|
||||||
IV. Using cmake
|
|
||||||
V. Directory structure
|
|
||||||
VI. Building with project files
|
|
||||||
VII. Building with makefiles
|
|
||||||
VIII. Configuring libpng for 16-bit platforms
|
|
||||||
IX. Configuring for DOS
|
|
||||||
X. Configuring for Medium Model
|
|
||||||
XI. Prepending a prefix to exported symbols
|
|
||||||
XII. Configuring for compiler xxx:
|
|
||||||
XIII. Removing unwanted object code
|
|
||||||
XIV. Enabling or disabling hardware optimizations
|
|
||||||
XV. Changes to the build and configuration of libpng in libpng-1.5.x
|
|
||||||
XVI. Setjmp/longjmp issues
|
|
||||||
XVII. Common linking failures
|
|
||||||
XVIII. Other sources of information about libpng
|
|
||||||
|
|
||||||
I. Simple installation
|
|
||||||
|
|
||||||
On Unix/Linux and similar systems, you can simply type
|
On Unix/Linux and similar systems, you can simply type
|
||||||
|
|
||||||
@@ -29,28 +7,13 @@ On Unix/Linux and similar systems, you can simply type
|
|||||||
make check
|
make check
|
||||||
make install
|
make install
|
||||||
|
|
||||||
and ignore the rest of this document. "/path" is the path to the directory
|
and ignore the rest of this document.
|
||||||
where you want to install the libpng "lib", "include", and "bin"
|
|
||||||
subdirectories.
|
|
||||||
|
|
||||||
If you downloaded a GIT clone, you will need to run ./autogen.sh before
|
|
||||||
running ./configure, to create "configure" and "Makefile.in" which are
|
|
||||||
not included in the GIT repository.
|
|
||||||
|
|
||||||
Note that "configure" is only included in the "*.tar" distributions and not
|
|
||||||
in the "*.zip" or "*.7z" distributions. If you downloaded one of those
|
|
||||||
distributions, see "Building with project files" or "Building with makefiles",
|
|
||||||
below.
|
|
||||||
|
|
||||||
II. Rebuilding the configure scripts
|
|
||||||
|
|
||||||
If configure does not work on your system, or if you have a need to
|
If configure does not work on your system, or if you have a need to
|
||||||
change configure.ac or Makefile.am, and you have a reasonably
|
change configure.ac or Makefile.am, and you have a reasonably
|
||||||
up-to-date set of tools, running ./autogen.sh in a git clone before
|
up-to-date set of tools, running ./autogen.sh in a git clone before
|
||||||
running ./configure may fix the problem. To be really sure that you
|
running ./configure may fix the problem. To be really sure that you
|
||||||
aren't using any of the included pre-built scripts, especially if you
|
aren't using any of the included pre-built scripts, you can do this:
|
||||||
are building from a tar distribution instead of a git distribution,
|
|
||||||
do this:
|
|
||||||
|
|
||||||
./configure --enable-maintainer-mode
|
./configure --enable-maintainer-mode
|
||||||
make maintainer-clean
|
make maintainer-clean
|
||||||
@@ -61,12 +24,9 @@ do this:
|
|||||||
make install
|
make install
|
||||||
make check
|
make check
|
||||||
|
|
||||||
III. Using scripts/makefile*
|
|
||||||
|
|
||||||
Instead, you can use one of the custom-built makefiles in the
|
Instead, you can use one of the custom-built makefiles in the
|
||||||
"scripts" directory
|
"scripts" directory
|
||||||
|
|
||||||
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
|
|
||||||
cp scripts/makefile.system makefile
|
cp scripts/makefile.system makefile
|
||||||
make test
|
make test
|
||||||
make install
|
make install
|
||||||
@@ -78,8 +38,8 @@ Or you can use one of the "projects" in the "projects" directory.
|
|||||||
|
|
||||||
Before installing libpng, you must first install zlib, if it
|
Before installing libpng, you must first install zlib, if it
|
||||||
is not already on your system. zlib can usually be found
|
is not already on your system. zlib can usually be found
|
||||||
wherever you got libpng; otherwise go to https://zlib.net/. You can
|
wherever you got libpng. zlib can be placed in another directory,
|
||||||
place zlib in the same directory as libpng or in another directory.
|
at the same level as libpng.
|
||||||
|
|
||||||
If your system already has a preinstalled zlib you will still need
|
If your system already has a preinstalled zlib you will still need
|
||||||
to have access to the zlib.h and zconf.h include files that
|
to have access to the zlib.h and zconf.h include files that
|
||||||
@@ -90,18 +50,14 @@ standard library search path, put ZLIBLIB, ZLIBINC, CPPFLAGS, LDFLAGS,
|
|||||||
and LD_LIBRARY_PATH in your environment before running "make test"
|
and LD_LIBRARY_PATH in your environment before running "make test"
|
||||||
or "make distcheck":
|
or "make distcheck":
|
||||||
|
|
||||||
ZLIBLIB=/path/to/lib export ZLIBLIB
|
ZLIBLIB=/path/to/lib export ZLIBLIB
|
||||||
ZLIBINC=/path/to/include export ZLIBINC
|
ZLIBINC=/path/to/include export ZLIBINC
|
||||||
CPPFLAGS="-I$ZLIBINC" export CPPFLAGS
|
CPPFLAGS="-I$ZLIBINC" export CPPFLAGS
|
||||||
LDFLAGS="-L$ZLIBLIB" export LDFLAGS
|
LDFLAGS="-L$ZLIBLIB" export LDFLAGS
|
||||||
LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
|
LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
|
||||||
|
|
||||||
If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
|
If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
|
||||||
in your environment and type
|
in your environment and type "make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test".
|
||||||
|
|
||||||
make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test
|
|
||||||
|
|
||||||
IV. Using cmake
|
|
||||||
|
|
||||||
If you want to use "cmake" (see www.cmake.org), type
|
If you want to use "cmake" (see www.cmake.org), type
|
||||||
|
|
||||||
@@ -109,15 +65,9 @@ If you want to use "cmake" (see www.cmake.org), type
|
|||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
As when using the simple configure method described above, "/path" points to
|
|
||||||
the installation directory where you want to put the libpng "lib", "include",
|
|
||||||
and "bin" subdirectories.
|
|
||||||
|
|
||||||
V. Directory structure
|
|
||||||
|
|
||||||
You can rename the directories that you downloaded (they
|
You can rename the directories that you downloaded (they
|
||||||
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.8"
|
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.7"
|
||||||
or "zlib128") so that you have directories called "zlib" and "libpng".
|
or "zlib127") so that you have directories called "zlib" and "libpng".
|
||||||
|
|
||||||
Your directory structure should look like this:
|
Your directory structure should look like this:
|
||||||
|
|
||||||
@@ -125,20 +75,24 @@ Your directory structure should look like this:
|
|||||||
libpng (this directory)
|
libpng (this directory)
|
||||||
INSTALL (this file)
|
INSTALL (this file)
|
||||||
README
|
README
|
||||||
*.h, *.c => libpng source files
|
*.h
|
||||||
|
*.c
|
||||||
CMakeLists.txt => "cmake" script
|
CMakeLists.txt => "cmake" script
|
||||||
ci
|
|
||||||
ci_*.sh
|
|
||||||
configuration files:
|
configuration files:
|
||||||
configure.ac, configure, Makefile.am, Makefile.in,
|
configure.ac, configure, Makefile.am, Makefile.in,
|
||||||
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
|
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
|
||||||
libpng-config.in, aclocal.m4, config.h.in, config.sub,
|
libpng-config.in, aclocal.m4, config.h.in, config.sub,
|
||||||
depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
|
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
|
||||||
contrib
|
contrib
|
||||||
arm-neon, conftest, examples, gregbook, libtests, pngminim,
|
gregbook
|
||||||
pngminus, pngsuite, tools, visupng, riscv-rvv
|
libtests
|
||||||
|
pngminim
|
||||||
|
pngminus
|
||||||
|
pngsuite
|
||||||
|
visupng
|
||||||
projects
|
projects
|
||||||
owatcom, visualc71, vstudio
|
visualc71
|
||||||
|
vstudio
|
||||||
scripts
|
scripts
|
||||||
makefile.*
|
makefile.*
|
||||||
*.def (module definition files)
|
*.def (module definition files)
|
||||||
@@ -146,35 +100,29 @@ Your directory structure should look like this:
|
|||||||
pngtest.png
|
pngtest.png
|
||||||
etc.
|
etc.
|
||||||
zlib
|
zlib
|
||||||
README, *.h, *.c, contrib, etc.
|
README
|
||||||
|
*.h
|
||||||
|
*.c
|
||||||
|
contrib
|
||||||
|
etc.
|
||||||
|
|
||||||
If the line endings in the files look funny, you may wish to get the other
|
If the line endings in the files look funny, you may wish to get the other
|
||||||
distribution of libpng. It is available in both tar.gz (UNIX style line
|
distribution of libpng. It is available in both tar.gz (UNIX style line
|
||||||
endings) and zip (DOS style line endings) formats.
|
endings) and zip (DOS style line endings) formats.
|
||||||
|
|
||||||
VI. Building with project files
|
If you are building libpng with MSVC, you can enter the
|
||||||
|
libpng projects\visualc6 or visualc71 directory and follow the instructions
|
||||||
|
in README.txt.
|
||||||
|
|
||||||
If you are building libpng with Microsoft Visual Studio, you can enter
|
Otherwise enter the zlib directory and follow the instructions in zlib/README,
|
||||||
the directory projects\visualc71 or projects\vstudio and follow the
|
then come back here and run "configure" or choose the appropriate
|
||||||
instructions in README.txt.
|
makefile.sys in the scripts directory.
|
||||||
|
|
||||||
Otherwise, enter the zlib directory and follow the instructions in
|
|
||||||
zlib/README, then come back here and run "configure" or choose the
|
|
||||||
appropriate makefile in the scripts directory.
|
|
||||||
|
|
||||||
VII. Building with makefiles
|
|
||||||
|
|
||||||
Copy the file (or files) that you need from the
|
Copy the file (or files) that you need from the
|
||||||
scripts directory into this directory, for example
|
scripts directory into this directory, for example
|
||||||
|
|
||||||
UNIX example:
|
MSDOS example: copy scripts\makefile.msc makefile
|
||||||
|
UNIX example: cp scripts/makefile.std makefile
|
||||||
cp scripts/makefile.std Makefile
|
|
||||||
make
|
|
||||||
|
|
||||||
Windows example:
|
|
||||||
|
|
||||||
nmake -f scripts\makefile.vcwin32
|
|
||||||
|
|
||||||
Read the makefile to see if you need to change any source or
|
Read the makefile to see if you need to change any source or
|
||||||
target directories to match your preferences.
|
target directories to match your preferences.
|
||||||
@@ -191,277 +139,32 @@ test. For more confidence, you can run another test by typing
|
|||||||
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
|
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
|
||||||
your output with the result shown in contrib/pngsuite/README.
|
your output with the result shown in contrib/pngsuite/README.
|
||||||
|
|
||||||
Most of the makefiles used to allow you to run "make install" to put
|
Most of the makefiles will allow you to run "make install" to
|
||||||
the library in its final resting place, but that feature is no longer
|
put the library in its final resting place (if you want to
|
||||||
supported. The only tested and supported manners to install libpng are
|
do that, run "make install" in the zlib directory first if necessary).
|
||||||
the conventional build and install procedures driven by the configure
|
Some also allow you to run "make test-installed" after you have
|
||||||
script or by the CMake file.
|
run "make install".
|
||||||
|
|
||||||
VIII. Configuring for DOS and other 16-bit platforms
|
|
||||||
|
|
||||||
Officially, the support for 16-bit platforms has been removed.
|
|
||||||
|
|
||||||
For DOS users who only have access to the lower 640K, you will
|
|
||||||
have to limit zlib's memory usage via a png_set_compression_mem_level()
|
|
||||||
call. See zlib.h or zconf.h in the zlib library for more information.
|
|
||||||
|
|
||||||
You may be or may not be in luck if you target the "large" memory model,
|
|
||||||
but all the smaller models ("small", "compact" and "medium") are known
|
|
||||||
to be unworkable. For DOS users who have access beyond the lower 640K,
|
|
||||||
a "flat" 32-bit DOS model (such as DJGPP) is strongly recommended.
|
|
||||||
|
|
||||||
For DOS users who only have access to the lower 640K, you will have to
|
|
||||||
limit zlib's memory usage via a png_set_compression_mem_level() call.
|
|
||||||
You will also have to look into zconf.h to tell zlib (and thus libpng)
|
|
||||||
that it cannot allocate more than 64K at a time. Even if you can, the
|
|
||||||
memory won't be accessible. Therefore, you should limit zlib and libpng
|
|
||||||
to 64K by defining MAXSEG_64K.
|
|
||||||
|
|
||||||
IX. Prepending a prefix to exported symbols
|
|
||||||
|
|
||||||
Starting with libpng-1.6.0, you can configure libpng (when using the
|
|
||||||
"configure" script) to prefix all exported symbols by means of the
|
|
||||||
configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
|
|
||||||
string beginning with a letter and containing only uppercase
|
|
||||||
and lowercase letters, digits, and the underscore (i.e., a C language
|
|
||||||
identifier). This creates a set of macros in pnglibconf.h, so this is
|
|
||||||
transparent to applications; their function calls get transformed by
|
|
||||||
the macros to use the modified names.
|
|
||||||
|
|
||||||
X. Configuring for compiler xxx:
|
|
||||||
|
|
||||||
All includes for libpng are in pngconf.h. If you need to add, change
|
|
||||||
or delete an include, this is the place to do it.
|
|
||||||
The includes that are not needed outside libpng are placed in pngpriv.h,
|
|
||||||
which is only used by the routines inside libpng itself.
|
|
||||||
The files in libpng proper only include pngpriv.h and png.h, which
|
|
||||||
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
|
|
||||||
As of libpng-1.5.0, pngpriv.h also includes three other private header
|
|
||||||
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
|
|
||||||
that previously appeared in the public headers.
|
|
||||||
|
|
||||||
XI. Removing unwanted object code
|
|
||||||
|
|
||||||
There are a bunch of #define's in pngconf.h that control what parts of
|
|
||||||
libpng are compiled. All the defines end in _SUPPORTED. If you are
|
|
||||||
never going to use a capability, you can change the #define to #undef
|
|
||||||
before recompiling libpng and save yourself code and data space, or
|
|
||||||
you can turn off individual capabilities with defines that begin with
|
|
||||||
"PNG_NO_".
|
|
||||||
|
|
||||||
In libpng-1.5.0 and later, the #define's are in pnglibconf.h instead.
|
|
||||||
|
|
||||||
You can also turn all of the transforms and ancillary chunk capabilities
|
|
||||||
off en masse with compiler directives that define
|
|
||||||
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
|
|
||||||
or all four, along with directives to turn on any of the capabilities that
|
|
||||||
you do want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the
|
|
||||||
extra transformations but still leave the library fully capable of reading
|
|
||||||
and writing PNG files with all known public chunks. Use of the
|
|
||||||
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
|
|
||||||
that is incapable of reading or writing ancillary chunks. If you are
|
|
||||||
not using the progressive reading capability, you can turn that off
|
|
||||||
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
|
|
||||||
capability, which you'll still have).
|
|
||||||
|
|
||||||
All the reading and writing specific code are in separate files, so the
|
|
||||||
linker should only grab the files it needs. However, if you want to
|
|
||||||
make sure, or if you are building a stand alone library, all the
|
|
||||||
reading files start with "pngr" and all the writing files start with "pngw".
|
|
||||||
The files that don't match either (like png.c, pngtrans.c, etc.)
|
|
||||||
are used for both reading and writing, and always need to be included.
|
|
||||||
The progressive reader is in pngpread.c
|
|
||||||
|
|
||||||
If you are creating or distributing a dynamically linked library (a .so
|
|
||||||
or DLL file), you should not remove or disable any parts of the library,
|
|
||||||
as this will cause applications linked with different versions of the
|
|
||||||
library to fail if they call functions not available in your library.
|
|
||||||
The size of the library itself should not be an issue, because only
|
|
||||||
those sections that are actually used will be loaded into memory.
|
|
||||||
|
|
||||||
XII. Enabling or disabling hardware optimizations
|
|
||||||
|
|
||||||
Certain hardware capabilities, such as the Intel SSE instructions,
|
|
||||||
are normally detected at run time. Enable them with configure options
|
|
||||||
such as one of
|
|
||||||
|
|
||||||
--enable-arm-neon=yes
|
|
||||||
--enable-mips-msa=yes
|
|
||||||
--enable-intel-sse=yes
|
|
||||||
--enable-powerpc-vsx=yes
|
|
||||||
--enable-riscv-rvv=yes
|
|
||||||
|
|
||||||
or enable them all at once with
|
|
||||||
|
|
||||||
--enable-hardware-optimizations=yes
|
|
||||||
|
|
||||||
or, if you are not using "configure", you can use one
|
|
||||||
or more of
|
|
||||||
|
|
||||||
CPPFLAGS += "-DPNG_ARM_NEON"
|
|
||||||
CPPFLAGS += "-DPNG_MIPS_MSA"
|
|
||||||
CPPFLAGS += "-DPNG_INTEL_SSE"
|
|
||||||
CPPFLAGS += "-DPNG_POWERPC_VSX"
|
|
||||||
CPPFLAGS += "-DPNG_RISCV_RVV"
|
|
||||||
|
|
||||||
See for example scripts/makefile.linux-opt
|
|
||||||
|
|
||||||
If you wish to avoid using them,
|
|
||||||
you can disable them via the configure option
|
|
||||||
|
|
||||||
--disable-hardware-optimizations
|
|
||||||
|
|
||||||
to disable them all, or
|
|
||||||
|
|
||||||
--enable-intel-sse=no
|
|
||||||
|
|
||||||
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_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_RISCV_RVV=no
|
|
||||||
|
|
||||||
or disable them all at once with
|
|
||||||
|
|
||||||
cmake . -DPNG_HARDWARE_OPTIMIZATIONS=no
|
|
||||||
|
|
||||||
XIII. Changes to the build and configuration of libpng in libpng-1.5.x
|
|
||||||
|
|
||||||
Details of internal changes to the library code can be found in the CHANGES
|
|
||||||
file and in the GIT repository logs. These will be of no concern to the vast
|
|
||||||
majority of library users or builders; however, the few who configure libpng
|
|
||||||
to a non-default feature set may need to change how this is done.
|
|
||||||
|
|
||||||
There should be no need for library builders to alter build scripts if
|
|
||||||
these use the distributed build support - configure or the makefiles -
|
|
||||||
however, users of the makefiles may care to update their build scripts
|
|
||||||
to build pnglibconf.h where the corresponding makefile does not do so.
|
|
||||||
|
|
||||||
Building libpng with a non-default configuration has changed completely.
|
|
||||||
The old method using pngusr.h should still work correctly even though the
|
|
||||||
way pngusr.h is used in the build has been changed; however, library
|
|
||||||
builders will probably want to examine the changes to take advantage of
|
|
||||||
new capabilities and to simplify their build system.
|
|
||||||
|
|
||||||
A. Specific changes to library configuration capabilities
|
|
||||||
|
|
||||||
The exact mechanism used to control attributes of API functions has
|
|
||||||
changed. A single set of operating system independent macro definitions
|
|
||||||
is used and operating system specific directives are defined in
|
|
||||||
pnglibconf.h
|
|
||||||
|
|
||||||
As part of this the mechanism used to choose procedure call standards on
|
|
||||||
those systems that allow a choice has been changed. At present this only
|
|
||||||
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
|
|
||||||
running on Intel processors. As before, PNGAPI is defined where required
|
|
||||||
to control the exported API functions; however, two new macros, PNGCBAPI
|
|
||||||
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
|
|
||||||
(PNGCAPI) for functions that must match a C library prototype (currently
|
|
||||||
only png_longjmp_ptr, which must match the C longjmp function.) The new
|
|
||||||
approach is documented in pngconf.h
|
|
||||||
|
|
||||||
Despite these changes, libpng 1.5.0 only supports the native C function
|
|
||||||
calling standard on those platforms tested so far ("__cdecl" on Microsoft
|
|
||||||
Windows). This is because the support requirements for alternative
|
|
||||||
calling conventions seem to no longer exist. Developers who find it
|
|
||||||
necessary to set PNG_API_RULE to 1 should advise the mailing list
|
|
||||||
(png-mng-implement) of this and library builders who use Openwatcom and
|
|
||||||
therefore set PNG_API_RULE to 2 should also contact the mailing list.
|
|
||||||
|
|
||||||
B. Changes to the configuration mechanism
|
|
||||||
|
|
||||||
Prior to libpng-1.5.0 library builders who needed to configure libpng
|
|
||||||
had either to modify the exported pngconf.h header file to add system
|
|
||||||
specific configuration or had to write feature selection macros into
|
|
||||||
pngusr.h and cause this to be included into pngconf.h by defining
|
|
||||||
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
|
|
||||||
application built without PNG_USER_CONFIG defined would see the
|
|
||||||
unmodified, default, libpng API and thus would probably fail to link.
|
|
||||||
|
|
||||||
These mechanisms still work in the configure build and in any makefile
|
|
||||||
build that builds pnglibconf.h, although the feature selection macros
|
|
||||||
have changed somewhat as described above. In 1.5.0, however, pngusr.h is
|
|
||||||
processed only once, at the time the exported header file pnglibconf.h is
|
|
||||||
built. pngconf.h no longer includes pngusr.h; therefore, pngusr.h is ignored
|
|
||||||
after the build of pnglibconf.h and it is never included in an application
|
|
||||||
build.
|
|
||||||
|
|
||||||
The formerly used alternative of adding a list of feature macros to the
|
|
||||||
CPPFLAGS setting in the build also still works; however, the macros will be
|
|
||||||
copied to pnglibconf.h and this may produce macro redefinition warnings
|
|
||||||
when the individual C files are compiled.
|
|
||||||
|
|
||||||
All configuration now only works if pnglibconf.h is built from
|
|
||||||
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
|
|
||||||
(the original author of awk) maintains C source code of that awk and this
|
|
||||||
and all known later implementations (often called by subtly different
|
|
||||||
names - nawk and gawk for example) are adequate to build pnglibconf.h.
|
|
||||||
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
|
|
||||||
and does not work; this may also apply to other systems that have a
|
|
||||||
functioning awk called 'nawk'.
|
|
||||||
|
|
||||||
Configuration options are now documented in scripts/pnglibconf.dfa. This
|
|
||||||
file also includes dependency information that ensures a configuration is
|
|
||||||
consistent; that is, if a feature is switched off, dependent features are
|
|
||||||
also switched off. As a recommended alternative to using feature macros in
|
|
||||||
pngusr.h a system builder may also define equivalent options in pngusr.dfa
|
|
||||||
(or, indeed, any file) and add that to the configuration by setting
|
|
||||||
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
|
|
||||||
how to do this, and also illustrate a case where pngusr.h is still required.
|
|
||||||
|
|
||||||
After you have built libpng, the definitions that were recorded in
|
|
||||||
pnglibconf.h are available to your application (pnglibconf.h is included
|
|
||||||
in png.h and gets installed alongside png.h and pngconf.h in your
|
|
||||||
$PREFIX/include directory). Do not edit pnglibconf.h after you have built
|
|
||||||
libpng, because than the settings would not accurately reflect the settings
|
|
||||||
that were used to build libpng.
|
|
||||||
|
|
||||||
XIV. Setjmp/longjmp issues
|
|
||||||
|
|
||||||
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
|
|
||||||
is known to be not thread-safe on some platforms and we don't know of
|
|
||||||
any platform where it is guaranteed to be thread-safe. Therefore, if
|
|
||||||
your application is going to be using multiple threads, you should
|
|
||||||
configure libpng with PNG_NO_SETJMP in your pngusr.dfa file, with
|
|
||||||
-DPNG_NO_SETJMP on your compile line, or with
|
|
||||||
|
|
||||||
#undef PNG_SETJMP_SUPPORTED
|
|
||||||
|
|
||||||
in your pnglibconf.h or pngusr.h.
|
|
||||||
|
|
||||||
Starting with libpng-1.6.0, the library included a "simplified API".
|
|
||||||
This requires setjmp/longjmp, so you must either build the library
|
|
||||||
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
|
|
||||||
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
|
|
||||||
|
|
||||||
XV. Common linking failures
|
|
||||||
|
|
||||||
If your application fails to find libpng or zlib entries while linking:
|
|
||||||
|
|
||||||
Be sure "-lz" appears after "-lpng" on your linking command.
|
|
||||||
|
|
||||||
Be sure you have built libpng, zlib, and your application for the
|
|
||||||
same platform (e.g., 32-bit or 64-bit).
|
|
||||||
|
|
||||||
If you are using the vstudio project, observe the WARNING in
|
|
||||||
project/vstudio/README.txt.
|
|
||||||
|
|
||||||
XVI. Other sources of information about libpng:
|
|
||||||
|
|
||||||
Further information can be found in the README and libpng-manual.txt
|
Further information can be found in the README and libpng-manual.txt
|
||||||
files, in the individual makefiles, in png.h, and the manual pages
|
files, in the individual makefiles, in png.h, and the manual pages
|
||||||
libpng.3 and png.5.
|
libpng.3 and png.5.
|
||||||
|
|
||||||
Copyright (c) 2022 Cosmin Truta
|
Using the ./configure script -- 16 December 2002.
|
||||||
Copyright (c) 1998-2002,2006-2016 Glenn Randers-Pehrson
|
=================================================
|
||||||
This document is released under the libpng license.
|
|
||||||
For conditions of distribution and use, see the disclaimer
|
The ./configure script should work compatibly with what scripts/makefile.*
|
||||||
and license in png.h.
|
did, however there are some options you might need to add to configure
|
||||||
|
explicitly, which previously was done semi-automatically (if you didn't edit
|
||||||
|
scripts/makefile.* yourself, that is)
|
||||||
|
|
||||||
|
CFLAGS="-Wall -O -funroll-loops \
|
||||||
|
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
|
||||||
|
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
|
||||||
|
|
||||||
|
You can alternatively specify --includedir=/usr/include, /usr/local/include,
|
||||||
|
/usr/include/libpng%NN%, or whatever.
|
||||||
|
|
||||||
|
If you find that the configure script is out-of-date or is not supporting
|
||||||
|
your platform properly, try running autogen.sh to regenerate "configure",
|
||||||
|
"Makefile.in", and the other configuration files. Then try configure again.
|
||||||
|
|
||||||
|
|||||||
139
LICENSE
139
LICENSE
@@ -1,88 +1,53 @@
|
|||||||
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
PNG Reference Library License version 2
|
This copy of the libpng notices is provided for your convenience. In case of
|
||||||
---------------------------------------
|
any discrepancy between this copy and the notices in the file png.h that is
|
||||||
|
included in the libpng distribution, the latter shall prevail.
|
||||||
|
|
||||||
* Copyright (c) 1995-2025 The PNG Reference Library Authors.
|
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||||
* Copyright (c) 2018-2025 Cosmin Truta.
|
|
||||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
|
||||||
* Copyright (c) 1996-1997 Andreas Dilger.
|
|
||||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
|
||||||
|
|
||||||
The software is supplied "as is", without warranty of any kind,
|
If you modify libpng you may insert additional notices immediately following
|
||||||
express or implied, including, without limitation, the warranties
|
this sentence.
|
||||||
of merchantability, fitness for a particular purpose, title, and
|
|
||||||
non-infringement. In no event shall the Copyright owners, or
|
|
||||||
anyone distributing the software, be liable for any damages or
|
|
||||||
other liability, whether in contract, tort or otherwise, arising
|
|
||||||
from, out of, or in connection with the software, or the use or
|
|
||||||
other dealings in the software, even if advised of the possibility
|
|
||||||
of such damage.
|
|
||||||
|
|
||||||
Permission is hereby granted to use, copy, modify, and distribute
|
This code is released under the libpng license.
|
||||||
this software, or portions hereof, for any purpose, without fee,
|
|
||||||
subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you
|
libpng versions 1.2.6, August 15, 2004, through 1.7.0beta04, February 27, 2013, are
|
||||||
must not claim that you wrote the original software. If you
|
Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
||||||
use this software in a product, an acknowledgment in the product
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
documentation would be appreciated, but is not required.
|
with the following individual added to the list of Contributing Authors
|
||||||
|
|
||||||
2. Altered source versions must be plainly marked as such, and must
|
Cosmin Truta
|
||||||
not be misrepresented as being the original software.
|
|
||||||
|
|
||||||
3. This Copyright notice may not be removed or altered from any
|
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
|
||||||
source or altered source distribution.
|
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
|
||||||
|
distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
|
with the following individuals added to the list of Contributing Authors
|
||||||
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
|
||||||
-----------------------------------------------------------------------
|
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
|
||||||
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
|
||||||
derived from libpng-1.0.6, and are distributed according to the same
|
|
||||||
disclaimer and license as libpng-1.0.6 with the following individuals
|
|
||||||
added to the list of Contributing Authors:
|
|
||||||
|
|
||||||
Simon-Pierre Cadieux
|
Simon-Pierre Cadieux
|
||||||
Eric S. Raymond
|
Eric S. Raymond
|
||||||
Mans Rullgard
|
|
||||||
Cosmin Truta
|
|
||||||
Gilles Vollant
|
Gilles Vollant
|
||||||
James Yu
|
|
||||||
Mandar Sahastrabuddhe
|
|
||||||
Google Inc.
|
|
||||||
Vadim Barkov
|
|
||||||
|
|
||||||
and with the following additions to the disclaimer:
|
and with the following additions to the disclaimer:
|
||||||
|
|
||||||
There is no warranty against interference with your enjoyment of
|
There is no warranty against interference with your enjoyment of the
|
||||||
the library or against infringement. There is no warranty that our
|
library or against infringement. There is no warranty that our
|
||||||
efforts or the library will fulfill any of your particular purposes
|
efforts or the library will fulfill any of your particular purposes
|
||||||
or needs. This library is provided with all faults, and the entire
|
or needs. This library is provided with all faults, and the entire
|
||||||
risk of satisfactory quality, performance, accuracy, and effort is
|
risk of satisfactory quality, performance, accuracy, and effort is with
|
||||||
with the user.
|
the user.
|
||||||
|
|
||||||
Some files in the "contrib" directory and some configure-generated
|
|
||||||
files that are distributed with libpng have other copyright owners, and
|
|
||||||
are released under other open source licenses.
|
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||||
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
|
||||||
libpng-0.96, and are distributed according to the same disclaimer and
|
distributed according to the same disclaimer and license as libpng-0.96,
|
||||||
license as libpng-0.96, with the following individuals added to the
|
with the following individuals added to the list of Contributing Authors:
|
||||||
list of Contributing Authors:
|
|
||||||
|
|
||||||
Tom Lane
|
Tom Lane
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
Willem van Schaik
|
Willem van Schaik
|
||||||
|
|
||||||
libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
||||||
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
|
Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
and are distributed according to the same disclaimer and license as
|
Distributed according to the same disclaimer and license as libpng-0.88,
|
||||||
libpng-0.88, with the following individuals added to the list of
|
with the following individuals added to the list of Contributing Authors:
|
||||||
Contributing Authors:
|
|
||||||
|
|
||||||
John Bowler
|
John Bowler
|
||||||
Kevin Bracey
|
Kevin Bracey
|
||||||
@@ -91,11 +56,8 @@ Contributing Authors:
|
|||||||
Greg Roelofs
|
Greg Roelofs
|
||||||
Tom Tanner
|
Tom Tanner
|
||||||
|
|
||||||
Some files in the "scripts" directory have other copyright owners,
|
|
||||||
but are released under this license.
|
|
||||||
|
|
||||||
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
|
|
||||||
For the purposes of this copyright and license, "Contributing Authors"
|
For the purposes of this copyright and license, "Contributing Authors"
|
||||||
is defined as the following set of individuals:
|
is defined as the following set of individuals:
|
||||||
@@ -106,29 +68,44 @@ is defined as the following set of individuals:
|
|||||||
Paul Schmidt
|
Paul Schmidt
|
||||||
Tim Wegner
|
Tim Wegner
|
||||||
|
|
||||||
The PNG Reference Library is supplied "AS IS". The Contributing
|
The PNG Reference Library is supplied "AS IS". The Contributing Authors
|
||||||
Authors and Group 42, Inc. disclaim all warranties, expressed or
|
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
||||||
implied, including, without limitation, the warranties of
|
including, without limitation, the warranties of merchantability and of
|
||||||
merchantability and of fitness for any purpose. The Contributing
|
fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
||||||
Authors and Group 42, Inc. assume no liability for direct, indirect,
|
assume no liability for direct, indirect, incidental, special, exemplary,
|
||||||
incidental, special, exemplary, or consequential damages, which may
|
or consequential damages, which may result from the use of the PNG
|
||||||
result from the use of the PNG Reference Library, even if advised of
|
Reference Library, even if advised of the possibility of such damage.
|
||||||
the possibility of such damage.
|
|
||||||
|
|
||||||
Permission is hereby granted to use, copy, modify, and distribute this
|
Permission is hereby granted to use, copy, modify, and distribute this
|
||||||
source code, or portions hereof, for any purpose, without fee, subject
|
source code, or portions hereof, for any purpose, without fee, subject
|
||||||
to the following restrictions:
|
to the following restrictions:
|
||||||
|
|
||||||
1. The origin of this source code must not be misrepresented.
|
1. The origin of this source code must not be misrepresented.
|
||||||
|
|
||||||
2. Altered versions must be plainly marked as such and must not
|
2. Altered versions must be plainly marked as such and must not
|
||||||
be misrepresented as being the original source.
|
be misrepresented as being the original source.
|
||||||
|
|
||||||
3. This Copyright notice may not be removed or altered from any
|
3. This Copyright notice may not be removed or altered from any
|
||||||
source or altered source distribution.
|
source or altered source distribution.
|
||||||
|
|
||||||
The Contributing Authors and Group 42, Inc. specifically permit,
|
The Contributing Authors and Group 42, Inc. specifically permit, without
|
||||||
without fee, and encourage the use of this source code as a component
|
fee, and encourage the use of this source code as a component to
|
||||||
to supporting the PNG file format in commercial products. If you use
|
supporting the PNG file format in commercial products. If you use this
|
||||||
this source code in a product, acknowledgment is not required but would
|
source code in a product, acknowledgment is not required but would be
|
||||||
be appreciated.
|
appreciated.
|
||||||
|
|
||||||
|
|
||||||
|
A "png_get_copyright" function is available, for convenient use in "about"
|
||||||
|
boxes and the like:
|
||||||
|
|
||||||
|
printf("%s",png_get_copyright(NULL));
|
||||||
|
|
||||||
|
Also, the PNG logo (in PNG format, of course) is supplied in the
|
||||||
|
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
|
||||||
|
|
||||||
|
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
|
||||||
|
certification mark of the Open Source Initiative.
|
||||||
|
|
||||||
|
Glenn Randers-Pehrson
|
||||||
|
glennrp at users.sourceforge.net
|
||||||
|
February 27, 2013
|
||||||
|
|||||||
280
Makefile.am
280
Makefile.am
@@ -1,44 +1,14 @@
|
|||||||
# Makefile.am, the source file for Makefile.in (and hence Makefile), is
|
# Makefile.am:
|
||||||
|
# Source file for Makefile.in (and hence Makefile)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018-2025 Cosmin Truta
|
|
||||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
|
||||||
#
|
|
||||||
# This code is released under the libpng license.
|
|
||||||
# For conditions of distribution and use, see the disclaimer
|
|
||||||
# and license in png.h
|
|
||||||
|
|
||||||
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I scripts/autoconf
|
ACLOCAL_AMFLAGS = -I scripts
|
||||||
|
|
||||||
# test programs - run on make check, make distcheck
|
# test programs - run on make check, make distcheck
|
||||||
if ENABLE_TESTS
|
check_PROGRAMS= pngtest pngunknown pngstest pngvalid
|
||||||
check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp
|
|
||||||
if HAVE_CLOCK_GETTIME
|
|
||||||
check_PROGRAMS += timepng
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
check_PROGRAMS=
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Utilities - installed
|
|
||||||
if ENABLE_TOOLS
|
|
||||||
bin_PROGRAMS= pngfix png-fix-itxt
|
|
||||||
else
|
|
||||||
bin_PROGRAMS=
|
|
||||||
endif
|
|
||||||
|
|
||||||
# This ensures that pnglibconf.h gets built at the start of 'make all' or
|
|
||||||
# 'make check', but it does not add dependencies to the individual programs,
|
|
||||||
# this is done below.
|
|
||||||
#
|
|
||||||
# IMPORTANT: always add the object modules of new programs to the list below
|
|
||||||
# because otherwise the sequence 'configure; make new-program' will *sometimes*
|
|
||||||
# result in the installed (system) pnglibconf.h being used and the result is
|
|
||||||
# always wrong and always very confusing.
|
|
||||||
BUILT_SOURCES = pnglibconf.h
|
|
||||||
|
|
||||||
if ENABLE_TESTS
|
|
||||||
pngtest_SOURCES = pngtest.c
|
pngtest_SOURCES = pngtest.c
|
||||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||||
|
|
||||||
@@ -51,44 +21,30 @@ pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|||||||
pngunknown_SOURCES = contrib/libtests/pngunknown.c
|
pngunknown_SOURCES = contrib/libtests/pngunknown.c
|
||||||
pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||||
|
|
||||||
pngimage_SOURCES = contrib/libtests/pngimage.c
|
|
||||||
pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|
||||||
|
|
||||||
timepng_SOURCES = contrib/libtests/timepng.c
|
|
||||||
timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|
||||||
|
|
||||||
pngcp_SOURCES = contrib/tools/pngcp.c
|
|
||||||
pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ENABLE_TOOLS
|
|
||||||
pngfix_SOURCES = contrib/tools/pngfix.c
|
|
||||||
pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|
||||||
|
|
||||||
png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Generally these are single line shell scripts to run a test with a particular
|
# Generally these are single line shell scripts to run a test with a particular
|
||||||
# set of parameters:
|
# set of parameters:
|
||||||
if ENABLE_TESTS
|
|
||||||
TESTS =\
|
TESTS =\
|
||||||
tests/pngtest-all\
|
tests/pngtest\
|
||||||
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
|
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
|
||||||
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
|
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
|
||||||
tests/pngvalid-gamma-expand16-background\
|
tests/pngvalid-gamma-expand16-background\
|
||||||
tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
|
tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
|
||||||
tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
|
tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
|
||||||
tests/pngvalid-progressive-size\
|
tests/pngvalid-progressive-interlace-size\
|
||||||
tests/pngvalid-progressive-interlace-standard\
|
tests/pngvalid-progressive-interlace-standard\
|
||||||
tests/pngvalid-transform\
|
tests/pngvalid-progressive-interlace-transform\
|
||||||
tests/pngvalid-progressive-standard tests/pngvalid-standard\
|
tests/pngvalid-progressive-standard tests/pngvalid-standard\
|
||||||
tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\
|
tests/pngstest-0g01 tests/pngstest-0g02 tests/pngstest-0g04\
|
||||||
tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\
|
tests/pngstest-0g08 tests/pngstest-0g16 tests/pngstest-2c08\
|
||||||
tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\
|
tests/pngstest-2c16 tests/pngstest-3p01 tests/pngstest-3p02\
|
||||||
|
tests/pngstest-3p04 tests/pngstest-3p08 tests/pngstest-4a08\
|
||||||
|
tests/pngstest-4a16 tests/pngstest-6a08 tests/pngstest-6a16\
|
||||||
|
tests/pngstest-error tests/pngunknown-IDAT\
|
||||||
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
|
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
|
||||||
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
|
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg
|
||||||
tests/pngimage-quick tests/pngimage-full
|
|
||||||
endif
|
# These tests are expected, and required, to fail:
|
||||||
|
XFAIL_TESTS = tests/pngstest-error
|
||||||
|
|
||||||
# man pages
|
# man pages
|
||||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||||
@@ -108,46 +64,7 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
|
|||||||
|
|
||||||
if PNG_ARM_NEON
|
if PNG_ARM_NEON
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
||||||
arm/filter_neon_intrinsics.c \
|
arm/filter_neon.S
|
||||||
arm/palette_neon_intrinsics.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if PNG_MIPS_MSA
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c\
|
|
||||||
mips/filter_msa_intrinsics.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if PNG_MIPS_MMI
|
|
||||||
if !PNG_MIPS_MSA
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c
|
|
||||||
endif
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/filter_mmi_inline_assembly.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if PNG_INTEL_SSE
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += intel/intel_init.c\
|
|
||||||
intel/filter_sse2_intrinsics.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if PNG_POWERPC_VSX
|
|
||||||
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
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
||||||
@@ -170,14 +87,6 @@ else
|
|||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
|
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
|
||||||
endif
|
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
|
|
||||||
|
|
||||||
#distribute headers in /usr/include/libpng/*
|
#distribute headers in /usr/include/libpng/*
|
||||||
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
|
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
|
||||||
pkginclude_HEADERS= png.h pngconf.h
|
pkginclude_HEADERS= png.h pngconf.h
|
||||||
@@ -192,25 +101,24 @@ pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
|
|||||||
# from those directories being included. This only works if the configure is
|
# from those directories being included. This only works if the configure is
|
||||||
# not done in the source directory!
|
# not done in the source directory!
|
||||||
EXTRA_DIST= \
|
EXTRA_DIST= \
|
||||||
ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \
|
ANNOUNCE CHANGES INSTALL LICENSE README TODO \
|
||||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||||
${srcdir}/ci ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
|
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
|
||||||
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
|
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
|
||||||
CMakeLists.txt example.c libpng-manual.txt
|
CMakeLists.txt example.c libpng-manual.txt
|
||||||
|
|
||||||
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk
|
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
|
||||||
|
|
||||||
CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
|
CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
|
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
|
||||||
check.new pnglibconf.h pngprefix.h symbols.new pngtest-log.txt \
|
check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \
|
||||||
pnglibconf.out pnglibconf.c pnglibconf.pre pnglibconf.dfn \
|
|
||||||
$(SCRIPT_CLEANFILES)
|
$(SCRIPT_CLEANFILES)
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||||
config.sub configure depcomp install-sh ltmain.sh missing
|
config.sub configure depcomp install-sh ltmain.sh missing
|
||||||
|
|
||||||
# PNG_COPTS give extra options for the C compiler to be used on all compilation
|
# PNG_COPTS give extra options for the C compiler to be used on all compilation
|
||||||
# steps (unless target_CFLAGS is specified; that will take precedence over
|
# steps (unless targe_CFLAGS is specified; that will take precedence over
|
||||||
# AM_CFLAGS)
|
# AM_CFLAGS)
|
||||||
PNG_COPTS = @PNG_COPTS@
|
PNG_COPTS = @PNG_COPTS@
|
||||||
AM_CFLAGS = ${PNG_COPTS}
|
AM_CFLAGS = ${PNG_COPTS}
|
||||||
@@ -222,7 +130,7 @@ AM_CFLAGS = ${PNG_COPTS}
|
|||||||
# checks for this and sets DFNCPP appropriately.
|
# checks for this and sets DFNCPP appropriately.
|
||||||
DFNCPP = @DFNCPP@
|
DFNCPP = @DFNCPP@
|
||||||
|
|
||||||
SUFFIXES = .chk .out
|
SUFFIXES = .chk .dfn .out
|
||||||
|
|
||||||
$(PNGLIB_BASENAME).pc: libpng.pc
|
$(PNGLIB_BASENAME).pc: libpng.pc
|
||||||
cp libpng.pc $@
|
cp libpng.pc $@
|
||||||
@@ -235,6 +143,8 @@ scripts/prefix.out: png.h pngconf.h pnglibconf.out
|
|||||||
scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
|
scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
|
||||||
scripts/intprefix.out: pnglibconf.h
|
scripts/intprefix.out: pnglibconf.h
|
||||||
|
|
||||||
|
pnglibconf.out: config.h
|
||||||
|
|
||||||
libpng.sym: scripts/sym.out
|
libpng.sym: scripts/sym.out
|
||||||
rm -f $@
|
rm -f $@
|
||||||
cp $? $@
|
cp $? $@
|
||||||
@@ -246,7 +156,7 @@ if DO_PNG_PREFIX
|
|||||||
# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
|
# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
|
||||||
# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
|
# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
|
||||||
# implementation of the macro).
|
# implementation of the macro).
|
||||||
pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
|
pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst config.h
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(AWK) 's==0 && NR>1{print prev}\
|
$(AWK) 's==0 && NR>1{print prev}\
|
||||||
s==0{prev=$$0}\
|
s==0{prev=$$0}\
|
||||||
@@ -272,29 +182,14 @@ endif
|
|||||||
$(srcdir)/scripts/pnglibconf.h.prebuilt:
|
$(srcdir)/scripts/pnglibconf.h.prebuilt:
|
||||||
@echo "Attempting to build $@" >&2
|
@echo "Attempting to build $@" >&2
|
||||||
@echo "This is a machine generated file, but if you want to make" >&2
|
@echo "This is a machine generated file, but if you want to make" >&2
|
||||||
@echo "a new one simply make 'scripts/pnglibconf.out', copy that" >&2
|
@echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2
|
||||||
@echo "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2
|
|
||||||
@exit 1
|
@exit 1
|
||||||
|
|
||||||
# The following is necessary to ensure that the local pnglibconf.h is used, not
|
# The following is necessary to ensure that the local pnglibconf.h is used, not
|
||||||
# an installed one (this can happen immediately after on a clean system if
|
# an installed one (this can happen immediately after on a clean system if
|
||||||
# 'make test' is the first thing the user does.) Only files which include
|
# 'make test' is the first thing the user does.)
|
||||||
# one of the png source files (typically png.h or pngpriv.h) need to be listed
|
contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
|
||||||
# here:
|
|
||||||
pngtest.o: pnglibconf.h
|
|
||||||
|
|
||||||
contrib/libtests/makepng.o: pnglibconf.h
|
|
||||||
contrib/libtests/pngstest.o: pnglibconf.h
|
|
||||||
contrib/libtests/pngunknown.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
|
|
||||||
contrib/libtests/timepng.o: pnglibconf.h
|
|
||||||
|
|
||||||
contrib/tools/makesRGB.o: pnglibconf.h
|
|
||||||
contrib/tools/pngfix.o: pnglibconf.h
|
|
||||||
contrib/tools/pngcp.o: pnglibconf.h
|
|
||||||
|
|
||||||
# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
|
# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
|
||||||
# be built with PNG_USE_READ_MACROS; this prevents the read macros from
|
# be built with PNG_USE_READ_MACROS; this prevents the read macros from
|
||||||
@@ -308,17 +203,18 @@ if DO_PNG_PREFIX
|
|||||||
SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
|
SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.c.out:
|
.dfn.out:
|
||||||
rm -f $@ $*.tf[12]
|
rm -f $@ $*.c $*.tf[12]
|
||||||
test -d scripts || mkdir scripts || test -d scripts
|
test -d scripts || mkdir scripts || test -d scripts
|
||||||
|
echo '#include "$<"' >$*.c
|
||||||
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
|
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
|
||||||
$(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1
|
$(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
|
||||||
$(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
|
$(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
|
||||||
rm -f $*.tf1
|
rm -f $*.c $*.tf1
|
||||||
mv $*.tf2 $@
|
mv $*.tf2 $@
|
||||||
|
|
||||||
# The .c file for pnglibconf.h is machine generated
|
# The .dfn file for pnglibconf.h is machine generated
|
||||||
pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
|
pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
|
||||||
rm -f $@ $*.tf[45]
|
rm -f $@ $*.tf[45]
|
||||||
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
|
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
|
||||||
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
||||||
@@ -338,7 +234,7 @@ scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.ou
|
|||||||
|
|
||||||
# used on demand to regenerate the standard header, CPPFLAGS should
|
# used on demand to regenerate the standard header, CPPFLAGS should
|
||||||
# be empty - no non-standard defines
|
# be empty - no non-standard defines
|
||||||
scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
|
scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
|
||||||
rm -f $@ pnglibconf.tf[67]
|
rm -f $@ pnglibconf.tf[67]
|
||||||
test -z "$(CPPFLAGS)"
|
test -z "$(CPPFLAGS)"
|
||||||
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
|
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
|
||||||
@@ -362,76 +258,40 @@ check: scripts/symbols.chk
|
|||||||
dist-hook:
|
dist-hook:
|
||||||
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
|
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
|
||||||
|
|
||||||
# Make links between installed files with release-specific names and the generic
|
# install the .../include headers as links to the new ones
|
||||||
# file names. If this install rule is run the generic names will be deleted and
|
install-data-hook:
|
||||||
# recreated - this has obvious issues for systems with multiple installations.
|
cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
|
||||||
|
cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
|
||||||
|
cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
|
||||||
|
pngconf.h
|
||||||
|
cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \
|
||||||
|
pnglibconf.h
|
||||||
|
cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc
|
||||||
|
cd '$(DESTDIR)$(pkgconfigdir)'; $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
|
||||||
|
|
||||||
install-header-links:
|
# do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
|
||||||
@set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \
|
install-exec-hook:
|
||||||
rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done
|
cd '$(DESTDIR)$(bindir)'; rm -f libpng-config
|
||||||
|
cd '$(DESTDIR)$(bindir)';\
|
||||||
uninstall-header-links:
|
$(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||||
cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS)
|
@set -x;\
|
||||||
|
cd '$(DESTDIR)$(libdir)';\
|
||||||
install-libpng-pc:
|
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@\
|
||||||
@set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \
|
sl dylib dll.a; do\
|
||||||
$(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc
|
rm -f libpng.$$ext;\
|
||||||
|
if test -f $(PNGLIB_BASENAME).$$ext; then\
|
||||||
uninstall-libpng-pc:
|
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
|
||||||
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
|
|
||||||
|
|
||||||
# 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
|
|
||||||
# actually installed on a given system, so instead we check for every extension
|
|
||||||
# we have seen.
|
|
||||||
|
|
||||||
EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib
|
|
||||||
|
|
||||||
install-library-links:
|
|
||||||
@set -x; cd '$(DESTDIR)$(libdir)';\
|
|
||||||
for ext in $(EXT_LIST); do\
|
|
||||||
rm -f "libpng.$$ext";\
|
|
||||||
if test -f "$(PNGLIB_BASENAME).$$ext"; then\
|
|
||||||
$(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\
|
|
||||||
fi;\
|
fi;\
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall-library-links:
|
uninstall-hook:
|
||||||
@set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\
|
cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
|
||||||
rm -f "libpng.$$ext"; done
|
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
|
||||||
|
|
||||||
install-libpng-config:
|
|
||||||
@set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \
|
|
||||||
$(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config
|
|
||||||
|
|
||||||
uninstall-libpng-config:
|
|
||||||
rm -f '$(DESTDIR)$(bindir)/libpng-config'
|
rm -f '$(DESTDIR)$(bindir)/libpng-config'
|
||||||
|
rm -f '$(DESTDIR)$(libdir)/libpng.a'
|
||||||
if DO_INSTALL_LINKS
|
rm -f '$(DESTDIR)$(libdir)/libpng.la'
|
||||||
# If --enable-unversioned-links is specified the header and lib file links
|
rm -f '$(DESTDIR)$(libdir)/libpng.so'
|
||||||
# will be automatically made on a 'make install':
|
rm -f '$(DESTDIR)$(libdir)/libpng.so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@'
|
||||||
|
rm -f '$(DESTDIR)$(libdir)/libpng.sl'
|
||||||
install-data-hook: install-header-links
|
rm -f '$(DESTDIR)$(libdir)/libpng.dylib'
|
||||||
uninstall-hook: uninstall-header-links
|
rm -f '$(DESTDIR)$(libdir)/libpng.dll.a'
|
||||||
install-exec-hook: install-library-links
|
|
||||||
uninstall-hook: uninstall-library-links
|
|
||||||
endif
|
|
||||||
|
|
||||||
if DO_INSTALL_LIBPNG_PC
|
|
||||||
# Likewise, --install-pc causes libpng.pc to be constructed:
|
|
||||||
|
|
||||||
install-data-hook: install-libpng-pc
|
|
||||||
uninstall-hook: uninstall-libpng-pc
|
|
||||||
endif
|
|
||||||
|
|
||||||
if DO_INSTALL_LIBPNG_CONFIG
|
|
||||||
# And --install-config:
|
|
||||||
|
|
||||||
install-exec-hook: install-libpng-config
|
|
||||||
uninstall-hook: uninstall-libpng-config
|
|
||||||
endif
|
|
||||||
|
|
||||||
# The following addition ensures that 'make all' always builds the test programs
|
|
||||||
# too. It used to, but some change either in libpng or configure stopped this
|
|
||||||
# working.
|
|
||||||
all-am: $(check_PROGRAMS)
|
|
||||||
|
|||||||
2610
Makefile.in
2610
Makefile.in
File diff suppressed because it is too large
Load Diff
272
README
272
README
@@ -1,88 +1,49 @@
|
|||||||
README for libpng version 1.6.51.git
|
README for libpng version 1.7.0beta04 - February 27, 2013 (shared library 17.0)
|
||||||
====================================
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See the note about version numbers near the top of `png.h`.
|
See INSTALL for instructions on how to install libpng.
|
||||||
See `INSTALL` for instructions on how to install libpng.
|
|
||||||
|
|
||||||
Libpng comes in several distribution formats. Get `libpng-*.tar.gz`
|
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
|
||||||
or `libpng-*.tar.xz` if you want UNIX-style line endings in the text
|
libpng-*.tar.xz or libpng-*.tar.bz2 if you want UNIX-style line endings
|
||||||
files, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.
|
in the text files, or lpng*.zip if you want DOS-style line endings.
|
||||||
|
|
||||||
For a detailed description on using libpng, read `libpng-manual.txt`.
|
Version 0.89 was the first official release of libpng. Don't let the
|
||||||
For examples of libpng in a program, see `example.c` and `pngtest.c`.
|
fact that it's the first release fool you. The libpng library has been in
|
||||||
For usage information and restrictions (what little they are) on libpng,
|
extensive use and testing since mid-1995. By late 1997 it had
|
||||||
see `png.h`. For a description on using zlib (the compression library
|
finally gotten to the stage where there hadn't been significant
|
||||||
used by libpng) and zlib's restrictions, see `zlib.h`.
|
changes to the API in some time, and people have a bad feeling about
|
||||||
|
libraries with versions < 1.0. Version 1.0.0 was released in
|
||||||
|
March 1998.
|
||||||
|
|
||||||
You should use zlib 1.0.4 or later to run this, but it _may_ work with
|
****
|
||||||
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
Note that some of the changes to the png_info structure render this
|
||||||
versions which can cause the output of invalid compression streams for
|
|
||||||
some images.
|
|
||||||
|
|
||||||
You should also note that zlib is a compression library that is useful
|
|
||||||
for more things than just PNG files. You can use zlib as a drop-in
|
|
||||||
replacement for `fread()` and `fwrite()`, if you are so inclined.
|
|
||||||
|
|
||||||
zlib should be available at the same place that libpng is, or at
|
|
||||||
https://zlib.net .
|
|
||||||
|
|
||||||
You may also want a copy of the PNG specification. It is available
|
|
||||||
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
|
||||||
these at http://www.libpng.org/pub/png/pngdocs.html .
|
|
||||||
|
|
||||||
This code is currently being archived at https://libpng.sourceforge.io
|
|
||||||
in the download area, and at http://libpng.download/src .
|
|
||||||
|
|
||||||
This release, based in a large way on Glenn's, Guy's and Andreas'
|
|
||||||
earlier work, was created and will be supported by myself and the PNG
|
|
||||||
development group.
|
|
||||||
|
|
||||||
Send comments, corrections and commendations to `png-mng-implement`
|
|
||||||
at `lists.sourceforge.net`. (Subscription is required; visit
|
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
|
||||||
to subscribe.)
|
|
||||||
|
|
||||||
Send general questions about the PNG specification to `png-mng-misc`
|
|
||||||
at `lists.sourceforge.net`. (Subscription is required; visit
|
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
|
|
||||||
to subscribe.)
|
|
||||||
|
|
||||||
Historical notes
|
|
||||||
----------------
|
|
||||||
|
|
||||||
The libpng library has been in extensive use and testing since mid-1995.
|
|
||||||
Version 0.89, published a year later, was the first official release.
|
|
||||||
By late 1997, it had finally gotten to the stage where there hadn't
|
|
||||||
been significant changes to the API in some time, and people have a bad
|
|
||||||
feeling about libraries with versions below 1.0. Version 1.0.0 was
|
|
||||||
released in March 1998.
|
|
||||||
|
|
||||||
Note that some of the changes to the `png_info` structure render this
|
|
||||||
version of the library binary incompatible with libpng-0.89 or
|
version of the library binary incompatible with libpng-0.89 or
|
||||||
earlier versions if you are using a shared library. The type of the
|
earlier versions if you are using a shared library. The type of the
|
||||||
`filler` parameter for `png_set_filler()` has changed from `png_byte`
|
"filler" parameter for png_set_filler() has changed from png_byte to
|
||||||
to `png_uint_32`, which will affect shared-library applications that
|
png_uint_32, which will affect shared-library applications that use
|
||||||
use this function.
|
this function.
|
||||||
|
|
||||||
To avoid problems with changes to the internals of the `info_struct`,
|
To avoid problems with changes to the internals of png_info_struct,
|
||||||
new APIs have been made available in 0.95 to avoid direct application
|
new APIs have been made available in 0.95 to avoid direct application
|
||||||
access to `info_ptr`. These functions are the `png_set_<chunk>` and
|
access to info_ptr. These functions are the png_set_<chunk> and
|
||||||
`png_get_<chunk>` functions. These functions should be used when
|
png_get_<chunk> functions. These functions should be used when
|
||||||
accessing/storing the `info_struct` data, rather than manipulating it
|
accessing/storing the info_struct data, rather than manipulating it
|
||||||
directly, to avoid such problems in the future.
|
directly, to avoid such problems in the future.
|
||||||
|
|
||||||
It is important to note that the APIs did not make current programs
|
It is important to note that the APIs do not make current programs
|
||||||
that access the info struct directly incompatible with the new
|
that access the info struct directly incompatible with the new
|
||||||
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
|
library. However, it is strongly suggested that new programs use
|
||||||
be a transitional release, members of the `png_struct` and the
|
the new APIs (as shown in example.c and pngtest.c), and older programs
|
||||||
`info_struct` can still be accessed, but the compiler will issue a
|
be converted to the new format, to facilitate upgrades in the future.
|
||||||
warning about deprecated usage. Since libpng-1.5.0, direct access
|
****
|
||||||
to these structs is not allowed, and the definitions of the structs
|
|
||||||
reside in private `pngstruct.h` and `pnginfo.h` header files that are
|
Additions since 0.90 include the ability to compile libpng as a
|
||||||
not accessible to applications. It is strongly suggested that new
|
Windows DLL, and new APIs for accessing data in the info struct.
|
||||||
programs use the new APIs (as shown in `example.c` and `pngtest.c`),
|
Experimental functions include the ability to set weighting and cost
|
||||||
and older programs be converted to the new format, to facilitate
|
factors for row filter selection, direct reads of integers from buffers
|
||||||
upgrades in the future.
|
on big-endian processors that support misaligned data access, faster
|
||||||
|
methods of doing alpha composition, and more accurate 16->8 bit color
|
||||||
|
conversion.
|
||||||
|
|
||||||
The additions since 0.89 include the ability to read from a PNG stream
|
The additions since 0.89 include the ability to read from a PNG stream
|
||||||
which has had some (or all) of the signature bytes read by the calling
|
which has had some (or all) of the signature bytes read by the calling
|
||||||
@@ -92,31 +53,95 @@ the library action on the detection of chunk CRC errors. It is possible
|
|||||||
to set different actions based on whether the CRC error occurred in a
|
to set different actions based on whether the CRC error occurred in a
|
||||||
critical or an ancillary chunk.
|
critical or an ancillary chunk.
|
||||||
|
|
||||||
The additions since 0.90 include the ability to compile libpng as a
|
The changes made to the library, and bugs fixed are based on discussions
|
||||||
Windows DLL, and new APIs for accessing data in the `info_struct`.
|
on the PNG-implement mailing list and not on material submitted
|
||||||
Experimental functions included the ability to set weighting and cost
|
privately to Guy, Andreas, or Glenn. They will forward any good
|
||||||
factors for row filter selection, direct reads of integers from buffers
|
suggestions to the list.
|
||||||
on big-endian processors that support misaligned data access, faster
|
|
||||||
methods of doing alpha composition, and more accurate 16-to-8 bit color
|
|
||||||
conversion. Some of these experimental functions, such as the weighted
|
|
||||||
filter heuristics, have since been removed.
|
|
||||||
|
|
||||||
Files included in this distribution
|
For a detailed description on using libpng, read libpng-manual.txt. For
|
||||||
-----------------------------------
|
examples of libpng in a program, see example.c and pngtest.c. For usage
|
||||||
|
information and restrictions (what little they are) on libpng, see
|
||||||
|
png.h. For a description on using zlib (the compression library used by
|
||||||
|
libpng) and zlib's restrictions, see zlib.h
|
||||||
|
|
||||||
|
I have included a general makefile, as well as several machine and
|
||||||
|
compiler specific ones, but you may have to modify one for your own needs.
|
||||||
|
|
||||||
|
You should use zlib 1.0.4 or later to run this, but it MAY work with
|
||||||
|
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
||||||
|
versions which can cause the output of invalid compression streams for
|
||||||
|
some images. You will definitely need zlib 1.0.4 or later if you are
|
||||||
|
taking advantage of the MS-DOS "far" structure allocation for the small
|
||||||
|
and medium memory models. You should also note that zlib is a
|
||||||
|
compression library that is useful for more things than just PNG files.
|
||||||
|
You can use zlib as a drop-in replacement for fread() and fwrite() if
|
||||||
|
you are so inclined.
|
||||||
|
|
||||||
|
zlib should be available at the same place that libpng is, or at.
|
||||||
|
ftp://ftp.info-zip.org/pub/infozip/zlib
|
||||||
|
|
||||||
|
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/documents/
|
||||||
|
|
||||||
|
This code is currently being archived at libpng.sf.net in the
|
||||||
|
[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT)
|
||||||
|
at GO GRAPHSUP. If you can't find it in any of those places,
|
||||||
|
e-mail me, and I'll help you find it.
|
||||||
|
|
||||||
|
If you have any code changes, requests, problems, etc., please e-mail
|
||||||
|
them to me. Also, I'd appreciate any make files or project files,
|
||||||
|
and any modifications you needed to make to get libpng to compile,
|
||||||
|
along with a #define variable to tell what compiler/system you are on.
|
||||||
|
If you needed to add transformations to libpng, or wish libpng would
|
||||||
|
provide the image in a different way, drop me a note (and code, if
|
||||||
|
possible), so I can consider supporting the transformation.
|
||||||
|
Finally, if you get any warning messages when compiling libpng
|
||||||
|
(note: not zlib), and they are easy to fix, I'd appreciate the
|
||||||
|
fix. Please mention "libpng" somewhere in the subject line. Thanks.
|
||||||
|
|
||||||
|
This release was created and will be supported by myself (of course
|
||||||
|
based in a large way on Guy's and Andreas' earlier work), and the PNG
|
||||||
|
development group.
|
||||||
|
|
||||||
|
Send comments/corrections/commendations to png-mng-implement at
|
||||||
|
lists.sourceforge.net (subscription required; visit
|
||||||
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
|
to subscribe) or to glennrp at users.sourceforge.net
|
||||||
|
|
||||||
|
You can't reach Guy, the original libpng author, at the addresses
|
||||||
|
given in previous versions of this document. He and Andreas will
|
||||||
|
read mail addressed to the png-implement list, however.
|
||||||
|
|
||||||
|
Please do not send general questions about PNG. Send them to
|
||||||
|
png-mng-misc at lists.sf.net (subscription required; visit
|
||||||
|
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
|
||||||
|
subscribe). If you have a question about something
|
||||||
|
in the PNG specification that is related to using libpng, send it
|
||||||
|
to me. Send me any questions that start with "I was using libpng,
|
||||||
|
and ...". If in doubt, send questions to me. I'll bounce them
|
||||||
|
to others, if necessary.
|
||||||
|
|
||||||
|
Please do not send suggestions on how to change PNG. We have
|
||||||
|
been discussing PNG for sixteen years now, and it is official and
|
||||||
|
finished. If you have suggestions for libpng, however, I'll
|
||||||
|
gladly listen. Even if your suggestion is not used immediately,
|
||||||
|
it may be used later.
|
||||||
|
|
||||||
|
Files in this distribution:
|
||||||
|
|
||||||
ANNOUNCE => Announcement of this version, with recent changes
|
ANNOUNCE => Announcement of this version, with recent changes
|
||||||
AUTHORS => List of contributing authors
|
|
||||||
CHANGES => Description of changes between libpng versions
|
CHANGES => Description of changes between libpng versions
|
||||||
INSTALL => Instructions to install libpng
|
KNOWNBUG => List of known bugs and deficiencies
|
||||||
LICENSE => License to use and redistribute libpng
|
LICENSE => License to use and redistribute libpng
|
||||||
README => This file
|
README => This file
|
||||||
TODO => Things not implemented in the current library
|
TODO => Things not implemented in the current library
|
||||||
TRADEMARK => Trademark information
|
Y2KINFO => Statement of Y2K compliance
|
||||||
example.c => Example code for using libpng functions
|
example.c => Example code for using libpng functions
|
||||||
libpng.3 => Manual page for libpng (includes libpng-manual.txt)
|
libpng.3 => manual page for libpng (includes libpng-manual.txt)
|
||||||
libpng-manual.txt => Description of libpng and its functions
|
libpng-manual.txt => Description of libpng and its functions
|
||||||
libpngpf.3 => Manual page for libpng's private functions (deprecated)
|
libpngpf.3 => manual page for libpng's private functions
|
||||||
png.5 => Manual page for the PNG format
|
png.5 => manual page for the PNG format
|
||||||
png.c => Basic interface functions common to library
|
png.c => Basic interface functions common to library
|
||||||
png.h => Library function and interface declarations (public)
|
png.h => Library function and interface declarations (public)
|
||||||
pngpriv.h => Library function and interface declarations (private)
|
pngpriv.h => Library function and interface declarations (private)
|
||||||
@@ -142,43 +167,36 @@ Files included in this distribution
|
|||||||
pngwrite.c => High-level write functions
|
pngwrite.c => High-level write functions
|
||||||
pngwtran.c => Write data transformations
|
pngwtran.c => Write data transformations
|
||||||
pngwutil.c => Write utility functions
|
pngwutil.c => Write utility functions
|
||||||
arm/ => Optimized code for ARM Neon
|
contrib => Contributions
|
||||||
intel/ => Optimized code for INTEL SSE2
|
gregbook => source code for PNG reading and writing, from
|
||||||
loongarch/ => Optimized code for LoongArch LSX
|
Greg Roelofs' "PNG: The Definitive Guide",
|
||||||
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
|
|
||||||
mips-msa/ => Optimized code for the MIPS-MSA platform
|
|
||||||
powerpc-vsx/ => Optimized code for the POWERPC-VSX platform
|
|
||||||
examples/ => Examples of libpng usage
|
|
||||||
gregbook/ => Source code for PNG reading and writing, from
|
|
||||||
"PNG: The Definitive Guide" by Greg Roelofs,
|
|
||||||
O'Reilly, 1999
|
O'Reilly, 1999
|
||||||
libtests/ => Test programs
|
msvctest => Builds and runs pngtest using a MSVC workspace
|
||||||
pngexif/ => Program to inspect the EXIF information in PNG files
|
pngminus => Simple pnm2png and png2pnm programs
|
||||||
pngminim/ => Minimal decoder, encoder, and progressive decoder
|
pngsuite => Test images
|
||||||
programs demonstrating the use of pngusr.dfa
|
visupng => Contains a MSVC workspace for VisualPng
|
||||||
pngminus/ => Simple pnm2png and png2pnm programs
|
projects => Contains project files and workspaces for
|
||||||
pngsuite/ => Test images
|
building a DLL
|
||||||
riscv-rvv/ => Optimized code for the RISC-V Vector platform
|
cbuilder5 => Contains a Borland workspace for building
|
||||||
testpngs/ => Test images
|
libpng and zlib
|
||||||
tools/ => Various tools
|
visualc6 => Contains a Microsoft Visual C++ (MSVC)
|
||||||
visupng/ => VisualPng, a Windows viewer for PNG images
|
workspace for building libpng and zlib
|
||||||
projects/ => Project files and workspaces for various IDEs
|
visualc71 => Contains a Microsoft Visual C++ (MSVC)
|
||||||
owatcom/ => OpenWatcom project
|
workspace for building libpng and zlib
|
||||||
visualc71/ => Microsoft Visual C++ 7.1 workspace
|
xcode => Contains an Apple xcode
|
||||||
vstudio/ => Microsoft Visual Studio workspace
|
workspace for building libpng and zlib
|
||||||
scripts/ => Scripts and makefiles for building libpng
|
scripts => Directory containing scripts for building libpng:
|
||||||
(see scripts/README.txt for the complete list)
|
(see scripts/README.txt for the list of scripts)
|
||||||
tests/ => Test scripts
|
|
||||||
|
|
||||||
Good luck, and happy coding!
|
Good luck, and happy coding.
|
||||||
|
|
||||||
* Cosmin Truta (current maintainer, since 2018)
|
-Glenn Randers-Pehrson (current maintainer, since 1998)
|
||||||
* Glenn Randers-Pehrson (former maintainer, 1998-2018)
|
Internet: glennrp at users.sourceforge.net
|
||||||
* Andreas Eric Dilger (former maintainer, 1996-1997)
|
|
||||||
* Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
-Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||||
(formerly of Group 42, Inc.)
|
Internet: adilger at enel.ucalgary.ca
|
||||||
|
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
|
||||||
|
|
||||||
|
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
||||||
|
(formerly of Group 42, Inc)
|
||||||
|
Internet: gschal at infinet.com
|
||||||
|
|||||||
47
TODO
47
TODO
@@ -1,22 +1,27 @@
|
|||||||
TODO list for libpng
|
/*
|
||||||
--------------------
|
TODO - list of things to do for libpng:
|
||||||
|
|
||||||
* Fix all defects (duh!)
|
Final bug fixes.
|
||||||
* cHRM transformation.
|
Better C++ wrapper/full C++ implementation?
|
||||||
* Palette creation.
|
Fix problem with C++ and EXTERN "C".
|
||||||
* "grayscale->palette" transformation and "palette->grayscale" detection.
|
cHRM transformation.
|
||||||
* Improved dithering.
|
Remove setjmp/longjmp usage in favor of returning error codes.
|
||||||
* Multi-lingual error and warning message support.
|
Add "grayscale->palette" transformation and "palette->grayscale" detection.
|
||||||
* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
|
Improved dithering.
|
||||||
* Man pages for function calls.
|
Multi-lingual error and warning message support.
|
||||||
* Better documentation.
|
Complete sRGB transformation (presently it simply uses gamma=0.45455).
|
||||||
* Better filter selection
|
Man pages for function calls.
|
||||||
(e.g., counting huffman bits/precompression; filter inertia; filter costs).
|
Better documentation.
|
||||||
* Histogram creation.
|
Better filter selection
|
||||||
* Text conversion between different code pages (e.g., Latin-1 to Mac).
|
(counting huffman bits/precompression? filter inertia? filter costs?).
|
||||||
* Avoid building gamma tables whenever possible.
|
Histogram creation.
|
||||||
* Greater precision in changing to linear gamma for compositing against
|
Text conversion between different code pages (Latin-1 -> Mac and DOS).
|
||||||
background, and in doing rgb-to-gray transformations.
|
Avoid building gamma tables whenever possible.
|
||||||
* Investigate pre-incremented loop counters and other loop constructions.
|
Use greater precision when changing to linear gamma for compositing against
|
||||||
* Interpolated method of handling interlacing.
|
background and doing rgb-to-gray transformation.
|
||||||
* More validations for libpng transformations.
|
Investigate pre-incremented loop counters and other loop constructions.
|
||||||
|
Add interpolated method of handling interlacing.
|
||||||
|
Switch to the simpler zlib (zlib/libpng) license if legally possible.
|
||||||
|
Extend pngvalid.c to validate more of the libpng transformations.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
TRADEMARK
|
|
||||||
=========
|
|
||||||
|
|
||||||
The name "libpng" has not been registered by the Copyright owners
|
|
||||||
as a trademark in any jurisdiction. However, because libpng has
|
|
||||||
been distributed and maintained world-wide, continually since 1995,
|
|
||||||
the Copyright owners claim "common-law trademark protection" in any
|
|
||||||
jurisdiction where common-law trademark is recognized.
|
|
||||||
1378
aclocal.m4
vendored
1378
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
213
arm/arm_init.c
213
arm/arm_init.c
@@ -1,87 +1,167 @@
|
|||||||
|
|
||||||
/* arm_init.c - NEON optimised filter functions
|
/* arm_init.c - NEON optimised filter functions
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018-2022 Cosmin Truta
|
* Copyright (c) 2013 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
|
|
||||||
* Written by Mans Rullgard, 2011.
|
* Written by Mans Rullgard, 2011.
|
||||||
|
* Last changed in libpng 1.5.15 [%RDATE%]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
* and license in png.h
|
* and license in png.h
|
||||||
*/
|
*/
|
||||||
|
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
|
||||||
/* This module requires POSIX 1003.1 functions. */
|
* called.
|
||||||
|
*/
|
||||||
#define _POSIX_SOURCE 1
|
#define _POSIX_SOURCE 1
|
||||||
|
|
||||||
#include "../pngpriv.h"
|
#include "../pngpriv.h"
|
||||||
|
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#if defined(PNG_FILTER_OPTIMIZATIONS) && defined(__arm__) && \
|
||||||
|
defined(__ARM_NEON__)
|
||||||
#if PNG_ARM_NEON_OPT > 0
|
/* __arm__ is defined by GCC, MSVC defines _M_ARM to the ARM version number,
|
||||||
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
|
* Andoid intends to define __ANDROID__, however there are bugs in their
|
||||||
/* WARNING: it is strongly recommended that you do not build libpng with
|
* toolchain; use -D__ANDROID__ to work round this.
|
||||||
* run-time checks for CPU features if at all possible. In the case of the ARM
|
|
||||||
* NEON instructions there is no processor-specific way of detecting the
|
|
||||||
* presence of the required support, therefore run-time detection is extremely
|
|
||||||
* OS specific.
|
|
||||||
*
|
*
|
||||||
* You may set the macro PNG_ARM_NEON_FILE to the file name of file containing
|
* __ARM_NEON__ is used to ensure that the compiler has the appropriate ARM
|
||||||
* a fragment of C source code which defines the png_have_neon function. There
|
* NEON support
|
||||||
* are a number of implementations in contrib/arm-neon, but the only one that
|
|
||||||
* has partial support is contrib/arm-neon/linux.c - a generic Linux
|
|
||||||
* implementation which reads /proc/cpufino.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
|
||||||
#include <signal.h> /* for sig_atomic_t */
|
#include <signal.h> /* for sig_atomic_t */
|
||||||
|
|
||||||
#ifndef PNG_ARM_NEON_FILE
|
#ifdef __ANDROID__
|
||||||
# if defined(__aarch64__) || defined(_M_ARM64)
|
/* Linux provides access to information about CPU capabilites via
|
||||||
/* ARM Neon is expected to be unconditionally available on ARM64. */
|
* /proc/self/auxv, however Android blocks this while still claiming to be
|
||||||
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
|
* Linux. The Andoid NDK, however, provides appropriate support.
|
||||||
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
|
*
|
||||||
/* ARM Neon is expected to be available on the target CPU architecture. */
|
* Documentation: http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
|
||||||
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
|
*/
|
||||||
# elif defined(__linux__)
|
#include <cpu-features.h>
|
||||||
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
|
|
||||||
# else
|
|
||||||
# error No support for run-time ARM Neon checking; use compile-time options
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int png_have_neon(png_structp png_ptr);
|
static int
|
||||||
#ifdef PNG_ARM_NEON_FILE
|
png_have_neon(png_structp png_ptr)
|
||||||
# include PNG_ARM_NEON_FILE
|
{
|
||||||
#endif
|
/* This is a whole lot easier than the mess below, however it is probably
|
||||||
|
* implemented as below, therefore it is better to cache the result (these
|
||||||
|
* function calls may be slow!)
|
||||||
|
*/
|
||||||
|
return andoid_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
|
||||||
|
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
|
||||||
|
}
|
||||||
|
#elif defined(__linux__)
|
||||||
|
/* The generic __linux__ implementation requires reading /proc/self/auxv and
|
||||||
|
* looking at each element for one that records NEON capabilities.
|
||||||
|
*/
|
||||||
|
#include <unistd.h> /* for POSIX 1003.1 */
|
||||||
|
#include <errno.h> /* for EINTR */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <elf.h>
|
||||||
|
#include <asm/hwcap.h>
|
||||||
|
|
||||||
|
/* A read call may be interrupted, in which case it returns -1 and sets errno to
|
||||||
|
* EINTR if nothing was done, otherwise (if something was done) a partial read
|
||||||
|
* may result.
|
||||||
|
*/
|
||||||
|
static size_t
|
||||||
|
safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
|
||||||
|
{
|
||||||
|
size_t ntotal = 0;
|
||||||
|
char *buffer = png_voidcast(char*, buffer_in);
|
||||||
|
|
||||||
|
while (nbytes > 0)
|
||||||
|
{
|
||||||
|
unsigned int nread;
|
||||||
|
int iread;
|
||||||
|
|
||||||
|
/* Passing nread > INT_MAX to read is implementation defined in POSIX
|
||||||
|
* 1003.1, therefore despite the unsigned argument portable code must
|
||||||
|
* limit the value to INT_MAX!
|
||||||
|
*/
|
||||||
|
if (nbytes > INT_MAX)
|
||||||
|
nread = INT_MAX;
|
||||||
|
|
||||||
|
else
|
||||||
|
nread = (unsigned int)/*SAFE*/nbytes;
|
||||||
|
|
||||||
|
iread = read(fd, buffer, nread);
|
||||||
|
|
||||||
|
if (iread == -1)
|
||||||
|
{
|
||||||
|
/* This is the devil in the details, a read can terminate early with 0
|
||||||
|
* bytes read because of EINTR, yet it still returns -1 otherwise end
|
||||||
|
* of file cannot be distinguished.
|
||||||
|
*/
|
||||||
|
if (errno != EINTR)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "/proc read failed");
|
||||||
|
return 0; /* I.e. a permanent failure */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (iread < 0)
|
||||||
|
{
|
||||||
|
/* Not a valid 'read' result: */
|
||||||
|
png_warning(png_ptr, "OS /proc read bug");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (iread > 0)
|
||||||
|
{
|
||||||
|
/* Continue reading until a permanent failure, or EOF */
|
||||||
|
buffer += iread;
|
||||||
|
nbytes -= (unsigned int)/*SAFE*/iread;
|
||||||
|
ntotal += (unsigned int)/*SAFE*/iread;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
return ntotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ntotal; /* nbytes == 0 */
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
png_have_neon(png_structp png_ptr)
|
||||||
|
{
|
||||||
|
int fd = open("/proc/self/auxv", O_RDONLY);
|
||||||
|
Elf32_auxv_t aux;
|
||||||
|
|
||||||
|
/* Failsafe: failure to open means no NEON */
|
||||||
|
if (fd == -1)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "/proc/self/auxv open failed");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux)
|
||||||
|
{
|
||||||
|
if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0)
|
||||||
|
{
|
||||||
|
close(fd);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* We don't know how to do a run-time check on this system */
|
||||||
|
# error "no support for run-time ARM NEON checks"
|
||||||
|
#endif /* OS checks */
|
||||||
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
||||||
|
|
||||||
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
|
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
|
||||||
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
|
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
|
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
|
||||||
{
|
{
|
||||||
/* The switch statement is compiled in for ARM_NEON_API, the call to
|
|
||||||
* png_have_neon is compiled in for ARM_NEON_CHECK. If both are defined
|
|
||||||
* the check is only performed if the API has not set the NEON option on
|
|
||||||
* or off explicitly. In this case the check controls what happens.
|
|
||||||
*
|
|
||||||
* If the CHECK is not compiled in and the option is UNSET the behavior prior
|
|
||||||
* to 1.6.7 was to use the NEON code - this was a bug caused by having the
|
|
||||||
* wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF,
|
|
||||||
* as documented in png.h
|
|
||||||
*/
|
|
||||||
png_debug(1, "in png_init_filter_functions_neon");
|
|
||||||
#ifdef PNG_ARM_NEON_API_SUPPORTED
|
|
||||||
switch ((pp->options >> PNG_ARM_NEON) & 3)
|
|
||||||
{
|
|
||||||
case PNG_OPTION_UNSET:
|
|
||||||
/* Allow the run-time check to execute if it has been enabled -
|
|
||||||
* thus both API and CHECK can be turned on. If it isn't supported
|
|
||||||
* this case will fall through to the 'default' below, which just
|
|
||||||
* returns.
|
|
||||||
*/
|
|
||||||
#endif /* PNG_ARM_NEON_API_SUPPORTED */
|
|
||||||
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
|
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
|
||||||
{
|
|
||||||
static volatile sig_atomic_t no_neon = -1; /* not checked */
|
static volatile sig_atomic_t no_neon = -1; /* not checked */
|
||||||
|
|
||||||
if (no_neon < 0)
|
if (no_neon < 0)
|
||||||
@@ -89,22 +169,8 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
|
|||||||
|
|
||||||
if (no_neon)
|
if (no_neon)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
#ifdef PNG_ARM_NEON_API_SUPPORTED
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_ARM_NEON_API_SUPPORTED
|
|
||||||
default: /* OFF or INVALID */
|
|
||||||
return;
|
|
||||||
|
|
||||||
case PNG_OPTION_ON:
|
|
||||||
/* Option turned on */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* IMPORTANT: any new external functions used here must be declared using
|
/* IMPORTANT: any new external functions used here must be declared using
|
||||||
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
|
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
|
||||||
* 'prefix' option to configure works:
|
* 'prefix' option to configure works:
|
||||||
@@ -134,5 +200,4 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
|
|||||||
png_read_filter_row_paeth4_neon;
|
png_read_filter_row_paeth4_neon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
#endif /* FILTER_OPTIMIZATIONS && __arm__ && __ARM_NEON__ */
|
||||||
#endif /* READ */
|
|
||||||
|
|||||||
@@ -1,60 +1,235 @@
|
|||||||
/* filter_neon.S - placeholder file
|
|
||||||
|
/* filter_neon.S - NEON optimised filter functions
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024 Cosmin Truta
|
* Copyright (c) 2011 Glenn Randers-Pehrson
|
||||||
|
* Written by Mans Rullgard, 2011.
|
||||||
|
* Last changed in libpng 1.5.7 [December 15, 2011]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
* and license in png.h
|
* and license in png.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* IMPORTANT NOTE:
|
/* This is required to get the symbol renames, which are #defines, and also
|
||||||
*
|
* includes the value of PNG_FILTER_OPTIMIZATIONS.
|
||||||
* 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
|
#define PNG_VERSION_INFO_ONLY
|
||||||
#include "../pngpriv.h"
|
#include "../pngpriv.h"
|
||||||
|
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#if defined(PNG_FILTER_OPTIMIZATIONS) && defined(__arm__) && \
|
||||||
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
|
defined(__ARM_NEON__)
|
||||||
#if PNG_ARM_NEON_OPT > 0
|
#if defined(__linux__) && defined(__ELF__)
|
||||||
|
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
||||||
#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 GNUC_VERSION 0 /* not gcc */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300)
|
#ifdef __ELF__
|
||||||
#error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0"
|
# define ELF
|
||||||
#elif GNUC_VERSION == 40504
|
|
||||||
#error "PNG_ARM_NEON is not supported with gcc version 4.5.4"
|
|
||||||
#else
|
#else
|
||||||
#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support"
|
# define ELF @
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
.arch armv7-a
|
||||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
|
.fpu neon
|
||||||
#endif /* READ */
|
|
||||||
|
.macro func name, export=0
|
||||||
|
.macro endfunc
|
||||||
|
ELF .size \name, . - \name
|
||||||
|
.endfunc
|
||||||
|
.purgem endfunc
|
||||||
|
.endm
|
||||||
|
.text
|
||||||
|
.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
|
||||||
|
|
||||||
|
pop {r4,pc}
|
||||||
|
endfunc
|
||||||
|
#endif /* FILTER_OPTIMIZATIONS && __arm__ && __ARM_NEON__ */
|
||||||
|
|||||||
@@ -1,401 +0,0 @@
|
|||||||
/* filter_neon_intrinsics.c - NEON optimised filter functions
|
|
||||||
*
|
|
||||||
* Copyright (c) 2018 Cosmin Truta
|
|
||||||
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
|
|
||||||
* Written by James Yu <james.yu at linaro.org>, October 2013.
|
|
||||||
* Based on filter_neon.S, written by Mans Rullgard, 2011.
|
|
||||||
*
|
|
||||||
* This code is released under the libpng license.
|
|
||||||
* For conditions of distribution and use, see the disclaimer
|
|
||||||
* and license in png.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "../pngpriv.h"
|
|
||||||
|
|
||||||
#ifdef PNG_READ_SUPPORTED
|
|
||||||
|
|
||||||
/* This code requires -mfpu=neon on the command line: */
|
|
||||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
|
|
||||||
# include <arm64_neon.h>
|
|
||||||
#else
|
|
||||||
# include <arm_neon.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* libpng row pointers are not necessarily aligned to any particular boundary,
|
|
||||||
* however this code will only work with appropriate alignment. arm/arm_init.c
|
|
||||||
* checks for this (and will not compile unless it is done). This code uses
|
|
||||||
* variants of png_aligncast to avoid compiler warnings.
|
|
||||||
*/
|
|
||||||
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
|
|
||||||
#define png_ptrc(type,pointer) png_aligncastconst(const type *,pointer)
|
|
||||||
|
|
||||||
/* The following relies on a variable 'temp_pointer' being declared with type
|
|
||||||
* 'type'. This is written this way just to hide the GCC strict aliasing
|
|
||||||
* warning; note that the code is safe because there never is an alias between
|
|
||||||
* the input and output pointers.
|
|
||||||
*
|
|
||||||
* When compiling with MSVC ARM64, the png_ldr macro can't be passed directly
|
|
||||||
* to vst4_lane_u32, because of an internal compiler error inside MSVC.
|
|
||||||
* To avoid this compiler bug, we use a temporary variable (vdest_val) to store
|
|
||||||
* the result of png_ldr.
|
|
||||||
*/
|
|
||||||
#define png_ldr(type,pointer)\
|
|
||||||
(temp_pointer = png_ptr(type,pointer), *temp_pointer)
|
|
||||||
|
|
||||||
#if PNG_ARM_NEON_OPT > 0
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
png_const_bytep pp = prev_row;
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_up_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop; rp += 16, pp += 16)
|
|
||||||
{
|
|
||||||
uint8x16_t qrp, qpp;
|
|
||||||
|
|
||||||
qrp = vld1q_u8(rp);
|
|
||||||
qpp = vld1q_u8(pp);
|
|
||||||
qrp = vaddq_u8(qrp, qpp);
|
|
||||||
vst1q_u8(rp, qrp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
|
|
||||||
uint8x16_t vtmp = vld1q_u8(rp);
|
|
||||||
uint8x8x2_t *vrpt = png_ptr(uint8x8x2_t, &vtmp);
|
|
||||||
uint8x8x2_t vrp = *vrpt;
|
|
||||||
|
|
||||||
uint8x8x4_t vdest;
|
|
||||||
vdest.val[3] = vdup_n_u8(0);
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_sub3_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop;)
|
|
||||||
{
|
|
||||||
uint8x8_t vtmp1, vtmp2;
|
|
||||||
uint32x2_t *temp_pointer;
|
|
||||||
|
|
||||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
|
|
||||||
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
|
|
||||||
vtmp2 = vext_u8(vrp.val[0], vrp.val[1], 6);
|
|
||||||
vdest.val[1] = vadd_u8(vdest.val[0], vtmp1);
|
|
||||||
|
|
||||||
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
|
|
||||||
vdest.val[2] = vadd_u8(vdest.val[1], vtmp2);
|
|
||||||
vdest.val[3] = vadd_u8(vdest.val[2], vtmp1);
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(rp + 12);
|
|
||||||
vrpt = png_ptr(uint8x8x2_t, &vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
|
|
||||||
rp += 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
PNG_UNUSED(prev_row)
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
|
|
||||||
uint8x8x4_t vdest;
|
|
||||||
vdest.val[3] = vdup_n_u8(0);
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_sub4_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop; rp += 16)
|
|
||||||
{
|
|
||||||
uint32x2x4_t vtmp = vld4_u32(png_ptr(uint32_t,rp));
|
|
||||||
uint8x8x4_t *vrpt = png_ptr(uint8x8x4_t,&vtmp);
|
|
||||||
uint8x8x4_t vrp = *vrpt;
|
|
||||||
uint32x2x4_t *temp_pointer;
|
|
||||||
uint32x2x4_t vdest_val;
|
|
||||||
|
|
||||||
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
|
|
||||||
vdest.val[1] = vadd_u8(vdest.val[0], vrp.val[1]);
|
|
||||||
vdest.val[2] = vadd_u8(vdest.val[1], vrp.val[2]);
|
|
||||||
vdest.val[3] = vadd_u8(vdest.val[2], vrp.val[3]);
|
|
||||||
|
|
||||||
vdest_val = png_ldr(uint32x2x4_t, &vdest);
|
|
||||||
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
PNG_UNUSED(prev_row)
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_const_bytep pp = prev_row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
|
|
||||||
uint8x16_t vtmp;
|
|
||||||
uint8x8x2_t *vrpt;
|
|
||||||
uint8x8x2_t vrp;
|
|
||||||
uint8x8x4_t vdest;
|
|
||||||
vdest.val[3] = vdup_n_u8(0);
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(rp);
|
|
||||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_avg3_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop; pp += 12)
|
|
||||||
{
|
|
||||||
uint8x8_t vtmp1, vtmp2, vtmp3;
|
|
||||||
|
|
||||||
uint8x8x2_t *vppt;
|
|
||||||
uint8x8x2_t vpp;
|
|
||||||
|
|
||||||
uint32x2_t *temp_pointer;
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(pp);
|
|
||||||
vppt = png_ptr(uint8x8x2_t,&vtmp);
|
|
||||||
vpp = *vppt;
|
|
||||||
|
|
||||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
|
|
||||||
vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]);
|
|
||||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
|
||||||
|
|
||||||
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3);
|
|
||||||
vtmp3 = vext_u8(vrp.val[0], vrp.val[1], 6);
|
|
||||||
vdest.val[1] = vhadd_u8(vdest.val[0], vtmp2);
|
|
||||||
vdest.val[1] = vadd_u8(vdest.val[1], vtmp1);
|
|
||||||
|
|
||||||
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 6);
|
|
||||||
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(rp + 12);
|
|
||||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
|
|
||||||
vdest.val[2] = vhadd_u8(vdest.val[1], vtmp2);
|
|
||||||
vdest.val[2] = vadd_u8(vdest.val[2], vtmp3);
|
|
||||||
|
|
||||||
vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1);
|
|
||||||
|
|
||||||
vdest.val[3] = vhadd_u8(vdest.val[2], vtmp2);
|
|
||||||
vdest.val[3] = vadd_u8(vdest.val[3], vtmp1);
|
|
||||||
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
|
|
||||||
rp += 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
png_const_bytep pp = prev_row;
|
|
||||||
|
|
||||||
uint8x8x4_t vdest;
|
|
||||||
vdest.val[3] = vdup_n_u8(0);
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_avg4_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop; rp += 16, pp += 16)
|
|
||||||
{
|
|
||||||
uint32x2x4_t vtmp;
|
|
||||||
uint8x8x4_t *vrpt, *vppt;
|
|
||||||
uint8x8x4_t vrp, vpp;
|
|
||||||
uint32x2x4_t *temp_pointer;
|
|
||||||
uint32x2x4_t vdest_val;
|
|
||||||
|
|
||||||
vtmp = vld4_u32(png_ptr(uint32_t,rp));
|
|
||||||
vrpt = png_ptr(uint8x8x4_t,&vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
vtmp = vld4_u32(png_ptrc(uint32_t,pp));
|
|
||||||
vppt = png_ptr(uint8x8x4_t,&vtmp);
|
|
||||||
vpp = *vppt;
|
|
||||||
|
|
||||||
vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]);
|
|
||||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
|
||||||
vdest.val[1] = vhadd_u8(vdest.val[0], vpp.val[1]);
|
|
||||||
vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]);
|
|
||||||
vdest.val[2] = vhadd_u8(vdest.val[1], vpp.val[2]);
|
|
||||||
vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]);
|
|
||||||
vdest.val[3] = vhadd_u8(vdest.val[2], vpp.val[3]);
|
|
||||||
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
|
|
||||||
|
|
||||||
vdest_val = png_ldr(uint32x2x4_t, &vdest);
|
|
||||||
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint8x8_t
|
|
||||||
paeth(uint8x8_t a, uint8x8_t b, uint8x8_t c)
|
|
||||||
{
|
|
||||||
uint8x8_t d, e;
|
|
||||||
uint16x8_t p1, pa, pb, pc;
|
|
||||||
|
|
||||||
p1 = vaddl_u8(a, b); /* a + b */
|
|
||||||
pc = vaddl_u8(c, c); /* c * 2 */
|
|
||||||
pa = vabdl_u8(b, c); /* pa */
|
|
||||||
pb = vabdl_u8(a, c); /* pb */
|
|
||||||
pc = vabdq_u16(p1, pc); /* pc */
|
|
||||||
|
|
||||||
p1 = vcleq_u16(pa, pb); /* pa <= pb */
|
|
||||||
pa = vcleq_u16(pa, pc); /* pa <= pc */
|
|
||||||
pb = vcleq_u16(pb, pc); /* pb <= pc */
|
|
||||||
|
|
||||||
p1 = vandq_u16(p1, pa); /* pa <= pb && pa <= pc */
|
|
||||||
|
|
||||||
d = vmovn_u16(pb);
|
|
||||||
e = vmovn_u16(p1);
|
|
||||||
|
|
||||||
d = vbsl_u8(d, b, c);
|
|
||||||
e = vbsl_u8(e, a, d);
|
|
||||||
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_const_bytep pp = prev_row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
|
|
||||||
uint8x16_t vtmp;
|
|
||||||
uint8x8x2_t *vrpt;
|
|
||||||
uint8x8x2_t vrp;
|
|
||||||
uint8x8_t vlast = vdup_n_u8(0);
|
|
||||||
uint8x8x4_t vdest;
|
|
||||||
vdest.val[3] = vdup_n_u8(0);
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(rp);
|
|
||||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_paeth3_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop; pp += 12)
|
|
||||||
{
|
|
||||||
uint8x8x2_t *vppt;
|
|
||||||
uint8x8x2_t vpp;
|
|
||||||
uint8x8_t vtmp1, vtmp2, vtmp3;
|
|
||||||
uint32x2_t *temp_pointer;
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(pp);
|
|
||||||
vppt = png_ptr(uint8x8x2_t,&vtmp);
|
|
||||||
vpp = *vppt;
|
|
||||||
|
|
||||||
vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast);
|
|
||||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
|
||||||
|
|
||||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
|
|
||||||
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3);
|
|
||||||
vdest.val[1] = paeth(vdest.val[0], vtmp2, vpp.val[0]);
|
|
||||||
vdest.val[1] = vadd_u8(vdest.val[1], vtmp1);
|
|
||||||
|
|
||||||
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 6);
|
|
||||||
vtmp3 = vext_u8(vpp.val[0], vpp.val[1], 6);
|
|
||||||
vdest.val[2] = paeth(vdest.val[1], vtmp3, vtmp2);
|
|
||||||
vdest.val[2] = vadd_u8(vdest.val[2], vtmp1);
|
|
||||||
|
|
||||||
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
|
|
||||||
vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1);
|
|
||||||
|
|
||||||
vtmp = vld1q_u8(rp + 12);
|
|
||||||
vrpt = png_ptr(uint8x8x2_t,&vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
|
|
||||||
vdest.val[3] = paeth(vdest.val[2], vtmp2, vtmp3);
|
|
||||||
vdest.val[3] = vadd_u8(vdest.val[3], vtmp1);
|
|
||||||
|
|
||||||
vlast = vtmp2;
|
|
||||||
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
|
|
||||||
rp += 3;
|
|
||||||
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
|
|
||||||
rp += 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row,
|
|
||||||
png_const_bytep prev_row)
|
|
||||||
{
|
|
||||||
png_bytep rp = row;
|
|
||||||
png_bytep rp_stop = row + row_info->rowbytes;
|
|
||||||
png_const_bytep pp = prev_row;
|
|
||||||
|
|
||||||
uint8x8_t vlast = vdup_n_u8(0);
|
|
||||||
uint8x8x4_t vdest;
|
|
||||||
vdest.val[3] = vdup_n_u8(0);
|
|
||||||
|
|
||||||
png_debug(1, "in png_read_filter_row_paeth4_neon");
|
|
||||||
|
|
||||||
for (; rp < rp_stop; rp += 16, pp += 16)
|
|
||||||
{
|
|
||||||
uint32x2x4_t vtmp;
|
|
||||||
uint8x8x4_t *vrpt, *vppt;
|
|
||||||
uint8x8x4_t vrp, vpp;
|
|
||||||
uint32x2x4_t *temp_pointer;
|
|
||||||
uint32x2x4_t vdest_val;
|
|
||||||
|
|
||||||
vtmp = vld4_u32(png_ptr(uint32_t,rp));
|
|
||||||
vrpt = png_ptr(uint8x8x4_t,&vtmp);
|
|
||||||
vrp = *vrpt;
|
|
||||||
vtmp = vld4_u32(png_ptrc(uint32_t,pp));
|
|
||||||
vppt = png_ptr(uint8x8x4_t,&vtmp);
|
|
||||||
vpp = *vppt;
|
|
||||||
|
|
||||||
vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast);
|
|
||||||
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
|
|
||||||
vdest.val[1] = paeth(vdest.val[0], vpp.val[1], vpp.val[0]);
|
|
||||||
vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]);
|
|
||||||
vdest.val[2] = paeth(vdest.val[1], vpp.val[2], vpp.val[1]);
|
|
||||||
vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]);
|
|
||||||
vdest.val[3] = paeth(vdest.val[2], vpp.val[3], vpp.val[2]);
|
|
||||||
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
|
|
||||||
|
|
||||||
vlast = vpp.val[3];
|
|
||||||
|
|
||||||
vdest_val = png_ldr(uint32x2x4_t, &vdest);
|
|
||||||
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
|
||||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 1 (intrinsics) */
|
|
||||||
#endif /* READ */
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
|
|
||||||
*
|
|
||||||
* Copyright (c) 2018-2019 Cosmin Truta
|
|
||||||
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
|
|
||||||
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
|
|
||||||
*
|
|
||||||
* This code is released under the libpng license.
|
|
||||||
* For conditions of distribution and use, see the disclaimer
|
|
||||||
* and license in png.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "../pngpriv.h"
|
|
||||||
|
|
||||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
|
|
||||||
# include <arm64_neon.h>
|
|
||||||
#else
|
|
||||||
# include <arm_neon.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
|
|
||||||
void
|
|
||||||
png_riffle_palette_neon(png_structrp png_ptr)
|
|
||||||
{
|
|
||||||
png_const_colorp palette = png_ptr->palette;
|
|
||||||
png_bytep riffled_palette = png_ptr->riffled_palette;
|
|
||||||
png_const_bytep trans_alpha = png_ptr->trans_alpha;
|
|
||||||
int num_trans = png_ptr->num_trans;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Initially black, opaque. */
|
|
||||||
uint8x16x4_t w = {{
|
|
||||||
vdupq_n_u8(0x00),
|
|
||||||
vdupq_n_u8(0x00),
|
|
||||||
vdupq_n_u8(0x00),
|
|
||||||
vdupq_n_u8(0xff),
|
|
||||||
}};
|
|
||||||
|
|
||||||
png_debug(1, "in png_riffle_palette_neon");
|
|
||||||
|
|
||||||
/* First, riffle the RGB colours into an RGBA8 palette.
|
|
||||||
* The alpha component is set to opaque for now.
|
|
||||||
*/
|
|
||||||
for (i = 0; i < 256; i += 16)
|
|
||||||
{
|
|
||||||
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
|
|
||||||
w.val[0] = v.val[0];
|
|
||||||
w.val[1] = v.val[1];
|
|
||||||
w.val[2] = v.val[2];
|
|
||||||
vst4q_u8(riffled_palette + (i << 2), w);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fix up the missing transparency values. */
|
|
||||||
for (i = 0; i < num_trans; i++)
|
|
||||||
riffled_palette[(i << 2) + 3] = trans_alpha[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Expands a palettized row into RGBA8. */
|
|
||||||
int
|
|
||||||
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
|
|
||||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
|
||||||
{
|
|
||||||
png_uint_32 row_width = row_info->width;
|
|
||||||
const png_uint_32 *riffled_palette =
|
|
||||||
png_aligncastconst(png_const_uint_32p, png_ptr->riffled_palette);
|
|
||||||
const png_uint_32 pixels_per_chunk = 4;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
png_debug(1, "in png_do_expand_palette_rgba8_neon");
|
|
||||||
|
|
||||||
PNG_UNUSED(row)
|
|
||||||
if (row_width < pixels_per_chunk)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* This function originally gets the last byte of the output row.
|
|
||||||
* The NEON part writes forward from a given position, so we have
|
|
||||||
* to seek this back by 4 pixels x 4 bytes.
|
|
||||||
*/
|
|
||||||
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1);
|
|
||||||
|
|
||||||
for (i = 0; i < row_width; i += pixels_per_chunk)
|
|
||||||
{
|
|
||||||
uint32x4_t cur;
|
|
||||||
png_bytep sp = *ssp - i, dp = *ddp - (i << 2);
|
|
||||||
cur = vld1q_dup_u32 (riffled_palette + *(sp - 3));
|
|
||||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1);
|
|
||||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2);
|
|
||||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3);
|
|
||||||
vst1q_u32((void *)dp, cur);
|
|
||||||
}
|
|
||||||
if (i != row_width)
|
|
||||||
{
|
|
||||||
/* Remove the amount that wasn't processed. */
|
|
||||||
i -= pixels_per_chunk;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Decrement output pointers. */
|
|
||||||
*ssp = *ssp - i;
|
|
||||||
*ddp = *ddp - (i << 2);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Expands a palettized row into RGB8. */
|
|
||||||
int
|
|
||||||
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
|
|
||||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
|
||||||
{
|
|
||||||
png_uint_32 row_width = row_info->width;
|
|
||||||
png_const_bytep palette = (png_const_bytep)png_ptr->palette;
|
|
||||||
const png_uint_32 pixels_per_chunk = 8;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
png_debug(1, "in png_do_expand_palette_rgb8_neon");
|
|
||||||
|
|
||||||
PNG_UNUSED(row)
|
|
||||||
if (row_width <= pixels_per_chunk)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* Seeking this back by 8 pixels x 3 bytes. */
|
|
||||||
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1);
|
|
||||||
|
|
||||||
for (i = 0; i < row_width; i += pixels_per_chunk)
|
|
||||||
{
|
|
||||||
uint8x8x3_t cur;
|
|
||||||
png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i);
|
|
||||||
cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7)));
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1);
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2);
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3);
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4);
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5);
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6);
|
|
||||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7);
|
|
||||||
vst3_u8((void *)dp, cur);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i != row_width)
|
|
||||||
{
|
|
||||||
/* Remove the amount that wasn't processed. */
|
|
||||||
i -= pixels_per_chunk;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Decrement output pointers. */
|
|
||||||
*ssp = *ssp - i;
|
|
||||||
*ddp = *ddp - ((i << 1) + i);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION */
|
|
||||||
25
autogen.sh
25
autogen.sh
@@ -9,15 +9,15 @@
|
|||||||
#
|
#
|
||||||
# For regular ("tarball") distributions all the files should exist. We do not
|
# For regular ("tarball") distributions all the files should exist. We do not
|
||||||
# want them to be updated *under any circumstances*. It should never be
|
# want them to be updated *under any circumstances*. It should never be
|
||||||
# necessary to run autogen.sh because ./configure --enable-maintainer-mode says
|
# necessary to rune autogen.sh because ./configure --enable-maintainer-mode says
|
||||||
# what to do if Makefile.am or configure.ac are changed.
|
# what to do if Makeile.am or configure.ac are changed.
|
||||||
#
|
#
|
||||||
# It is *probably* OK to update the files on a GIT checkout, because they have
|
# It is *probably* OK to update the files on a GIT checkout, because they have
|
||||||
# come from the local tools, but leave that to the user who is assumed to know
|
# come from the local tools, but leave that to the user who is assumed to know
|
||||||
# whether it is ok or required.
|
# whether it is ok or required.
|
||||||
#
|
#
|
||||||
# This script is intended to work without arguments, there are, however, hidden
|
# This script is intended to work without arguments, there are, however, hidden
|
||||||
# arguments (a) for use while testing the script and (b) to fix up systems that
|
# arguments for (a) use while testing the script and (b) to fix up systems that
|
||||||
# have been broken. If (b) is required the script prompts for the correct
|
# have been broken. If (b) is required the script prompts for the correct
|
||||||
# options. For this reason the options are *NOT* documented in the help; this
|
# options. For this reason the options are *NOT* documented in the help; this
|
||||||
# is deliberate; UTSL.
|
# is deliberate; UTSL.
|
||||||
@@ -73,18 +73,12 @@ done
|
|||||||
# present bad things are happening.
|
# present bad things are happening.
|
||||||
#
|
#
|
||||||
# The autotools generated files:
|
# The autotools generated files:
|
||||||
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
|
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in\
|
||||||
config.sub configure depcomp install-sh ltmain.sh missing\
|
config.sub configure depcomp install-sh ltmain.sh missing test-driver"
|
||||||
test-driver"
|
|
||||||
#
|
|
||||||
# Files generated by versions of autoconf >2.68 or automake >1.13 (i.e. later
|
|
||||||
# versions than those required by configure.ac):
|
|
||||||
libpng_autotools_extra="compile config.h.in~"
|
|
||||||
#
|
#
|
||||||
# These are separate because 'maintainer-clean' does not remove them.
|
# These are separate because 'maintainer-clean' does not remove them.
|
||||||
libpng_libtool_files="scripts/autoconf/libtool.m4 scripts/autoconf/ltoptions.m4\
|
libpng_libtool_files="scripts/libtool.m4 scripts/ltoptions.m4\
|
||||||
scripts/autoconf/ltsugar.m4 scripts/autoconf/ltversion.m4\
|
scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4"
|
||||||
scripts/autoconf/lt~obsolete.m4"
|
|
||||||
|
|
||||||
libpng_autotools_dirs="autom4te.cache" # not required
|
libpng_autotools_dirs="autom4te.cache" # not required
|
||||||
#
|
#
|
||||||
@@ -100,7 +94,6 @@ libpng_configure_dirs=".deps"
|
|||||||
# of Makefile. These functions do the two bits of cleaning.
|
# of Makefile. These functions do the two bits of cleaning.
|
||||||
clean_autotools(){
|
clean_autotools(){
|
||||||
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
|
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
|
||||||
rm -rf $libpng_autotools_extra
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clean_configure(){
|
clean_configure(){
|
||||||
@@ -195,7 +188,7 @@ case "$mode" in
|
|||||||
if test -d .git
|
if test -d .git
|
||||||
then
|
then
|
||||||
exec >&2
|
exec >&2
|
||||||
echo "ERROR: running autoreconf on an initialized system"
|
echo "ERROR: running autoreconf on an initialized sytem"
|
||||||
echo " This is not necessary; it is only necessary to remake the"
|
echo " This is not necessary; it is only necessary to remake the"
|
||||||
echo " autotools generated files if Makefile.am or configure.ac"
|
echo " autotools generated files if Makefile.am or configure.ac"
|
||||||
echo " change and make does the right thing with:"
|
echo " change and make does the right thing with:"
|
||||||
@@ -205,7 +198,7 @@ case "$mode" in
|
|||||||
echo " You can run autoreconf yourself if you don't like maintainer"
|
echo " You can run autoreconf yourself if you don't like maintainer"
|
||||||
echo " mode and you can also just run autoreconf -f -i to initialize"
|
echo " mode and you can also just run autoreconf -f -i to initialize"
|
||||||
echo " everything in the first place; this script is only for"
|
echo " everything in the first place; this script is only for"
|
||||||
echo " compatibility with prior releases."
|
echo " compatiblity with prior releases."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
exec >&2
|
exec >&2
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
# Disable the "expressions don't expand in single quotes, use double quotes"
|
|
||||||
# advice. We need the regular expressions to remain uninterpolated.
|
|
||||||
disable=SC2016
|
|
||||||
|
|
||||||
# Disable the "variable appears unused" warning caused by the use of getopts
|
|
||||||
# with an obligatory (but unused) variable name in the main function.
|
|
||||||
disable=SC2034
|
|
||||||
|
|
||||||
# Disable all the "quote to prevent globbing or word splitting" advice.
|
|
||||||
# We need word splitting for well-known variables like MAKEFLAGS and CFLAGS.
|
|
||||||
disable=SC2086,SC2206
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
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.
|
|
||||||
25
ci/README.md
25
ci/README.md
@@ -1,25 +0,0 @@
|
|||||||
Scripts for the Continuous Integration of the PNG Reference Library
|
|
||||||
===================================================================
|
|
||||||
|
|
||||||
Copyright Notice
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Copyright (c) 2019-2025 Cosmin Truta.
|
|
||||||
|
|
||||||
Use, modification and distribution are subject to the MIT License.
|
|
||||||
Please see the accompanying file `LICENSE_MIT.txt` or visit
|
|
||||||
https://opensource.org/license/mit
|
|
||||||
|
|
||||||
File List
|
|
||||||
---------
|
|
||||||
|
|
||||||
LICENSE_MIT.txt ==> The License file
|
|
||||||
README.md ==> This file
|
|
||||||
ci_lint.sh ==> Lint the source code
|
|
||||||
ci_shellify.sh ==> Convert select definitions to shell syntax
|
|
||||||
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 utilities for the main ci_*.sh scripts
|
|
||||||
targets/*/ci_env.*.sh ==> Shell environments for cross-platform testing
|
|
||||||
142
ci/ci_lint.sh
142
ci/ci_lint.sh
@@ -1,142 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
|
||||||
#
|
|
||||||
# Use, modification and distribution are subject to the MIT License.
|
|
||||||
# Please see the accompanying file LICENSE_MIT.txt
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
# shellcheck source=ci/lib/ci.lib.sh
|
|
||||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
|
||||||
cd "$CI_TOPLEVEL_DIR"
|
|
||||||
|
|
||||||
# Initialize the global constants CI_{...}{CHECK,CHECKER,LINT}.
|
|
||||||
CI_SHELLCHECK="${CI_SHELLCHECK:-shellcheck}"
|
|
||||||
CI_EDITORCONFIG_CHECKER="${CI_EDITORCONFIG_CHECKER:-editorconfig-checker}"
|
|
||||||
CI_YAMLLINT="${CI_YAMLLINT:-yamllint}"
|
|
||||||
|
|
||||||
# Initialize the global lint status.
|
|
||||||
CI_LINT_STATUS=0
|
|
||||||
|
|
||||||
function ci_init_lint {
|
|
||||||
ci_info "## START OF LINTING ##"
|
|
||||||
local my_program
|
|
||||||
# Complete the initialization of CI_SHELLCHECK.
|
|
||||||
# Set it to the empty string if the shellcheck program is unavailable.
|
|
||||||
my_program="$(command -v "$CI_SHELLCHECK")" || {
|
|
||||||
ci_warn "program not found: '$CI_SHELLCHECK'"
|
|
||||||
}
|
|
||||||
CI_SHELLCHECK="$my_program"
|
|
||||||
# Complete the initialization of CI_EDITORCONFIG_CHECKER.
|
|
||||||
# Set it to the empty string if the editorconfig-checker program is unavailable.
|
|
||||||
my_program="$(command -v "$CI_EDITORCONFIG_CHECKER")" || {
|
|
||||||
ci_warn "program not found: '$CI_EDITORCONFIG_CHECKER'"
|
|
||||||
}
|
|
||||||
CI_EDITORCONFIG_CHECKER="$my_program"
|
|
||||||
# Complete the initialization of CI_YAMLLINT.
|
|
||||||
# Set it to the empty string if the yamllint program is unavailable.
|
|
||||||
my_program="$(command -v "$CI_YAMLLINT")" || {
|
|
||||||
ci_warn "program not found: '$CI_YAMLLINT'"
|
|
||||||
}
|
|
||||||
CI_YAMLLINT="$my_program"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_finish_lint {
|
|
||||||
ci_info "## END OF LINTING ##"
|
|
||||||
if [[ $CI_LINT_STATUS -eq 0 ]]
|
|
||||||
then
|
|
||||||
ci_info "## SUCCESS ##"
|
|
||||||
else
|
|
||||||
ci_info "linting failed"
|
|
||||||
fi
|
|
||||||
return "$CI_LINT_STATUS"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_lint_ci_scripts {
|
|
||||||
[[ -x $CI_SHELLCHECK ]] || {
|
|
||||||
ci_warn "## NOT LINTING: CI scripts ##"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
ci_info "## LINTING: CI scripts ##"
|
|
||||||
ci_spawn "$CI_SHELLCHECK" --version
|
|
||||||
find ./ci -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 {
|
|
||||||
[[ -x $CI_EDITORCONFIG_CHECKER ]] || {
|
|
||||||
ci_warn "## NOT LINTING: text files ##"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
ci_info "## LINTING: text files ##"
|
|
||||||
ci_spawn "$CI_EDITORCONFIG_CHECKER" --version
|
|
||||||
ci_spawn "$CI_EDITORCONFIG_CHECKER" --config .editorconfig-checker.json || {
|
|
||||||
# Linting failed.
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_lint_yaml_files {
|
|
||||||
[[ -x $CI_YAMLLINT ]] || {
|
|
||||||
ci_warn "## NOT LINTING: YAML files ##"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
ci_info "## LINTING: YAML files ##"
|
|
||||||
ci_spawn "$CI_YAMLLINT" --version
|
|
||||||
# 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_STATUS=1
|
|
||||||
ci_lint_text_files || CI_LINT_STATUS=1
|
|
||||||
ci_lint_yaml_files || CI_LINT_STATUS=1
|
|
||||||
# TODO: ci_lint_png_files, etc.
|
|
||||||
ci_finish_lint
|
|
||||||
}
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
|
||||||
echo "options: -?|-h|--help"
|
|
||||||
exit "${@:-0}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local opt
|
|
||||||
while getopts ":" opt
|
|
||||||
do
|
|
||||||
# This ain't a while-loop. It only pretends to be.
|
|
||||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
|
||||||
ci_err "unknown option: '$1'"
|
|
||||||
done
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
[[ $# -eq 0 ]] || {
|
|
||||||
echo >&2 "error: unexpected argument: '$1'"
|
|
||||||
usage 2
|
|
||||||
}
|
|
||||||
# And... go!
|
|
||||||
ci_lint
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,209 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
|
||||||
#
|
|
||||||
# Use, modification and distribution are subject to the MIT License.
|
|
||||||
# Please see the accompanying file LICENSE_MIT.txt
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
# shellcheck source=ci/lib/ci.lib.sh
|
|
||||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
|
||||||
cd "$CI_TOPLEVEL_DIR"
|
|
||||||
|
|
||||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
|
||||||
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"
|
|
||||||
|
|
||||||
function ci_init_build {
|
|
||||||
# Ensure that the mandatory variables are initialized.
|
|
||||||
CI_CMAKE="${CI_CMAKE:-cmake}"
|
|
||||||
CI_CTEST="${CI_CTEST:-ctest}"
|
|
||||||
CI_CMAKE_BUILD_TYPE="${CI_CMAKE_BUILD_TYPE:-Release}"
|
|
||||||
if [[ $CI_CMAKE_GENERATOR == "Visual Studio"* ]]
|
|
||||||
then
|
|
||||||
# Clean up incidental mixtures of Windows and Bash-on-Windows
|
|
||||||
# environment variables, to avoid confusing MSBuild.
|
|
||||||
[[ $TEMP && ( $Temp || $temp ) ]] && unset TEMP
|
|
||||||
[[ $TMP && ( $Tmp || $tmp ) ]] && unset TMP
|
|
||||||
# Ensure that CI_CMAKE_GENERATOR_PLATFORM is initialized for this generator.
|
|
||||||
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] || {
|
|
||||||
ci_err_internal "missing \$CI_CMAKE_GENERATOR_PLATFORM"
|
|
||||||
}
|
|
||||||
elif [[ -x $(command -v ninja) ]]
|
|
||||||
then
|
|
||||||
CI_CMAKE_GENERATOR="${CI_CMAKE_GENERATOR:-Ninja}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_trace_build {
|
|
||||||
ci_info "## START OF CONFIGURATION ##"
|
|
||||||
ci_info "build arch: $CI_BUILD_ARCH"
|
|
||||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
|
||||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
|
||||||
ci_info "target arch: $CI_TARGET_ARCH"
|
|
||||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
|
||||||
}
|
|
||||||
ci_info "source directory: $CI_SRC_DIR"
|
|
||||||
ci_info "build directory: $CI_BUILD_DIR"
|
|
||||||
ci_info "install directory: $CI_INSTALL_DIR"
|
|
||||||
ci_info "environment option: \$CI_CMAKE: '$CI_CMAKE'"
|
|
||||||
ci_info "environment option: \$CI_CMAKE_GENERATOR: '$CI_CMAKE_GENERATOR'"
|
|
||||||
ci_info "environment option: \$CI_CMAKE_GENERATOR_PLATFORM: '$CI_CMAKE_GENERATOR_PLATFORM'"
|
|
||||||
ci_info "environment option: \$CI_CMAKE_BUILD_TYPE: '$CI_CMAKE_BUILD_TYPE'"
|
|
||||||
ci_info "environment option: \$CI_CMAKE_BUILD_FLAGS: '$CI_CMAKE_BUILD_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_CMAKE_TOOLCHAIN_FILE: '$CI_CMAKE_TOOLCHAIN_FILE'"
|
|
||||||
ci_info "environment option: \$CI_CMAKE_VARS: '$CI_CMAKE_VARS'"
|
|
||||||
ci_info "environment option: \$CI_CTEST: '$CI_CTEST'"
|
|
||||||
ci_info "environment option: \$CI_CTEST_FLAGS: '$CI_CTEST_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
|
||||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
|
||||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
|
||||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
|
||||||
ci_info "environment option: \$CI_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'"
|
|
||||||
ci_info "executable: \$CI_CMAKE: $(command -V "$CI_CMAKE")"
|
|
||||||
ci_info "executable: \$CI_CTEST: $(command -V "$CI_CTEST")"
|
|
||||||
[[ $CI_CC ]] && {
|
|
||||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
|
||||||
}
|
|
||||||
[[ $CI_AR ]] && {
|
|
||||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
|
||||||
}
|
|
||||||
[[ $CI_RANLIB ]] && {
|
|
||||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
|
||||||
}
|
|
||||||
ci_info "## END OF CONFIGURATION ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_cleanup_old_build {
|
|
||||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
|
||||||
[[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
|
|
||||||
ci_spawn rm -fr "$CI_BUILD_DIR"
|
|
||||||
ci_spawn rm -fr "$CI_INSTALL_DIR"
|
|
||||||
}
|
|
||||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_build {
|
|
||||||
ci_info "## START OF BUILD ##"
|
|
||||||
# Adjust the CI environment variables, as needed.
|
|
||||||
CI_CMAKE="$(command -v "$CI_CMAKE")" || ci_err "bad or missing \$CI_CMAKE"
|
|
||||||
ci_spawn "$CI_CMAKE" --version
|
|
||||||
CI_CTEST="$(command -v "$CI_CTEST")" || ci_err "bad or missing \$CI_CTEST"
|
|
||||||
ci_spawn "$CI_CTEST" --version
|
|
||||||
[[ $CI_CMAKE_GENERATOR == *"Ninja"* ]] && {
|
|
||||||
CI_NINJA="$(command -v ninja)" || ci_err "bad or missing ninja, no pun intended"
|
|
||||||
ci_spawn "$CI_NINJA" --version
|
|
||||||
}
|
|
||||||
[[ $CI_AR ]] && {
|
|
||||||
# Use the full path of CI_AR to work around a mysterious CMake error.
|
|
||||||
CI_AR="$(command -v "$CI_AR")" || ci_err "bad or missing \$CI_AR"
|
|
||||||
}
|
|
||||||
[[ $CI_RANLIB ]] && {
|
|
||||||
# Use the full path of CI_RANLIB to work around a mysterious CMake error.
|
|
||||||
CI_RANLIB="$(command -v "$CI_RANLIB")" || ci_err "bad or missing \$CI_RANLIB"
|
|
||||||
}
|
|
||||||
# Export the CMake environment variables.
|
|
||||||
[[ $CI_CMAKE_GENERATOR ]] && {
|
|
||||||
ci_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
|
|
||||||
}
|
|
||||||
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] && {
|
|
||||||
ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
|
|
||||||
}
|
|
||||||
# Initialize and populate the local arrays.
|
|
||||||
local all_cmake_vars=()
|
|
||||||
local all_cmake_build_flags=()
|
|
||||||
local all_ctest_flags=()
|
|
||||||
[[ $CI_CMAKE_TOOLCHAIN_FILE ]] && {
|
|
||||||
all_cmake_vars+=("-DCMAKE_TOOLCHAIN_FILE=$CI_CMAKE_TOOLCHAIN_FILE")
|
|
||||||
}
|
|
||||||
[[ $CI_CC ]] && {
|
|
||||||
all_cmake_vars+=("-DCMAKE_C_COMPILER=$CI_CC")
|
|
||||||
}
|
|
||||||
[[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
|
|
||||||
[[ $CI_SANITIZERS ]] && CI_CC_FLAGS+="${CI_CC_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
|
|
||||||
all_cmake_vars+=("-DCMAKE_C_FLAGS=$CI_CC_FLAGS")
|
|
||||||
}
|
|
||||||
[[ $CI_AR ]] && {
|
|
||||||
all_cmake_vars+=("-DCMAKE_AR=$CI_AR")
|
|
||||||
}
|
|
||||||
[[ $CI_RANLIB ]] && {
|
|
||||||
all_cmake_vars+=("-DCMAKE_RANLIB=$CI_RANLIB")
|
|
||||||
}
|
|
||||||
all_cmake_vars+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE")
|
|
||||||
all_cmake_vars+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
|
|
||||||
all_cmake_vars+=($CI_CMAKE_VARS)
|
|
||||||
all_cmake_build_flags+=($CI_CMAKE_BUILD_FLAGS)
|
|
||||||
all_ctest_flags+=($CI_CTEST_FLAGS)
|
|
||||||
# And... build!
|
|
||||||
ci_spawn mkdir -p "$CI_BUILD_DIR"
|
|
||||||
# Spawn "cmake ...".
|
|
||||||
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_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_BUILD_DIR" \
|
|
||||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
|
||||||
--target clean \
|
|
||||||
"${all_cmake_build_flags[@]}"
|
|
||||||
}
|
|
||||||
ci_info "## END OF BUILD ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
|
||||||
echo "options: -?|-h|--help"
|
|
||||||
exit "${@:-0}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local opt
|
|
||||||
while getopts ":" opt
|
|
||||||
do
|
|
||||||
# This ain't a while-loop. It only pretends to be.
|
|
||||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
|
||||||
ci_err "unknown option: '$1'"
|
|
||||||
done
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
# And... go!
|
|
||||||
ci_init_build
|
|
||||||
ci_trace_build
|
|
||||||
[[ $# -eq 0 ]] || {
|
|
||||||
echo >&2 "error: unexpected argument: '$1'"
|
|
||||||
echo >&2 "note: this program accepts environment options only"
|
|
||||||
usage 2
|
|
||||||
}
|
|
||||||
ci_cleanup_old_build
|
|
||||||
ci_build
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
|
||||||
#
|
|
||||||
# Use, modification and distribution are subject to the MIT License.
|
|
||||||
# Please see the accompanying file LICENSE_MIT.txt
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
# shellcheck source=ci/lib/ci.lib.sh
|
|
||||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
|
||||||
cd "$CI_TOPLEVEL_DIR"
|
|
||||||
|
|
||||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
|
||||||
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
|
|
||||||
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
|
|
||||||
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
|
|
||||||
|
|
||||||
function ci_init_build {
|
|
||||||
# Ensure that the mandatory variables are initialized.
|
|
||||||
CI_MAKE="${CI_MAKE:-make}"
|
|
||||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] || {
|
|
||||||
# For native builds, set CI_CC to "cc" by default if the cc command is available.
|
|
||||||
# The configure script defaults CC to "gcc", which is not always a good idea.
|
|
||||||
[[ -x $(command -v cc) ]] && CI_CC="${CI_CC:-cc}"
|
|
||||||
}
|
|
||||||
# Ensure that the CI_ variables that cannot be customized reliably are not initialized.
|
|
||||||
[[ ! $CI_CONFIGURE_VARS ]] || {
|
|
||||||
ci_err "unsupported: \$CI_CONFIGURE_VARS='$CI_CONFIGURE_VARS'"
|
|
||||||
}
|
|
||||||
[[ ! $CI_MAKE_VARS ]] || {
|
|
||||||
ci_err "unsupported: \$CI_MAKE_VARS='$CI_MAKE_VARS'"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_trace_build {
|
|
||||||
ci_info "## START OF CONFIGURATION ##"
|
|
||||||
ci_info "build arch: $CI_BUILD_ARCH"
|
|
||||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
|
||||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
|
||||||
ci_info "target arch: $CI_TARGET_ARCH"
|
|
||||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
|
||||||
}
|
|
||||||
ci_info "source directory: $CI_SRC_DIR"
|
|
||||||
ci_info "build directory: $CI_BUILD_DIR"
|
|
||||||
ci_info "install directory: $CI_INSTALL_DIR"
|
|
||||||
ci_info "environment option: \$CI_CONFIGURE_FLAGS: '$CI_CONFIGURE_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
|
|
||||||
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
|
||||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
|
|
||||||
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
|
||||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
|
||||||
ci_info "environment option: \$CI_LD: '$CI_LD'"
|
|
||||||
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
|
||||||
ci_info "environment option: \$CI_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'"
|
|
||||||
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
|
|
||||||
[[ $CI_CC ]] && {
|
|
||||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
|
||||||
}
|
|
||||||
[[ $CI_CPP ]] && {
|
|
||||||
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
|
|
||||||
}
|
|
||||||
[[ $CI_AR ]] && {
|
|
||||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
|
||||||
}
|
|
||||||
[[ $CI_RANLIB ]] && {
|
|
||||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
|
||||||
}
|
|
||||||
[[ $CI_LD ]] && {
|
|
||||||
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
|
|
||||||
}
|
|
||||||
ci_info "## END OF CONFIGURATION ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_cleanup_old_build {
|
|
||||||
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 ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_build {
|
|
||||||
ci_info "## START OF BUILD ##"
|
|
||||||
# Export the configure build environment.
|
|
||||||
[[ $CI_CC ]] && ci_spawn export CC="$CI_CC"
|
|
||||||
[[ $CI_CC_FLAGS ]] && ci_spawn export CFLAGS="$CI_CC_FLAGS"
|
|
||||||
[[ $CI_CPP ]] && ci_spawn export CPP="$CI_CPP"
|
|
||||||
[[ $CI_CPP_FLAGS ]] && ci_spawn export CPPFLAGS="$CI_CPP_FLAGS"
|
|
||||||
[[ $CI_AR ]] && ci_spawn export AR="$CI_AR"
|
|
||||||
[[ $CI_RANLIB ]] && ci_spawn export RANLIB="$CI_RANLIB"
|
|
||||||
[[ $CI_LD ]] && ci_spawn export LD="$CI_LD"
|
|
||||||
[[ $CI_LD_FLAGS ]] && ci_spawn export LDFLAGS="$CI_LD_FLAGS"
|
|
||||||
[[ $CI_SANITIZERS ]] && {
|
|
||||||
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" --maintainer
|
|
||||||
}
|
|
||||||
# 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
|
|
||||||
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
|
|
||||||
}
|
|
||||||
ci_expr $((CI_NO_INSTALL)) || {
|
|
||||||
# Spawn "make install" if installation is not disabled.
|
|
||||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS install
|
|
||||||
}
|
|
||||||
ci_expr $((CI_NO_CLEAN)) || {
|
|
||||||
# Spawn "make clean" and "make distclean" if cleaning is not disabled.
|
|
||||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS clean
|
|
||||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS distclean
|
|
||||||
}
|
|
||||||
ci_info "## END OF BUILD ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
|
||||||
echo "options: -?|-h|--help"
|
|
||||||
exit "${@:-0}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local opt
|
|
||||||
while getopts ":" opt
|
|
||||||
do
|
|
||||||
# This ain't a while-loop. It only pretends to be.
|
|
||||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
|
||||||
ci_err "unknown option: '$1'"
|
|
||||||
done
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
# And... go!
|
|
||||||
ci_init_build
|
|
||||||
ci_trace_build
|
|
||||||
[[ $# -eq 0 ]] || {
|
|
||||||
echo >&2 "error: unexpected argument: '$1'"
|
|
||||||
echo >&2 "note: this program accepts environment options only"
|
|
||||||
usage 2
|
|
||||||
}
|
|
||||||
ci_cleanup_old_build
|
|
||||||
ci_build
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
|
||||||
#
|
|
||||||
# Use, modification and distribution are subject to the MIT License.
|
|
||||||
# Please see the accompanying file LICENSE_MIT.txt
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
# shellcheck source=ci/lib/ci.lib.sh
|
|
||||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
|
||||||
cd "$CI_TOPLEVEL_DIR"
|
|
||||||
|
|
||||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
|
||||||
|
|
||||||
function ci_init_build {
|
|
||||||
# Ensure that the mandatory variables are initialized.
|
|
||||||
CI_MAKE="${CI_MAKE:-make}"
|
|
||||||
case "$CI_CC" in
|
|
||||||
( *clang* )
|
|
||||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.clang"}" ;;
|
|
||||||
( *gcc* )
|
|
||||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.gcc"}" ;;
|
|
||||||
( * )
|
|
||||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.std"}" ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_trace_build {
|
|
||||||
ci_info "## START OF CONFIGURATION ##"
|
|
||||||
ci_info "build arch: $CI_BUILD_ARCH"
|
|
||||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
|
||||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
|
||||||
ci_info "target arch: $CI_TARGET_ARCH"
|
|
||||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
|
||||||
}
|
|
||||||
ci_info "source directory: $CI_SRC_DIR"
|
|
||||||
ci_info "environment option: \$CI_MAKEFILES: '$CI_MAKEFILES'"
|
|
||||||
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
|
|
||||||
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_MAKE_VARS: '$CI_MAKE_VARS'"
|
|
||||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
|
||||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
|
|
||||||
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
|
||||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
|
||||||
ci_info "environment option: \$CI_LD: '$CI_LD'"
|
|
||||||
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
|
|
||||||
ci_info "environment option: \$CI_LIBS: '$CI_LIBS'"
|
|
||||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
|
||||||
ci_info "environment option: \$CI_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")"
|
|
||||||
[[ $CI_CC ]] && {
|
|
||||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
|
||||||
}
|
|
||||||
[[ $CI_CPP ]] && {
|
|
||||||
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
|
|
||||||
}
|
|
||||||
[[ $CI_AR ]] && {
|
|
||||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
|
||||||
}
|
|
||||||
[[ $CI_RANLIB ]] && {
|
|
||||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
|
||||||
}
|
|
||||||
[[ $CI_LD ]] && {
|
|
||||||
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
|
|
||||||
}
|
|
||||||
ci_info "## END OF CONFIGURATION ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_cleanup_old_build {
|
|
||||||
# Any old makefile-based build will most likely leave a mess
|
|
||||||
# of object files behind if interrupted, e.g., via Ctrl+C.
|
|
||||||
# There may be other files behind, depending on what makefile
|
|
||||||
# had been used. We cannot easily enumerate all of those.
|
|
||||||
# Fortunately, for a clean makefiles-based build, it should be
|
|
||||||
# sufficient to remove the old object files only.
|
|
||||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
|
||||||
local find_args=(-maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \))
|
|
||||||
[[ ! $(find "$CI_SRC_DIR" "${find_args[@]}" | head -n1) ]] || {
|
|
||||||
ci_warn "unexpected build found in '$CI_SRC_DIR'"
|
|
||||||
if ci_expr $((CI_FORCE))
|
|
||||||
then
|
|
||||||
# Delete the old build.
|
|
||||||
local my_file
|
|
||||||
find "$CI_SRC_DIR" "${find_args[@]}" |
|
|
||||||
while IFS="" read -r my_file
|
|
||||||
do
|
|
||||||
ci_spawn rm -fr "$my_file"
|
|
||||||
done
|
|
||||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
|
||||||
else
|
|
||||||
# Alert the user, but do not delete their existing files,
|
|
||||||
# and do not mess up their existing build.
|
|
||||||
ci_info "hint: consider using the option \$CI_FORCE=1"
|
|
||||||
ci_err "unable to continue"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_build {
|
|
||||||
ci_info "## START OF BUILD ##"
|
|
||||||
# Initialize and populate the local arrays.
|
|
||||||
local all_make_flags=()
|
|
||||||
local all_make_vars=()
|
|
||||||
[[ $CI_MAKE_FLAGS ]] && {
|
|
||||||
all_make_flags+=($CI_MAKE_FLAGS)
|
|
||||||
}
|
|
||||||
[[ $CI_CC ]] && {
|
|
||||||
all_make_vars+=("CC=$CI_CC")
|
|
||||||
}
|
|
||||||
[[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
|
|
||||||
[[ $CI_SANITIZERS ]] && CI_CC_FLAGS="${CI_CC_FLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
|
|
||||||
all_make_vars+=("CFLAGS=$CI_CC_FLAGS")
|
|
||||||
}
|
|
||||||
[[ $CI_CPP ]] && {
|
|
||||||
all_make_vars+=("CPP=$CI_CPP")
|
|
||||||
}
|
|
||||||
[[ $CI_CPP_FLAGS ]] && {
|
|
||||||
all_make_vars+=("CPPFLAGS=$CI_CPP_FLAGS")
|
|
||||||
}
|
|
||||||
[[ $CI_AR ]] && {
|
|
||||||
all_make_vars+=("AR=$CI_AR")
|
|
||||||
}
|
|
||||||
[[ $CI_RANLIB ]] && {
|
|
||||||
all_make_vars+=("RANLIB=$CI_RANLIB")
|
|
||||||
}
|
|
||||||
[[ $CI_LD ]] && {
|
|
||||||
all_make_vars+=("LD=$CI_LD")
|
|
||||||
}
|
|
||||||
[[ $CI_LD_FLAGS || $CI_SANITIZERS ]] && {
|
|
||||||
[[ $CI_SANITIZERS ]] && CI_LD_FLAGS+="${CI_LD_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
|
|
||||||
all_make_vars+=("LDFLAGS=$CI_LD_FLAGS")
|
|
||||||
}
|
|
||||||
[[ $CI_LIBS ]] && {
|
|
||||||
all_make_vars+=("LIBS=$CI_LIBS")
|
|
||||||
}
|
|
||||||
all_make_vars+=($CI_MAKE_VARS)
|
|
||||||
# And... build!
|
|
||||||
local my_makefile
|
|
||||||
for my_makefile in $CI_MAKEFILES
|
|
||||||
do
|
|
||||||
ci_info "using makefile: $my_makefile"
|
|
||||||
ci_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" \
|
|
||||||
"${all_make_flags[@]}" \
|
|
||||||
"${all_make_vars[@]}" \
|
|
||||||
test
|
|
||||||
}
|
|
||||||
ci_expr $((CI_NO_CLEAN)) || {
|
|
||||||
# Spawn "make clean" if cleaning is not disabled.
|
|
||||||
ci_spawn "$CI_MAKE" -f "$my_makefile" \
|
|
||||||
"${all_make_flags[@]}" \
|
|
||||||
"${all_make_vars[@]}" \
|
|
||||||
clean
|
|
||||||
}
|
|
||||||
done
|
|
||||||
ci_info "## END OF BUILD ##"
|
|
||||||
}
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
|
||||||
echo "options: -?|-h|--help"
|
|
||||||
exit "${@:-0}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local opt
|
|
||||||
while getopts ":" opt
|
|
||||||
do
|
|
||||||
# This ain't a while-loop. It only pretends to be.
|
|
||||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
|
||||||
ci_err "unknown option: '$1'"
|
|
||||||
done
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
# And... go!
|
|
||||||
ci_init_build
|
|
||||||
ci_trace_build
|
|
||||||
[[ $# -eq 0 ]] || {
|
|
||||||
echo >&2 "error: unexpected argument: '$1'"
|
|
||||||
echo >&2 "note: this program accepts environment options only"
|
|
||||||
usage 2
|
|
||||||
}
|
|
||||||
ci_cleanup_old_build
|
|
||||||
ci_build
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 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"
|
|
||||||
|
|
||||||
# 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:" "$@"
|
|
||||||
"$BASH" "$my_script" "$@"
|
|
||||||
echo "$my_result" | "$BASH" --posix || ci_err "bad shellify output"
|
|
||||||
echo "$my_result"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_init_version_verification {
|
|
||||||
ci_info "## START OF VERIFICATION ##"
|
|
||||||
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*"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER_STRING != $my_expect*"
|
|
||||||
fi
|
|
||||||
my_expect=$((PNG_LIBPNG_VER_MAJOR*10000 + PNG_LIBPNG_VER_MINOR*100 + PNG_LIBPNG_VER_RELEASE))
|
|
||||||
if [[ "$PNG_LIBPNG_VER" == "$my_expect" ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNG_LIBPNG_VER == $my_expect"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER != $my_expect"
|
|
||||||
fi
|
|
||||||
my_expect=$((PNG_LIBPNG_VER_MAJOR*10 + PNG_LIBPNG_VER_MINOR))
|
|
||||||
if [[ "$PNG_LIBPNG_VER_SHAREDLIB" == "$my_expect" ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNG_LIBPNG_VER_SHAREDLIB == $my_expect"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER_SHAREDLIB != $my_expect"
|
|
||||||
fi
|
|
||||||
if [[ "$PNG_LIBPNG_VER_SONUM" == "$my_expect" ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNG_LIBPNG_VER_SONUM == $my_expect"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER_SONUM != $my_expect"
|
|
||||||
fi
|
|
||||||
if [[ "$PNG_LIBPNG_VER_DLLNUM" == "$my_expect" ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNG_LIBPNG_VER_DLLNUM == $my_expect"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER_DLLNUM != $my_expect"
|
|
||||||
fi
|
|
||||||
if [[ "$PNG_LIBPNG_VER_BUILD" == [01] ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNG_LIBPNG_VER_BUILD == [01]"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != [01]"
|
|
||||||
fi
|
|
||||||
ci_info "## VERIFYING: 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_STABLE"
|
|
||||||
else
|
|
||||||
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_VER_BUILD -ne 0 ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNG_LIBPNG_VER_BUILD -ne 0"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -eq 0"
|
|
||||||
fi
|
|
||||||
if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -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: 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: 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: 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"
|
|
||||||
ci_info "matched: \$PNGLIB_SUBREVISION == 0"
|
|
||||||
elif [[ "$PNGLIB_VERSION.$PNGLIB_SUBREVISION" == "$PNG_LIBPNG_VER_STRING" ]]
|
|
||||||
then
|
|
||||||
ci_info "matched: \$PNGLIB_VERSION.\$PNGLIB_SUBREVISION == \$PNG_LIBPNG_VER_STRING"
|
|
||||||
else
|
|
||||||
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
|
|
||||||
fi
|
|
||||||
ci_info "## 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 ##"
|
|
||||||
# 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 {
|
|
||||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
|
||||||
echo "options: -?|-h|--help"
|
|
||||||
exit "${@:-0}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local opt
|
|
||||||
while getopts ":" opt
|
|
||||||
do
|
|
||||||
# This ain't a while-loop. It only pretends to be.
|
|
||||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
|
||||||
ci_err "unknown option: '$1'"
|
|
||||||
done
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
[[ $# -eq 0 ]] || {
|
|
||||||
echo >&2 "error: unexpected argument: '$1'"
|
|
||||||
usage 2
|
|
||||||
}
|
|
||||||
# And... go!
|
|
||||||
ci_verify_version
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
111
ci/lib/ci.lib.sh
111
ci/lib/ci.lib.sh
@@ -1,111 +0,0 @@
|
|||||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
|
||||||
#
|
|
||||||
# Use, modification and distribution are subject to the MIT License.
|
|
||||||
# Please see the accompanying file LICENSE_MIT.txt
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
test -f "$BASH_SOURCE" || {
|
|
||||||
echo >&2 "warning: this module requires Bash version 3 or newer"
|
|
||||||
}
|
|
||||||
test "${#BASH_SOURCE[@]}" -gt 1 || {
|
|
||||||
echo >&2 "warning: this module should be sourced from a Bash script"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Reset the locale to avoid surprises from locale-dependent commands.
|
|
||||||
export LC_ALL=C
|
|
||||||
export LANG=C
|
|
||||||
export LANGUAGE=C
|
|
||||||
|
|
||||||
# Reset CDPATH to avoid surprises from the "cd" command.
|
|
||||||
export CDPATH=""
|
|
||||||
|
|
||||||
# Initialize the global constants CI_SCRIPT_{NAME,DIR} and CI_TOPLEVEL_DIR.
|
|
||||||
CI_SCRIPT_NAME="$(basename -- "$0")"
|
|
||||||
CI_SCRIPT_DIR="$(cd "$(dirname -- "$0")" && pwd)"
|
|
||||||
CI_TOPLEVEL_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
||||||
|
|
||||||
# Initialize the global constants CI_BUILD_{...} for the host build platform.
|
|
||||||
CI_BUILD_ARCH="${CI_BUILD_ARCH:-"$(uname -m | tr 'A-Z/\.-' 'a-z____')"}"
|
|
||||||
CI_BUILD_SYSTEM="${CI_BUILD_SYSTEM:-"$(uname -s | tr 'A-Z/\.-' 'a-z____')"}"
|
|
||||||
|
|
||||||
# Initialize the global constants CI_TARGET_{...} for the target platform.
|
|
||||||
CI_TARGET_ARCH="${CI_TARGET_ARCH:-"$CI_BUILD_ARCH"}"
|
|
||||||
CI_TARGET_SYSTEM="${CI_TARGET_SYSTEM:-"$CI_BUILD_SYSTEM"}"
|
|
||||||
|
|
||||||
function ci_info {
|
|
||||||
printf >&2 "%s: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_warn {
|
|
||||||
printf >&2 "%s: warning: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_err {
|
|
||||||
printf >&2 "%s: error: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_err_internal {
|
|
||||||
printf >&2 "%s: internal error: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
|
||||||
printf >&2 "ABORTED\\n"
|
|
||||||
# Exit with the conventional SIGABRT code.
|
|
||||||
exit 134
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_expr {
|
|
||||||
if [[ ${*:-0} == [0-9] ]]
|
|
||||||
then
|
|
||||||
# This is the same as in the else-branch below, albeit much faster
|
|
||||||
# for our intended use cases.
|
|
||||||
return $((!$1))
|
|
||||||
else
|
|
||||||
# The funny-looking compound command "... && return $? || return $?"
|
|
||||||
# allows the execution to continue uninterrupted under "set -e".
|
|
||||||
expr >/dev/null "$@" && return $? || return $?
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function ci_spawn {
|
|
||||||
printf >&2 "%s: executing:" "$CI_SCRIPT_NAME"
|
|
||||||
printf >&2 " %q" "$@"
|
|
||||||
printf >&2 "\\n"
|
|
||||||
"$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Ensure that the internal initialization is correct.
|
|
||||||
[[ $CI_TOPLEVEL_DIR/ci/lib/ci.lib.sh -ef ${BASH_SOURCE[0]} ]] || {
|
|
||||||
ci_err_internal "bad or missing \$CI_TOPLEVEL_DIR"
|
|
||||||
}
|
|
||||||
[[ $CI_SCRIPT_DIR/$CI_SCRIPT_NAME -ef $0 ]] || {
|
|
||||||
ci_err_internal "bad or missing \$CI_SCRIPT_DIR/\$CI_SCRIPT_NAME"
|
|
||||||
}
|
|
||||||
[[ $CI_BUILD_ARCH && $CI_BUILD_SYSTEM ]] || {
|
|
||||||
ci_err_internal "missing \$CI_BUILD_ARCH or \$CI_BUILD_SYSTEM"
|
|
||||||
}
|
|
||||||
[[ $CI_TARGET_ARCH && $CI_TARGET_SYSTEM ]] || {
|
|
||||||
ci_err_internal "missing \$CI_TARGET_ARCH or \$CI_TARGET_SYSTEM"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Ensure that the user initialization is correct.
|
|
||||||
[[ ${CI_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'"
|
|
||||||
}
|
|
||||||
[[ ${CI_NO_INSTALL:-0} == [01] ]] || {
|
|
||||||
ci_err "bad boolean option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
|
||||||
}
|
|
||||||
[[ ${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
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 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"
|
|
||||||
|
|
||||||
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 [<options>] 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 "$@"
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 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"
|
|
||||||
|
|
||||||
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 [<options>] 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 "$@"
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 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"
|
|
||||||
|
|
||||||
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 [<options>] 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 "$@"
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o pipefail -o posix
|
|
||||||
|
|
||||||
# Copyright (c) 2019-2025 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"
|
|
||||||
|
|
||||||
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 [<options>] 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 "$@"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
export CI_TARGET_ARCH=aarch64
|
|
||||||
export CI_TARGET_SYSTEM=freebsd
|
|
||||||
|
|
||||||
export CI_CMAKE_VARS="
|
|
||||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
|
||||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
|
||||||
"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
export CI_TARGET_ARCH=i686
|
|
||||||
export CI_TARGET_SYSTEM=freebsd
|
|
||||||
|
|
||||||
export CI_CMAKE_VARS="
|
|
||||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
|
||||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
|
||||||
"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
export CI_TARGET_ARCH=riscv64
|
|
||||||
export CI_TARGET_SYSTEM=freebsd
|
|
||||||
|
|
||||||
export CI_CMAKE_VARS="
|
|
||||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
|
||||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
|
||||||
"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright (c) 2023-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
|
|
||||||
|
|
||||||
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
|
|
||||||
"
|
|
||||||
364
compile
364
compile
@@ -1,364 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
|
|
||||||
scriptversion=2025-06-18.21; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 1999-2025 Free Software Foundation, Inc.
|
|
||||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# This file is maintained in Automake, please report
|
|
||||||
# bugs to <bug-automake@gnu.org> or send patches to
|
|
||||||
# <automake-patches@gnu.org>.
|
|
||||||
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
|
|
||||||
# We need space, tab and new line, in precisely that order. Quoting is
|
|
||||||
# there to prevent tools from complaining about whitespace usage.
|
|
||||||
IFS=" "" $nl"
|
|
||||||
|
|
||||||
file_conv=
|
|
||||||
|
|
||||||
# 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) UNNEEDED_CONVERSIONS, no
|
|
||||||
# conversion will take place.
|
|
||||||
func_file_conv ()
|
|
||||||
{
|
|
||||||
file=$1
|
|
||||||
case $file in
|
|
||||||
/ | /[!/]*) # absolute file, and not a UNC file
|
|
||||||
if test -z "$file_conv"; then
|
|
||||||
# lazily determine how to convert abs files
|
|
||||||
case `uname -s` in
|
|
||||||
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
|
|
||||||
;;
|
|
||||||
MSYS*)
|
|
||||||
# Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
|
|
||||||
file_conv=cygwin
|
|
||||||
;;
|
|
||||||
CYGWIN*)
|
|
||||||
# Cygwin environment.
|
|
||||||
file_conv=cygwin
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
file_conv=wine
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
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/*)
|
|
||||||
file=`cygpath -w "$file" || echo "$file"`
|
|
||||||
;;
|
|
||||||
wine/*)
|
|
||||||
file=`winepath -w "$file" || echo "$file"`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_dashL linkdir
|
|
||||||
# Make cl look for libraries in LINKDIR
|
|
||||||
func_cl_dashL ()
|
|
||||||
{
|
|
||||||
func_file_conv "$1"
|
|
||||||
if test -z "$lib_path"; then
|
|
||||||
lib_path=$file
|
|
||||||
else
|
|
||||||
lib_path="$lib_path;$file"
|
|
||||||
fi
|
|
||||||
linker_opts="$linker_opts -LIBPATH:$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_dashl library
|
|
||||||
# Do a library search-path lookup for cl
|
|
||||||
func_cl_dashl ()
|
|
||||||
{
|
|
||||||
lib=$1
|
|
||||||
found=no
|
|
||||||
save_IFS=$IFS
|
|
||||||
IFS=';'
|
|
||||||
for dir in $lib_path $LIB
|
|
||||||
do
|
|
||||||
IFS=$save_IFS
|
|
||||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/$lib.dll.lib
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test -f "$dir/$lib.lib"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/$lib.lib
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test -f "$dir/lib$lib.a"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/lib$lib.a
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS=$save_IFS
|
|
||||||
|
|
||||||
if test "$found" != yes; then
|
|
||||||
lib=$lib.lib
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_wrapper cl arg...
|
|
||||||
# Adjust compile command to suit cl
|
|
||||||
func_cl_wrapper ()
|
|
||||||
{
|
|
||||||
# Assume a capable shell
|
|
||||||
lib_path=
|
|
||||||
shared=:
|
|
||||||
linker_opts=
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$eat"; then
|
|
||||||
eat=
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
-o)
|
|
||||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
||||||
eat=1
|
|
||||||
case $2 in
|
|
||||||
*.o | *.lo | *.[oO][bB][jJ])
|
|
||||||
func_file_conv "$2"
|
|
||||||
set x "$@" -Fo"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
func_file_conv "$2"
|
|
||||||
set x "$@" -Fe"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
-I)
|
|
||||||
eat=1
|
|
||||||
func_file_conv "$2" mingw
|
|
||||||
set x "$@" -I"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-I*)
|
|
||||||
func_file_conv "${1#-I}" mingw
|
|
||||||
set x "$@" -I"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l)
|
|
||||||
eat=1
|
|
||||||
func_cl_dashl "$2"
|
|
||||||
set x "$@" "$lib"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l*)
|
|
||||||
func_cl_dashl "${1#-l}"
|
|
||||||
set x "$@" "$lib"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-L)
|
|
||||||
eat=1
|
|
||||||
func_cl_dashL "$2"
|
|
||||||
;;
|
|
||||||
-L*)
|
|
||||||
func_cl_dashL "${1#-L}"
|
|
||||||
;;
|
|
||||||
-static)
|
|
||||||
shared=false
|
|
||||||
;;
|
|
||||||
-Wl,*)
|
|
||||||
arg=${1#-Wl,}
|
|
||||||
save_ifs="$IFS"; IFS=','
|
|
||||||
for flag in $arg; do
|
|
||||||
IFS="$save_ifs"
|
|
||||||
linker_opts="$linker_opts $flag"
|
|
||||||
done
|
|
||||||
IFS="$save_ifs"
|
|
||||||
;;
|
|
||||||
-Xlinker)
|
|
||||||
eat=1
|
|
||||||
linker_opts="$linker_opts $2"
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
|
||||||
func_file_conv "$1"
|
|
||||||
set x "$@" -Tp"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
|
||||||
func_file_conv "$1" mingw
|
|
||||||
set x "$@" "$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
if test -n "$linker_opts"; then
|
|
||||||
linker_opts="-link$linker_opts"
|
|
||||||
fi
|
|
||||||
exec "$@" $linker_opts
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
eat=
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
'')
|
|
||||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
|
||||||
exit 1;
|
|
||||||
;;
|
|
||||||
-h | --h*)
|
|
||||||
cat <<\EOF
|
|
||||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
|
||||||
|
|
||||||
Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
|
||||||
arguments, and rename the output as expected.
|
|
||||||
|
|
||||||
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 <bug-automake@gnu.org>.
|
|
||||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
|
||||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
|
||||||
EOF
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
-v | --v*)
|
|
||||||
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...
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
ofile=
|
|
||||||
cfile=
|
|
||||||
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$eat"; then
|
|
||||||
eat=
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
-o)
|
|
||||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
||||||
# So we strip '-o arg' only if arg is an object.
|
|
||||||
eat=1
|
|
||||||
case $2 in
|
|
||||||
*.o | *.obj)
|
|
||||||
ofile=$2
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" -o "$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*.c)
|
|
||||||
cfile=$1
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -z "$ofile" || test -z "$cfile"; then
|
|
||||||
# If no '-o' option was seen then we might have been invoked from a
|
|
||||||
# pattern rule where we don't need one. That is ok -- this is a
|
|
||||||
# normal compilation that the losing compiler can handle. If no
|
|
||||||
# '.c' file was seen then we are probably linking. That is also
|
|
||||||
# ok.
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Name of file we expect compiler to create.
|
|
||||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
|
||||||
|
|
||||||
# Create the lock directory.
|
|
||||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
|
||||||
# that we are using for the .o file. Also, base the name on the expected
|
|
||||||
# object file name, since that is what matters with a parallel build.
|
|
||||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
|
||||||
while true; do
|
|
||||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
# FIXME: race condition here if user kills between mkdir and trap.
|
|
||||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
|
||||||
|
|
||||||
# Run the compile.
|
|
||||||
"$@"
|
|
||||||
ret=$?
|
|
||||||
|
|
||||||
if test -f "$cofile"; then
|
|
||||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
|
||||||
elif test -f "${cofile}bj"; then
|
|
||||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rmdir "$lockdir"
|
|
||||||
exit $ret
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
1815
config.guess
vendored
1815
config.guess
vendored
File diff suppressed because it is too large
Load Diff
138
config.h.in
138
config.h.in
@@ -1,138 +0,0 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#undef HAVE_DLFCN_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'feenableexcept' function. */
|
|
||||||
#undef HAVE_FEENABLEEXCEPT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'm' library (-lm). */
|
|
||||||
#undef HAVE_LIBM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'z' library (-lz). */
|
|
||||||
#undef HAVE_LIBZ
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'pow' function. */
|
|
||||||
#undef HAVE_POW
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#undef HAVE_STDIO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
|
||||||
#undef LT_OBJDIR
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Turn on ARM Neon optimizations at run-time */
|
|
||||||
#undef PNG_ARM_NEON_API_SUPPORTED
|
|
||||||
|
|
||||||
/* Check for ARM Neon support at run-time */
|
|
||||||
#undef PNG_ARM_NEON_CHECK_SUPPORTED
|
|
||||||
|
|
||||||
/* Enable ARM Neon optimizations */
|
|
||||||
#undef PNG_ARM_NEON_OPT
|
|
||||||
|
|
||||||
/* Enable Intel SSE optimizations */
|
|
||||||
#undef PNG_INTEL_SSE_OPT
|
|
||||||
|
|
||||||
/* Enable LOONGARCH LSX optimizations */
|
|
||||||
#undef PNG_LOONGARCH_LSX_OPT
|
|
||||||
|
|
||||||
/* Turn on MIPS MMI optimizations at run-time */
|
|
||||||
#undef PNG_MIPS_MMI_API_SUPPORTED
|
|
||||||
|
|
||||||
/* Check for MIPS MMI support at run-time */
|
|
||||||
#undef PNG_MIPS_MMI_CHECK_SUPPORTED
|
|
||||||
|
|
||||||
/* Enable MIPS MMI optimizations */
|
|
||||||
#undef PNG_MIPS_MMI_OPT
|
|
||||||
|
|
||||||
/* Turn on MIPS MSA optimizations at run-time */
|
|
||||||
#undef PNG_MIPS_MSA_API_SUPPORTED
|
|
||||||
|
|
||||||
/* Check for MIPS MSA support at run-time */
|
|
||||||
#undef PNG_MIPS_MSA_CHECK_SUPPORTED
|
|
||||||
|
|
||||||
/* Enable MIPS MSA optimizations */
|
|
||||||
#undef PNG_MIPS_MSA_OPT
|
|
||||||
|
|
||||||
/* Turn on POWERPC VSX optimizations at run-time */
|
|
||||||
#undef PNG_POWERPC_VSX_API_SUPPORTED
|
|
||||||
|
|
||||||
/* Check for POWERPC VSX support at run-time */
|
|
||||||
#undef PNG_POWERPC_VSX_CHECK_SUPPORTED
|
|
||||||
|
|
||||||
/* Enable POWERPC VSX optimizations */
|
|
||||||
#undef PNG_POWERPC_VSX_OPT
|
|
||||||
|
|
||||||
/* Enable RISCV RVV optimizations */
|
|
||||||
#undef PNG_RISCV_RVV_OPT
|
|
||||||
|
|
||||||
/* Define to 1 if all of the C89 standard headers exist (not just the ones
|
|
||||||
required in a freestanding environment). This macro is provided for
|
|
||||||
backward compatibility; new code need not use it. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
|
|
||||||
#undef TM_IN_SYS_TIME
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
|
||||||
nothing if this is not supported. Do not define if restrict is
|
|
||||||
supported only directly. */
|
|
||||||
#undef restrict
|
|
||||||
/* Work around a bug in older versions of Sun C++, which did not
|
|
||||||
#define __restrict__ or support _Restrict or __restrict__
|
|
||||||
even though the corresponding Sun C compiler ended up with
|
|
||||||
"#define restrict _Restrict" or "#define restrict __restrict__"
|
|
||||||
in the previous line. This workaround can be removed once
|
|
||||||
we assume Oracle Developer Studio 12.5 (2016) or later. */
|
|
||||||
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
|
|
||||||
# define _Restrict
|
|
||||||
# define __restrict__
|
|
||||||
#endif
|
|
||||||
2354
config.sub
vendored
2354
config.sub
vendored
File diff suppressed because it is too large
Load Diff
713
configure.ac
713
configure.ac
@@ -1,12 +1,5 @@
|
|||||||
# configure.ac
|
# configure.ac
|
||||||
|
|
||||||
# Copyright (c) 2018-2024 Cosmin Truta
|
|
||||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
|
||||||
|
|
||||||
# This code is released under the libpng license.
|
|
||||||
# For conditions of distribution and use, see the disclaimer
|
|
||||||
# and license in png.h
|
|
||||||
|
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
dnl
|
dnl
|
||||||
dnl Minor upgrades (compatible ABI): increment the package version
|
dnl Minor upgrades (compatible ABI): increment the package version
|
||||||
@@ -25,8 +18,8 @@ AC_PREREQ([2.68])
|
|||||||
|
|
||||||
dnl Version number stuff here:
|
dnl Version number stuff here:
|
||||||
|
|
||||||
AC_INIT([libpng],[1.6.51.git],[png-mng-implement@lists.sourceforge.net])
|
AC_INIT([libpng],[1.7.0beta04],[png-mng-implement@lists.sourceforge.net])
|
||||||
AC_CONFIG_MACRO_DIR([scripts/autoconf])
|
AC_CONFIG_MACRO_DIR([scripts])
|
||||||
|
|
||||||
# libpng does not follow GNU file name conventions (hence 'foreign')
|
# libpng does not follow GNU file name conventions (hence 'foreign')
|
||||||
# color-tests requires automake 1.11 or later
|
# color-tests requires automake 1.11 or later
|
||||||
@@ -34,9 +27,9 @@ AC_CONFIG_MACRO_DIR([scripts/autoconf])
|
|||||||
# dist-xz requires automake 1.11 or later
|
# dist-xz requires automake 1.11 or later
|
||||||
# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
|
# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
|
||||||
# 1.13 is required for parallel tests
|
# 1.13 is required for parallel tests
|
||||||
AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules subdir-objects])
|
AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules])
|
||||||
# The following line causes --disable-maintainer-mode to be the default to
|
# The following line causes --disable-maintainer-mode to be the default to
|
||||||
# configure. This is necessary because libpng distributions cannot rely on the
|
# configure, this is necessary because libpng distributions cannot rely on the
|
||||||
# time stamps of the autotools generated files being correct
|
# time stamps of the autotools generated files being correct
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
@@ -46,17 +39,17 @@ dnl automake, so the following is not necessary (and is not defined anyway):
|
|||||||
dnl AM_PREREQ([1.11.2])
|
dnl AM_PREREQ([1.11.2])
|
||||||
dnl stop configure from automagically running automake
|
dnl stop configure from automagically running automake
|
||||||
|
|
||||||
PNGLIB_VERSION=1.6.51.git
|
PNGLIB_VERSION=1.7.0beta04
|
||||||
PNGLIB_MAJOR=1
|
PNGLIB_MAJOR=1
|
||||||
PNGLIB_MINOR=6
|
PNGLIB_MINOR=7
|
||||||
PNGLIB_RELEASE=51
|
PNGLIB_RELEASE=0
|
||||||
|
|
||||||
dnl End of version number stuff
|
dnl End of version number stuff
|
||||||
|
|
||||||
AC_CONFIG_SRCDIR([pngget.c])
|
AC_CONFIG_SRCDIR([pngget.c])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
# Check the basic programs.
|
# Checks for programs.
|
||||||
AC_LANG([C])
|
AC_LANG([C])
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
@@ -67,24 +60,21 @@ AC_PROG_INSTALL
|
|||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
|
||||||
dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any
|
dnl libtool/libtoolize; version 2.4.2 is the tested version, this or any
|
||||||
dnl compatible later version may be used
|
dnl compatible later version may be used
|
||||||
LT_INIT([win32-dll])
|
LT_INIT([win32-dll])
|
||||||
LT_PREREQ([2.4.2])
|
LT_PREREQ([2.4.2])
|
||||||
|
|
||||||
dnl Declare the AWK variable.
|
# Some awks crash when confronted with pnglibconf.dfa, do a test run now
|
||||||
AC_ARG_VAR(AWK, [AWK language processor])
|
# to make sure this doesn't happen
|
||||||
|
AC_MSG_CHECKING([that AWK works])
|
||||||
# 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\
|
if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
|
||||||
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
||||||
${srcdir}/pngusr.dfa 1>&2
|
${srcdir}/pngusr.dfa 1>&2
|
||||||
then
|
then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([ok])
|
||||||
else
|
else
|
||||||
AC_MSG_FAILURE([no], 1)
|
AC_MSG_FAILURE([failed], 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This is a remnant of the old cc -E validation, where it may have been
|
# This is a remnant of the old cc -E validation, where it may have been
|
||||||
@@ -92,29 +82,11 @@ fi
|
|||||||
DFNCPP="$CPP"
|
DFNCPP="$CPP"
|
||||||
AC_SUBST(DFNCPP)
|
AC_SUBST(DFNCPP)
|
||||||
|
|
||||||
AC_ARG_ENABLE([tests],
|
# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
|
||||||
AS_HELP_STRING([--disable-tests],
|
# checks the compiler with a program that generates a warning), add the
|
||||||
[do not build the test programs (default is to build)]),
|
# following option to deal with this
|
||||||
[enable_tests="$enableval"],
|
|
||||||
[enable_tests=yes])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([ENABLE_TESTS],
|
|
||||||
[test "$enable_tests" != "no"])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([tools],
|
|
||||||
AS_HELP_STRING([--disable-tools],
|
|
||||||
[do not build the auxiliary tools (default is to build)]),
|
|
||||||
[enable_tools="$enableval"],
|
|
||||||
[enable_tools=yes])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([ENABLE_TOOLS],
|
|
||||||
[test "$enable_tools" != "no"])
|
|
||||||
|
|
||||||
# -Werror cannot be passed to GCC in CFLAGS because configure will fail
|
|
||||||
# (it checks the compiler with a program that generates a warning).
|
|
||||||
# Add the following option to deal with this:
|
|
||||||
AC_ARG_VAR(PNG_COPTS,
|
AC_ARG_VAR(PNG_COPTS,
|
||||||
[additional flags for the C compiler, to be used for options that would]
|
[additional flags for the C compiler, use this for options that would]
|
||||||
[cause configure itself to fail])
|
[cause configure itself to fail])
|
||||||
AC_ARG_ENABLE(werror,
|
AC_ARG_ENABLE(werror,
|
||||||
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
|
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
|
||||||
@@ -135,52 +107,140 @@ AC_ARG_ENABLE(werror,
|
|||||||
CFLAGS="$sav_CFLAGS"
|
CFLAGS="$sav_CFLAGS"
|
||||||
fi],)
|
fi],)
|
||||||
|
|
||||||
# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89.
|
# Checks for header files.
|
||||||
# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
|
AC_HEADER_STDC
|
||||||
# _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
|
# Headers used in pngpriv.h:
|
||||||
# we test for that and force the "-std=c89" compiler option:
|
AC_CHECK_HEADERS([assert.h stdlib.h string.h float.h fp.h math.h m68881.h])
|
||||||
AC_MSG_CHECKING([if we need to force back C standard to C89])
|
# Additional headers used in pngconf.h:
|
||||||
AC_COMPILE_IFELSE(
|
AC_CHECK_HEADERS([limits.h stddef.h stdio.h setjmp.h time.h])
|
||||||
[AC_LANG_PROGRAM([
|
# Used by pngread.c (for the simplified API):
|
||||||
[#define _POSIX_SOURCE 1]
|
AC_CHECK_HEADERS([errno.h])
|
||||||
[#include <stdio.h>]
|
# The following are not required for the standard 'make' build of libpng:
|
||||||
])],
|
# Additional requirements of contrib/libtests/makepng.c:
|
||||||
AC_MSG_RESULT(no),[
|
AC_CHECK_HEADERS([ctype.h])
|
||||||
if test "x$GCC" != "xyes"; then
|
# Additional requirements of contrib/libtests/pngvalid.c:
|
||||||
AC_MSG_ERROR(
|
AC_CHECK_HEADERS([fenv.h])
|
||||||
[Forcing back to C89 is required but the flags are only known for GCC])
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
CFLAGS="$CFLAGS -std=c89"
|
|
||||||
])
|
|
||||||
|
|
||||||
# Checks for structures and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_STRUCT_TM
|
# Most of these have been removed from 1.7.0 because they checked for non-ANSI-C
|
||||||
|
# behaviors and the result were, anyway, not used by earlier versions of libpng.
|
||||||
AC_C_RESTRICT
|
AC_C_RESTRICT
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions; these need to be in order, least demanding to
|
||||||
AC_CHECK_FUNCS([pow], ,
|
# most because the -l directives are added to the head of the list at each
|
||||||
[AC_CHECK_LIB([m], [pow], , [AC_MSG_ERROR([cannot find pow])])])
|
# check.
|
||||||
|
# ANSI-C functions: all are required but they don't have to be implemented in
|
||||||
|
# libc, it is perfectly ok to configure with an extra, wrapper, library preset
|
||||||
|
# in LIBS. NOTE: this list may not be complete
|
||||||
|
AC_CHECK_FUNCS([memset memcpy strncpy],,
|
||||||
|
AC_MSG_FAILURE([missing ANSI-C functions]))
|
||||||
|
|
||||||
# Some later POSIX 1003.1 functions are required for test programs, failure
|
# floor and ceil are required for FLOATING_POINT, but they can be turned off on
|
||||||
# here is soft (the corresponding test program is not built).
|
# the configure command line (and they are independent.) Default is to 'on'
|
||||||
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
|
AC_ARG_ENABLE([floating-point],[Enable floating point APIs],,
|
||||||
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
|
[enable_floating_point=yes])
|
||||||
|
AC_ARG_ENABLE([fixed-point],[Enable fixed point APIs],,
|
||||||
|
[enable_fixed_point=yes])
|
||||||
|
AC_ARG_ENABLE([floating-arithmetic],[Use floating point arithmetic internally],,
|
||||||
|
[enable_floating_arithmetic=yes])
|
||||||
|
|
||||||
AC_ARG_WITH(zlib-prefix,
|
# Check for a requirement for math library support
|
||||||
AS_HELP_STRING([[[--with-zlib-prefix]]],
|
if test "$enable_floating_arithmetic" = yes
|
||||||
[prefix that may have been used in installed zlib]),
|
then
|
||||||
[ZPREFIX=${withval}],
|
AC_SEARCH_LIBS([floor],[m],,
|
||||||
[ZPREFIX='z_'])
|
[AC_MSG_WARN([not found])
|
||||||
AC_CHECK_LIB([z], [zlibVersion], ,
|
enable_floating_arithmetic=no])
|
||||||
[AC_CHECK_LIB([z], [${ZPREFIX}zlibVersion], ,
|
AC_SEARCH_LIBS([frexp],[m],,
|
||||||
[AC_MSG_ERROR([zlib not installed])])])
|
[AC_MSG_WARN([not found])
|
||||||
|
enable_floating_arithmetic=no])
|
||||||
|
AC_SEARCH_LIBS([modf],[m],,
|
||||||
|
[AC_MSG_WARN([not found])
|
||||||
|
enable_floating_arithmetic=no])
|
||||||
|
AC_SEARCH_LIBS([atof],[m],,
|
||||||
|
[AC_MSG_WARN([not found])
|
||||||
|
enable_floating_arithmetic=no])
|
||||||
|
AC_SEARCH_LIBS([pow],[m],,
|
||||||
|
[AC_MSG_WARN([not found])
|
||||||
|
enable_floating_arithmetic=no])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set the relevant defines if required (only if required), this will override
|
||||||
|
# anything on the command line.
|
||||||
|
if test "$enable_floating_point" != yes
|
||||||
|
then
|
||||||
|
AC_MSG_NOTICE([Floating point APIs disabled])
|
||||||
|
AC_DEFINE([PNG_NO_FLOATING_POINT],[1],
|
||||||
|
[No support for floating point APIs])
|
||||||
|
fi
|
||||||
|
if test "$enable_fixed_point" != yes
|
||||||
|
then
|
||||||
|
AC_MSG_NOTICE([Fixed point APIs disabled])
|
||||||
|
AC_DEFINE([PNG_NO_FIXED_POINT],[1],
|
||||||
|
[No support for fixed point APIs])
|
||||||
|
fi
|
||||||
|
if test "$enable_floating_arithmetic" != yes
|
||||||
|
then
|
||||||
|
AC_MSG_NOTICE([Fixed point arithmetic will be used])
|
||||||
|
AC_DEFINE([PNG_NO_FLOATING_ARITHMETIC],[1],
|
||||||
|
[No support for floating point arithmetic])
|
||||||
|
fi
|
||||||
|
|
||||||
# The following is for pngvalid, to ensure it catches FP errors even on
|
# 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
|
# 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.
|
# library (typically), it's not an error if it is not found.
|
||||||
AC_CHECK_LIB([m], [feenableexcept])
|
AC_SEARCH_LIBS([feenableexcept],[m],AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],
|
||||||
AC_CHECK_FUNCS([feenableexcept])
|
[Define to 1 if the feenableexcept function is available]))
|
||||||
|
# Required by pngvalid:
|
||||||
|
AC_SEARCH_LIBS([ceil],[m])
|
||||||
|
|
||||||
|
# zlib checks and arguments;
|
||||||
|
# package zlib: argument is the name of the library
|
||||||
|
# zlib-header: the name of the header file
|
||||||
|
# zlib-prefix: the prefix for library functions, if any
|
||||||
|
AC_ARG_WITH([zlib],
|
||||||
|
AS_HELP_STRING([[[--with-zlib=<name>]]],
|
||||||
|
[base name of the zlib implementation (e.g. 'z')]),,
|
||||||
|
[with_zlib='z'])
|
||||||
|
|
||||||
|
z_prefix=
|
||||||
|
AC_ARG_WITH([zlib-prefix],
|
||||||
|
AS_HELP_STRING([[[--with-zlib-prefix=<prefix>]]],
|
||||||
|
[prefix for zlib API functions]),
|
||||||
|
[if test "$withval" = "" -o "$withval" = yes; then
|
||||||
|
with_zlib_prefix='z_'
|
||||||
|
AC_DEFINE([PNG_ZLIB_PREFIX],[z_],[Standard zlib prefix])
|
||||||
|
elif test "${withval}" != "no"; then
|
||||||
|
AC_DEFINE_UNQUOTED([PNG_ZLIB_PREFIX],[${withval}],
|
||||||
|
[User defined zlib prefix])
|
||||||
|
else
|
||||||
|
with_zlib_prefix=
|
||||||
|
fi
|
||||||
|
if test "$with_zlib_prefix" != ""; then
|
||||||
|
AC_DEFINE([Z_PREFIX],[1],[Tell zlib.h to prefix function names])
|
||||||
|
z_prefix="#define Z_PREFIX 1"
|
||||||
|
fi])
|
||||||
|
|
||||||
|
AC_ARG_WITH([zlib-header],
|
||||||
|
AS_HELP_STRING([[[--with-zlib-header='<file>' or '"file"']]],
|
||||||
|
[C include argument to locate zlib header file, e.g. <zlib.h>, take
|
||||||
|
care to put single quotes round this on the command line]),
|
||||||
|
[AC_DEFINE_UNQUOTED([PNG_ZLIB_HEADER],[${withval}],[Zlib header file])],
|
||||||
|
with_zlib_header='<zlib.h>')
|
||||||
|
|
||||||
|
# AC_CHECK_LIB isn't quite enough for this because we need the special header
|
||||||
|
# file too.
|
||||||
|
LIBS="-l${with_zlib} $LIBS"
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[[Library '${with_zlib}' and #include ${with_zlib_header} for symbol '${with_zlib_prefix}zlibVersion']])
|
||||||
|
AC_LINK_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM(
|
||||||
|
[[
|
||||||
|
${z_prefix}
|
||||||
|
#include ${with_zlib_header}
|
||||||
|
]],
|
||||||
|
[[(void)${with_zlib_prefix}zlibVersion();]])],
|
||||||
|
AC_MSG_RESULT([ok]),
|
||||||
|
AC_MSG_FAILURE([not found]))
|
||||||
|
|
||||||
AC_MSG_CHECKING([if using Solaris linker])
|
AC_MSG_CHECKING([if using Solaris linker])
|
||||||
SLD=`$LD --version 2>&1 | grep Solaris`
|
SLD=`$LD --version 2>&1 | grep Solaris`
|
||||||
@@ -226,9 +286,9 @@ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
|||||||
if test "$have_ld_version_script" = "yes"; then
|
if test "$have_ld_version_script" = "yes"; then
|
||||||
AC_MSG_CHECKING([for symbol prefix])
|
AC_MSG_CHECKING([for symbol prefix])
|
||||||
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
|
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
|
||||||
| ${CPP:-${CC:-gcc} -E} - 2>&1 \
|
| ${CPP-${CC-gcc} -E} - 2>&1 \
|
||||||
| ${EGREP:-grep} "^PREFIX=" \
|
| ${EGREP-grep} "^PREFIX=" \
|
||||||
| ${SED:-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
|
| ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
|
||||||
AC_SUBST(SYMBOL_PREFIX)
|
AC_SUBST(SYMBOL_PREFIX)
|
||||||
AC_MSG_RESULT($SYMBOL_PREFIX)
|
AC_MSG_RESULT($SYMBOL_PREFIX)
|
||||||
fi
|
fi
|
||||||
@@ -274,476 +334,31 @@ AC_ARG_WITH(libpng-prefix,
|
|||||||
fi])
|
fi])
|
||||||
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
|
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
|
||||||
|
|
||||||
# Control over what links are made for installed files. Versioned files are
|
# Because GCC by default assembles code with an executable stack, even though it
|
||||||
# always installed, when the following options are turned on corresponding
|
# compiles C code with a non-executable stack, it is necessary to do a fixup
|
||||||
# unversioned links are also created (normally as symbolic links):
|
# here (this may by GCC specific)
|
||||||
AC_ARG_ENABLE([unversioned-links],
|
AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack])
|
||||||
AS_HELP_STRING([[[--enable-unversioned-links]]],
|
|
||||||
[Installed libpng header files are placed in a versioned subdirectory]
|
|
||||||
[and installed libpng library (including DLL) files are versioned.]
|
|
||||||
[If this option is enabled unversioned links will be created pointing to]
|
|
||||||
[the corresponding installed files. If you use libpng.pc or]
|
|
||||||
[libpng-config for all builds you do not need these links, but if you]
|
|
||||||
[compile programs directly they will typically #include <png.h> and]
|
|
||||||
[link with -lpng; in that case you need the links.]
|
|
||||||
[The links can be installed manually using 'make install-header-links']
|
|
||||||
[and 'make install-library-links' and can be removed using the]
|
|
||||||
[corresponding uninstall- targets. If you do enable this option every]
|
|
||||||
[libpng 'make install' will recreate the links to point to the just]
|
|
||||||
[installed version of libpng. The default is to create the links;]
|
|
||||||
[use --disable-unversioned-links to change this]))
|
|
||||||
|
|
||||||
# The AM_CONDITIONAL test is written so that the default is enabled;
|
|
||||||
# --disable-unversioned-links must be given to turn the option off.
|
|
||||||
AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([unversioned-libpng-pc],
|
|
||||||
AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]],
|
|
||||||
[Install the configuration file 'libpng.pc' as a link to the versioned]
|
|
||||||
[version. This is done by default - use --disable-unversioned-libpng-pc]
|
|
||||||
[to change this.]))
|
|
||||||
AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC],
|
|
||||||
[test "$enable_unversioned_libpng_pc" != "no"])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([unversioned-libpng-config],
|
|
||||||
AS_HELP_STRING([[[--enable-unversioned-libpng-config]]],
|
|
||||||
[Install the configuration file 'libpng-config' as a link to the]
|
|
||||||
[versioned version. This is done by default - use]
|
|
||||||
[--disable-unversioned-libpng-config to change this.]))
|
|
||||||
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
|
|
||||||
[test "$enable_unversioned_libpng_config" != "no"])
|
|
||||||
|
|
||||||
# HOST-SPECIFIC OPTIONS
|
|
||||||
# =====================
|
|
||||||
#
|
|
||||||
# DEFAULT
|
|
||||||
# =======
|
|
||||||
#
|
|
||||||
AC_ARG_ENABLE([hardware-optimizations],
|
|
||||||
AS_HELP_STRING([[[--enable-hardware-optimizations]]],
|
|
||||||
[Enable hardware optimizations: =no/off, yes/on.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable hardware optimization on all systems:
|
|
||||||
enable_arm_neon=no
|
|
||||||
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
|
|
||||||
[Disable ARM_NEON optimizations])
|
|
||||||
enable_mips_msa=no
|
|
||||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
|
|
||||||
[Disable MIPS_MSA optimizations])
|
|
||||||
enable_mips_mmi=no
|
|
||||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
|
|
||||||
[Disable MIPS_MMI optimizations])
|
|
||||||
enable_powerpc_vsx=no
|
|
||||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
|
||||||
[Disable POWERPC VSX optimizations])
|
|
||||||
enable_intel_sse=no
|
|
||||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
|
||||||
[Disable INTEL_SSE 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:
|
|
||||||
case "$host_cpu" in
|
|
||||||
arm*|aarch64*)
|
|
||||||
enable_arm_neon=yes
|
|
||||||
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
|
|
||||||
[Enable ARM_NEON optimizations])
|
|
||||||
;;
|
|
||||||
mipsel*|mips64el*)
|
|
||||||
enable_mips_mmi=yes
|
|
||||||
enable_mips_msa=yes
|
|
||||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
|
|
||||||
[Enable MIPS_MMI optimizations])
|
|
||||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
|
|
||||||
[Enable MIPS_MSA optimizations])
|
|
||||||
;;
|
|
||||||
i?86|x86_64)
|
|
||||||
enable_intel_sse=yes
|
|
||||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
|
||||||
[Enable Intel SSE optimizations])
|
|
||||||
;;
|
|
||||||
powerpc*|ppc64*)
|
|
||||||
enable_powerpc_vsx=yes
|
|
||||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
|
|
||||||
[Enable POWERPC VSX optimizations])
|
|
||||||
;;
|
|
||||||
loongarch*)
|
|
||||||
enable_loongarch_lsx=yes
|
|
||||||
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 NEON
|
|
||||||
# ========
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([arm-neon],
|
AC_ARG_ENABLE([arm-neon],
|
||||||
AS_HELP_STRING([[[--enable-arm-neon]]],
|
AS_HELP_STRING([[[--enable-arm-neon]]],
|
||||||
[Enable ARM NEON optimizations: =no/off, check, api, yes/on.]
|
[Enable ARM NEON optimizations: use 'always' to turn off run-time checks]),
|
||||||
[no/off: disable the optimizations;]
|
[if test "${enableval}" = "yes" -o "${enableval}" = "always"; then
|
||||||
[check: use internal checking code (deprecated and poorly supported);]
|
AC_DEFINE([PNG_FILTER_OPTIMIZATIONS],
|
||||||
[api: disable by default, enable by a call to png_set_option;]
|
[png_init_filter_functions_neon],
|
||||||
[yes/on: turn on unconditionally.]
|
[ARM NEON filter initialization function])
|
||||||
[If not specified: determined by the compiler.]),
|
AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [],
|
||||||
[case "$enableval" in
|
[Align row buffers])
|
||||||
no|off)
|
if test "${enableval}" = "always"; then
|
||||||
# disable the default enabling on __ARM_NEON__ systems:
|
AC_DEFINE([PNG_NO_ARM_NEON_CHECK], [],
|
||||||
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
|
[Turn off run-time checking for ARM NEON support])
|
||||||
[Disable ARM Neon optimizations])
|
|
||||||
# Prevent inclusion of the assembler files below:
|
|
||||||
enable_arm_neon=no ;;
|
|
||||||
check)
|
|
||||||
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
|
|
||||||
[Check for ARM Neon support at run-time]);;
|
|
||||||
api)
|
|
||||||
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
|
|
||||||
[Turn on ARM Neon optimizations at run-time]);;
|
|
||||||
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_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*'.)
|
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_ARM_NEON],
|
|
||||||
[test "$enable_arm_neon" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
arm*|aarch64*) : ;;
|
|
||||||
*) test "$enable_arm_neon" != '' ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
# 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.]
|
|
||||||
[If not specified: determined by the compiler.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable the default enabling on __mips_msa systems:
|
|
||||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
|
|
||||||
[Disable MIPS MSA optimizations])
|
|
||||||
# Prevent inclusion of the assembler files below:
|
|
||||||
enable_mips_msa=no ;;
|
|
||||||
check)
|
|
||||||
AC_DEFINE([PNG_MIPS_MSA_CHECK_SUPPORTED], [],
|
|
||||||
[Check for MIPS MSA support at run-time]);;
|
|
||||||
api)
|
|
||||||
AC_DEFINE([PNG_MIPS_MSA_API_SUPPORTED], [],
|
|
||||||
[Turn on MIPS MSA optimizations at run-time]);;
|
|
||||||
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_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*'.)
|
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_MIPS_MSA],
|
|
||||||
[test "$enable_mips_msa" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
mipsel*|mips64el*) : ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
# 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.]
|
|
||||||
[If not specified: determined by the compiler.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable the default enabling on __mips_mmi systems:
|
|
||||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
|
|
||||||
[Disable MIPS MMI optimizations])
|
|
||||||
# Prevent inclusion of the assembler files below:
|
|
||||||
enable_mips_mmi=no;;
|
|
||||||
check)
|
|
||||||
AC_DEFINE([PNG_MIPS_MMI_CHECK_SUPPORTED], [],
|
|
||||||
[Check for MIPS MMI support at run-time]);;
|
|
||||||
api)
|
|
||||||
AC_DEFINE([PNG_MIPS_MMI_API_SUPPORTED], [],
|
|
||||||
[Turn on MIPS MMI optimizations at run-time]);;
|
|
||||||
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_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*'.)
|
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_MIPS_MMI],
|
|
||||||
[test "$enable_mips_mmi" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
mipsel*|mips64el*) : ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
# INTEL SSE
|
|
||||||
# =========
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([intel-sse],
|
|
||||||
AS_HELP_STRING([[[--enable-intel-sse]]],
|
|
||||||
[Enable Intel SSE optimizations: =no/off, yes/on.]
|
|
||||||
[no/off: disable the optimizations;]
|
|
||||||
[yes/on: enable the optimizations.]
|
|
||||||
[If not specified: determined by the compiler.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable the default enabling:
|
|
||||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
|
||||||
[Disable Intel SSE optimizations])
|
|
||||||
# Prevent inclusion of the assembler files below:
|
|
||||||
enable_intel_sse=no ;;
|
|
||||||
yes|on)
|
|
||||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
|
||||||
[Enable Intel SSE optimizations]);;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}:]
|
|
||||||
[invalid 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*'.)
|
|
||||||
AM_CONDITIONAL([PNG_INTEL_SSE],
|
|
||||||
[test "$enable_intel_sse" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
i?86|x86_64) : ;;
|
|
||||||
*) test "$enable_intel_sse" != '' ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
# 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;]
|
|
||||||
[yes/on: turn on unconditionally.]
|
|
||||||
[If not specified: determined by the compiler.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable the default enabling on __ppc64__ systems:
|
|
||||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
|
||||||
[Disable POWERPC VSX optimizations])
|
|
||||||
# Prevent inclusion of the platform-specific files below:
|
|
||||||
enable_powerpc_vsx=no ;;
|
|
||||||
check)
|
|
||||||
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
|
|
||||||
[Check for POWERPC VSX support at run-time])
|
|
||||||
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_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*'.)
|
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_POWERPC_VSX],
|
|
||||||
[test "$enable_powerpc_vsx" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
powerpc*|ppc64*) : ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
# LOONGARCH LSX
|
|
||||||
# =============
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([loongarch-lsx],
|
|
||||||
AS_HELP_STRING([[[--enable-loongarch-lsx]]],
|
|
||||||
[Enable LOONGARCH LSX optimizations: =no/off, yes/on:]
|
|
||||||
[no/off: disable the optimizations;]
|
|
||||||
[yes/on: turn on unconditionally.]
|
|
||||||
[If not specified: determined by the compiler.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable the default enabling on __loongarch_simd systems:
|
|
||||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
|
|
||||||
[Disable LOONGARCH LSX optimizations])
|
|
||||||
# Prevent inclusion of the assembler files below:
|
|
||||||
enable_loongarch_lsx=no;;
|
|
||||||
yes|on)
|
|
||||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
|
||||||
[Enable LOONGARCH LSX optimizations])
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}:]
|
|
||||||
[invalid argument])
|
|
||||||
esac])
|
|
||||||
|
|
||||||
if test "$enable_loongarch_lsx" != "no" &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
loongarch*) : ;;
|
|
||||||
*) test "$enable_loongarch_lsx" != '' ;;
|
|
||||||
esac
|
|
||||||
then
|
|
||||||
compiler_support_loongarch_lsx=no
|
|
||||||
AC_MSG_CHECKING(whether to use LoongArch LSX intrinsics)
|
|
||||||
save_CFLAGS="$CFLAGS"
|
|
||||||
LSX_CFLAGS="${LSX_CFLAGS:-"-mlsx"}"
|
|
||||||
CFLAGS="$CFLAGS $LSX_CFLAGS"
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <lsxintrin.h>
|
|
||||||
int main(){
|
|
||||||
__m128i a, b, c;
|
|
||||||
a = __lsx_vadd_w(b, c);
|
|
||||||
return 0;
|
|
||||||
}]])],compiler_support_loongarch_lsx=yes)
|
|
||||||
CFLAGS="$save_CFLAGS"
|
|
||||||
AC_MSG_RESULT($compiler_support_loongarch_lsx)
|
|
||||||
if test "$compiler_support_loongarch_lsx" = "yes"; then
|
|
||||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
|
||||||
[Enable LOONGARCH LSX optimizations])
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([Compiler does not support loongarch LSX.])
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi])
|
||||||
|
AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" != "no"])
|
||||||
# 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" &&
|
|
||||||
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 <riscv_vector.h>
|
|
||||||
#include <asm/hwcap.h>
|
|
||||||
#ifndef COMPAT_HWCAP_ISA_V /* added in linux-6.5 */
|
|
||||||
#error "COMPAT_HWCAP_ISA_V is not available"
|
|
||||||
#endif
|
|
||||||
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
|
|
||||||
riscv64) : ;;
|
|
||||||
*) test "$compiler_support_riscv_rvv" != '' ;;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
||||||
|
|
||||||
# Config files, substituting as above
|
# Config files, substituting as above
|
||||||
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
|
AC_CONFIG_FILES([Makefile libpng.pc])
|
||||||
AC_CONFIG_FILES([libpng-config:libpng-config.in],
|
AC_CONFIG_FILES([libpng-config], [chmod +x libpng-config])
|
||||||
[chmod +x libpng-config])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# https://editorconfig.org
|
|
||||||
|
|
||||||
root = false
|
|
||||||
|
|
||||||
[*.[ch]]
|
|
||||||
indent_size = unset
|
|
||||||
indent_style = unset
|
|
||||||
max_doc_length = unset
|
|
||||||
max_line_length = unset
|
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
External contributions to libpng
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
This "contrib" directory contains contributions which are not necessarily under
|
This "contrib" directory contains contributions which are not necessarily under
|
||||||
the libpng license, although all are open source. They are not part of
|
the libpng license, although all are open source. They are not part of
|
||||||
libpng proper and are not used for building the library, although some are used
|
libpng proper and are not used for building the library.
|
||||||
for testing the library via "make check".
|
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
OPERATING SYSTEM SPECIFIC ARM NEON DETECTION
|
|
||||||
--------------------------------------------
|
|
||||||
|
|
||||||
Detection of the ability to execute ARM NEON on an ARM processor requires
|
|
||||||
operating system support. (The information is not available in user mode.)
|
|
||||||
|
|
||||||
HOW TO USE THIS
|
|
||||||
---------------
|
|
||||||
|
|
||||||
This directory contains C code fragments that can be included in arm/arm_init.c
|
|
||||||
by setting the macro PNG_ARM_NEON_FILE to the file name in "" or <> at build
|
|
||||||
time. This setting is not recorded in pnglibconf.h and can be changed simply by
|
|
||||||
rebuilding arm/arm_init.o with the required macro definition.
|
|
||||||
|
|
||||||
For any of this code to be used the ARM NEON code must be enabled and run time
|
|
||||||
checks must be supported. I.e.:
|
|
||||||
|
|
||||||
#if PNG_ARM_NEON_OPT > 0
|
|
||||||
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
|
|
||||||
|
|
||||||
This is done in a 'configure' build by passing configure the argument:
|
|
||||||
|
|
||||||
--enable-arm-neon=check
|
|
||||||
|
|
||||||
Apart from the basic Linux implementation in contrib/arm-neon/linux.c this code
|
|
||||||
is unsupported. That means that it is not even compiled on a regular basis and
|
|
||||||
may be broken in any given minor release.
|
|
||||||
|
|
||||||
FILE FORMAT
|
|
||||||
-----------
|
|
||||||
|
|
||||||
Each file documents its testing status as of the last time it was tested (which
|
|
||||||
may have been a long time ago):
|
|
||||||
|
|
||||||
STATUS: one of:
|
|
||||||
SUPPORTED: This indicates that the file is included in the regularly
|
|
||||||
performed test builds and bugs are fixed when discovered.
|
|
||||||
COMPILED: This indicates that the code did compile at least once. See the
|
|
||||||
more detailed description for the extent to which the result was
|
|
||||||
successful.
|
|
||||||
TESTED: This means the code was fully compiled into the libpng test programs
|
|
||||||
and these were run at least once.
|
|
||||||
|
|
||||||
BUG REPORTS: an email address to which to send reports of problems
|
|
||||||
|
|
||||||
The file is a fragment of C code. It should not define any 'extern' symbols;
|
|
||||||
everything should be static. It must define the function:
|
|
||||||
|
|
||||||
static int png_have_neon(png_structp png_ptr);
|
|
||||||
|
|
||||||
That function must return 1 if ARM NEON instructions are supported, 0 if not.
|
|
||||||
It must not execute png_error unless it detects a bug. A png_error will prevent
|
|
||||||
the reading of the PNG and in the future, writing too.
|
|
||||||
|
|
||||||
BUG REPORTS
|
|
||||||
-----------
|
|
||||||
|
|
||||||
If you mail a bug report for any file that is not SUPPORTED there may only be
|
|
||||||
limited response. Consider fixing it and sending a patch to fix the problem -
|
|
||||||
this is more likely to result in action.
|
|
||||||
|
|
||||||
CONTRIBUTIONS
|
|
||||||
-------------
|
|
||||||
|
|
||||||
You may send contributions of new implementations to
|
|
||||||
png-mng-implement@sourceforge.net. Please write code in strict C90 C where
|
|
||||||
possible. Obviously OS dependencies are to be expected. If you submit code you
|
|
||||||
must have the authors permission and it must have a license that is acceptable
|
|
||||||
to the current maintainer; in particular that license must permit modification
|
|
||||||
and redistribution.
|
|
||||||
|
|
||||||
Please try to make the contribution a single file and give the file a clear and
|
|
||||||
unambiguous name that identifies the target OS. If multiple files really are
|
|
||||||
required put them all in a sub-directory.
|
|
||||||
|
|
||||||
You must also be prepared to handle bug reports from users of the code, either
|
|
||||||
by joining the png-mng-implement mailing list or by providing an email for the
|
|
||||||
"BUG REPORTS" entry or both. Please make sure that the header of the file
|
|
||||||
contains the STATUS and BUG REPORTS fields as above.
|
|
||||||
|
|
||||||
Please list the OS requirements as precisely as possible. Ideally you should
|
|
||||||
also list the environment in which the code has been tested and certainly list
|
|
||||||
any environments where you suspect it might not work.
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/* contrib/arm-neon/android-ndk.c
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
|
||||||
* Written by John Bowler, 2014.
|
|
||||||
*
|
|
||||||
* This code is released under the libpng license.
|
|
||||||
* For conditions of distribution and use, see the disclaimer
|
|
||||||
* and license in png.h
|
|
||||||
*
|
|
||||||
* SEE contrib/arm-neon/README before reporting bugs
|
|
||||||
*
|
|
||||||
* STATUS: COMPILED, UNTESTED
|
|
||||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
|
||||||
*
|
|
||||||
* png_have_neon implemented for the Android NDK, see:
|
|
||||||
*
|
|
||||||
* Documentation:
|
|
||||||
* http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
|
|
||||||
* https://code.google.com/p/android/issues/detail?id=49065
|
|
||||||
*
|
|
||||||
* NOTE: this requires that libpng is built against the Android NDK and linked
|
|
||||||
* with an implementation of the Android ARM 'cpu-features' library. The code
|
|
||||||
* has been compiled only, not linked: no version of the library has been found,
|
|
||||||
* only the header files exist in the NDK.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <cpu-features.h>
|
|
||||||
|
|
||||||
static int
|
|
||||||
png_have_neon(png_structp png_ptr)
|
|
||||||
{
|
|
||||||
/* This is a whole lot easier than the linux code, however it is probably
|
|
||||||
* implemented as below, therefore it is better to cache the result (these
|
|
||||||
* function calls may be slow!)
|
|
||||||
*/
|
|
||||||
PNG_UNUSED(png_ptr)
|
|
||||||
return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
|
|
||||||
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
/* contrib/arm-neon/linux-auxv.c
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
|
||||||
* Written by Mans Rullgard, 2011.
|
|
||||||
*
|
|
||||||
* This code is released under the libpng license.
|
|
||||||
* For conditions of distribution and use, see the disclaimer
|
|
||||||
* and license in png.h
|
|
||||||
*
|
|
||||||
* SEE contrib/arm-neon/README before reporting bugs
|
|
||||||
*
|
|
||||||
* STATUS: COMPILED, TESTED
|
|
||||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
|
||||||
*
|
|
||||||
* png_have_neon implemented for Linux versions which allow access to
|
|
||||||
* /proc/self/auxv. This is probably faster, cleaner and safer than the code to
|
|
||||||
* read /proc/cpuinfo in contrib/arm-neon/linux, however it is yet another piece
|
|
||||||
* of potentially untested code and has more complex dependencies than the code
|
|
||||||
* to read cpuinfo.
|
|
||||||
*
|
|
||||||
* This generic __linux__ implementation requires reading /proc/self/auxv and
|
|
||||||
* looking at each element for one that records NEON capabilities.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <unistd.h> /* for POSIX 1003.1 */
|
|
||||||
#include <errno.h> /* for EINTR */
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <elf.h>
|
|
||||||
#include <asm/hwcap.h>
|
|
||||||
|
|
||||||
/* A read call may be interrupted, in which case it returns -1 and sets errno to
|
|
||||||
* EINTR if nothing was done, otherwise (if something was done) a partial read
|
|
||||||
* may result.
|
|
||||||
*/
|
|
||||||
static size_t
|
|
||||||
safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
|
|
||||||
{
|
|
||||||
size_t ntotal = 0;
|
|
||||||
char *buffer = png_voidcast(char*, buffer_in);
|
|
||||||
|
|
||||||
while (nbytes > 0)
|
|
||||||
{
|
|
||||||
unsigned int nread;
|
|
||||||
int iread;
|
|
||||||
|
|
||||||
/* Passing nread > INT_MAX to read is implementation defined in POSIX
|
|
||||||
* 1003.1, therefore despite the unsigned argument portable code must
|
|
||||||
* limit the value to INT_MAX!
|
|
||||||
*/
|
|
||||||
if (nbytes > INT_MAX)
|
|
||||||
nread = INT_MAX;
|
|
||||||
|
|
||||||
else
|
|
||||||
nread = (unsigned int)/*SAFE*/nbytes;
|
|
||||||
|
|
||||||
iread = read(fd, buffer, nread);
|
|
||||||
|
|
||||||
if (iread == -1)
|
|
||||||
{
|
|
||||||
/* This is the devil in the details, a read can terminate early with 0
|
|
||||||
* bytes read because of EINTR, yet it still returns -1 otherwise end
|
|
||||||
* of file cannot be distinguished.
|
|
||||||
*/
|
|
||||||
if (errno != EINTR)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "/proc read failed");
|
|
||||||
return 0; /* I.e., a permanent failure */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (iread < 0)
|
|
||||||
{
|
|
||||||
/* Not a valid 'read' result: */
|
|
||||||
png_warning(png_ptr, "OS /proc read bug");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (iread > 0)
|
|
||||||
{
|
|
||||||
/* Continue reading until a permanent failure, or EOF */
|
|
||||||
buffer += iread;
|
|
||||||
nbytes -= (unsigned int)/*SAFE*/iread;
|
|
||||||
ntotal += (unsigned int)/*SAFE*/iread;
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
return ntotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ntotal; /* nbytes == 0 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
png_have_neon(png_structp png_ptr)
|
|
||||||
{
|
|
||||||
int fd = open("/proc/self/auxv", O_RDONLY);
|
|
||||||
Elf32_auxv_t aux;
|
|
||||||
|
|
||||||
/* Failsafe: failure to open means no NEON */
|
|
||||||
if (fd == -1)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "/proc/self/auxv open failed");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux)
|
|
||||||
{
|
|
||||||
if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0)
|
|
||||||
{
|
|
||||||
close(fd);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
/* contrib/arm-neon/linux.c
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014, 2017 Glenn Randers-Pehrson
|
|
||||||
* Written by John Bowler, 2014, 2017.
|
|
||||||
*
|
|
||||||
* This code is released under the libpng license.
|
|
||||||
* For conditions of distribution and use, see the disclaimer
|
|
||||||
* and license in png.h
|
|
||||||
*
|
|
||||||
* SEE contrib/arm-neon/README before reporting bugs
|
|
||||||
*
|
|
||||||
* STATUS: SUPPORTED
|
|
||||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
|
||||||
*
|
|
||||||
* png_have_neon implemented for Linux by reading the widely available
|
|
||||||
* pseudo-file /proc/cpuinfo.
|
|
||||||
*
|
|
||||||
* This code is strict ANSI-C and is probably moderately portable; it does
|
|
||||||
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
static int
|
|
||||||
png_have_neon(png_structp png_ptr)
|
|
||||||
{
|
|
||||||
FILE *f = fopen("/proc/cpuinfo", "rb");
|
|
||||||
|
|
||||||
if (f != NULL)
|
|
||||||
{
|
|
||||||
/* This is a simple state machine which reads the input byte-by-byte until
|
|
||||||
* it gets a match on the 'neon' feature or reaches the end of the stream.
|
|
||||||
*/
|
|
||||||
static const char ch_feature[] = { 70, 69, 65, 84, 85, 82, 69, 83 };
|
|
||||||
static const char ch_neon[] = { 78, 69, 79, 78 };
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
StartLine, Feature, Colon, StartTag, Neon, HaveNeon, SkipTag, SkipLine
|
|
||||||
} state;
|
|
||||||
int counter;
|
|
||||||
|
|
||||||
for (state=StartLine, counter=0;;)
|
|
||||||
{
|
|
||||||
int ch = fgetc(f);
|
|
||||||
|
|
||||||
if (ch == EOF)
|
|
||||||
{
|
|
||||||
/* EOF means error or end-of-file, return false; neon at EOF is
|
|
||||||
* assumed to be a mistake.
|
|
||||||
*/
|
|
||||||
fclose(f);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (state)
|
|
||||||
{
|
|
||||||
case StartLine:
|
|
||||||
/* Match spaces at the start of line */
|
|
||||||
if (ch <= 32) /* skip control characters and space */
|
|
||||||
break;
|
|
||||||
|
|
||||||
counter=0;
|
|
||||||
state = Feature;
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
|
|
||||||
case Feature:
|
|
||||||
/* Match 'FEATURE', ASCII case insensitive. */
|
|
||||||
if ((ch & ~0x20) == ch_feature[counter])
|
|
||||||
{
|
|
||||||
if (++counter == (sizeof ch_feature))
|
|
||||||
state = Colon;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* did not match 'feature' */
|
|
||||||
state = SkipLine;
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
|
|
||||||
case SkipLine:
|
|
||||||
skipLine:
|
|
||||||
/* Skip everything until we see linefeed or carriage return */
|
|
||||||
if (ch != 10 && ch != 13)
|
|
||||||
break;
|
|
||||||
|
|
||||||
state = StartLine;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Colon:
|
|
||||||
/* Match any number of space or tab followed by ':' */
|
|
||||||
if (ch == 32 || ch == 9)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (ch == 58) /* i.e. ':' */
|
|
||||||
{
|
|
||||||
state = StartTag;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Either a bad line format or a 'feature' prefix followed by
|
|
||||||
* other characters.
|
|
||||||
*/
|
|
||||||
state = SkipLine;
|
|
||||||
goto skipLine;
|
|
||||||
|
|
||||||
case StartTag:
|
|
||||||
/* Skip space characters before a tag */
|
|
||||||
if (ch == 32 || ch == 9)
|
|
||||||
break;
|
|
||||||
|
|
||||||
state = Neon;
|
|
||||||
counter = 0;
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
|
|
||||||
case Neon:
|
|
||||||
/* Look for 'neon' tag */
|
|
||||||
if ((ch & ~0x20) == ch_neon[counter])
|
|
||||||
{
|
|
||||||
if (++counter == (sizeof ch_neon))
|
|
||||||
state = HaveNeon;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
state = SkipTag;
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
|
|
||||||
case SkipTag:
|
|
||||||
/* Skip non-space characters */
|
|
||||||
if (ch == 10 || ch == 13)
|
|
||||||
state = StartLine;
|
|
||||||
|
|
||||||
else if (ch == 32 || ch == 9)
|
|
||||||
state = StartTag;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HaveNeon:
|
|
||||||
/* Have seen a 'neon' prefix, but there must be a space or new
|
|
||||||
* line character to terminate it.
|
|
||||||
*/
|
|
||||||
if (ch == 10 || ch == 13 || ch == 32 || ch == 9)
|
|
||||||
{
|
|
||||||
fclose(f);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
state = SkipTag;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
png_error(png_ptr, "png_have_neon: internal error (bug)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef PNG_WARNINGS_SUPPORTED
|
|
||||||
else
|
|
||||||
png_warning(png_ptr, "/proc/cpuinfo open failed");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
This directory contains test configuration files, currently always '.dfa' files
|
|
||||||
intended to be used in the build by setting the make macro DFA_XTRA to the name
|
|
||||||
of the file.
|
|
||||||
|
|
||||||
These files are used in release validation of the 'configure' builds of libpng
|
|
||||||
by building 'make check', or 'make all-am' for cross-builds, with each .dfa
|
|
||||||
file.
|
|
||||||
|
|
||||||
The files in this directory may change between minor releases, however
|
|
||||||
contributions describing specific builds of libpng are welcomed. There is no
|
|
||||||
guarantee that libpng will continue to build with such configurations; support
|
|
||||||
for given configurations can be, and has been, dropped between successive minor
|
|
||||||
releases. However if a .dfa file describing a configuration is not in this
|
|
||||||
directory it is very unlikely that it will be tested before a minor release!
|
|
||||||
|
|
||||||
You can use these .dfa files as the basis of new configurations. Files in this
|
|
||||||
directory should not have any use restrictions or restrictive licenses.
|
|
||||||
|
|
||||||
This directory is not included in the .zip and .7z distributions, which do
|
|
||||||
not contain 'configure' scripts.
|
|
||||||
|
|
||||||
DOCUMENTATION
|
|
||||||
=============
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
${srcdir}/pngusr.dfa
|
|
||||||
${srcdir}/contrib/pngminim/*/pngusr.dfa
|
|
||||||
|
|
||||||
Documentation of the options:
|
|
||||||
${srcdir}/scripts/pnglibconf.dfa
|
|
||||||
|
|
||||||
Documentation of the file format:
|
|
||||||
${srcdir}/scripts/options.awk
|
|
||||||
|
|
||||||
FILE NAMING
|
|
||||||
===========
|
|
||||||
|
|
||||||
File names in this directory may NOT contain any of the five characters:
|
|
||||||
|
|
||||||
- , + * ?
|
|
||||||
|
|
||||||
Neither may they contain any space character.
|
|
||||||
|
|
||||||
While other characters may be used it is strongly suggested that file names be
|
|
||||||
limited to lower case Latiin alphabetic characters (a-z), digits (0-9) and, if
|
|
||||||
necessary the underscore (_) character. File names should be about 8 characters
|
|
||||||
long (excluding the .dfa extension). Submitted .dfa files should have names
|
|
||||||
between 7 and 16 characters long, shorter names (6 characters or less) are
|
|
||||||
reserved for standard tests.
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
# basic.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2024
|
|
||||||
# Usage rights:
|
|
||||||
# To the extent possible under law, the author has waived all copyright and
|
|
||||||
# related or neighboring rights to this work. This work is published from:
|
|
||||||
# United States.
|
|
||||||
#
|
|
||||||
# Build libpng with basic read and write support. This enables the lowest
|
|
||||||
# level libpng read and write APIs - the "row-by-row" ones.
|
|
||||||
#
|
|
||||||
# Support is enabled only for those transformations that are observed to be
|
|
||||||
# required by widely used apps or are in the v3 specification.
|
|
||||||
#
|
|
||||||
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
# The sequential read code is enabled here; the progressive code can be used
|
|
||||||
# instead but there is no point enabling both.
|
|
||||||
|
|
||||||
option READ on
|
|
||||||
option SEQUENTIAL_READ on
|
|
||||||
option EASY_ACCESS on
|
|
||||||
option SET_USER_LIMITS on
|
|
||||||
option INFO_IMAGE on
|
|
||||||
option READ_16BIT on
|
|
||||||
|
|
||||||
# Errors: these can be disabled but then there won't be any error messages
|
|
||||||
# just failures and the error messages are really needed for apps:
|
|
||||||
option WARNINGS on
|
|
||||||
option ERROR_TEXT on
|
|
||||||
option BENIGN_READ_ERRORS on
|
|
||||||
|
|
||||||
# Required for many display programs such as web browsers:
|
|
||||||
option PROGRESSIVE_READ on
|
|
||||||
|
|
||||||
# Switch on the write code - this makes a minimalist encoder but with
|
|
||||||
# interlace support turned on; otherwise png_read_png..png_write_png will
|
|
||||||
# fail on an interlaced image.
|
|
||||||
option WRITE on
|
|
||||||
option WRITE_INTERLACING on
|
|
||||||
option WRITE_16BIT on
|
|
||||||
|
|
||||||
# Usages of the 'fixed' APIs are relatively rare but they do occur
|
|
||||||
# one or the other for both the API and the internal math.
|
|
||||||
|
|
||||||
#Fixed point:
|
|
||||||
option FIXED_POINT on
|
|
||||||
|
|
||||||
#Floating point:
|
|
||||||
option FLOATING_POINT on
|
|
||||||
option FLOATING_ARITHMETIC on
|
|
||||||
|
|
||||||
# Basic error handling, IO and user memory support. The latter allows the
|
|
||||||
# application program to provide its own implementations of 'malloc' and 'free'.
|
|
||||||
option SETJMP on
|
|
||||||
option STDIO on
|
|
||||||
option USER_MEM on
|
|
||||||
|
|
||||||
# Gamma handling: this needs to be on for the gamma handling
|
|
||||||
option READ_GAMMA on
|
|
||||||
|
|
||||||
# The supported chunks
|
|
||||||
chunk bKGD on
|
|
||||||
chunk cHRM on
|
|
||||||
chunk eXIf on
|
|
||||||
chunk gAMA on
|
|
||||||
chunk iCCP on
|
|
||||||
chunk iTXt on
|
|
||||||
chunk pHYs on
|
|
||||||
chunk sBIT on
|
|
||||||
chunk sRGB on
|
|
||||||
chunk tEXt on
|
|
||||||
chunk tIME on
|
|
||||||
chunk tRNS on
|
|
||||||
chunk zTXt on
|
|
||||||
|
|
||||||
# These don't seem to be used anywhere:
|
|
||||||
# chunk pCAL
|
|
||||||
# chunk sCAL
|
|
||||||
# chunk sPLT
|
|
||||||
|
|
||||||
# The rest of this is app dependent: none of these options are required for
|
|
||||||
# read/write of the full range of PNG files and the normal chunk handling on
|
|
||||||
# read.
|
|
||||||
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
|
|
||||||
option WRITE_CUSTOMIZE_COMPRESSION on
|
|
||||||
|
|
||||||
option READ_EXPAND on
|
|
||||||
option READ_FILLER on
|
|
||||||
option READ_GRAY_TO_RGB on
|
|
||||||
option READ_INVERT on
|
|
||||||
option READ_PACK on
|
|
||||||
option READ_RGB_TO_GRAY on
|
|
||||||
option READ_SCALE_16_TO_8 on
|
|
||||||
option READ_SHIFT on
|
|
||||||
option READ_STRIP_16_TO_8 on
|
|
||||||
option READ_STRIP_ALPHA on
|
|
||||||
option READ_SWAP on
|
|
||||||
|
|
||||||
option CONVERT_tIME on
|
|
||||||
|
|
||||||
# optipng
|
|
||||||
option IO_STATE on
|
|
||||||
option STORE_UNKNOWN_CHUNKS on
|
|
||||||
option HANDLE_AS_UNKNOWN on
|
|
||||||
|
|
||||||
# pngcrush
|
|
||||||
option READ_USER_TRANSFORM on
|
|
||||||
option WRITE_FLUSH on
|
|
||||||
|
|
||||||
# pnmtopng
|
|
||||||
chunk hIST on
|
|
||||||
|
|
||||||
# cairo
|
|
||||||
option WRITE_PACKSWAP on
|
|
||||||
option WRITE_USER_TRANSFORM on
|
|
||||||
|
|
||||||
# graphicsmagick
|
|
||||||
option READ_USER_CHUNKS on
|
|
||||||
|
|
||||||
# Qt5.15 qtgui (gentoo package split) Qt6.6 qtbase
|
|
||||||
option READ_BGR on
|
|
||||||
option WRITE_BGR on
|
|
||||||
option READ_SWAP_ALPHA on
|
|
||||||
option WRITE_SWAP_ALPHA on
|
|
||||||
chunk oFFs on
|
|
||||||
|
|
||||||
# ghostscript-gpl
|
|
||||||
option WRITE_INVERT_ALPHA on
|
|
||||||
option WRITE_INVERT on
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
# pngcp.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2016
|
|
||||||
# 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 support for pngcp. This means just png_read_png,
|
|
||||||
# png_write_png and small number of configuration settings.
|
|
||||||
#
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
# This option is specific to this configuration; it adds a #define to the
|
|
||||||
# generated pnglibconf.h which turns on the (not portable) timing option for
|
|
||||||
# pngcp. Note that any option is automatically preceded by PNG_; there is no
|
|
||||||
# way round this and this is deliberate.
|
|
||||||
option PNGCP_TIMING
|
|
||||||
|
|
||||||
# Because of the everything off above the option must also be turned on. This
|
|
||||||
# may not be done in one step because it is safer and avoids mis-spelled options
|
|
||||||
# in user .dfa files to error out if an unrecognized option is turned on.
|
|
||||||
option PNGCP_TIMING on
|
|
||||||
|
|
||||||
# Options to turn on png_read_png and png_write_png:
|
|
||||||
option INFO_IMAGE on
|
|
||||||
option SEQUENTIAL_READ on
|
|
||||||
option EASY_ACCESS on
|
|
||||||
option WRITE on
|
|
||||||
option WRITE_16BIT on
|
|
||||||
option WRITE_FILTER on
|
|
||||||
|
|
||||||
# pngcp needs this to preserve unknown chunks, switching all these on means that
|
|
||||||
# pngcp can work without explicit known chunk reading support
|
|
||||||
option UNKNOWN_CHUNKS on
|
|
||||||
option SET_UNKNOWN_CHUNKS on
|
|
||||||
option HANDLE_AS_UNKNOWN on
|
|
||||||
option SAVE_UNKNOWN_CHUNKS on
|
|
||||||
option WRITE_UNKNOWN_CHUNKS on
|
|
||||||
|
|
||||||
# pngcp needs this to handle palette files with invalid indices:
|
|
||||||
option CHECK_FOR_INVALID_INDEX on
|
|
||||||
option GET_PALETTE_MAX on
|
|
||||||
|
|
||||||
# Pre-libpng 1.7 pngcp has to stash text chunks manually, post 1.7 without this
|
|
||||||
# text chunks should be handled as unknown ok.
|
|
||||||
option TEXT on
|
|
||||||
|
|
||||||
# this is used to turn off limits:
|
|
||||||
option USER_LIMITS on
|
|
||||||
option SET_USER_LIMITS on
|
|
||||||
|
|
||||||
# these are just required for specific customizations
|
|
||||||
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
|
|
||||||
option WRITE_CUSTOMIZE_COMPRESSION on
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# read.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2013
|
|
||||||
# Usage rights:
|
|
||||||
# To the extent possible under law, the author has waived all copyright and
|
|
||||||
# related or neighboring rights to this work. This work is published from:
|
|
||||||
# United States.
|
|
||||||
#
|
|
||||||
# Build libpng with basic read support. This enables the lowest level libpng
|
|
||||||
# read API - the one where the calling code has to use a loop to read each row.
|
|
||||||
# At present this is the API used by most programs.
|
|
||||||
#
|
|
||||||
# Support is enabled only for those chunks and transformations that are
|
|
||||||
# typically required - others can be added easily.
|
|
||||||
#
|
|
||||||
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
# The sequential read code is enabled here; the progressive code can be used
|
|
||||||
# instead but there is no point enabling both.
|
|
||||||
|
|
||||||
option SEQUENTIAL_READ on
|
|
||||||
|
|
||||||
# Likewise it is pointless enabling both fixed and floating point APIs. Choose
|
|
||||||
# one or the other for both the API and the internal math.
|
|
||||||
|
|
||||||
#Fixed point:
|
|
||||||
#option FIXED_POINT on
|
|
||||||
#option FLOATING_ARITHMETIC off
|
|
||||||
|
|
||||||
#Floating point:
|
|
||||||
option FLOATING_POINT on
|
|
||||||
option FLOATING_ARITHMETIC on
|
|
||||||
|
|
||||||
# Basic error handling, IO and user memory support. The latter allows the
|
|
||||||
# application program to provide its own implementations of 'malloc' and 'free'.
|
|
||||||
option SETJMP on
|
|
||||||
option STDIO on
|
|
||||||
option USER_MEM on
|
|
||||||
|
|
||||||
# To read the full set of PNG images correctly interlace, transparency and
|
|
||||||
# 16-bit support is required. The application can implement interlace itself,
|
|
||||||
# but very few do and it's no longer possible to disable it when READ is
|
|
||||||
# enabled.
|
|
||||||
option READ_tRNS on
|
|
||||||
option READ_16BIT on
|
|
||||||
|
|
||||||
# Everything else is application dependent. This file assumes the app handles
|
|
||||||
# all the native PNG bit layouts, so it doesn't need any of layout change
|
|
||||||
# transforms, but needs libpng to perform gamma correction. It doesn't do any
|
|
||||||
# colorspace stuff and ignores the 'significant bit' information.
|
|
||||||
#
|
|
||||||
# If your app always expands the image to a limited set of bit layouts you
|
|
||||||
# probably want to consider using the simplified API instead of the low level
|
|
||||||
# one - see png.h and s_read.dfa.
|
|
||||||
option READ_GAMMA on
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
# s_read.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2013
|
|
||||||
# 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 simplified read support (only). This builds a minimal
|
|
||||||
# libpng able to read all PNG formats and convert them into a small number of
|
|
||||||
# well understood memory formats.
|
|
||||||
#
|
|
||||||
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
option SIMPLIFIED_READ on
|
|
||||||
|
|
||||||
# It isn't necessary to chose fixed or floating point for the APIs because the
|
|
||||||
# simplified API doesn't need fixed or floating point numbers. It is necessary
|
|
||||||
# to chose an internal math implementation. The default (because of 'everything
|
|
||||||
# = off') is fixed point - turn the floating point implementation on if you have
|
|
||||||
# hardware floating point or prefer your software floating point implementation.
|
|
||||||
option FLOATING_ARITHMETIC on
|
|
||||||
|
|
||||||
# This is not strictly necessary, but without it the message strings in the API
|
|
||||||
# will not be filled in
|
|
||||||
option ERROR_TEXT on
|
|
||||||
|
|
||||||
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
|
|
||||||
# need this if you don't use them, they just allow the in-memory layout to be
|
|
||||||
# changed to match common hardware formats.
|
|
||||||
option SIMPLIFIED_READ_AFIRST on
|
|
||||||
option SIMPLIFIED_READ_BGR on
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
# s_write.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2013
|
|
||||||
# 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 (just) simplified write support
|
|
||||||
#
|
|
||||||
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
option SIMPLIFIED_WRITE on
|
|
||||||
|
|
||||||
# It isn't necessary to chose fixed or floating point for the APIs because the
|
|
||||||
# simplified API doesn't need fixed or floating point numbers. It is necessary
|
|
||||||
# to chose an internal math implementation. The default (because of 'everything
|
|
||||||
# = off') is fixed point - turn the floating point implementation on if you have
|
|
||||||
# hardware floating point or prefer your software floating point implementation.
|
|
||||||
option FLOATING_ARITHMETIC on
|
|
||||||
|
|
||||||
# This is not strictly necessary, but without it the message strings in the API
|
|
||||||
# will not be filled in
|
|
||||||
option ERROR_TEXT on
|
|
||||||
|
|
||||||
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
|
|
||||||
# need this if you don't use them, they just allow the in-memory layout to be
|
|
||||||
# changed to match common hardware formats.
|
|
||||||
option SIMPLIFIED_WRITE_AFIRST on
|
|
||||||
option SIMPLIFIED_WRITE_BGR on
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
# simple.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2013
|
|
||||||
# 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 just the simplified APIs (read and write).
|
|
||||||
#
|
|
||||||
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
option SIMPLIFIED_WRITE on
|
|
||||||
option SIMPLIFIED_READ on
|
|
||||||
|
|
||||||
# It isn't necessary to chose fixed or floating point for the APIs because the
|
|
||||||
# simplified API doesn't need fixed or floating point numbers. It is necessary
|
|
||||||
# to chose an internal math implementation. The default (because of 'everything
|
|
||||||
# = off') is fixed point - turn the floating point implementation on if you have
|
|
||||||
# hardware floating point or prefer your software floating point implementation.
|
|
||||||
option FLOATING_ARITHMETIC on
|
|
||||||
|
|
||||||
# This is not strictly necessary, but without it the message strings in the API
|
|
||||||
# will not be filled in
|
|
||||||
option ERROR_TEXT on
|
|
||||||
|
|
||||||
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
|
|
||||||
# need this if you don't use them, they just allow the in-memory layout to be
|
|
||||||
# changed to match common hardware formats.
|
|
||||||
option SIMPLIFIED_READ_AFIRST on
|
|
||||||
option SIMPLIFIED_READ_BGR on
|
|
||||||
option SIMPLIFIED_WRITE_AFIRST on
|
|
||||||
option SIMPLIFIED_WRITE_BGR on
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# write.dfa
|
|
||||||
# Build time configuration of libpng
|
|
||||||
#
|
|
||||||
# Author: John Bowler
|
|
||||||
# Copyright: (c) John Bowler, 2013
|
|
||||||
# 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 minimal write support.
|
|
||||||
#
|
|
||||||
|
|
||||||
everything = off
|
|
||||||
|
|
||||||
# Switch on the write code - this makes a minimalist encoder
|
|
||||||
|
|
||||||
option WRITE on
|
|
||||||
|
|
||||||
# Choose fixed or floating point APIs and arithmetic. The choices are
|
|
||||||
# independent but normally they will match. It is typically better to use the
|
|
||||||
# floating point if you have floating point hardware. If you don't know, or
|
|
||||||
# (perhaps) to make libpng smaller used fixed point throughout.
|
|
||||||
|
|
||||||
#Fixed point:
|
|
||||||
#option FIXED_POINT on
|
|
||||||
#option FLOATING_ARITHMETIC off
|
|
||||||
|
|
||||||
#Floating point:
|
|
||||||
option FLOATING_POINT on
|
|
||||||
option FLOATING_ARITHMETIC on
|
|
||||||
|
|
||||||
# Basic error handling, IO and user memory support. The latter allows the
|
|
||||||
# application program to provide its own implementations of 'malloc' and 'free'.
|
|
||||||
option SETJMP on
|
|
||||||
option STDIO on
|
|
||||||
option USER_MEM on
|
|
||||||
|
|
||||||
# Everything else is optional. Unlike the read code in libpng the write code
|
|
||||||
# does not need to deal with arbitrary formats, so only add support for things
|
|
||||||
# you really do write! For example you might only write sRGB images, sometimes
|
|
||||||
# with transparency and never write 16 bit images, so:
|
|
||||||
option WRITE_sRGB on
|
|
||||||
option WRITE_tRNS on
|
|
||||||
#option WRITE_16BIT off (this is the default with 'everything = off')
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user