1352 Commits

Author SHA1 Message Date
Cosmin Truta
222086586b chore: Pacify editorconfig-checker version 3.0 2024-09-08 15:22:58 +03:00
Eric Riff
43d6ad3e15 cmake: Honor CMAKE_SYSROOT if set
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-05 18:35:46 +03:00
Cosmin Truta
f1848a3b56 Bump version to 1.6.44.git 2024-02-24 13:32:56 +02:00
Cosmin Truta
ed217e3e60 Release libpng version 1.6.43 2024-02-23 11:51:40 +02:00
Cosmin Truta
3b9a73ed3e doc: Review the libpng history and update scripts/cmake/AUTHORS.md 2024-02-22 16:47:51 +02:00
Benjamin Buch
7b888092b9 build: Mark the installed libpng headers as system headers in CMake
Modern compilers can disable the warnings that originate from system
headers. This change allows them to do so with the libpng headers.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-21 23:26:07 +02:00
Dan Rosser
e7ba9c0dfc build: Fix a CMake build regression introduced in version 1.6.41
This fixes commit 4edbb4da81626a7342a22824d7a8f60a3ea71bd0.

During the move of CMake scripts to the scripts/cmake/ subdirectory,
some of the workflows have been broken.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-19 11:19:52 +02:00
Cosmin Truta
4191872d0d chore: Update the .editorconfig files and pacify editorconfig-checker 2024-02-15 18:29:26 +02:00
Cosmin Truta
1cdde11877 build: Update the makefiles for the benefit of cross-compilation
Split AR_RC into AR and ARFLAGS. The variables AR and ARFLAGS are
de-facto standards (like CC and CFLAGS, LD and LDFLAGS, etc.) that
may be overridden when running make. Moreover, configuring CC, LD,
AR, etc., to point to a cross-platform compiler, linker, librarian,
etc., is a de-facto standard practice as well.

Also remove the MKDIR_P variable definitions from all makefiles.
They've been leftovers from the removal of the "install*" targets.
2024-02-11 23:14:09 +02:00
Cosmin Truta
920db2ecc0 api: Introduce the PNG_LIBPNG_VER_SHAREDLIB macro; update pngwin.rc
The version macros `PNG_LIBPNG_VER_SONUM` and `PNG_LIBPNG_VER_DLLNUM`
weren't always in sync, but they should be, going forward.

Or, better yet, we should keep them in, deprecated, and introduce
`PNG_LIBPNG_VER_SHAREDLIB` for all shared library builds of all kinds
on all platforms.

