summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Allow overwriting the debug postfix of library filenamesHEADmasterlibpng16Cosmin Truta2023-02-121-4/+10
| | | | | | | | | | Users may opt to change the debug suffix, e.g., from "d" to "_debug". Rather than making CMAKE_DEBUG_POSTFIX a cache variable (which is an antipattern in CMake), we introduce a new cache variable, named PNG_DEBUG_POSTFIX. Suggested-by: Diego Barrios Romero <eldruin@gmail.com>
* cmake: Redo the fix for Clang support on WindowsCosmin Truta2023-02-121-74/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | Redo commit 70fda1837d5de802ce5f7e04be239192b6a74d92, with a redesign. Define the variables PNG_SHARED_OUTPUT_NAME and PNG_STATIC_OUTPUT_NAME for the benefit of the OUTPUT_NAME target properties of, respectively, the shared libpng build and the static libpng build. Fix and improve not only Clang, but also other Windows toolchains, such as Embarcadero. Rename the variable PNGLIB_SHARED_SOVERSION to PNG_ABI_VERSION. The applicability of this variable, which is much wider than the old name used to suggest, includes the definitions of PNG_*_OUTPUT_NAME. Delete the confusingly-named variables PNGLIB_NAME and PNG_LIB_NAME, and rename PNG_LIB_TARGETS to PNG_LIBRARY_TARGETS. Set the macros _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE, for all compilers that use MSVC run-time library headers. Currently, these compilers are MSVC and Clang/Windows. Add or improve the comments that accompany user-serviceable variables and options. Co-authored-by: B. Scott Michel <scooter.phd@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Clean up CMakeLists.txtCosmin Truta2023-02-081-83/+91
| | | | | | | | | | | | | | | * Rename the target `png` to `png_shared`. The main targets are now named `png_shared`, `png_static` and `png_framework`. * Rename the function symbol_prefix() to find_symbol_prefix(). * Rename the prefix `S` to `_SYM` in the function create_symlink(). * Rewrite the precondition checks in the function create_symlink(). * Add precondition checks to the function generate_copy(). * Delete the vestigial property CLEAN_DIRECT_OUTPUT. * Delete the variables PNG_LIB_NAME_STATIC and PNG_LIB_NAME_FRAMEWORK. * Initialize and use PNG_LIB_TARGETS consistently as a list. * Move all include() commands to the top of the file. * Acknowledge a former contributor. * Reformat.
* cmake: Rename the custom targets to have the png_ prefixJeremy Maitin-Shepard2023-02-082-28/+29
| | | | | | | This avoids taget namespace pollution when including libpng as a sub-project. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Revert "cmake: Fix the Clang support on Windows"Cosmin Truta2023-02-071-19/+19
| | | | | | | | This reverts commit 70fda1837d5de802ce5f7e04be239192b6a74d92. Fixing Clang on Windows is important. However, in the previous fix, the name of the compiled libpng library file was changed, incorrectly, on all platforms except Windows. A proper fix will follow up.
* ci: Update the CI scriptsCosmin Truta2023-02-053-70/+97
| | | | | | | | | | | | | | Apply the following changes: * Update CI_BUILDDIR and CI_INSTALLDIR to reflect the new script names. * Introduce CI_SRCDIR_FROM_BUILDDIR and CI_INSTALLDIR_FROM_BUILDDIR to the cmake build, to ensure that the Windows tools can handle native Windows paths correctly when executed via Bash-on-Windows. * Stop guessing and using CI_SRCDIR_NATIVE and CI_INSTALLDIR_NATIVE in the cmake build, since we now have a better solution. * Show the ninja program version in ninja-based cmake builds. * Move the cleanup of previous builds into separate functions, and do it in a cleaner manner. No pun intended.
* ci: Add CMake+Ninja+Clang to the AppVeyor CI matrixCosmin Truta2023-02-041-1/+10
|
* cmake: Fix the Clang support on WindowsB. Scott Michel2023-02-031-19/+19
| | | | | | | | | Fix a build error that occurs with the Ninja code generator and the Clang compiler on Windows: ninja: error: build.ninja: multiple rules generate png16.lib Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* cmake: Use CMAKE_SHARED_LIBRARY_C_FLAGS in version script checksGunther Nikl2023-01-311-2/+9
| | | | | | | | | | | | Building the version script test executable may fail in the link step with GNU ld as linker like this: ld: final link failed: Nonrepresentable section on output Building the test excutable with CMAKE_SHARED_LIBRARY_C_FLAGS makes the test succeed with GNU ld since this adds -fpic/-fPIC. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Fix for universal binaries on macOSJon Creighton2023-01-092-4/+5
| | | | | | | | | | | | | | | | | 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>
* Update the copyright yearCosmin Truta2023-01-095-9/+9
|
* Update the configuration for Travis CI and AppVeyor CICosmin Truta2022-11-292-14/+4
| | | | | | Simplify the test matrix on Travis CI to reduce the testing time. Use CI_CMAKE_TOOLCHAIN_FILE on AppVeyor CI.
* ci: Fix verification under Cygwin Bash + CMake + Visual Studio; updateCosmin Truta2022-11-272-23/+25
| | | | | | | | | | | Fix autodetection and use of the cygpath executable on Windows. Add a new variable CI_CMAKE_TOOLCHAIN_FILE to ci_verify_cmake.sh. This should help in future cross-platform testing. Remove the implicit initialization of CI_CC, CI_LD and CI_LIBS from ci_verify_makefiles.sh. This should help the testing of default values of their respective make variables (CC, LD and LIBS).
* ci: Rename the ci_* scriptsCosmin Truta2022-11-275-39/+39
| | | | | | | | | | | | Give the CI scripts new names that better reflect what they do, and make room for activities such as linting or dependency installation: * Rename ci_autotools.sh to ci_verify_configure.sh. * Rename ci_cmake.sh to ci_verify_cmake.sh. * Rename ci_legacy.sh to ci_verify_makefiles.sh. Also rename CI_LEGACY_MAKEFILES to CI_MAKEFILES. Update the config files for Travis CI and AppVeyor CI accordingly.
* Fix typosmusvaage2022-11-2710-15/+15
| | | | Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* manuals: Remove references to libpngpf(3); update linksCosmin Truta2022-11-272-53/+18
| | | | | | | | | | From libpng-1.5.0 onwards, the private libpng functions are no longer accessible to the libpng users, and the content of libpngpf(3) is no longer relevant. Update links, introducing the new canonical location of the libpng source repository: https://github.com/pnggroup/libpng
* Reorganize and update the README file; add Markdown formattingCosmin Truta2022-11-271-81/+79
|
* Bump version to 1.6.40.gitCosmin Truta2022-11-2713-35/+45
|
* Release libpng version 1.6.39v1.6.39Cosmin Truta2022-11-2016-60/+68
|
* Update the file list in READMECosmin Truta2022-11-201-67/+68
|
* configure: Fix possible regressions with trunk autoconf (vs 2.71)Paul Eggert2022-11-201-3/+5
| | | | Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* tools: Fix a memory leak in pngcpJohn Bowler2022-11-201-14/+58
| | | | Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* tools: Fix a buffer overflow involving a file name in pngfixAlberto Barbaro2022-11-201-1/+8
| | | | | | | Reported-by: Guoxiang Niu (@niugx), EaglEye Team Reported-by: Riccardo Mori <patacca@autistici.org> Reviewed-by: John Bowler <jbowler@acm.org> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Clean up comments and whitespace characters in source filesCosmin Truta2022-11-2024-44/+26
| | | | | | | Remove all remaining "last changed" version info from source comments. (The version control system maintains this information automatically.) Delete the trailing whitespace characters.
* Clean up oss-fuzzCosmin Truta2022-11-203-6/+3
| | | | | | | | | | | | With the caveat that oss-fuzz needs a full sync with upstream, here are the changes applied to our old copy: * Add a missing #include directive. * Remove the "last changed" version info. * Clean up the trailing whitespace. Co-authored-by: Ilya Yegorov <hkctkuy@gmail.com> Co-authored-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Update, rename and clean up various scriptsCosmin Truta2022-11-207-63/+46
| | | | | | | | | | | | | | | | 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.)
* Clean up vestigial uses of png_size_tpCosmin Truta2022-11-203-5/+5
|
* Turn large PNG chunks into benign errorsCosmin Truta2022-11-202-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import Chromium commit https://chromium.googlesource.com/chromium/src/+/e87a02987101e2dbe319a4aba6b52470f7624b4a Add the author to the list of libpng contributing authors. Portions from the original commit message follow: *** A recent change to libpng [1] (included in Chromium with the recent libpng update [2]) turns chunks that are bigger than PNG_USER_CHUNK_MALLOC_MAX into failures. Although this matches the intent of PNG_USER_CHUNK_MALLOC_MAX, it also causes images which used to be viewable in Chromium to fail. Changing to a benign error allows us to display these images once again. Though it means we do allow libpng to allocate more than PNG_USER_CHUNK_MALLOC_MAX, it matches the behavior prior to [2] (when we were using 1.6.22), and it does not regress crbug.com/117369 [1] https://github.com/glennrp/libpng/commit/347538efbdc21b8df684ebd92d37400b3ce85d55 [2] https://chromium.googlesource.com/chromium/src/+/f82653a473f8de5fc86d0f2ecc75f6237e61946b *** Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=827754 Co-authored-by: Leon Scroggins III <scroggo@google.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Fix commentstangyaofang2022-11-162-5/+5
| | | | Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* scripts: Fix the remaining instance of ZLIB_INCLUDE_DIRFelix Hanau2022-10-231-1/+1
|
* arm: Add a compile-time assertion about PNG_ARM_NEON_CHECK_SUPPORTEDCosmin Truta2022-10-121-1/+4
| | | | | | | | | Following up on the previous commit by Martin Storsjö: If the availability of ARM Neon is not only known at compile time, but also expected by the compiler's target architecture, there should be no further need for a run-time check. In fact, such a check would be counter-productive.
* cmake: Default to PNG_ARM_NEON=off for arm targetsMartin Storsjö2022-10-121-2/+3
| | | | | | | | | | | | | | | | | | This matches the configure script - unless the user has requested anything, no hardware optimizations are autoenabled. Defaulting to "check" is brittle (that configuration is deprecated and poorly supported) - and for configurations where it would make sense (where NEON isn't universally enabled in the compiler) it didn't end up setting ARM_NEON_OPT to 1 in pnglibconf.h anyway. This fixes default builds with cmake for iOS and Windows on armv7, where NEON is universally available (but there's no runtime check implemented) - but actually using NEON on this architecture requires explicitly opting in to it when configuring, just like with the configure script. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* scripts: Add missing makefile.clang reference to README.txtCosmin Truta2022-09-181-0/+1
|
* scripts: Remove the support for "install" targets from all makefilesCosmin Truta2022-09-1825-2125/+309
| | | | | | | | | | | | | | | | | 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.
* scripts: Remove makefile.cegccCosmin Truta2022-09-182-117/+0
| | | | It is obsolete and unlikely to be still working
* .gitignore: Ignore the autoreconf artifactsCosmin Truta2022-09-181-0/+3
|
* Bump version to 1.6.39.gitCosmin Truta2022-09-1713-37/+47
|
* Release libpng version 1.6.38v1.6.38Cosmin Truta2022-09-1422-78/+67
|
* Acknowledge the contributors of bug fixes applied to the EXIF supportCosmin Truta2022-09-141-0/+2
| | | | | | Considering that the EXIF support is part of the core libpng library (which excludes scripts, tests, and other independent programs), its contributors should be acknowledged in the AUTHORS file.
* Fix a last-minute bug in the checking of the EXIF byte-order headerCosmin Truta2022-09-141-7/+10
| | | | | | | The check should fail if the EXIF byte-order header doesn't start with a correct character, or if the two heading characters aren't identical. Rewrite the check to make the code logic easier to follow.
* Revert "Remove second call to write_eXIf"Cosmin Truta2022-09-141-0/+5
| | | | | | | | | | | | | | The second call to png_write_eXIf should not have been removed. The first call to png_write_eXIf is for writing the eXIf chunk that is positioned before IDAT, while the second call is for writing the eXIf chunk that is positioned after IDAT. TODO: Implement a correct fix which consists in ensuring that there are no eXIf chunks simultaneously before and after IDAT. This reverts commit cd03aaf7bf0e0c748b8c6cb34a56b402b40d61d0.
* .gitignore: UpdateCosmin Truta2022-09-141-0/+1
|
* scripts: Remove leftover references to the ci_* scripts from README.txtCosmin Truta2022-09-141-4/+0
|
* ci: Trace the paths of executable files found on the build machineCosmin Truta2022-09-143-55/+99
| | | | | Also add markers to trace the boundaries of configuration and build steps.
* scripts: Add makefile.emcc for building libpng with EmscriptenCosmin Truta2022-09-141-0/+83
| | | | | | | 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>
* scripts: Disable the hardware-optimized compilation in legacy makefilesCosmin Truta2022-09-146-262/+23
| | | | | | | | 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.
* scripts: Set the compiler warning options to "-Wall -Wextra -Wundef"Cosmin Truta2022-09-1425-107/+97
| | | | | | | | | 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.
* scripts: Clean up the logging in makefile.std and pnglibconf.makCosmin Truta2022-09-142-25/+24
| | | | | | | | 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").
* Fix handling incorrect hIST chunks of uneven sizeCosmin Truta2022-09-141-2/+3
| | | | | | | | | The hIST chunks, used for storing image histograms, contain arrays of 16-bit unsigned integers, and the chunk size is expected to be an even number. Raise a png_chunk_benign_error() if a hIST chunk fails to meet this expectation. Reported-by: Eugene Kliuchnikov <eustas@google.com>
* Simplify the definition of png_isaligned and avoid compiler warningsCosmin Truta2022-09-142-20/+18
| | | | | | | | | | | The following pointer subtraction was unnecessary: ((const char*)(ptr)-(const char*)0) In order to avoid further warnings about casting a wide pointer type to a narrower integer type, we cast the pointer to the target integer type through (size_t). Also fix a comment and reformat the surrounding code.