It is unknown how many user applications have been using these macros.
We have been using `PNG_LIBPNG_VER_DLLNUM` for pngwin.rc, for example.
Which, by the way, was last updated in 2009.
2024-02-05 21:54:19 +02:00
Cameron Cawley
ab6d97b7c8 build: Update and rename makefile.acorn to makefile.riscos
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-02 21:36:53 +02:00
Cosmin Truta
3bd304e5f4 chore: Split lines in scripts/*.awk to pacify the editorconfig checker 2024-01-31 15:02:42 +02:00
Cosmin Truta
4356cb0709 Bump version to 1.6.43.git 2024-01-31 11:32:51 +02:00
Cosmin Truta
35d9f5ea52 Release libpng version 1.6.42 2024-01-29 22:51:33 +02:00
Cosmin Truta
ba980b8f0c Release libpng version 1.6.41 2024-01-24 18:59:00 +02:00
Cosmin Truta
4edbb4da81 build: Move scripts/*.cmake.in to scripts/cmake/; add cmake/AUTHORS.md
From the libpng licensing point of view, the build projects, the build
scripts, the test scripts, the CI verification scripts, et cetera, have
not traditionally been part of libpng proper, although some of these,
including the CMake-based build, have been released under the libpng
license.

Considering how the CMake build grew as a result of many contributions
from many contributing authors over a long time, one may argue that it
almost became an individual piece of software in its own right.

Moving on, everything CMake-related shall be placed in the subdirectory
scripts/cmake/ (except, of course, the main CMakeLists.txt). Moreover,
contributing authors shall be acknowledged in scripts/cmake/AUTHORS.md.

Please see scripts/cmake/README.md for more information.
2024-01-22 17:24:59 +02:00
Cosmin Truta
671661849a build: Move scripts/*.m4 to scripts/autoconf/
Move all Autoconf macro files (except for those that need to be in
the top-level directory) to their own subdirectory scripts/autoconf/

In this commit, we introduce a better way to organize the scripts dir,
and we make a better separation between the build scripts under the
libpng license vs. the build scripts that fall under other licenses.

Please see scripts/autoconf/README.md for more information.
2024-01-22 15:16:10 +02:00
John Bowler
269b753496 Do not build unused Adler32 code
This removes the default build of an undocumented feature to disable
Adler32 checksums on those systems where it was the default.

The PR is motived by github #187 however it fixes a much more general
problem (#187 is limited to an issue where libpng "crashes" on some
manufacturer systems).  The fix is based on a suggestion by @sgowdev who
is the originator of the issue.

When libpng disables the checking of Adler32 checksums it does so by an
undocumented and therefore possibly unsupported call to a zlib function
which does not exist in some versions of zlib.

Fortunately libpng only does this if the caller of libpng explicitly
asks for it to happen.  Unfortunately the call to the undocumented
function is still in the compiled and built libpng and this means that
on some systems (as identified in #187) libpng can fail to load or maybe
even crash.

The libpng authors are currently unaware of any program or system that
uses this feature and none has been identified by the contributors to

In this fix an option is added to *enable* the code so that by default
the code is *disabled* - this is a simple generalization of the
suggestion by @sgowdev.

BENEFITS: the problem is eliminated, users of the functionality, if any,
are idenfified, the functionality can be implemented correctly in the
future or it can be removed.  Hardly anyone complains.

COSTS: someone will complain that they have to enable an option in a
libpng build to use a feature that never worked consistently in the
first place.

This patch has been tested both with the option enabled and with it
disabled via pngusr.dfa.  Tests, checks pass with cmake and configure,
make distcheck passes on configure.

Reported-by: Stephen Gowen <dev.sgowen@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-18 23:57:06 +02:00
Cosmin Truta
a7fe3414e5 mips: Wrap up the MIPS/Loongson port and acknowledge the contributors
Completion of this port required a rerun of `./autogen.sh --maintainer`
followed by a rebuild of scripts/pnglibconf.h.prebuilt.
2024-01-17 23:24:05 +02:00
gxw
ce4b632dd7 Optimize png16 with loongson mmi for 64-bit os 2024-01-17 22:46:16 +02:00
Cosmin Truta
0dfe422e9f Update the copyright year 2024-01-02 21:25:55 +02:00
Cosmin Truta
acfd50ae0b cmake: Clean up functions, string operations, regular expressions, etc.
Remove the inclusion of the external module `CMakeParseArguments`.
Function argument parsing became a first-class feature in CMake 3.5.

Delete the function `find_symbol_prefix`. It is no longer used.

Use variables instead of strings in string operations where possible.
Prevent CMake from getting confused by string values that might be
accidentally identical to unrelated keywords.

Clean up spurious `.*` sequences in regex matching operations.

Rephrase a comment.
2023-12-11 20:51:06 +02:00
Cosmin Truta
d7f77bf271 Bump version to 1.6.41.git 2023-06-26 11:09:17 +03:00
Cosmin Truta
f135775ad4 Release libpng version 1.6.40 2023-06-21 22:06:40 +03:00
Jesús González
82097c2108 Fix a doc typo in pnglibconf.dfa
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-02-16 15:34:29 +02:00
Jeremy Maitin-Shepard
efa9c2e920 cmake: Rename the custom targets to have the png_ prefix
This avoids taget namespace pollution when including libpng as a
sub-project.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-02-08 17:10:52 +02:00
Jon Creighton
cd0ea2a7f5 Fix for universal binaries on macOS
Fix the issue of a
    clang: error: no such file or directory: 'x86_64'
error on building universal binaries on macOS.

It is also necessary to specify:
    -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"

Example CMake command:
    cmake -S libpng \
          -B build_libpng \
          -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
          -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-01-09 19:55:04 +02:00
Cosmin Truta
9923515ff4 Update the copyright year 2023-01-09 19:50:00 +02:00
Cosmin Truta
3c761b5135 Bump version to 1.6.40.git 2022-11-27 13:10:35 +02:00
Cosmin Truta
07b8803110 Release libpng version 1.6.39 2022-11-20 23:53:23 +02:00
Cosmin Truta
77c3a39299 Clean up comments and whitespace characters in source files
Remove all remaining "last changed" version info from source comments.
(The version control system maintains this information automatically.)

Delete the trailing whitespace characters.
2022-11-20 21:23:33 +02:00
Cosmin Truta
f6036c0aeb Update, rename and clean up various scripts
Rename contrib/tools/chkfmt to contrib/tools/chkfmt.sh; refactor:
 * Increase the max line length for contrib/**/*.[ch] from 96 to 100.
 * Set the max line length for ci_*.sh to 100.
 * Use `basename $0` instead of the hard-coded script name.
 * Update comments.

Remove contrib/tools/reindent. For automated code formatting, including
indentation, we need a robust solution.

Add an empty line after the hashbang line in all scripts.

Remove the "last changed" version info from comment headers.
(The version control system maintains this information automatically.)
2022-11-20 20:21:41 +02:00
Felix Hanau
04c016d79f scripts: Fix the remaining instance of ZLIB_INCLUDE_DIR 2022-10-23 23:10:07 +03:00
Cosmin Truta
12222e6fbd scripts: Add missing makefile.clang reference to README.txt 2022-09-18 23:51:58 +03:00
Cosmin Truta
9b65ad49d3 scripts: Remove the support for "install" targets from all makefiles
In most of the legacy makefiles (with only a few notable exceptions
such as makefile.linux), the "install" targets have been broken since
libpng-1.5.0beta01. Specifically, the "install-shared" targets produced
incorrect library names, due to a missing symbol in the definition of
the LIBSOREL macro.

Rather than correcting this long-standing and long-untested error, we
decided to remove the support for "make install" altogether, from all
legacy makefiles. Further use of "make install", "make install-static"
or "make install-shared" will fail with an error message.

Going forward, the only tested and supported manners to install libpng
shall be the conventional build and install procedures driven by the
configure script or by the CMake file.
2022-09-18 19:37:40 +03:00
Cosmin Truta
3f991d5092 scripts: Remove makefile.cegcc
It is obsolete and unlikely to be still working
2022-09-18 16:26:26 +03:00
Cosmin Truta
6fc5119423 Bump version to 1.6.39.git 2022-09-17 13:36:12 +03:00
Cosmin Truta
0a158f3506 Release libpng version 1.6.38 2022-09-14 22:42:00 +03:00
Cosmin Truta
823ef44f01 scripts: Remove leftover references to the ci_* scripts from README.txt 2022-09-14 21:56:47 +03:00
Cosmin Truta
3c67eeca51 scripts: Add makefile.emcc for building libpng with Emscripten
Adapt makefile.clang to invoke the Emscripten toolchain utilities.

Co-authored-by: Kirk Roerig <mr.possoms@gmail.com>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
2022-09-14 21:50:02 +03:00
Cosmin Truta
b60656ecdc scripts: Disable the hardware-optimized compilation in legacy makefiles
Fix the legacy makefile builds on ARM, MIPS and PowerPC, where
hardware-optimized compilation was enabled by default in the generic
source files, but without including the machine-specific source files.

Delete scripts/makefile.linux-opt.
2022-09-14 21:35:33 +03:00
Cosmin Truta
c64655d058 scripts: Set the compiler warning options to "-Wall -Wextra -Wundef"
Considering that "-Wextra" is a more descriptive alternative to "-W",
and that "-Wundef" is a highly useful warning option that has been
available in ancient versions of gcc (version 2.x), we replace all
occurrences of "-W -Wall" with "-Wall -Wextra -Wundef".

Also clean up the makefiles.
2022-09-14 21:18:20 +03:00
Cosmin Truta
8b7b99c1db scripts: Clean up the logging in makefile.std and pnglibconf.mak
The console logs produced by these scripts should be easy to follow,
especially on CI bots.

Delete the unnecessary macros ECHO and SED.
Add a new macro MV_F (for "mv -f"), alongside RM_F (for "rm -f").
2022-09-14 11:53:47 +03:00
luz paz
f16427e58e Fix various typos
Found via `codespell -q 3 -S ./ltmain.sh,./scripts/libtool.m4 -L ake,ans,ba,bloc,crashers,doed,inout,lengthh,maked,paeth,parm,parms,redy,unx`
2022-09-13 01:35:28 +03:00
Gabor Kertesz
bbab57105b scripts: Add makefile for win-arm64
This makefile is based on makefile.vcwin32, but includes Neon
intrinsic optimization.

Co-authored-by: Gabor Kertesz <gabor.kertesz@linaro.org>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-13 01:23:52 +03:00
Christopher Sean Morrison
840af2eda6 cmake: Fix the build on Unix with source files checked out on Windows
The issue is that, by default, Git for Windows checks out text files
with CRLF line endings. This is a problem for awk, which is expecting
Unix-style LF line endings. When cloning on Windows and attempting to
compile on WSL, Mingw or Cygwin, there may be an error from awk.

The fix is to leverage CMake's ability to configure a file and perform
EOL conversions. We copy the awk scripts from the source directory to
the build directory. This portable method ensures they have LF endings,
and the build logic is updated to use the build directory version.

Intentionally avoiding .gitattributes to avoid setting precedent.

Co-authored-by: Christopher Sean Morrison <brlcad@gmail.com>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 22:02:00 +03:00
Cosmin Truta
9e32b6f1ad Rerun "./autogen.sh --maintainer" 2022-09-05 17:30:06 +03:00
Cosmin Truta
723b2d9f2e Update the copyright year 2022-08-26 03:12:35 +03:00
Cosmin Truta
b7ea74c97d Update the copyright year 2021-03-15 20:23:26 -04:00
Cosmin Truta
3676fd324a ci: Add a new top-level directory, dedicated for CI verification
Update the ci_*.sh scripts and move them to the more conventional
ci/ directory. Update .appveyor.yml and .travis.yml, as well as
the AUTHORS file, accordingly.

Speed up ci_cmake.sh: add "-DPNG_TESTS=OFF" to the list of CMake
variables if CI_NO_TEST is true.

Remove "sudo: false" from .travis.yml.

Refactor .appveyor.yml.
2020-05-18 21:30:30 -04:00