Compare commits

..

486 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
e7c0ec1e92 [libpng15] Imported from libpng-1.5.29.tar 2017-08-24 16:38:35 -05:00
Glenn Randers-Pehrson
fe3a4493e5 [libpng15] Imported from libpng-1.5.29rc01.tar 2017-08-18 20:00:30 -05:00
Glenn Randers-Pehrson
a862fd04b9 [libpng15] Imported from libpng-1.5.29beta02.tar 2017-08-07 09:43:44 -05:00
Glenn Randers-Pehrson
752c6c0042 [libpng15] Moved chunk-name and chunk-length checks into PNG_EXTERN private
png_check_chunk_name() and png_check_chunk_length() functions
  (Suggested by Max Stepin).
Merged pngtest.c with libpng-1.6.32.
2017-08-06 19:14:18 -05:00
Glenn Randers-Pehrson
dc2b679f13 [libpng15] Update documentation of user limits 2017-05-22 10:21:11 -05:00
Glenn Randers-Pehrson
11ece2b403 [libpng15] Change http: urls to https: in libpng.3 2017-04-03 17:02:15 -05:00
Glenn Randers-Pehrson
22a018e49d [libpng15] Bump version to 1.5.29beta02 2017-04-01 11:19:30 -05:00
Glenn Randers-Pehrson
934593011b [libpng15] Imported from libpng-1.5.29beta01.tar 2017-04-01 11:19:17 -05:00
Glenn Randers-Pehrson
ece1601032 [libpng15] Silence clang -Wcomma warnings (Viktor SzaKats). 2017-03-30 13:39:23 -05:00
Glenn Randers-Pehrson
3e878e3f8d [libpng15] Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
makefile.linux and makefile.solaris-x86 (Cosmin).
2017-03-21 20:00:33 -05:00
Glenn Randers-Pehrson
0b21dc3efe [libpng15] Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer). 2017-03-01 15:46:04 -06:00
Glenn Randers-Pehrson
d0023a7391 [libpng15] Suppress clang warnings about implicit sign changes in png.c 2017-03-01 15:37:30 -06:00
Glenn Randers-Pehrson
11fc1f0f26 [libpng15] Clean up license info, mention CVE-2016-10087 in CHANGES 2016-12-30 13:58:49 -06:00
Glenn Randers-Pehrson
dbf3e10487 [libpng15] Bump version to 1.5.29beta01 2016-12-30 08:41:07 -06:00
Glenn Randers-Pehrson
237b11b573 [libpng15] Imported from libpng-1.5.28.tar 2016-12-29 07:49:17 -06:00
Glenn Randers-Pehrson
ca76407b75 [libpng15] Fixed a potential null pointer dereference in png_set_text_2()
(bug report and patch by Patrick Keshishian)
2016-12-29 07:48:30 -06:00
Glenn Randers-Pehrson
aba2535d0f [libpng15] Bump version to 1.5.28 2016-12-29 07:45:56 -06:00
Glenn Randers-Pehrson
8cae396a20 [libpng15] Imported from libpng-1.5.28rc01.tar 2016-12-27 08:24:09 -06:00
Glenn Randers-Pehrson
daa97ebf42 [libpng15] Update CHANGES and ANNOUNCE 2016-12-26 19:28:24 -06:00
Glenn Randers-Pehrson
80d36775d4 Merge branch 'libpng15' of git://github.com/jbowler/libpng into libpng15 2016-12-26 19:27:37 -06:00
Glenn Randers-Pehrson
742c66f37c [libpng15] none 2016-12-26 18:44:25 -06:00
John Bowler
95e0094f85 Eliminate signed overlow in png_64bit_product
The previous version produced a signed overflow as a result of both the
& 0xffff on the most significant bits of a negative argument; this
converted (-1) into 65535 which resulted in a subsequent overflow.
Since signed overflow is undefined in C90 the code has been modified to
correctly calculate a signed result.  This requires changing the 'hi'
result parametr to a signed value.

This has been code reviewed solely by the author.  A further code review
is highly desireable.  Nevertheless the code compiles without warnings
from clang and without the prior detection of an overflow.  Since it no
longer truncates any of the intermediate values this should be enough to
ensure that it is correct.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-12-26 16:29:16 -08:00
John Bowler
09dcb906a7 Remove unsigned overflow
The previous code always results in an unsigned arithmetic overflow,
this is well defined but produces errors from clang with the option to
detect unsigned overflow.  As the expression only gets evaluated once
per row in this version of libpng it is easier just to rewrite it.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-12-26 16:27:33 -08:00
John Bowler
8d4110bd61 Remove 'defined' within macro
This removes the use of a macro containing the pre-processor 'defined'
operator.  It is unclear whether this is valid; a macro which
"generates" 'defined' is not permitted, but the use of the work
"generates" within the C90 standard seems to imply more than simple
substitution of an expression itself containing a well-formed defined
operation.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-12-26 16:24:40 -08:00
Glenn Randers-Pehrson
6b7c27341e [libpng15] Merge with libpng16/pngminus 2016-10-30 09:20:04 -05:00
Glenn Randers-Pehrson
5a945f3393 [libpng15] Merge with libpng16/pngtest.c, pngvalid.c, gregbook, pngminim 2016-10-30 08:39:00 -05:00
Glenn Randers-Pehrson
b555c55c6d [libpng15] Minor editing of INSTALL, (whitespace, added copyright line) 2016-08-18 12:49:16 -05:00
Glenn Randers-Pehrson
6d610b9c4d [libpng15] Suppress warning about unused png_digit[] array in pngerror.c. 2016-08-07 18:50:58 -05:00
Glenn Randers-Pehrson
0188ecfb8f [libpng15] Merge contrib/pngminim/*/makefile with those from libpng-1.6.24 2016-08-02 10:20:52 -05:00
Glenn Randers-Pehrson
5c026a3d59 [libpng15] Minor edit of INSTALL 2016-07-04 20:37:59 -05:00
Glenn Randers-Pehrson
7ea459bd4e [libpng15] Added "Common linking failures" section to INSTALL. 2016-07-02 12:34:38 -05:00
Glenn Randers-Pehrson
a82098a22b [libpng15] Sync contrib/libtests/pngvalid.c with libpng16 2016-06-25 15:00:36 -05:00
Glenn Randers-Pehrson
6ddc038db9 [libpng15] Fixed undefined behavior in png_push_save_buffer(). Do not call
memcpy() with a null source, even if count is zero (Leon Scroggins III).
2016-06-03 21:26:43 -05:00
Glenn Randers-Pehrson
c1ac308d12 [libpng15] Merge contrib/libtests/pngvalid.c with libpng16 2016-05-31 10:05:56 -05:00
Glenn Randers-Pehrson
94727db1ea [libpng15] Bump version to 1.5.28beta01 2016-05-29 15:59:43 -05:00
John Bowler
6a1a8df343 Backported pngvalid changes from libpng 1.6
Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-29 12:44:22 -07:00
Glenn Randers-Pehrson
6fb875a54e [libpng15] Imported from libpng-1.5.27.tar 2016-05-26 07:24:57 -05:00
Glenn Randers-Pehrson
9c7338aa16 [libpng15] Imported from libpng-1.5.27rc01.tar 2016-05-14 09:42:35 -05:00
Glenn Randers-Pehrson
c5da514b08 [libpng15] Bump version to 1.5.27beta03 2016-05-11 06:42:58 -05:00
Glenn Randers-Pehrson
b78e99b1c9 [libpng15] Imported from libpng-1.5.27beta02.tar 2016-05-11 06:36:14 -05:00
Glenn Randers-Pehrson
14beb679d4 [libpng15] Merge png.h with libpng16/png.h 2016-05-11 06:34:59 -05:00
Glenn Randers-Pehrson
d92b1c6305 [libpng15] Bump version to 1.5.27beta02 2016-03-09 12:04:24 -06:00
Glenn Randers-Pehrson
870fcc9b64 [libpng15] Imported from libpng-1.5.27beta01.tar 2016-03-09 12:04:14 -06:00
Glenn Randers-Pehrson
09779deaa9 [libpng15] Added a common-law trademark notice and export control information
to the LICENSE file, png.h, and the man page.
Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h
(Robert C. Seacord).
2016-02-14 13:10:43 -06:00
Glenn Randers-Pehrson
55aea59737 [libpng15] Make pnglibconf.h a public header in CmakeLists.txt 2016-02-09 08:44:30 -06:00
Roger Leigh
1f2fe83987 [libpng15] Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in
and test.cmake.in (Roger Leigh).
2016-02-08 18:43:58 -06:00
John Bowler
1cef0c0eae pngvalid: backport autoconf exit(77) fix
Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-28 16:49:48 -08:00
Glenn Randers-Pehrson
73adedf0e4 [libpng15] Revised workaround for Coverity issue in pngvalid.c 2016-01-23 10:06:58 -06:00
Glenn Randers-Pehrson
7190c4f5af [libpng15] Worked around a false-positive Coverity issue in pngvalid.c. 2016-01-13 09:55:15 -06:00
Glenn Randers-Pehrson
d189b54e30 [libpng15] Happy 2016! Updated copyright year. 2016-01-02 14:09:11 -06:00
Glenn Randers-Pehrson
c583ec1579 [libpng15] In projects/vstudio, combined readme.txt and WARNING into README.txt 2015-12-29 08:43:51 -06:00
Glenn Randers-Pehrson
89a025317c [libpng15] Update CHANGES and ANNOUNCE with recent pngvalid.c update 2015-12-17 20:22:16 -06:00
Glenn Randers-Pehrson
7c32176ba0 Merge branch 'libpng15' of git://github.com/jbowler/libpng-1 into libpng15 2015-12-17 20:19:23 -06:00
Glenn Randers-Pehrson
684c68d6fb [libpng15] Bump version to 1.5.27beta01 2015-12-17 20:09:18 -06:00
John Bowler
829cba63d3 Fix undefined behavior in pngvalid.c
Undefined because (png_byte) << shift is undefined if it changes the signed bit
(because png_byte is promoted to int).  The libpng exported functions
png_get_uint_32 and png_get_uint_16 handle this.

Bug reported by David Drysdale as a result of reports from UBSAN in clang 3.8.

This changes pngvalid to use BE random numbers; this used to produce errors but
these should not be fixed as a result of the previous changes.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-17 12:57:49 -08:00
John Bowler
b409572cec Merge branch 'libpng15' of ../../libpng into libpng15 2015-12-17 09:40:11 -08:00
Glenn Randers-Pehrson
94322f3f8f [libpng15] Imported from libpng-1.5.26.tar 2015-12-17 08:11:20 -06:00
John Bowler
aff684567e pngvalid from libpng 1.7 with fixes
Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-15 08:28:02 -08:00
Glenn Randers-Pehrson
8f1c1a6d8c [libpng15] Imported from libpng-1.5.26rc01.tar 2015-12-13 21:44:19 -06:00
Glenn Randers-Pehrson
fd3cd9fad2 [libpng15] Update some last-changed dates 2015-12-13 18:36:30 -06:00
Glenn Randers-Pehrson
2921aa280f Merge branch 'libpng15-20151213-keyword' of git://github.com/jbowler/libpng-1 into libpng15 2015-12-13 18:20:11 -06:00
John Bowler
e40ac66f81 [libpng15] Do png_check_keyword in png_set_*() 2015-12-13 18:10:53 -06:00
Glenn Randers-Pehrson
a510a813ef [libpng15] Remove new redundant prototype for png_set_keyword() 2015-12-13 17:35:11 -06:00
Glenn Randers-Pehrson
ad5f16c406 [libpng15] Bump version to 1.5.26beta02 2015-12-13 16:19:49 -06:00
Glenn Randers-Pehrson
2b5be93866 [libpng15] Move png_check_keyword() from pngwutil.c to pngset.c 2015-12-13 16:18:58 -06:00
John Bowler
8d28ab2101 Move png_check_keyword to pngset.c
This is a backport of the libpng16 version with the warnings switched
off.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 13:44:34 -08:00
Glenn Randers-Pehrson
29c1086ba3 [libpng15] Imported from libpng-1.5.26beta01.tar 2015-12-11 10:20:41 -06:00
Glenn Randers-Pehrson
456d614959 [libpng15] Bump version to 1.5.26beta01 2015-12-09 09:42:49 -06:00
Glenn Randers-Pehrson
d9006f683c [libpng15] Fixed an out-of-range read in png_check_keyword() (Bug report
from Qixue Xiao).
2015-12-09 09:40:48 -06:00
Glenn Randers-Pehrson
93e111afc5 [libpng15] Imported from libpng-1.5.25.tar 2015-12-02 22:30:30 -06:00
Glenn Randers-Pehrson
3a1a5256fa [libpng15] Imported from libpng-1.5.25rc01.tar 2015-11-26 07:04:16 -06:00
Glenn Randers-Pehrson
b5da27d211 [libpng15] Imported from libpng-1.5.25beta03.tar 2015-11-24 09:36:23 -06:00
Glenn Randers-Pehrson
11c2f47bd6 Merge branch 'libpng15-20151123' of git://github.com/jbowler/libpng-1 into libpng15 2015-11-24 09:34:59 -06:00
John Bowler
daf54fe4fc Test backport
Tests backported from the multi-version compatible ones in libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 20:16:21 -08:00
Glenn Randers-Pehrson
17749bdd61 [libpng15] Imported from libpng-1.5.25beta02.tar 2015-11-23 09:29:33 -06:00
Glenn Randers-Pehrson
3ccfba8c28 [lbpng15] Revert 12 -> 12U change in pngrutil.c 2015-11-22 22:59:16 -06:00
Glenn Randers-Pehrson
596f052d69 [libpng15] Fixed bug recently introduced in png_set_PLTE() that uses png_ptr
not info_ptr.
2015-11-22 20:47:45 -06:00
Glenn Randers-Pehrson
69ac844654 [libpng15] Bump version to 1.5.25beta02 2015-11-22 14:11:19 -06:00
Glenn Randers-Pehrson
635a8b9b84 [libpng15] Imported from libpng-1.5.25beta01.tar 2015-11-22 14:08:45 -06:00
Glenn Randers-Pehrson
611e8de78c [libpng15] Use unsigned constants in buffer length comparisons 2015-11-21 14:33:31 -06:00
Glenn Randers-Pehrson
68a6e6755b [lbpng15] Rearrange terms in buffer length tests in pngrutil.c to
avoid potential overflow in calculations.
2015-11-19 09:12:43 -06:00
Glenn Randers-Pehrson
8738633bd6 [libpng15] Avoid potential pointer overflow in png_handle_iTXt(),
png_handle_zTXt(), png_handle_sPLT(), and png_handle_pCAL() (Bug report
by John Regehr).
2015-11-13 22:47:30 -06:00
Glenn Randers-Pehrson
b257d4a6a1 [libpng15] Bump version to 1.5.25beta01 2015-11-13 10:18:08 -06:00
Glenn Randers-Pehrson
df80d38897 [libpng15] Imported from libpng-1.5.24.tar 2015-11-12 07:13:10 -06:00
Glenn Randers-Pehrson
9b70e0332b [libpng15] Clean up coding style in png_handle_PLTE() 2015-11-05 11:17:54 -06:00
Glenn Randers-Pehrson
b6ec5eb74e [libpng15] Imported from libpng-1.5.24rc04.tar 2015-11-05 06:59:22 -06:00
Glenn Randers-Pehrson
15117f202c [libpng15] Fixed new bug with CRC error after reading an over-length palette. 2015-11-04 23:46:24 -06:00
Glenn Randers-Pehrson
4b0a6350cd [libpng15] Imported from libpng-1.5.24rc02.tar 2015-11-03 10:00:01 -06:00
Glenn Randers-Pehrson
e4a9c63445 [libpng15] Imported from libpng-1.5.24rc02.tar 2015-11-03 08:12:20 -06:00
Glenn Randers-Pehrson
06c1be4b28 [libpng15] Bump version to 1.5.24rc02 2015-11-03 07:51:53 -06:00
Glenn Randers-Pehrson
cd8a3ffeb1 [libpng15] Fixed some inconsequential cut-and-paste typos in
png_set_cHRM_XYZ_fixed().
2015-11-01 12:40:04 -06:00
Glenn Randers-Pehrson
9db953ad5b [libpng15] Imported from libpng-1.5.24rc01.tar 2015-10-31 08:52:12 -05:00
Glenn Randers-Pehrson
91a73053b9 [libpng15] Update manual about handling over-length PLTE chunks. 2015-10-31 08:47:32 -05:00
Glenn Randers-Pehrson
820a090567 [libpng15] Silently truncate over-length PLTE chunk while reading. 2015-10-30 13:21:32 -05:00
Glenn Randers-Pehrson
20e0daa74a [libpng15] Update CHANGES and ANNOUNCE about rowbytes fix 2015-10-30 13:02:20 -05:00
John Bowler
8678f9c3f4 rowbytes check correction
The old code incorrectly calculated the output rowbytes when the
application decreased either the number of channels or the bit depth (or
both) in a user transform.  This was safe; libpng overallocated buffer
space (potentially by quite a lot; up to 4 times the amount required)
but, from 1.5.4 on, resulted in a png_error.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-10-29 18:12:10 -07:00
Glenn Randers-Pehrson
3a990c93f4 [libng15] Prevent writing over-length PLTE chunk (Cosmin Truta). 2015-10-29 09:56:19 -05:00
Glenn Randers-Pehrson
39f8f0e6da [libpng15] Bump version to 1.5.24beta03 2015-10-14 22:14:22 -05:00
Glenn Randers-Pehrson
51148c5255 [libpng15] Imported from libpng-1.5.24beta02.tar 2015-10-14 22:14:13 -05:00
Glenn Randers-Pehrson
5e51957594 [libpng15] Added sPLT support to pngtest.c 2015-10-11 11:31:44 -05:00
Glenn Randers-Pehrson
2cc28ebc00 [libpng15] Merged pngvalid.c with libpng16's pngvalid.c, again. 2015-10-03 18:07:03 -05:00
Glenn Randers-Pehrson
24e485baec [libpng15] Improve CHANGES and ANNOUNCE description of filler-byte fix. 2015-09-18 23:34:55 -05:00
Glenn Randers-Pehrson
01789a5e8e [libpng15] Fix "last changed" line for pngvalid.c 2015-09-18 22:01:55 -05:00
Glenn Randers-Pehrson
1f4508c7e2 [libpng15] Update CHANGES and ANNOUNCE per recent pull request. 2015-09-18 21:24:29 -05:00
John Bowler
9946064745 pngvalid. copied from libpng17
This change requires the fix to png_set_filler

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-18 15:49:57 -07:00
John Bowler
e87d502b16 png_set_filler with 16-bit output byte swapped the value
A simple case of assigning the low and high byte in the wrong order, may
cause problems for some apps if they already have a work-round.  The
code executes before the 16-bit byte swap so the order is always the PNG
one.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-18 14:04:50 -07:00
John Bowler
8c4b258355 [libpng15] Fixed png_save_int_32 when int is not 2's complement (John Bowler). 2015-08-21 14:50:38 -05:00
Glenn Randers-Pehrson
7730265b27 [libpng15] Bump version to 1.5.24beta02 2015-08-19 12:54:33 -05:00
Glenn Randers-Pehrson
75318bc745 [libpng15] Imported from libpng-1.5.24beta01.tar 2015-08-19 12:54:24 -05:00
Glenn Randers-Pehrson
c357fb70b5 [lbipng15] Fixed the recently reported 1's complement security issue by
replacing the value that is illegal in the PNG spec, in both signed and
  unsigned values, with 0. Illegal unsigned values (anything greater than or
  equal to  0x80000000) can still pass through, but since these are not illegal
  in ANSI-C (unlike 0x80000000 in the signed case) the checking that
  occurs later can catch them (John Bowler).

Safely convert num_bytes to a png_byte in png_set_sig_bytes() (Robert
  Seacord).
2015-08-19 12:52:39 -05:00
Glenn Randers-Pehrson
a88dec67f2 [libpng15] Safely convert num_bytes to a png_byte in png_set_sig_bytes() (Robert
Seacord).
2015-08-18 10:23:35 -05:00
Glenn Randers-Pehrson
357f3da6b0 [libpng15] Fix links in man page 2015-08-11 15:33:21 -05:00
Glenn Randers-Pehrson
53cabf986f [libpng15] Fix links in man page 2015-08-11 13:03:02 -05:00
Glenn Randers-Pehrson
adef6f991f [libpng15] Update dead link in man page 2015-08-11 12:09:06 -05:00
Glenn Randers-Pehrson
bb98fdbf31 [libpng15] Fixed potential leak of png_pixels in contrib/pngminus/pnm2png.c
and fixed uninitialized variable in contrib/gregbook/rpng2-x.c
2015-07-30 11:32:56 -05:00
Glenn Randers-Pehrson
aa24431c93 [libpng15] Bump version to 1.5.24beta01 2015-07-23 20:20:39 -05:00
Glenn Randers-Pehrson
a058d6cee0 [libpng15] Imported from libpng-1.5.23.tar 2015-07-22 22:40:33 -05:00
Glenn Randers-Pehrson
445ad8fabf [libpng15] Imported from libpng-1.5.23rc03.tar 2015-07-15 21:23:58 -05:00
Glenn Randers-Pehrson
4dc8ea0929 [libpng15] Removed WEIGHTED_FILTER paragraph from the man page. 2015-07-13 14:42:14 -05:00
Glenn Randers-Pehrson
91c2de79b9 [libpng15] Bump version to libpng-1.5.23rc03.tar 2015-07-13 08:30:27 -05:00
Glenn Randers-Pehrson
06bf45e527 [libpng15] Imported from libpng-1.5.23rc02.tar 2015-07-13 07:06:07 -05:00
Glenn Randers-Pehrson
ce12446903 [libpng15] Restored unused FILTER_HEURISTIC macros removed at
libpng-1.5.23beta02 to png.h to avoid compatibility warnings.
2015-07-13 07:04:17 -05:00
Glenn Randers-Pehrson
ceaf50079a [libpng15] Imported from libpng-1.5.23rc01.tar 2015-07-09 11:58:09 -05:00
Glenn Randers-Pehrson
5129cbb795 [libpng15] Belatedly added Mans Rullgard to the list of Contributing Authors. 2015-07-09 11:53:58 -05:00
Glenn Randers-Pehrson
5c88d90ce8 [libpng15] Bump version to 1.5.23beta03 2015-06-30 11:01:58 -05:00
Glenn Randers-Pehrson
57b246e736 [libpng15] Imported from libpng-1.5.23beta02.tar 2015-06-30 11:01:50 -05:00
Glenn Randers-Pehrson
32751e6a20 [libpng15] Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h 2015-06-10 07:14:50 -05:00
Glenn Randers-Pehrson
d522ff063f [libpng15] Removed non-working progressive reader 'skip' function. 2015-06-03 17:09:47 -05:00
Glenn Randers-Pehrson
ab096c961b [libpng15] Quieted Coverity issues in pngvalid.c. 2015-06-03 16:18:23 -05:00
Glenn Randers-Pehrson
5ce5cb7a9a [libpng15] Bump version to 1.5.23beta02 2015-06-01 21:10:37 -05:00
Glenn Randers-Pehrson
8ed373b1fa [libpng15] Removed WRITE_WEIGHTED_FILTERED code, to save a few kbytes of the
compiled library size. It never worked properly and as far as we can
tell, no one uses it. The png_set_filter_heuristics() and
png_set_filter_heuristics_fixed() APIs are retained but deprecated
and do nothing.
2015-06-01 21:08:14 -05:00
Glenn Randers-Pehrson
9fee864806 [libpng15] Imported from libpng-1.5.23beta01.tar 2015-06-01 21:07:27 -05:00
Glenn Randers-Pehrson
2cd7404743 [libpng15] Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug
report from Christopher Ferris).
2015-05-21 15:20:52 -05:00
Glenn Randers-Pehrson
8583cc23e4 [libpng15] Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c
PNG_DEBUG builds.
2015-05-09 21:44:18 -05:00
Glenn Randers-Pehrson
58a54220dd [libpng15] Replaced "unexpected" with an integer in pngset.c where a long was
expected, to avoid a compiler warning when PNG_DEBUG > 1.
2015-04-29 11:53:28 -05:00
Glenn Randers-Pehrson
e985b95d65 [libpng15] Removed unused PNG_SET_CHUNK_[CACHE|MALLOC]_LIMIT_SUPPORTED definitions
from pnglibconf.h.prebuilt (Andrew Church).
2015-03-27 09:14:25 -05:00
Glenn Randers-Pehrson
4925a28f6d [libpng15] Bump version to 1.5.23beta01 2015-03-27 09:09:21 -05:00
Glenn Randers-Pehrson
4b1b9ce028 [libpng15] Imported from libpng-1.5.22.tar 2015-03-26 08:11:00 -05:00
Glenn Randers-Pehrson
76a0ff6a10 [libpng15] Bump version to 1.5.22rc05 2015-03-17 08:14:08 -05:00
Glenn Randers-Pehrson
00176867fe [libpng15] Imported from libpng-1.5.22rc04.tar 2015-03-17 08:00:00 -05:00
Glenn Randers-Pehrson
88c83a2030 [libpng15] Fix incorrect calculation of maximum number of unknown chunks or
sPLT chunks to be stored (John Bowler).
2015-03-16 16:07:50 -05:00
Glenn Randers-Pehrson
ca9e4e3a3b [libpng15] Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin).
2015-03-15 17:20:10 -05:00
Glenn Randers-Pehrson
b1ac30b94e [libpng15] Bump version to 1.5.22rc04 2015-03-12 08:10:01 -05:00
Glenn Randers-Pehrson
79553bcc3d [libpng15] Imported from libpng-1.5.22rc03.tar 2015-03-12 07:27:17 -05:00
Glenn Randers-Pehrson
2f70791939 [libpng15] Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
2015-03-12 07:26:12 -05:00
Glenn Randers-Pehrson
9c5ed64946 [libpng15] Imported from libpng-1.5.22rc02.tar 2015-03-09 09:22:20 -05:00
Glenn Randers-Pehrson
687d018609 [libpng15] Merged png_free_data() with libpng-1.6.17 2015-03-09 09:08:12 -05:00
Glenn Randers-Pehrson
d50ec244d2 [libpng15] Removed some comments that the configure script did not handle
properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
Bump version to 1.5.22rc02
2015-03-05 21:07:11 -06:00
Glenn Randers-Pehrson
17b747c8a6 [libpng15] Imported from libpng-1.5.22rc01.tar 2015-03-04 11:19:19 -06:00
Glenn Randers-Pehrson
af625883d6 [libpng15] Bump version to 1.5.22beta05 2015-02-25 15:42:09 -06:00
Glenn Randers-Pehrson
ddc5beaa89 [libpng15] Imported from libpng-1.5.22beta04.tar 2015-02-25 15:17:31 -06:00
Glenn Randers-Pehrson
74aa31a7c5 [libpng15] Relocated a misplaced "}" in png_reciprocal2(). 2015-02-24 12:36:13 -06:00
Glenn Randers-Pehrson
193eb0b717 [libpng15] Bump version to 1.5.22beta04 2015-02-21 12:48:59 -06:00
Glenn Randers-Pehrson
9c20439822 [libpng15] Imported from libpng-1.5.22beta03.tar 2015-02-21 12:48:41 -06:00
Glenn Randers-Pehrson
014440e6cd [libpng15] Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default. 2015-02-18 13:00:09 -06:00
Glenn Randers-Pehrson
a117d4eacc [libpng15] Allow calling png_get_IHDR() with NULL arguments (Reuben Hawkins). 2015-02-18 12:59:28 -06:00
Glenn Randers-Pehrson
61c3508c42 [libpng15] Bump version to 1.5.22beta03 2015-02-17 10:51:59 -06:00
Glenn Randers-Pehrson
0f97758e5f [libpng15] Imported from libpng-1.5.22beta02.tar 2015-02-17 10:51:19 -06:00
Glenn Randers-Pehrson
8a6253ed6f [libpng15] Merged pngtest.c with libpng-1.6.17/pngtest.c
Display user limits in the output from pngtest.
Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column
  and 1-million-row default limits in pnglibconf.dfa, that can be reset
  by the user at build time or run time.  This provides a more robust
  defense against DOS and as-yet undiscovered overflows.
2015-02-16 22:56:30 -06:00
Glenn Randers-Pehrson
c34f3658a7 [libpng15] Bump version to 1.5.22beta02 2015-01-28 19:42:01 -06:00
Glenn Randers-Pehrson
3cd4a410a5 [libpng15] Imported from libpng-1.5.22beta01.tar 2015-01-28 19:34:32 -06:00
Glenn Randers-Pehrson
747cea57e3 [libpng15] Made the check for out-of-range values in png_set_tRNS() detect
values that are exactly 2^bit_depth, and work on 16-bit platforms.
2015-01-13 09:39:15 -06:00
Glenn Randers-Pehrson
ee48ecd71e [libpng15] Update ltmain.sh to libtool-2.4.4 2015-01-11 17:29:04 -06:00
Glenn Randers-Pehrson
e621f04541 [libpng15] Regenerated configure scripts with libtool-2.4.4 2014-12-28 19:18:57 -06:00
Glenn Randers-Pehrson
beddd7ed53 [libpng15] Bump version to 1.5.22beta01 2014-12-21 22:56:23 -06:00
Glenn Randers-Pehrson
67faef917b [libpng15] Imported from libpng-1.5.21.tar 2014-12-21 21:52:46 -06:00
Glenn Randers-Pehrson
9c526e5a5d [libpng15] Imported from libpng-1.5.21rc03.tar 2014-12-21 16:43:48 -06:00
John Bowler
7a6bbfd649 [libpng15] Fixed an overflow in png_combine_row with very wide interlaced
images.
2014-12-21 16:40:33 -06:00
Glenn Randers-Pehrson
90238dfe7a [libpng15] Imported from libpng-1.5.21rc02.tar 2014-12-21 14:08:01 -06:00
Glenn Randers-Pehrson
fb31308aea [libpng15] Imported from libpng-1.5.21rc01.tar 2014-12-21 09:31:27 -06:00
Glenn Randers-Pehrson
b0c2c4154a [libpng15] Bump version to 1.5.21beta02 2014-12-18 08:51:00 -06:00
Glenn Randers-Pehrson
8eb6549dac [libpng15] Imported from libpng-1.5.21beta01.tar 2014-12-18 08:50:49 -06:00
Glenn Randers-Pehrson
969d5a27dd [libpng15] Revised Makefile.am and scripts/*.dfn to work with MinGW/MSYS;
renamed scripts/*.dfn to scripts/*.c (Bob Friesenhahn and John Bowler).
2014-12-14 21:52:43 -06:00
Glenn Randers-Pehrson
394b2868f7 [libpng15] Bump version to 1.5.21beta01 2014-12-14 21:28:11 -06:00
Glenn Randers-Pehrson
82090022e7 [libpng15] Imported from libpng-1.5.20.tar 2014-11-20 10:22:49 -06:00
Glenn Randers-Pehrson
5290847c3e [libpng15] Imported from libpng-1.5.20rc03.tar 2014-11-16 20:04:17 -06:00
Cosmin Truta
f3c2a77175 [libpng15] Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in
scripts/makefile.vcwin32.
Removed the obsolete $ARCH variable from scripts/makefile.darwin.
2014-11-16 19:42:08 -06:00
Glenn Randers-Pehrson
55246f5ed6 [libpng15] Imported from libpng-1.5.20rc02.tar 2014-11-14 09:42:39 -06:00
Cosmin Truta
7852e7786b [libpng15] Use memcpy instead of CopyMemory in the definition of png_memcpy.
The Borland C++ build breaks otherwise (Cosmin).
2014-11-14 09:41:41 -06:00
Cosmin Truta
5310158c37 [libpng15] The macros passed in the command line to Borland make were ignored if
similarly-named macros are already defined in makefiles. This behavior
is different from POSIX make and other make programs.  Surround the
macro definitions with ifndef guards (Cosmin).
2014-11-14 09:38:20 -06:00
Glenn Randers-Pehrson
6e0f47f88f [libpng15] Imported from libpng-1.5.20rc01.tar 2014-11-13 06:46:37 -06:00
Glenn Randers-Pehrson
9e6249907b [libpng15] Bump version to 1.5.20beta02 2014-11-09 20:29:36 -06:00
Glenn Randers-Pehrson
2ccc2774f5 [libpng15] Quieted three "comparison is always false due to limited range"
compiler warnings in pngset.c
2014-11-09 20:28:12 -06:00
Glenn Randers-Pehrson
956a73a961 [libpng15] Imported from libpng-1.5.20beta01.tar 2014-11-06 11:09:02 -06:00
Glenn Randers-Pehrson
df8dd1183c [libpng15] Avoid out-of-bounds memory access in png_user_version_check().
Simplified and future-proofed png_user_version_check().
2014-11-06 07:58:21 -06:00
Glenn Randers-Pehrson
f2f5e89566 [libpng15] Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from
pnglibconf.dfa
2014-11-06 07:57:52 -06:00
Glenn Randers-Pehrson
023ff22642 [libpng15] Only mark text chunks as written after successfully writing them. 2014-11-06 07:56:34 -06:00
Glenn Randers-Pehrson
d0885f09af [libpng15] Revised INSTALL document. 2014-10-24 22:43:07 -05:00
Glenn Randers-Pehrson
259a5fc20d [libpng16] Revised the INSTALL document. 2014-10-24 22:37:46 -05:00
Glenn Randers-Pehrson
6c9ef75c6b [libpng15] Update "last changed" dates. 2014-08-21 09:50:28 -05:00
Glenn Randers-Pehrson
e99366837d [libpng15] Bump version to 1.5.20beta01 2014-08-21 09:15:51 -05:00
Glenn Randers-Pehrson
e73cc88b21 [libpng15] Imported from libpng-1.5.19.tar 2014-08-21 05:57:34 -05:00
Glenn Randers-Pehrson
60b6a64975 [libpng15] Bump version to 1.5.19rc02 2014-08-13 22:07:49 -05:00
Glenn Randers-Pehrson
1516875105 [libpng15] Imported from libpng-1.5.19rc01.tar 2014-08-13 22:07:39 -05:00
Glenn Randers-Pehrson
36f9f0bcc8 [libpng15] Bump version to 1.5.19beta06 2014-08-07 20:29:04 -05:00
Glenn Randers-Pehrson
6390528fab [libpng15] Imported from libpng-1.5.19beta05.tar 2014-08-07 20:28:56 -05:00
Glenn Randers-Pehrson
7de192f1e7 [libpng15] Eliminated use of "$<" when copying $PNGLIBCONF_H_PREBUILT
in makefiles. This does not work on some versions of make; bug introduced
in libpng version 1.5.19beta03.
2014-08-07 20:27:46 -05:00
Glenn Randers-Pehrson
cdc0ed8424 [libpng15] Bump version to 1.5.19beta05 2014-08-05 14:55:44 -05:00
Glenn Randers-Pehrson
ff3171322c [libpng15] Imported from libpng-1.5.19beta04.tar 2014-08-05 14:51:49 -05:00
Glenn Randers-Pehrson
1ee1fcc805 [libpng15] Removed scripts/makefile.elf which has not worked since libpng-1.4.x 2014-08-03 20:01:32 -05:00
Glenn Randers-Pehrson
98b0236a8b [libpng15] Updated CHANGES file with some January 2013 CVE numbers. 2014-04-10 16:32:30 -05:00
Glenn Randers-Pehrson
fba09cf080 [libpng15] Bump version to 1.5.19beta04 2014-04-06 08:55:43 -05:00
Glenn Randers-Pehrson
ba6c8d143d [libpng15] Imported from libpng-1.5.19beta03.tar 2014-04-06 08:49:40 -05:00
Glenn Randers-Pehrson
af759fb3fe [libpng15] Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that
interferes with "blocky" expansion of sub-8-bit interlaced PNG files.
2014-04-06 08:48:27 -05:00
Glenn Randers-Pehrson
c98798e7dc [libpng15] Fix syntax of Copy command in makefile.amiga 2014-03-22 18:38:49 -05:00
Cosmin Truta
e66d9c2416 [libpng15] Allow an easy replacement of the default pre-built configuration
header with a custom header, via the make PNGLIBCONF_H_PREBUILT macro.
2014-03-22 13:35:35 -05:00
Cosmin Truta
4904cbce65 [libpng15] Port recent changes from libpng-1.6.11beta
Silence 'unused parameter' build warnings (Cosmin).
  $(CP) is now used alongside $(RM_F).  Also, use 'copy' instead
    of 'cp' where applicable, and applied other minor makefile changes.
  Don't warn about invalid dimensions exceeding user limits.
2014-03-22 11:19:35 -05:00
Glenn Randers-Pehrson
d2016be48d [libpng15] Mention scripts/pnglibconf.h.prebuilt in INSTALL. 2014-03-21 12:48:49 -05:00
Glenn Randers-Pehrson
beaacb7821 [libpng15] Removed #if/#else/#endif from inside two pow() calls in pngvalid.c
because they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3
when using its "__builtin_pow()" function.
2014-03-17 16:14:05 -05:00
Glenn Randers-Pehrson
d485bd1379 [libpng15] Bump version to 1.5.19beta03 2014-03-17 13:21:01 -05:00
Glenn Randers-Pehrson
d27ed3f759 [libpng15] Imported from libpng-1.5.19beta02.tar 2014-03-17 13:19:06 -05:00
Glenn Randers-Pehrson
a73110b6ad [libpng15] Moved configuration information from the manual to the INSTALL file. 2014-03-17 08:41:52 -05:00
Glenn Randers-Pehrson
d92bbef414 [libpng15] Use "if (value != 0)" instead of "if (value)" consistently. 2014-03-08 16:23:06 -06:00
Glenn Randers-Pehrson
a00d14ddcf [libpng15] Removed unused PNG_CALLOC_SUPPORTED from scripts/pnglibconf.dfa
and script/pnglibconf.h.prebuilt
2014-03-08 06:46:22 -06:00
Glenn Randers-Pehrson
e4e3df8abb [libpng15] Update "last changed date" in pngrtran.c 2014-02-28 11:00:19 -06:00
Glenn Randers-Pehrson
788c61a37f [libpng15] Bump version to 1.5.19beta02 2014-02-28 10:49:32 -06:00
Glenn Randers-Pehrson
a2fbb6d41b [libpng15] Imported from libpng-1.5.19beta01.tar 2014-02-28 10:49:21 -06:00
Glenn Randers-Pehrson
c8af7e705d [libpng15] Fixed typos in the manual and in scripts/pnglibconf.dfa
(CFLAGS -> CPPFLAGS and PNG_USR_CONFIG -> PNG_USER_CONFIG).
2014-02-26 22:47:36 -06:00
John Bowler
7a456ca882 [libpng15] Removed now-redundant png_error redefinition from pngvalid.c 2014-02-17 07:32:39 -06:00
Glenn Randers-Pehrson
1f1c0aec9b [libpng15] Moved redefinitions of png_error() and related macros from
pngpriv.h to png.h to make them visible to libpng-calling applications.
2014-02-17 07:25:48 -06:00
Glenn Randers-Pehrson
3adf7f7bc8 [libpng15] Bump version to 1.5.19beta01 2014-02-06 10:42:45 -06:00
Glenn Randers-Pehrson
4449a29e1e [libpng15] Imported from libpng-1.5.18.tar 2014-02-05 22:27:21 -06:00
Glenn Randers-Pehrson
d4c7833273 [libpng15] Updated documentation about sCAL chunk support. 2014-02-01 20:17:26 -06:00
Glenn Randers-Pehrson
4f4a757c82 [libpng15] Imported from libpng-1.5.18rc02.tar 2014-01-30 15:15:02 -06:00
Glenn Randers-Pehrson
f1dd8adb83 [libpng15] Quiet an uninitialized memory warning from VC2013 in png_get_png(). 2014-01-30 15:14:22 -06:00
Glenn Randers-Pehrson
799943a1e6 [libpng15] Imported from libpng-1.5.18rc01.tar 2014-01-28 11:35:35 -06:00
Glenn Randers-Pehrson
dfa6aea8ac [libpng15] Imported from libpng-1.5.18beta05.tar 2014-01-20 12:56:42 -06:00
Glenn Randers-Pehrson
e9a25f4568 [libpng15] Updated scripts/makefile.* to use CPPFLAGS (Cosmin) 2014-01-12 11:57:09 -06:00
Glenn Randers-Pehrson
c8ada608b9 [libpng15] Bump version to 1.5.18beta05 2014-01-10 11:57:15 -06:00
Glenn Randers-Pehrson
101a87cb0f [libpng15] Imported from libpng-1.5.18beta04.tar 2014-01-10 11:57:06 -06:00
Glenn Randers-Pehrson
62c3f9f0fe [libpng15] Removed potentially misleading warning from png_check_IHDR(). 2014-01-10 06:14:32 -06:00
Glenn Randers-Pehrson
a951c329bd [libpng15] Revised png_check_IHDR() to use PNG_SIZE_MAX instead of
PNG_UINT_32_MAX in the test for potential overflow in PNG_ROWBYTES.
2014-01-09 20:07:26 -06:00
Glenn Randers-Pehrson
ea9249fe5b [libpng15] Only warn about image too wide if warning was not already issued. 2014-01-08 12:05:00 -06:00
Glenn Randers-Pehrson
449a3c9764 [libpng15] Bump version to 1.5.18beta04 2014-01-01 10:47:16 -06:00
Glenn Randers-Pehrson
38fb839420 [libpng15] Imported from libpng-1.5.18beta03.tar 2014-01-01 10:08:11 -06:00
Glenn Randers-Pehrson
77adefeda6 [libpng15] Updated copyright year in recently-changed files. 2013-12-31 21:06:14 -06:00
John Bowler
b86dd0b19b [libpng15] Allow unversioned links created on install to be disabled in
configure.  In configure builds 'make install' changes/adds links like png.h
and libpng.a to point to the newly installed, versioned, files (e.g.
libpng17/png.h and libpng17.a). Three new configure options and some
rearrangement of Makefile.am allow creation of these links to be disabled.
2013-12-29 19:09:48 -06:00
Glenn Randers-Pehrson
c5c7156df0 [libpng15] Removed extraneous "#endif" from ANNOUNCE. 2013-12-29 18:20:24 -06:00
John Bowler
01ad4848be [libpng15] Pushed new pngvalid.c to the libpng15 branch. 2013-12-29 18:18:58 -06:00
Glenn Randers-Pehrson
95eaa0b471 [libpng15] Revised a dependency in Makefile.am to work with 'subdirs' option. 2013-12-29 18:10:06 -06:00
Glenn Randers-Pehrson
cc323808f9 [libpng15] Rebuilt configure scripts with automake 1.14.1 and autoconf-2.69.
Require automake-1.13 and enable automake "subdirs" feature in autoconf.ac.
2013-12-29 15:50:13 -06:00
John Bowler
b152f8b6c5 [libpng15] The 'make all-am' command no longer builds $(check_PROGRAMS), leading
to a lack of checks on cross-builds such as ARM.  Makefile.am also
requires correct dependencies for the check programs on pnglibconf.h
otherwise parallel builds on fast machines can sometimes pick up the
system pnglibconf.h.
2013-12-29 15:26:45 -06:00
John Bowler
71fcb39efc [libpng15] Merged pngvalid and pngtest from libpng-1.5; made compressed chunks
after IDAT work with the progressive read code (this is a minor and
somewhat ugly fix-up; the proper fix is in 1.6).
2013-12-29 10:44:25 -06:00
John Bowler
c5568595ff [libpng15] Merged libpng-1.7 changes and created a single pngvalid.c 2013-12-27 07:40:15 -06:00
John Bowler
bd7143e6eb [libpng15] Fixed 'unused' warnings and mergeed with libpng16 pngvalid.
Various warnings revealed by configurations added to the tested
configurations in libpng 1.6 need corresponding fixes in libpng 1.5.
This takes the libpng 1.6 pngvalid.c and adds it back to libpng 1.5,
however one write-only test is currently disabled because it does not
work; possibly because of failures to reset or initialize the deflate
stream correctly in write-only cases.
2013-12-27 07:27:17 -06:00
Glenn Randers-Pehrson
705ac2fbbc [libpng15] Re-added "compile" (libpng15 branch includes configure-generated
stuff).
2013-12-26 15:25:18 -06:00
Glenn Randers-Pehrson
ad9982f677 [libpng15] Fix typo in pngrtran.c 2013-12-26 14:49:07 -06:00
Glenn Randers-Pehrson
feb216b62d [libpng15] Removed configure-generated "compile" file. 2013-12-26 14:45:39 -06:00
Glenn Randers-Pehrson
997a64992d [libpng15] Fix typo in CHANGES and ANNOUNCE 2013-12-26 12:38:34 -06:00
Glenn Randers-Pehrson
9d268b7758 [libpng15] Bump version to 1.5.18beta03 2013-12-26 12:03:38 -06:00
Glenn Randers-Pehrson
642b1d8f1e [libpng15] Imported from libpng-1.5.18beta02.tar 2013-12-26 12:03:21 -06:00
Glenn Randers-Pehrson
24726a403f [libpng16] Changed tabs to 3 spaces in png_debug macros and changed '"%s"m'
to '"%s" m' to improve portability among compilers.
2013-11-28 16:15:16 -06:00
Glenn Randers-Pehrson
eff3cc82c3 [libpng15] Bump version to 1.5.18beta02 2013-08-21 18:00:27 -05:00
Glenn Randers-Pehrson
3309da76cd [libpng15] Imported from libpng-1.5.18beta01.tar 2013-08-21 17:54:39 -05:00
Glenn Randers-Pehrson
fe7b94da93 [libpng15] Delay calling png_init_filter_functions() until a row with nonzero
filter is found.
2013-08-20 21:23:50 -05:00
Glenn Randers-Pehrson
c5b84c0ba6 [libpng15] Mention png_set_option() in the documentation. 2013-08-17 16:29:50 -05:00
Glenn Randers-Pehrson
551435c359 [libpng15] Change some hyphens to minus signs and fix other typos in libpng.3 2013-08-06 17:24:19 -05:00
Glenn Randers-Pehrson
f880e3a735 [libpng15] Bail out of loop over tRNS array once a transparent entry
is found.
2013-08-04 13:54:35 -05:00
Glenn Randers-Pehrson
b3b9360373 [libpng15] Ported recent "/*SAFE*/" comments from libpng-1.6.3 2013-07-15 10:35:09 -05:00
Glenn Randers-Pehrson
1feb6e2ef5 [libpng15] Bump version to 1.5.18beta01 2013-06-28 19:59:05 -05:00
Glenn Randers-Pehrson
25c8915f7c [libpng15] Imported from libpng-1.5.17.tar 2013-06-26 22:30:48 -05:00
Glenn Randers-Pehrson
6a17b3b469 [libpng15] Imported from libpng-1.5.17rc03.tar 2013-06-25 19:16:52 -05:00
Glenn Randers-Pehrson
67859c8fcb [libpng15] Revised example.c to illustrate use of PNG_DEFAULT_sRGB and
PNG_GAMMA_MAC_18 as parameters for png_set_gamma().  These have been available
since libpng-1.5.4.
2013-06-25 18:50:55 -05:00
Glenn Randers-Pehrson
fb8831d19a [libpng15] Fix spelling of "doclifter" in CHANGES and ANNOUNCE 2013-06-18 15:08:56 -05:00
Glenn Randers-Pehrson
2c3d751c3b [libpng15] Fix spelling of "doclifter" in CHANGES and ANNOUNCE 2013-06-18 15:05:54 -05:00
Glenn Randers-Pehrson
7689f1f96d [libpng15] Bump version to 1.5.17rc03 2013-06-18 13:34:28 -05:00
Glenn Randers-Pehrson
d29c519969 [libpng15] Imported from libpng-1.5.17rc02.tar 2013-06-18 12:54:24 -05:00
Glenn Randers-Pehrson
567bdd03e3 [libpng15] Imported from libpng-1.5.17rc01.tar 2013-06-17 07:57:28 -05:00
Glenn Randers-Pehrson
bd12c0ebbb [libpng15] Bump version to 1.5.17beta02 2013-06-08 16:50:27 -05:00
Glenn Randers-Pehrson
a6f079d4d7 [libpng15] Imported from libpng-1.5.17beta01.tar 2013-06-08 16:50:19 -05:00
John Bowler
ffeb8f0d09 [libpng15] Port ARM support changes from libpng-1.6.3beta07. 2013-06-08 13:57:56 -05:00
Glenn Randers-Pehrson
ea216228f3 [libpng15] Make ARM NEON support work at compile time (not just configure time).
This moves the test on __ARM_NEON__ into pngconf.h to avoid issues when
using a compiler that compiles for multiple architectures at one time.
2013-06-06 14:46:38 -05:00
Glenn Randers-Pehrson
fd03dddd78 [libpng15] Updated README (removed CompuServe, added simplesystems.org) 2013-06-05 16:49:35 -05:00
John Bowler
ce47f54deb [libpng15] Deleted set(CMAKE_BUILD_TYPE) block from CMakeLists.txt 2013-06-05 11:38:45 -05:00
Glenn Randers-Pehrson
4d4bfbc034 [libpng15] Added set(CMAKE_CONFIGURATION_TYPES ...) to CMakeLists.txt
(Andrew Hundt)
2013-06-05 11:08:12 -05:00
Glenn Randers-Pehrson
de089548e0 [libpng15] Removed a redundant test from png_set_IHDR(). 2013-06-04 14:57:55 -05:00
Glenn Randers-Pehrson
0801f13173 [libpng15] Updated arm, projects, and contrib descriptions in README 2013-06-03 20:39:30 -05:00
Glenn Randers-Pehrson
5588ed34ef [libpng15] Bump version to 1.5.17beta01 2013-05-23 11:40:13 -05:00
Glenn Randers-Pehrson
45b47c1a1c [libpng15] Imported from libpng-1.5.16.tar 2013-05-23 06:50:27 -05:00
Glenn Randers-Pehrson
333ca5496b [libpng15] Imported from libpng-1.5.16rc01.tar 2013-05-15 22:38:09 -05:00
Glenn Randers-Pehrson
bfcfdce7af [libpng15] Bump version to 1.5.16beta07 2013-05-12 18:36:24 -05:00
Glenn Randers-Pehrson
bc92887b2d [libpng15] Imported from libpng-1.5.16beta06.tar 2013-05-12 18:34:58 -05:00
Glenn Randers-Pehrson
ae8174d9a3 [libpng15] Imported from libpng-1.5.15beta06.tar 2013-05-12 12:12:08 -05:00
Glenn Randers-Pehrson
a3bece6bb7 [libpng15] Ported libpng-1.6.3beta06/contrib/pngminus/pnm2png.c changes
to use unsigned long, not png_uint_32 arguments to sscanf().
2013-05-12 12:09:48 -05:00
Glenn Randers-Pehrson
1087026c09 [libpng15] Revised contrib/pngminim/*/makefile to separate CPPFLAGS and
CPFLAGS, and to generate pnglibconf.h with the right zlib header files.
2013-05-10 07:43:54 -05:00
Glenn Randers-Pehrson
080fecf0e4 [libpng15] Allow contrib/pnminus/pnm2png.c to compile without WRITE_INVERT
and WRITE_PACK supported (writes error message that it can't read P1 or P4
PBM files).
2013-05-09 14:26:00 -05:00
Glenn Randers-Pehrson
7bef6f83ec [libpng15] Imported from libpng-1.5.16beta05.tar 2013-05-09 12:48:13 -05:00
Glenn Randers-Pehrson
dc7e768526 [libpng15] Updated contrib/pngminus/pnm2png.c (Paul Stewart):
Fixed whitespace handling
Added a call to png_set_packing()
Initialize dimension values so if sscanf fails at least we have known
invalid values.
2013-05-09 12:43:25 -05:00
Glenn Randers-Pehrson
a5173354d2 [libpng15] Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart).
Ignore "#" delimited comments in input file to pnm2png.c.
2013-05-07 14:42:52 -05:00
Glenn Randers-Pehrson
2defb206e7 [libpng15] Reverted patches committed to the wrong branch. 2013-05-07 14:29:36 -05:00
Glenn Randers-Pehrson
6ab1f4903f [libpng16] Ignore "#" delimited comments in input file to pnm2png.c. 2013-05-07 14:25:21 -05:00
Glenn Randers-Pehrson
34df4eb5ad [libpng16] Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart). 2013-05-07 13:50:50 -05:00
Glenn Randers-Pehrson
ec89c54e42 [libpng16] Choose to use windowBits==15 or the zlib header setting via the
benign-errors setting.  If benign errors are allowed, then ignore
the windowBits setting in the zlib header.
Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so
undid the improvement in beta04.
2013-05-07 13:48:48 -05:00
Glenn Randers-Pehrson
f02bb98fdf [libpng16] Choose to use our calculated windowBits or the zlib header setting
via the benign-errors setting.  If benign errors are allowed, then ignore
the windowBits setting in the zlib header.
2013-05-06 16:11:33 -05:00
Glenn Randers-Pehrson
30b247f1ea [libpng15] Bump version to libpng-1.5.16beta05.tar 2013-05-02 07:38:01 -05:00
Glenn Randers-Pehrson
a829dc9ed2 [libpng15] Imported from libpng-1.5.16beta04.tar 2013-05-02 07:31:01 -05:00
Glenn Randers-Pehrson
033a157a65 [libpng15] Added demo of how to deal with unknown chunk location
to the man page.
2013-04-28 21:10:01 -05:00
Glenn Randers-Pehrson
48398987d8 [libpng15] Bump version to 1.5.16beta04 2013-04-26 16:14:36 -05:00
Glenn Randers-Pehrson
09d718fae9 [libpng15] Imported from libpng-1.5.16beta03.tar 2013-04-26 16:14:25 -05:00
Glenn Randers-Pehrson
69a163b1f9 [libpng15] Test for 'arm*' not just 'arm' in the host_cpu configure variable. 2013-04-26 16:13:29 -05:00
Glenn Randers-Pehrson
64a36e34a7 [libpng15] Bump version to 1.5.16beta03 2013-04-25 22:16:40 -05:00
Glenn Randers-Pehrson
712f8aab93 [libpng15] Imported from libpng-1.5.16beta02.tar 2013-04-25 22:09:04 -05:00
Glenn Randers-Pehrson
f0d59e3f9b [libpng15] Bump version to libpng-1.5.16beta02 2013-04-25 21:40:29 -05:00
John Bowler
bb0407f3dc [libpng15] Avoid a compiler warning about unused png_ptr
in translate_gamma_flags()
2013-04-25 10:28:01 -05:00
John Bowler
b4a08b81b2 [libpng15] Ensure that NEON filter stuff is completely disabled when
switched 'off'.  Previously the ARM NEON specific files were still built
if the option was switched 'off' as opposed to being explicitly disabled.
2013-04-24 21:31:04 -05:00
Glenn Randers-Pehrson
880636292c [libpng15] Revised stack marking in arm/filter_neon.S and configure.ac 2013-04-23 08:59:38 -05:00
Glenn Randers-Pehrson
cdede7664e [lbipng15] Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c
(Flavio Medeiros).
2013-04-13 12:16:14 -05:00
Glenn Randers-Pehrson
893153aba3 [libpng15] Updated the GIT URL in the manual. 2013-04-11 18:48:24 -05:00
Glenn Randers-Pehrson
2971634978 [libpng15] Bump version to 1.5.16beta01 2013-03-29 07:11:09 -05:00
Glenn Randers-Pehrson
10de36ef25 [libpng15] Imported from libpng-1.5.15.tar 2013-03-27 20:26:28 -05:00
Glenn Randers-Pehrson
17637544be [libpng15] Imported from libpng-1.5.15rc01.tar 2013-03-21 07:37:31 -05:00
Glenn Randers-Pehrson
7f47448f49 [libpng15] Bump version to 1.5.15beta10 2013-03-13 09:19:26 -05:00
Glenn Randers-Pehrson
96a0c6a8c2 [libpng15] Imported from libpng-1.5.15beta09.tar 2013-03-13 09:19:12 -05:00
John Bowler
657dee1f3a [libpng15] Eliminated two warnings from the Intel C compiler. 2013-03-13 09:12:02 -05:00
Claudio Bley
a3b6fa08b2 [libpng15] Use copy_if_different in the CREATE_SYMLINK macro. 2013-03-07 11:12:40 -06:00
Claudio Bley
44ef7ceb62 [libpng15] Changed the CREATE_SYMLINK macro to expect the full path to a file
as the first argument. When symlinking the filename component of that path is
determined and used as the link target.
2013-03-07 11:05:45 -06:00
Claudio Bley
5d10f7c5f1 [libpng15] Fixed CMakelists.txt to allow building a single variant of the
library (Claudio Bley):
  Introduced a PNG_LIB_TARGETS variable that lists all activated library
    targets.  It is an error if this variable ends up empty, ie. you have
    to build at least one library variant.
  Made the *_COPY targets only depend on library targets actually being build.
  Use PNG_LIB_TARGETS to unify a code path.
2013-03-07 11:01:35 -06:00
Glenn Randers-Pehrson
aad05aa948 [libpng15] Bump version to 1.5.15beta09 2013-03-04 18:08:56 -06:00
Glenn Randers-Pehrson
c4e1faded4 [libpng15] Imported from libpng-1.5.15beta08.tar 2013-03-04 18:08:48 -06:00
John Bowler
c34143f615 [libpng15] Corrected Android builds and corrected libpng.vers with symbol
prefixing This adds an API to set optimization options externally,
    providing an alternative and general solution for the non-portable
    run-time tests used by the ARM Neon code.  It also makes those tests
    compile and link on Android.
  The order of settings vs options in pnglibconf.h is reversed to allow
    settings to depend on options and options can now set (or override) the
    defaults for settings.
2013-03-04 16:44:59 -06:00
John Bowler
85d027f3d0 [libpng15] Made the _SUPPORTED macro definitions consistent. 2013-03-01 20:23:11 -06:00
Glenn Randers-Pehrson
1d82c0f287 [libpng15] Avoid a possible memory leak in contrib/gregbook/readpng.c 2013-03-01 13:25:44 -06:00
Glenn Randers-Pehrson
301e06a46c [libpng15] Bump version to 1.5.15beta08 2013-02-27 15:24:30 -06:00
Glenn Randers-Pehrson
34d6c6882c [libpng15] Imported from libpng-1.5.15beta07.tar 2013-02-27 15:18:30 -06:00
John Bowler
da78c32207 [libpng15] Revised scripts/dfn.awk to work with the buggy MSYS awk that has
trouble with CRLF line endings.
2013-02-27 13:41:23 -06:00
Glenn Randers-Pehrson
ecfc22a681 [libpng15] Revised INSTALL to recommend using CPPFLAGS instead of INCLUDES.
Revised scripts/makefile.freebsd to respect ZLIBDIR and ZLIBINC.
2013-02-22 20:54:27 -06:00
Glenn Randers-Pehrson
6ec5e3ff67 [libpng15] Bump version to 1.5.15beta07 2013-02-22 16:42:00 -06:00
Glenn Randers-Pehrson
0e44f72b10 [libpng15] Imported from libpng-1.5.15beta06.tar 2013-02-22 16:41:25 -06:00
Glenn Randers-Pehrson
1ec6c5f335 [libpng15] Updated the INSTALL document. 2013-02-22 16:39:42 -06:00
John Bowler
d19ad72e28 [libpng15] Fixed PNG_ALIGN(ED)_MEMORY and add ability to turn off ARM_NEON
runtime checks
2013-02-19 10:20:59 -06:00
Glenn Randers-Pehrson
1b69de718e [libpng15] use "png_sizeof()" consistently in the documentation. 2013-02-18 15:42:16 -06:00
Glenn Randers-Pehrson
e67a47a19a [libpng15] Bump version to 1.5.15beta06 2013-02-17 22:09:27 -06:00
Glenn Randers-Pehrson
095b6f7f90 [libpng15] Imported from libpng-1.5.15beta05.tar 2013-02-17 22:09:17 -06:00
Glenn Randers-Pehrson
fb908d6ae2 [libpng15] Redo previous checkin; fold long lines and fix #ifdefs 2013-02-17 21:41:43 -06:00
Glenn Randers-Pehrson
354cd3930b [libpng15] Folded a long line, more consistent use of parentheses
in "#if defined()" tests.
2013-02-17 16:07:33 -06:00
Glenn Randers-Pehrson
8bf001b9da [libpng15] Use parentheses consistently in "#if defined()" tests. 2013-02-17 14:34:32 -06:00
Glenn Randers-Pehrson
f8d9b8b381 [libpng15] Fixed typo in an #ifdef. 2013-02-16 16:32:22 -06:00
John Bowler
d1031d714b [libpng15] 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.
2013-02-16 08:15:35 -06:00
John Bowler
33af2b7d98 [libpng15] Fix typo in previous arm patch 2013-02-15 19:54:06 -06:00
John Bowler
da3031a7d9 [libpng15] 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.
2013-02-15 19:51:05 -06:00
Glenn Randers-Pehrson
1679d4ce0f [libpng15] Bump version to 1.5.15beta05 2013-02-15 11:15:26 -06:00
Glenn Randers-Pehrson
5feedee233 [libpng15] Imported from libpng-1.5.15beta04.tar 2013-02-15 11:15:17 -06:00
Glenn Randers-Pehrson
a92e5a86f8 [libpng15] Fix inconsistencies in use of PNG_GET_PALETTE_MAX 2013-02-10 18:01:47 -06:00
Glenn Randers-Pehrson
8849c000ea [libpng15] Enclosed the new png_get_palette_max
in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED block, and revised pnglibconf.h
and pnglibconf.h.prebuilt accordingly.
2013-02-10 16:14:54 -06:00
Glenn Randers-Pehrson
06364d4585 [libpng15] Updated man page about png_get_palette_max(). 2013-02-08 09:15:59 -06:00
Glenn Randers-Pehrson
e3ab2fe6e9 [libpng15] Bump version to 1.5.15beta04 2013-02-06 22:56:01 -06:00
Glenn Randers-Pehrson
9f75a55f9d [libpng15] Imported from libpng-1.5.15beta03.tar 2013-02-06 22:49:57 -06:00
John Bowler
4c1eaadf38 [libpng15] Turn serial tests back on (recently turned off by autotools upgrade). 2013-02-06 18:42:53 -06:00
Glenn Randers-Pehrson
06f0c77a24 [libpng15] Bump version to 1.5.15beta03 2013-02-05 12:07:17 -06:00
Glenn Randers-Pehrson
6ad7871545 [libpng15] Imported from libpng-1.5.15beta02.tar 2013-02-05 10:50:52 -06:00
John Bowler
3b69793c6f [libpng15] Fix 'setting' handling in options.awk and fixed palette_max API 2013-02-05 07:41:43 -06:00
John Bowler
10303740d1 [libpng15] Updated scripts/makefile.msys, options.awk, and vers.dfn 2013-02-05 07:30:11 -06:00
John Bowler
572ba70905 [libpng15] Fix typo in Makefile.am, fix scripts/pnglibconf.mak and makefile.std 2013-02-04 22:21:53 -06:00
John Bowler
bc6abe8af8 [libpng15] Made a probably general fix for the preprocessing used to generate
source files. This change might make the check for a special C preprocessor
unnecessary, and it also eliminates the requirement for sed in the
configure build process. NOTE: this is incomplete, a change must also
be made to pnglibconf.mak
2013-02-04 21:53:41 -06:00
Glenn Randers-Pehrson
3051d453ef [libpng15] Bump version to 1.5.15beta02 2013-02-04 20:36:30 -06:00
Glenn Randers-Pehrson
11be27ed2c [libpng15] Imported from libpng-1.5.15beta01.tar 2013-02-04 20:21:37 -06:00
Glenn Randers-Pehrson
041f4465d0 [libpng15] Added documentation of new png_get_palette_max() function. 2013-02-04 19:58:58 -06:00
John Bowler
c9f2269857 [libpng15] Enabled renaming of the extern (but not DLL exported) ARM filter
functions.  Also enabled inclusion of pngpriv.h in non-C files by preventing
C/C++ specific definitions if PNG_VERSION_INFO_ONLY is defined.
2013-02-04 17:49:11 -06:00
Glenn Randers-Pehrson
6636826302 [libpng15] Bump version to 1.5.15beta01 2013-01-23 21:26:43 -06:00
Glenn Randers-Pehrson
8799d78361 [libpng15] Imported from libpng-1.5.14.tar 2013-01-23 21:06:35 -06:00
Glenn Randers-Pehrson
54491e8535 [libpng15] Removed an obsolete line from the manual. 2013-01-23 21:05:27 -06:00
Glenn Randers-Pehrson
40a8cd052a [libpng15] Imported from libpng-1.5.14rc03.tar 2013-01-17 23:34:18 -06:00
Glenn Randers-Pehrson
77a0a2ea11 [libpng15] Check validity of "nentries" parameter of png_set_sPLT().
and check validity of "num_text" parameter of png_set_text_2().
2013-01-17 16:15:46 -06:00
Glenn Randers-Pehrson
798d3de5f6 [libpng15] Check validity of "nentries" parameter of png_set_sPLT(). 2013-01-17 15:16:02 -06:00
Glenn Randers-Pehrson
5b4aa7841b [libpng15] Bump version to 1.5.14rc03 2013-01-17 14:15:55 -06:00
John Bowler
bec9ca9b8a [libpng15] Revised test for validity of "num_unknowns" to eliminate compiler
warnings.
2013-01-17 13:09:32 -06:00
Glenn Randers-Pehrson
77a817bfc2 [libpng15] Change info_ptr->unknown_chunks_num to type png_uint_32
and test against INT_MAX instead of UINT_MAX in pngset.c
2013-01-17 10:52:48 -06:00
Glenn Randers-Pehrson
5b9fe98c5f [libpng15] Imported from libpng-1.5.14rc01.tar 2013-01-16 21:29:52 -06:00
Glenn Randers-Pehrson
d91f8b0fe8 [libpng15] Bump version to 1.5.14beta09 2013-01-10 12:31:29 -06:00
Glenn Randers-Pehrson
1a3d6e3cf3 [libpng15] Check validity of "num_unknowns" parameter
of png_set_unknown_chunks().
2013-01-10 09:24:03 -06:00
Glenn Randers-Pehrson
c4b099396a [libpng15] Bump version to 1.5.14beta08 2013-01-06 20:12:39 -06:00
John Bowler
6d35722f70 [libpng15] Updated pngvalid.c from libpng16 2013-01-06 17:57:40 -06:00
John Bowler
84dc479108 [libpng15] De-configured build fixes to make a range of deconfiguration options
(such as switching off read or write support) work in more cases.  Also
upgraded pngtest and pngvalid to the libpng 1.6 versions (with some
modifications) which provide more extensive testing.  Replaced pngtest.png
because pngtest writes the ancillary chunks in a different order.
2013-01-06 12:38:39 -06:00
Glenn Randers-Pehrson
8e4a89f0f9 [libpng15] Changed AM_CONFIG_HEADER(config.h) to AC_CONFIG_HEADERS([config.h])
in configure.ac
2013-01-03 13:44:04 -06:00
Glenn Randers-Pehrson
3d3c517bc4 [libpng15] Bump version to 1.5.14beta07 2013-01-01 09:10:30 -06:00
Glenn Randers-Pehrson
c11abedafe [libpng15] Update copyright year to 2013 in newly-changed files. 2013-01-01 07:26:47 -06:00
John Bowler
a743b5ae08 [libpng15] Fixed 'make distcheck' on SUN OS - libpng.so was not being removed 2012-12-27 10:05:03 -06:00
Glenn Randers-Pehrson
649f94515a [libpng15] Discontinued distributing libpng-1.5.14-1.5.13-diff.txt and similar. 2012-12-23 21:22:44 -06:00
Glenn Randers-Pehrson
ea36195983 [libpng15] Bump version to 1.5.14beta06 2012-12-22 18:51:48 -06:00
Glenn Randers-Pehrson
dbd687d64f [libpng15] Reformatted latest CHANGES/ANNOUNCE entry to 80 character lines. 2012-12-22 17:14:07 -06:00
John Bowler
0a7508fd9b [libpng15] 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.
2012-12-20 22:33:13 -06:00
Glenn Randers-Pehrson
4a641ce19c [libpng15] Bump version to 1.5.14beta05 2012-12-19 16:34:03 -06:00
Glenn Randers-Pehrson
5e6764a39a [libpng15] ANNOUNCE that the git repository location at SourceForge has changed. 2012-12-18 22:00:56 -06:00
Glenn Randers-Pehrson
c0858ea57f [libpng15] Fixed typo in contrib/pngminim/encoder/README 2012-12-18 14:55:48 -06:00
Glenn Randers-Pehrson
5976cbbe6d [libpng15] Disassembled the version number in scripts/options.awk (necessary
for building on SunOs)
2012-12-18 09:09:43 -06:00
Glenn Randers-Pehrson
eb4b51674f [libpng15] Cleaned up whitespace in the synopsis portion of the manpage. 2012-12-17 20:25:26 -06:00
Glenn Randers-Pehrson
94decfcca7 [libpng15] Bump version to 1.5.14beta04 2012-12-15 11:50:18 -06:00
Glenn Randers-Pehrson
a2669c39c3 [libpng15] Fixed a minor bug in types to malloc and major bug in handling
compressed iTXt. Compressed iTXt could not be handled. Change was made
earlier but omitted from libpng-1.5.14beta02 distributions.
2012-12-15 11:09:44 -06:00
Glenn Randers-Pehrson
c53980584e [libpng15] Bump version to 1.5.14beta03 2012-12-15 09:14:39 -06:00
Glenn Randers-Pehrson
7515f2e5e6 [libpng15] Bump version to 1.5.14beta03 2012-12-15 09:02:54 -06:00
Glenn Randers-Pehrson
5255518620 [libpng15] Imported from libpng-1.5.14beta02.tar 2012-12-15 00:02:46 -06:00
John Bowler
ab43bdaa84 [libpng15] Fixed cases of unquoted DESTDIR in Makefile.am 2012-12-15 00:01:32 -06:00
John Bowler
508a744251 [libpng15] Improve commentary in ARM-NEON code. 2012-12-14 23:46:56 -06:00
John Bowler
62cfc893e0 [libpng15] Rearranged building of ARM NEON optimizations. The ARM specific code
is split out entirely to the arm subdirectory and changes to configure.ac and
Makefile.am to add new stuff are reduced.  Now material code changes,
although for build test purposes, --enable-arm-neon now builds on non-ARM
systems.
Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.2.5.
2012-12-14 22:05:08 -06:00
John Bowler
9b66cbcf2f [libpng15] Fixed a minor bug in types to malloc and major bug in handling
compressed iTXt. Compressed iTXt could not be handled.
2012-12-14 21:59:20 -06:00
Glenn Randers-Pehrson
58514a2eba [libpng15] Updated "last changed" comments in recently-changed files. 2012-12-10 09:15:28 -06:00
Glenn Randers-Pehrson
494a0040f4 [libpng15] Use "FALL THROUGH" comments consistently (all caps) 2012-12-09 20:39:31 -06:00
Glenn Randers-Pehrson
5aca696114 [libpng15] Add a "FALL THROUGH" comment in a "case:" statement in pngwrite.c 2012-12-09 20:38:53 -06:00
Glenn Randers-Pehrson
b0673cb50f [libpng16] Ignore, with a warning, out-of-range value of num_trans in
png_set_tRNS().
2012-12-09 20:28:26 -06:00
Glenn Randers-Pehrson
a8488b78dc [libpng15] Check for png_ptr==NULL earlier in png_zalloc(). 2012-12-09 20:27:28 -06:00
Glenn Randers-Pehrson
abc54c090b [libpng15] Fixed latest CHANGES entry: DZ_SOLO -> DNO_GZIP 2012-11-30 15:47:22 -06:00
Glenn Randers-Pehrson
3f490d128f [libpng15] Added missing "-" in front of DZ_SOLO in contrib/pngminim/*/makefile 2012-11-30 15:40:40 -06:00
Glenn Randers-Pehrson
12a5993ec5 [libpng15] Bump version to 1.5.14beta02 2012-10-24 11:45:56 -05:00
Glenn Randers-Pehrson
7c699f27fc [libpng15] Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose()
in pngrtran.c (Domani Hannes).
2012-10-24 11:10:49 -05:00
Glenn Randers-Pehrson
33b90debc5 [libpng15] Minor edit of documentation 2012-10-10 14:58:41 -05:00
John Bowler
1badb47dc3 [libpng15] Warn about the incorrect runtime library setting for VS2010
debug DLL builds.
2012-09-29 17:45:19 -05:00
Glenn Randers-Pehrson
f3862ea1be [libpng15] Merge Conflicts: libpng.3 png.h 2012-09-27 18:38:36 -05:00
Glenn Randers-Pehrson
47777cac10 [libpng15] Added -DZ_SOLO to contrib/pngminim/*/makefile so they will
work with zlib-1.2.7
2012-09-27 18:36:33 -05:00
Glenn Randers-Pehrson
e7d41c565b [libpng15] Bump version to 1.5.14beta01 2012-09-27 18:24:06 -05:00
Glenn Randers-Pehrson
753fd3f2cd Merge branch 'libpng15' of ssh://libpng.git.sourceforge.net/gitroot/libpng/libpng into libpng15
Conflicts:
	libpng.3
	png.h
2012-09-27 06:33:43 -05:00
Glenn Randers-Pehrson
25a7dd9956 [libpng15] Bump version to 1.5.13 2012-09-27 06:28:04 -05:00
Glenn Randers-Pehrson
0c577a7f95 [libpng15] Imported from libpng-1.5.13.tar 2012-09-27 06:09:41 -05:00
Glenn Randers-Pehrson
11c1e0d6e2 [libpng15] Imported from libpng-1.5.13rc01.tar 2012-09-17 08:56:34 -05:00
Glenn Randers-Pehrson
6e3b0c2e3a [libpng15] Bump version to 1.5.13beta03 2012-09-10 11:37:13 -05:00
Glenn Randers-Pehrson
95ea04f925 [libpng15] Folded some long lines; updated manual about removed macros 2012-08-16 00:56:45 -05:00
Glenn Randers-Pehrson
cabfa7d6d9 [libpng15] Use png_memset() consistently (pngmem.c contained some bare "memset"
calls).
2012-08-10 16:56:51 -05:00
Glenn Randers-Pehrson
8cc5341ba2 [libpng15] Corrected handling of the image array and the row_pointers array
in example.c
2012-08-08 22:14:51 -05:00
Glenn Randers-Pehrson
0054b566f4 [libpng15] When png_set_filler is used to strip a filler channel during write,
the code prior to 1.5 would ignore the case where the output required an
alpha channel or when the output was a palettized PNG.  In libpng-1.5 the
ignorance was lost and libpng proceeded to strip the channel resulting
in a bad (potential memory overwrite) failure later.  This reverts
the behavior to the pre-1.5 state but issues a warning. libpng-1.6 is
expected to issue an error on the erroneous png_set_filler call.
2012-08-08 22:13:25 -05:00
Glenn Randers-Pehrson
1a2606069c [libpng15] Bump version to 1.5.13beta02 2012-08-08 19:38:31 -05:00
John Bowler
2cbe15a3e2 [libpng15] Revised PNG_FP_EXPORT and PNG_FIXED_EXPORT macros to avoid
generating lone semicolons (patch ported from libpng-1.6.0beta11).
2012-08-08 18:09:38 -05:00
Glenn Randers-Pehrson
4588e97c73 [libpng15] Added information about png_calloc() to the manual. 2012-08-03 08:48:37 -05:00
Glenn Randers-Pehrson
08c3a838a3 [libpng15] Removed references to png_zalloc() and png_zfree() from
the manual.  They have not been exported to applications since libpng12.
2012-08-03 07:11:50 -05:00
Glenn Randers-Pehrson
77c1d30d14 [libpng15] Updated CHANGES to reflect that new CVE-2012-3425 was fixed
in March 2012, libpng-1.5.10
2012-07-27 21:12:34 -05:00
Glenn Randers-Pehrson
ae44b27606 [libpng15] Bump version to 1.5.13beta01 2012-07-25 08:54:39 -05:00
Glenn Randers-Pehrson
7dc03b1f91 [libpng15 Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when
__GNUC__ < 3.
2012-07-14 15:29:40 -05:00
Glenn Randers-Pehrson
3aebf04909 [libpng15] Bump version to 1.5.12 2012-07-10 21:56:11 -05:00
Glenn Randers-Pehrson
795b564635 [libpng15] Imported from libpng-1.5.12.tar 2012-07-10 20:58:37 -05:00
Glenn Randers-Pehrson
860d8f3f85 [libpng15] Fixed version number (libpng-1.5.12beta01) in CHANGES and ANNOUNCE. 2012-06-25 10:39:48 -05:00
Glenn Randers-Pehrson
9ff5d76fb8 [libpng15] Bump version to 1.5.12beta01 2012-06-25 10:25:13 -05:00
Glenn Randers-Pehrson
e088ce7363 [libpng15] Imported from libpng-1.5.11.tar 2012-06-14 06:33:45 -05:00
Glenn Randers-Pehrson
709db87a32 [libpng15] Updated info in the documentation about time_buffer
being removed from a future version of libpng.
2012-06-13 13:18:35 -05:00
Glenn Randers-Pehrson
af569eb682 [libpng15] Removed obsolete reference to "near_time_buffer"
from documentation; corrected comments in png.h and manual about time_buffer.
2012-06-13 12:38:11 -05:00
Glenn Randers-Pehrson
9ecdaa8d6d [libpng15] Corrected copyright year in several files. 2012-06-12 11:34:41 -05:00
Glenn Randers-Pehrson
87685ab33f [libpng15] Include zlib.h in contrib/gregbook and visupng examples. 2012-06-09 11:39:10 -05:00
Glenn Randers-Pehrson
83b354ac01 [libpng15] Fixed grammar and typos in manual and in scripts/pnglibconf.dfa 2012-06-09 10:42:43 -05:00
Glenn Randers-Pehrson
613dd05c55 [libpng15] Bump version to 1.5.11rc06 2012-06-07 10:03:55 -05:00
Glenn Randers-Pehrson
ff355004dd [libpng15] Don't do the palette-index checking when num_palette is 0. 2012-06-07 09:56:30 -05:00
Glenn Randers-Pehrson
6a169bbe76 [libpng15] Bump version to 1.5.11rc05 2012-06-06 13:27:23 -05:00
Glenn Randers-Pehrson
b705271d85 [libpng15] Updated some "Last changed" dates 2012-06-06 13:10:40 -05:00
Glenn Randers-Pehrson
c924d3dd25 [libpng15] Improved the efficiency of the new png_check_palette_indexes()
function.
2012-06-06 13:04:47 -05:00
Glenn Randers-Pehrson
d5d0bd91d2 [libpng15] Bump version to 1.5.11rc04 2012-06-04 08:03:20 -05:00
Glenn Randers-Pehrson
fd53b86e90 [libpng15] Do not depend upon a GCC feature macro being available for use in
generating the linker mapfile symbol prefix.
2012-06-04 03:07:49 -05:00
Glenn Randers-Pehrson
60370be808 [libpng15] Updated contrib/README.txt with two added files. 2012-05-29 10:35:48 -05:00
Glenn Randers-Pehrson
13266edb47 [libpng15] Bump version to 1.5.11rc03 2012-05-29 06:21:19 -05:00
Glenn Randers-Pehrson
d26920d5a8 [libpng15] Added two images to contrib/pngsuite (1-bit and 2-bit transparent
grayscale), and renamed three whose names were inconsistent with those in
pngsuite/README.txt.
2012-05-29 06:13:37 -05:00
Glenn Randers-Pehrson
0e23e2ad9f [libpng15] Revised CMakeLists.txt to not attempt to make a symlink under mingw. 2012-05-29 05:56:49 -05:00
Glenn Randers-Pehrson
e9a249eee7 [libpng15] Bump version to 1.5.11rc02 2012-05-23 12:24:03 -05:00
Glenn Randers-Pehrson
6e36306728 [libpng15] Imported from libpng-1.5.11rc01.tar 2012-05-22 16:03:01 -05:00
Glenn Randers-Pehrson
6e4c75b2c2 [libpng15] Bump version to 1.5.11beta02 2012-04-28 06:24:59 -05:00
Glenn Randers-Pehrson
6fb8433ecc [libpng15] Imported from libpng-1.5.11beta01.tar 2012-04-28 06:24:51 -05:00
Glenn Randers-Pehrson
2f5fc20ee7 [libpng15] Changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE
in scripts/makefile.freebsd.
2012-04-27 18:16:39 -05:00
Glenn Randers-Pehrson
49607cf603 [libpng15] Moved -lssp_nonshared to a comment in scripts/makefile.freebsd 2012-04-26 09:08:22 -05:00
Glenn Randers-Pehrson
0fd067dd93 [libpng15] Added -lssp_nonshared to scripts/makefile.freebsd 2012-04-26 08:30:27 -05:00
Glenn Randers-Pehrson
8a3b400826 [libpng15] Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
declaration of png_handle_unknown().
2012-04-23 23:04:32 -05:00
Glenn Randers-Pehrson
c1269a3975 [libpng15] Fixed problem with PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpread.c 2012-04-23 19:52:59 -05:00
Glenn Randers-Pehrson
9bb65df0be [libpng16] Revised makefile.darwin (Toby Thain) 2012-04-13 12:40:27 -05:00
Glenn Randers-Pehrson
8b8e9bfb29 [libpng15] Enable png_set_check_for_invalid_index() for both read and write. 2012-04-13 12:00:45 -05:00
Glenn Randers-Pehrson
b57e9b747f [libpng15] Bump version to 1.5.11beta01 2012-04-12 10:33:00 -05:00
Glenn Randers-Pehrson
38a706f83f [libpng15] Imported from libpng-1.5.10.tar 2012-03-29 06:33:41 -05:00
Glenn Randers-Pehrson
6aad6041aa [libpng15] Imported from libpng-1.5.10rc01.tar 2012-03-19 06:28:10 -05:00
Glenn Randers-Pehrson
2c78d4f676 [libpng15] Revised example.c to put text strings in a temporary character array
instead of directly assigning string constants to png_textp members.
This avoids compiler warnings when -Wwrite-strings is enabled.
2012-03-16 08:49:07 -05:00
Glenn Randers-Pehrson
d4247dd398 [libpng15] Fix an off-by-one error in the palette index checking function. 2012-03-10 20:14:23 -06:00
Glenn Randers-Pehrson
1ca16d92f2 [libng15] Issue a png_benign_error() instead of png_warning() about bad palette
index.
2012-03-10 08:14:49 -06:00
Glenn Randers-Pehrson
0ff5150f91 [libpng15] Reject all iCCP chunks after the first,
even if the first one is invalid.
2012-03-09 22:38:06 -06:00
Glenn Randers-Pehrson
fc9127370c [libpng15] Bump version to 1.5.10beta05 2012-03-09 21:36:02 -06:00
Glenn Randers-Pehrson
adc8042fca [libpng15] Imported from libpng-1.5.10beta04.tar 2012-03-09 21:35:10 -06:00
John Bowler
c4c21f1c87 [libpng15] Fixed CMF optimization of non-IDAT compressed chunks,
which was added at libpng-1.5.4.  It sometimes produced too small of a window.
2012-03-09 21:16:51 -06:00
Glenn Randers-Pehrson
0b8b358b98 [libpng15] Disabled part of the CMF optimization of non-IDAT compressed
chunks, which was added at libpng-1.5.4.  It sometimes produces too small
of a window.  This has been fixed in libpng-1.6.0.
2012-03-09 17:29:31 -06:00
Glenn Randers-Pehrson
8f7fc403e5 [libpng15] Bump version to 1.5.10beta04 2012-03-06 16:02:46 -06:00
Glenn Randers-Pehrson
16dba768df [libpng16] Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition in png.h 2012-03-06 16:00:38 -06:00
Glenn Randers-Pehrson
0054bee2a6 [libpng15] Imported from libpng-1.5.10beta03.tar 2012-03-06 07:54:40 -06:00
Glenn Randers-Pehrson
454e05a63a [libpng15] Added palette-index checking. 2012-03-04 22:30:06 -06:00
Glenn Randers-Pehrson
caae038b69 [libpng15] Removed unused "current_text" members of png_struct
and the png_free() of png_ptr->current_text from pngread.c
2012-02-27 08:07:55 -06:00
Glenn Randers-Pehrson
c11a25973c [libpng15] Bump version to 1.5.10beta03 2012-02-26 21:51:30 -06:00
Glenn Randers-Pehrson
b40411882a [libpng15] Imported from libpng-1.5.10beta02.tar 2012-02-26 21:51:19 -06:00
Glenn Randers-Pehrson
755c39725e [libpng15] Updated Makefile.am
Added information about the new limits in the manual.
2012-02-24 22:13:51 -06:00
Glenn Randers-Pehrson
d9c4484b3e [libpng15] Bump version to 1.5.10beta02 2012-02-24 17:02:39 -06:00
Glenn Randers-Pehrson
b7b42de05f [libpng15] Bump version to 1.5.10beta01 2012-02-24 16:56:30 -06:00
Glenn Randers-Pehrson
65de519c4a [libpng15] Revised the SAFE_LIMITS feature to be the same as the feature in
libpng16.  Added information about the new limits in the manual.
2012-02-24 16:54:12 -06:00
Glenn Randers-Pehrson
b27c862b14 [libpng15] Added information about the new limits in the manual. 2012-02-23 23:35:29 -06:00
Glenn Randers-Pehrson
f97ed91ead [libpng15] Always set the "safe" limits in pngconf.h when SAFE_LIMITS is
even if pnglibconf.h has been edited to remove the limits.
2012-02-23 23:06:07 -06:00
Glenn Randers-Pehrson
97b6ad1c06 [libpng15] Bump version to 1.5.10beta02 2012-02-23 22:53:17 -06:00
Glenn Randers-Pehrson
7746299fbe [libpng15] Imported from libpng-1.5.10beta01.tar 2012-02-23 22:45:49 -06:00
Glenn Randers-Pehrson
8d69281998 [libpng15] Updated scripts/pnglibconf.dfa to enable USER_LIMITS when
SAFE_LIMITS is turned on.
2012-02-23 22:44:06 -06:00
Glenn Randers-Pehrson
4d3d2d9472 [libpng15] Updated scripts/pnglibconf.h.prebuilt 2012-02-23 18:53:38 -06:00
Glenn Randers-Pehrson
8ae616fa97 [libpng15] Added PNG_SAFE_LIMITS feature to pnglibconf.dfa
and code in pngconf.h to reset the user limits to safe ones if
PNG_SAFE_LIMITS is defined.
2012-02-23 17:43:33 -06:00
539 changed files with 36473 additions and 84404 deletions

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -1,9 +0,0 @@
{
"Disable": {
"IndentSize": true
},
"Exclude": [
".git/",
"out/"
]
}

View File

@ -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
View File

@ -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

View File

@ -1,7 +0,0 @@
extends: default
rules:
document-start: disable
document-end: disable
line-length: disable
truthy:
check-keys: false

View File

@ -1,53 +1,46 @@
libpng 1.6.51.git
=================
This is a development version, not intended to be a public release.
It will be replaced by a public release, or by another development
version, at a later time.
Libpng 1.5.29 - August 24, 2017
This is a public release of libpng, intended for use in production codes.
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
libpng-1.5.29.tar.xz (LZMA-compressed, recommended)
libpng-1.5.29.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):
* 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)
lpng1529.7z (LZMA-compressed, recommended)
lpng1529.zip
Other information:
* README.md
* LICENSE.md
* AUTHORS.md
* TRADEMARK.md
libpng-1.5.29-README.txt
libpng-1.5.29-LICENSE.txt
libpng-1.5.29-*.asc (armored detached GPG signatures)
Changes since the last public release (1.5.28):
Suppress clang warnings about implicit sign changes in png.c
Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer).
Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
makefile.linux and makefile.solaris-x86 (Cosmin).
Silence clang -Wcomma warnings (Viktor Szakats).
Update Sourceforge URLs in documentation (https instead of http).
Moved chunk-name and chunk-length checks into PNG_EXTERN private
png_check_chunk_name() and png_check_chunk_length() functions
(Suggested by Max Stepin).
Merged pngtest.c with libpng-1.6.32.
Check for 0 return from png_get_rowbytes() in contrib/pngminus/*.c to stop
some Coverity issues (162705, 162706, and 162707).
Changes from version 1.6.49 to version 1.6.50
---------------------------------------------
* Improved the detection of the RVV Extension on the RISC-V platform.
(Contributed by Filip Wasil)
* Replaced inline ASM with C intrinsics in the RVV code.
(Contributed by Filip Wasil)
* Fixed a decoder defect in which unknown chunks trailing IDAT, set
to go through the unknown chunk handler, incorrectly triggered
out-of-place IEND errors.
(Contributed by John Bowler)
* Fixed the CMake file for cross-platform builds that require `libm`.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe.
to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P

66
AUTHORS
View File

@ -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.

2502
CHANGES

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

173
INSTALL
View File

@ -1,3 +1,4 @@
Installing libpng
Contents
@ -12,14 +13,13 @@ Contents
VIII. Configuring libpng for 16-bit platforms
IX. Configuring for DOS
X. Configuring for Medium Model
XI. Prepending a prefix to exported symbols
XI. Omitted
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
XIV. Changes to the build and configuration of libpng in libpng-1.5.x
XV. Setjmp/longjmp issues
XVI. Common linking failures
XVII. Other sources of information about libpng
I. Simple installation
@ -78,8 +78,8 @@ Or you can use one of the "projects" in the "projects" directory.
Before installing libpng, you must first install zlib, if it
is not already on your system. zlib can usually be found
wherever you got libpng; otherwise go to https://zlib.net/. You can
place zlib in the same directory as libpng or in another directory.
wherever you got libpng; otherwise go to http://zlib.net. You can place
zlib in the same directory as libpng or in another directory.
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
@ -127,18 +127,16 @@ Your directory structure should look like this:
README
*.h, *.c => libpng source files
CMakeLists.txt => "cmake" script
ci
ci_*.sh
configuration files:
configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
contrib
arm-neon, conftest, examples, gregbook, libtests, pngminim,
pngminus, pngsuite, tools, visupng, riscv-rvv
gregbook, libtests, pngminim, pngminus, pngsuite, tools,
visupng
projects
owatcom, visualc71, vstudio
cbuilder5, owatcom, visualc71, vstudio, xcode
scripts
makefile.*
*.def (module definition files)
@ -146,7 +144,7 @@ Your directory structure should look like this:
pngtest.png
etc.
zlib
README, *.h, *.c, contrib, etc.
README, *.h, *.c contrib, etc.
If the line endings in the files look funny, you may wish to get the other
distribution of libpng. It is available in both tar.gz (UNIX style line
@ -154,27 +152,28 @@ endings) and zip (DOS style line endings) formats.
VI. Building with project files
If you are building libpng with Microsoft Visual Studio, you can enter
the directory projects\visualc71 or projects\vstudio and follow the
instructions in README.txt.
If you are building libpng with MSVC, you can enter the
libpng projects\visualc71 or vstudio directory and follow the instructions
in README.txt.
Otherwise, enter the zlib directory and follow the instructions in
zlib/README, then come back here and run "configure" or choose the
appropriate makefile 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.sys in the scripts directory.
VII. Building with makefiles
Copy the file (or files) that you need from the
scripts directory into this directory, for example
MSDOS example:
copy scripts\makefile.msc makefile
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
UNIX example:
cp scripts/makefile.std Makefile
make
Windows example:
nmake -f scripts\makefile.vcwin32
cp scripts/makefile.std makefile
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
Read the makefile to see if you need to change any source or
target directories to match your preferences.
@ -191,44 +190,38 @@ test. For more confidence, you can run another test by typing
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
your output with the result shown in contrib/pngsuite/README.
Most of the makefiles used to allow you to run "make install" to put
the library in its final resting place, but that feature is no longer
supported. The only tested and supported manners to install libpng are
the conventional build and install procedures driven by the configure
script or by the CMake file.
Most of the makefiles will allow you to run "make install" to
put the library in its final resting place (if you want to
do that, run "make install" in the zlib directory first if necessary).
Some also allow you to run "make test-installed" after you have
run "make install".
VIII. Configuring for DOS and other 16-bit platforms
VIII. Configuring libpng for 16-bit platforms
Officially, the support for 16-bit platforms has been removed.
You will want to look into zconf.h to tell zlib (and thus libpng) that
it cannot allocate more than 64K at a time. Even if you can, the memory
won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K.
IX. Configuring for DOS
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.
X. Configuring for Medium Model
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.
Libpng's support for medium model has been tested on most of the popular
compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets
defined, and FAR gets defined to far in pngconf.h, and you should be
all set. Everything in the library (except for zlib's structure) is
expecting far data. You must use the typedefs with the p or pp on
the end for pointers (or at least look at them and be careful). Make
note that the rows of data are defined as png_bytepp, which is
an "unsigned char far * far *".
IX. Prepending a prefix to exported symbols
XI. Omitted
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:
XII. 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.
@ -240,7 +233,7 @@ As of libpng-1.5.0, pngpriv.h also includes three other private header
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
that previously appeared in the public headers.
XI. Removing unwanted object code
XIII. 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
@ -279,61 +272,7 @@ 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
XIV. 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
@ -424,7 +363,7 @@ $PREFIX/include directory). Do not edit pnglibconf.h after you have built
libpng, because than the settings would not accurately reflect the settings
that were used to build libpng.
XIV. Setjmp/longjmp issues
XV. 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
@ -437,12 +376,7 @@ configure libpng with PNG_NO_SETJMP in your pngusr.dfa file, with
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
XVI. Common linking failures
If your application fails to find libpng or zlib entries while linking:
@ -454,13 +388,12 @@ If your application fails to find libpng or zlib entries while linking:
If you are using the vstudio project, observe the WARNING in
project/vstudio/README.txt.
XVI. Other sources of information about libpng:
XVII. Other sources of information about libpng:
Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5.
Copyright (c) 2022 Cosmin Truta
Copyright (c) 1998-2002,2006-2016 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer

173
LICENSE
View File

@ -1,82 +1,49 @@
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 (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.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
The software is supplied "as is", without warranty of any kind,
express or implied, including, without limitation, the warranties
of merchantability, fitness for a particular purpose, title, and
non-infringement. In no event shall the Copyright owners, or
anyone distributing the software, be liable for any damages or
other liability, whether in contract, tort or otherwise, arising
from, out of, or in connection with the software, or the use or
other dealings in the software, even if advised of the possibility
of such damage.
If you modify libpng you may insert additional notices immediately following
this sentence.
Permission is hereby granted to use, copy, modify, and distribute
this software, or portions hereof, for any purpose, without fee,
subject to the following restrictions:
This code is released under the libpng license.
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you
use this software in a product, an acknowledgment in the product
documentation would be appreciated, but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
-----------------------------------------------------------------------
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
libpng versions 1.0.7, July 1, 2000 through 1.5.29, August 24, 2017 are
Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Mans Rullgard
Cosmin Truta
Gilles Vollant
James Yu
Mandar Sahastrabuddhe
Google Inc.
Vadim Barkov
Simon-Pierre Cadieux
Eric S. Raymond
Mans Rullgard
Cosmin Truta
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of
the library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is
with the user.
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
Some files in the "contrib" directory and some configure-generated
files that are distributed with libpng have other copyright owners, and
files that are distributed with libpng have other copyright owners and
are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and
license as libpng-0.96, with the following individuals added to the
list of Contributing Authors:
license as libpng-0.96, with the following individuals added to the list
of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
@ -84,14 +51,14 @@ and are distributed according to the same disclaimer and license as
libpng-0.88, with the following individuals added to the list of
Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
Some files in the "scripts" directory have other copyright owners,
Some files in the "scripts" directory have other copyright owners
but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are
@ -100,35 +67,63 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing
Authors and Group 42, Inc. disclaim all warranties, expressed or
implied, including, without limitation, the warranties of
merchantability and of fitness for any purpose. The Contributing
Authors and Group 42, Inc. assume no liability for direct, indirect,
incidental, special, exemplary, or consequential damages, which may
result from the use of the PNG Reference Library, even if advised of
the possibility of such damage.
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit,
without fee, and encourage the use of this source code as a component
to supporting the PNG file format in commercial products. If you use
this source code in a product, acknowledgment is not required but would
be appreciated.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
TRADEMARK:
The name "libpng" has not been registered by the Copyright owner
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owner claims "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
OSI CERTIFICATION:
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7.
EXPORT CONTROL:
The Copyright owner believes that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because
it is open source, publicly available software, that does not contain
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
734.7(b).
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
August 24, 2017

View File

@ -1,94 +1,28 @@
# 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@
ACLOCAL_AMFLAGS = -I scripts/autoconf
# libpng does not follow GNU file name conventions
# "color-tests" requires automake 1.11.1 or later. Enable it if you like,
# to get red "FAIL" and green "PASS" notations during tests.
# AUTOMAKE_OPTIONS = foreign color-tests
AUTOMAKE_OPTIONS = foreign
# test programs - run on make check, make distcheck
if ENABLE_TESTS
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
TESTS_ENVIRONMENT= srcdir=$(srcdir)
check_PROGRAMS= pngtest
pngtest_SOURCES = pngtest.c
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
TESTS = test-pngtest.sh
# Only do the following if the contrib directory is present.
check_PROGRAMS+= pngvalid
pngvalid_SOURCES = contrib/libtests/pngvalid.c
pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngstest_SOURCES = contrib/libtests/pngstest.c
pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngunknown_SOURCES = contrib/libtests/pngunknown.c
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
# set of parameters:
if ENABLE_TESTS
TESTS =\
tests/pngtest-all\
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
tests/pngvalid-gamma-expand16-background\
tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
tests/pngvalid-progressive-size\
tests/pngvalid-progressive-interlace-standard\
tests/pngvalid-transform\
tests/pngvalid-progressive-standard tests/pngvalid-standard\
tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\
tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\
tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
tests/pngimage-quick tests/pngimage-full
endif
TESTS += test-pngvalid-simple.sh test-pngvalid-full.sh
# man pages
dist_man_MANS= libpng.3 libpngpf.3 png.5
@ -108,50 +42,13 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
if PNG_ARM_NEON
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
arm/filter_neon_intrinsics.c \
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
arm/filter_neon.S
endif
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
-version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
@ -170,14 +67,6 @@ else
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
endif
if PNG_RISCV_RVV
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la
endif
if PNG_LOONGARCH_LSX
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
endif
#distribute headers in /usr/include/libpng/*
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
pkginclude_HEADERS= png.h pngconf.h
@ -188,33 +77,26 @@ nodist_pkginclude_HEADERS= pnglibconf.h
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
# Extra source distribution files, '${srcdir}' is used below to stop build files
# from those directories being included. This only works if the configure is
# not done in the source directory!
#extra source distribution files.
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 \
${srcdir}/ci ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
$(TESTS) \
CMakeLists.txt example.c libpng-manual.txt
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk
CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
CLEANFILES= dfn.c dfn?.out *.out.? scripts/*.out.? pngout.png \
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
check.new pnglibconf.h pngprefix.h symbols.new pngtest-log.txt \
pnglibconf.out pnglibconf.c pnglibconf.pre pnglibconf.dfn \
check.new pnglibconf.h symbols.new pngtest-log.txt \
pnglibconf.c pnglibconf.out pnglibconf.pre \
$(SCRIPT_CLEANFILES)
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
config.sub configure depcomp install-sh ltmain.sh missing
# PNG_COPTS give extra options for the C compiler to be used on all compilation
# steps (unless target_CFLAGS is specified; that will take precedence over
# AM_CFLAGS)
PNG_COPTS = @PNG_COPTS@
AM_CFLAGS = ${PNG_COPTS}
# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
# other operating systems (NeXT?) the C preprocessor selected by configure
# checks input tokens for validity - effectively it performs part of the ANSI-C
@ -231,9 +113,7 @@ $(PNGLIB_BASENAME)-config: libpng-config
cp libpng-config $@
scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
scripts/prefix.out: png.h pngconf.h pnglibconf.out
scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
scripts/intprefix.out: pnglibconf.h
libpng.sym: scripts/sym.out
rm -f $@
@ -241,60 +121,19 @@ libpng.sym: scripts/sym.out
libpng.vers: scripts/vers.out
rm -f $@
cp $? $@
if DO_PNG_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
# implementation of the macro).
pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
rm -f $@
$(AWK) 's==0 && NR>1{print prev}\
s==0{prev=$$0}\
s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\
s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\
END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\
s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8
mv pnglibconf.tf8 $@
pngprefix.h: scripts/intprefix.out
rm -f pngprefix.tf1
$(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
mv pngprefix.tf1 $@
else
pnglibconf.h: pnglibconf.out
rm -f $@
cp $? $@
pngprefix.h: # is empty
:>$@
endif
$(srcdir)/scripts/pnglibconf.h.prebuilt:
@echo "Attempting to build $@" >&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 "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2
@echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2
@exit 1
# 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
# 'make test' is the first thing the user does.) Only files which include
# one of the png source files (typically png.h or pngpriv.h) need to be listed
# 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/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
# 'make test' is the first thing the user does.)
contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
# 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
@ -304,10 +143,6 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
-DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
-DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
if DO_PNG_PREFIX
SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
endif
.c.out:
rm -f $@ $*.tf[12]
test -d scripts || mkdir scripts || test -d scripts
@ -316,42 +151,40 @@ endif
$(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
rm -f $*.tf1
mv $*.tf2 $@
# The .c file for pnglibconf.h is machine generated
pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
rm -f $@ $*.tf[45]
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
rm -f $@ pnglibconf.pre $@.?
$(AWK) -f ${srcdir}/scripts/options.awk out="pnglibconf.pre"\
version=search ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
rm $*.tf4
mv $*.tf5 $@
$(AWK) -f ${srcdir}/scripts/options.awk out="$@.1" pnglibconf.pre 1>&2
mv $@.1 $@
# Symbol checks (.def and .out files should match)
scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
.out.chk:
rm -f $@ $*.new
rm -f $@ symbols.new
$(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
of="$*.new" $< >&2
mv $*.new $@
$< >&2
mv symbols.new $@
# used on demand to regenerate the standard header, CPPFLAGS should
# be empty - no non-standard defines
scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
rm -f $@ pnglibconf.tf[67]
rm -f $@ dfn?.out
test -z "$(CPPFLAGS)"
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
logunsupported=1 version=search ${srcdir}/pngconf.h -\
${srcdir}/scripts/pnglibconf.dfa 1>&2
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\
pnglibconf.tf6 1>&2
rm pnglibconf.tf6
mv pnglibconf.tf7 $@
$(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out logunsupported=1\
version=search ${srcdir}/pngconf.h -\
${srcdir}/scripts/pnglibconf.dfa 1>&2
$(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2
rm dfn1.out
mv dfn2.out $@
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h
test: check-am

File diff suppressed because it is too large Load Diff

341
README
View File

@ -1,88 +1,56 @@
README for libpng version 1.6.51.git
====================================
README for libpng version 1.5.29 - August 24, 2017 (shared library 15.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`
or `libpng-*.tar.xz` if you want UNIX-style line endings in the text
files, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
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`.
Version 0.89 was the first official release of libpng. Don't let the
fact that it's the first release fool you. The libpng library has been in
extensive use and testing since mid-1995. By late 1997 it had
finally gotten to the stage where there hadn't been significant
changes to the API in some time, and people have a bad feeling about
libraries with versions < 1.0. Version 1.0.0 was released in
March 1998.
You should use zlib 1.0.4 or later to run this, but it _may_ work with
versions as old as zlib 0.95. Even so, there are bugs in older zlib
versions which can cause the output of invalid compression streams for
some images.
You should also note that zlib is a compression library that is useful
for more things than just PNG files. You can use zlib as a drop-in
replacement for `fread()` and `fwrite()`, if you are so inclined.
zlib should be available at the same place that libpng is, or at
https://zlib.net .
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/pngdocs.html .
This code is currently being archived at https://libpng.sourceforge.io
in the download area, and at http://libpng.download/src .
This release, based in a large way on Glenn's, Guy's and Andreas'
earlier work, was created and will be supported by myself and the PNG
development group.
Send comments, corrections and commendations to `png-mng-implement`
at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe.)
Send general questions about the PNG specification to `png-mng-misc`
at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
to subscribe.)
Historical notes
----------------
The libpng library has been in extensive use and testing since mid-1995.
Version 0.89, published a year later, was the first official release.
By late 1997, it had finally gotten to the stage where there hadn't
been significant changes to the API in some time, and people have a bad
feeling about libraries with versions below 1.0. Version 1.0.0 was
released in March 1998.
Note that some of the changes to the `png_info` structure render this
****
Note that some of the changes to the png_info structure render this
version of the library binary incompatible with libpng-0.89 or
earlier versions if you are using a shared library. The type of the
`filler` parameter for `png_set_filler()` has changed from `png_byte`
to `png_uint_32`, which will affect shared-library applications that
use this function.
"filler" parameter for png_set_filler() has changed from png_byte to
png_uint_32, which will affect shared-library applications that use
this function.
To avoid problems with changes to the internals of the `info_struct`,
To avoid problems with changes to the internals of the png info_struct,
new APIs have been made available in 0.95 to avoid direct application
access to `info_ptr`. These functions are the `png_set_<chunk>` and
`png_get_<chunk>` functions. These functions should be used when
accessing/storing the `info_struct` data, rather than manipulating it
access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when
accessing/storing the info_struct data, rather than manipulating it
directly, to avoid such problems in the future.
It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
be a transitional release, members of the `png_struct` and the
`info_struct` can still be accessed, but the compiler will issue a
be a transitional release, members of the png_struct and the
info_struct can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
reside in private `pngstruct.h` and `pnginfo.h` header files that are
not accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in `example.c` and `pngtest.c`),
and older programs be converted to the new format, to facilitate
upgrades in the future.
reside in private pngstruct.h and pnginfo.h header files that are not
accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in example.c and pngtest.c), and
older programs be converted to the new format, to facilitate upgrades
in the future.
****
Additions since 0.90 include the ability to compile libpng as a
Windows DLL, and new APIs for accessing data in the info struct.
Experimental functions include the ability to set weighting and cost
factors for row filter selection, direct reads of integers from buffers
on big-endian processors that support misaligned data access, faster
methods of doing alpha composition, and more accurate 16->8 bit color
conversion.
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
@ -92,93 +60,154 @@ the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk.
The additions since 0.90 include the ability to compile libpng as a
Windows DLL, and new APIs for accessing data in the `info_struct`.
Experimental functions included the ability to set weighting and cost
factors for row filter selection, direct reads of integers from buffers
on big-endian processors that support misaligned data access, faster
methods of doing alpha composition, and more accurate 16-to-8 bit color
conversion. Some of these experimental functions, such as the weighted
filter heuristics, have since been removed.
The changes made to the library, and bugs fixed are based on discussions
on the PNG-implement mailing list and not on material submitted
privately to Guy, Andreas, or Glenn. They will forward any good
suggestions to the list.
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
ANNOUNCE => Announcement of this version, with recent changes
AUTHORS => List of contributing authors
CHANGES => Description of changes between libpng versions
INSTALL => Instructions to install libpng
LICENSE => License to use and redistribute libpng
README => This file
TODO => Things not implemented in the current library
TRADEMARK => Trademark information
example.c => Example code for using libpng functions
libpng.3 => Manual page for libpng (includes libpng-manual.txt)
libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => Manual page for libpng's private functions (deprecated)
png.5 => Manual page for the PNG format
png.c => Basic interface functions common to library
png.h => Library function and interface declarations (public)
pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
pngbar.png => PNG logo, 88x31
pngnow.png => PNG logo, 98x31
pngpread.c => Progressive reading functions
pngread.c => Read data/helper high-level functions
pngrio.c => Lowest-level data read I/O functions
pngrtran.c => Read data transformation functions
pngrutil.c => Read data utility functions
pngset.c => Functions for storing data into the info_struct
pngtest.c => Library test program
pngtest.png => Library test sample image
pngtrans.c => Common data transformation functions
pngwio.c => Lowest-level write I/O functions
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm/ => Optimized code for ARM Neon
intel/ => Optimized code for INTEL SSE2
loongarch/ => Optimized code for LoongArch LSX
mips/ => Optimized code for MIPS MSA and MIPS MMI
powerpc/ => Optimized code for PowerPC VSX
riscv/ => Optimized code for the RISC-V platform
ci/ => Scripts for continuous integration
contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform
mips-msa/ => Optimized code for the MIPS-MSA platform
powerpc-vsx/ => Optimized code for the POWERPC-VSX platform
examples/ => Examples of libpng usage
gregbook/ => Source code for PNG reading and writing, from
"PNG: The Definitive Guide" by Greg Roelofs,
O'Reilly, 1999
libtests/ => Test programs
pngexif/ => Program to inspect the EXIF information in PNG files
pngminim/ => Minimal decoder, encoder, and progressive decoder
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images
riscv-rvv/ => Optimized code for the RISC-V Vector platform
testpngs/ => Test images
tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images
projects/ => Project files and workspaces for various IDEs
owatcom/ => OpenWatcom project
visualc71/ => Microsoft Visual C++ 7.1 workspace
vstudio/ => Microsoft Visual Studio workspace
scripts/ => Scripts and makefiles for building libpng
(see scripts/README.txt for the complete list)
tests/ => Test scripts
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.
Good luck, and happy coding!
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.
* Cosmin Truta (current maintainer, since 2018)
* Glenn Randers-Pehrson (former maintainer, 1998-2018)
* Andreas Eric Dilger (former maintainer, 1996-1997)
* Guy Eric Schalnat (original author and former maintainer, 1995-1996)
(formerly of Group 42, Inc.)
zlib should be available at the same place that libpng is, or at zlib.net.
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/pngdocs.html .
This code is currently being archived at libpng.sourceforge.io in the
[DOWNLOAD] area, and at ftp://ftp-osl.osuosl.org/pub/libpng/src . If you
can't find it in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because it
is open source, publicly available software, that does not contain any
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
If you have any code changes, requests, problems, etc., please e-mail
them to me. Also, I'd appreciate any make files or project files,
and any modifications you needed to make to get libpng to compile,
along with a #define variable to tell what compiler/system you are on.
If you needed to add transformations to libpng, or wish libpng would
provide the image in a different way, drop me a note (and code, if
possible), so I can consider supporting the transformation.
Finally, if you get any warning messages when compiling libpng
(note: not zlib), and they are easy to fix, I'd appreciate the
fix. Please mention "libpng" somewhere in the subject line. Thanks.
This release was created and will be supported by myself (of course
based in a large way on Guy's and Andreas' earlier work), and the PNG
development group.
Send comments/corrections/commendations to png-mng-implement at
lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe) or to glennrp at users.sourceforge.net
You can't reach Guy, the original libpng author, at the addresses
given in previous versions of this document. He and Andreas will
read mail addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to
png-mng-misc at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
subscribe). If you have a question about something
in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng,
and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for twenty years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
Files in this distribution:
ANNOUNCE => Announcement of this version, with recent changes
CHANGES => Description of changes between libpng versions
KNOWNBUG => List of known bugs and deficiencies
LICENSE => License to use and redistribute libpng
README => This file
TODO => Things not implemented in the current library
Y2KINFO => Statement of Y2K compliance
example.c => Example code for using libpng functions
libpng.3 => manual page for libpng (includes libpng-manual.txt)
libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => manual page for libpng's private functions
png.5 => manual page for the PNG format
png.c => Basic interface functions common to library
png.h => Library function and interface declarations (public)
pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
pngbar.png => PNG logo, 88x31
pngnow.png => PNG logo, 98x31
pngpread.c => Progressive reading functions
pngread.c => Read data/helper high-level functions
pngrio.c => Lowest-level data read I/O functions
pngrtran.c => Read data transformation functions
pngrutil.c => Read data utility functions
pngset.c => Functions for storing data into the info_struct
pngtest.c => Library test program
pngtest.png => Library test sample image
pngtrans.c => Common data transformation functions
pngwio.c => Lowest-level write I/O functions
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm => Contains optimized code for the ARM platform
contrib => Contributions
gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999
libtests => Test programs
pngminim => Minimal decoder, encoder, and progressive decoder
programs demonstrating use of pngusr.dfa
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for
building a DLL
owatcom => Contains a WATCOM project for building libpng
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
vstudio => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng:
(see scripts/README.txt for the list of scripts)
Good luck, and happy coding.
-Glenn Randers-Pehrson (current maintainer, since 1998)
Internet: glennrp at users.sourceforge.net
-Andreas Eric Dilger (former maintainer, 1996-1997)
Internet: adilger at enel.ucalgary.ca
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
(formerly of Group 42, Inc)
Internet: gschal at infinet.com

47
TODO
View File

@ -1,22 +1,27 @@
TODO list for libpng
--------------------
/*
TODO - list of things to do for libpng:
* Fix all defects (duh!)
* cHRM transformation.
* Palette creation.
* "grayscale->palette" transformation and "palette->grayscale" detection.
* Improved dithering.
* Multi-lingual error and warning message support.
* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
* Man pages for function calls.
* Better documentation.
* Better filter selection
(e.g., counting huffman bits/precompression; filter inertia; filter costs).
* Histogram creation.
* Text conversion between different code pages (e.g., Latin-1 to Mac).
* Avoid building gamma tables whenever possible.
* Greater precision in changing to linear gamma for compositing against
background, and in doing rgb-to-gray transformations.
* Investigate pre-incremented loop counters and other loop constructions.
* Interpolated method of handling interlacing.
* More validations for libpng transformations.
Final bug fixes.
Better C++ wrapper/full C++ implementation?
Fix problem with C++ and EXTERN "C".
cHRM transformation.
Remove setjmp/longjmp usage in favor of returning error codes.
Palette creation.
Add "grayscale->palette" transformation and "palette->grayscale" detection.
Improved dithering.
Multi-lingual error and warning message support.
Complete sRGB transformation (presently it simply uses gamma=0.45455).
Man pages for function calls.
Better documentation.
Better filter selection
(counting huffman bits/precompression? filter inertia? filter costs?).
Histogram creation.
Text conversion between different code pages (Latin-1 -> Mac and DOS).
Avoid building gamma tables whenever possible.
Use greater precision when changing to linear gamma for compositing against
background and doing rgb-to-gray transformation.
Investigate pre-incremented loop counters and other loop constructions.
Add interpolated method of handling interlacing.
Extend pngvalid.c to validate more of the libpng transformations.
*/

View File

@ -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.

9639
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,59 +1,154 @@
/* arm_init.c - NEON optimised filter functions
*
* Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Copyright (c) 2013 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
* Last changed in libpng 1.6.8 [December 19, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* This module requires POSIX 1003.1 functions. */
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_OPT > 0
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* 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
* a fragment of C source code which defines the png_have_neon function. There
* 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.
*/
#include <signal.h> /* for sig_atomic_t */
#ifndef PNG_ARM_NEON_FILE
# if defined(__aarch64__) || defined(_M_ARM64)
/* ARM Neon is expected to be unconditionally available on ARM64. */
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
/* ARM Neon is expected to be available on the target CPU architecture. */
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
# elif defined(__linux__)
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# else
# error No support for run-time ARM Neon checking; use compile-time options
# endif
#endif
#ifdef __ANDROID__
/* Linux provides access to information about CPU capabilites via
* /proc/self/auxv, however Android blocks this while still claiming to be
* Linux. The Andoid NDK, however, provides appropriate support.
*
* Documentation: http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
*/
#include <cpu-features.h>
static int png_have_neon(png_structp png_ptr);
#ifdef PNG_ARM_NEON_FILE
# include PNG_ARM_NEON_FILE
#endif
static int
png_have_neon(png_structp png_ptr)
{
/* 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!)
*/
PNG_UNUSED(png_ptr)
return android_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 */
#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
void
@ -69,7 +164,6 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
* 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)
{
@ -135,4 +229,4 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
}
}
#endif /* PNG_ARM_NEON_OPT > 0 */
#endif /* READ */
#endif /* PNG_READ_SUPPORTED */

View File

@ -1,60 +1,235 @@
/* filter_neon.S - placeholder file
/* filter_neon.S - NEON optimised filter functions
*
* Copyright (c) 2024 Cosmin Truta
* Copyright (c) 2013 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
* Last changed in libpng 1.5.17 [June 27, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* IMPORTANT NOTE:
*
* Historically, the hand-coded assembler implementation of Neon optimizations
* in this module had not been in sync with the intrinsics-based implementation
* in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since
* the introduction of riffled palette optimizations. Moreover, the assembler
* code used to work on 32-bit ARM only, and it caused problems, even if empty,
* on 64-bit ARM.
*
* All references to this module from our internal build scripts and projects
* have been removed.
*
* For the external projects that might still expect this module to be present,
* we leave this stub in place, for the remaining lifetime of libpng-1.6.x.
* Everything should continue to function normally, as long as there are no
* deliberate attempts to use the old hand-made assembler code. A build error
* will be raised otherwise.
*/
/* This is required to get the symbol renames, which are #defines, and the
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
/* This is required to get the symbol renames, which are #defines, and also
* includes the definition (or not) of PNG_ARM_NEON_OPT.
*/
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
#endif
#if PNG_ARM_NEON_OPT > 0
#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)
#ifdef __ELF__
# define ELF
#else
#define GNUC_VERSION 0 /* not gcc */
# define ELF @
#endif
#if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300)
#error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0"
#elif GNUC_VERSION == 40504
#error "PNG_ARM_NEON is not supported with gcc version 4.5.4"
#else
#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support"
#endif
.arch armv7-a
.fpu neon
.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 /* PNG_ARM_NEON_OPT > 0 */
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
#endif /* READ */

View File

@ -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 */

View File

@ -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 */

View File

@ -1,226 +1,34 @@
#! /bin/sh
# a quick hack script to generate necessary files from
# auto* tools.
#
# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
# control files.
#
# The first time this is run on a GIT checkout the only files that exist are
# configure.ac and Makefile.am; all of the autotools support scripts are
# missing. They are instantiated with autoreconf --force --install.
#
# For regular ("tarball") distributions all the files should exist. We do not
# want them to be updated *under any circumstances*. It should never be
# necessary to run autogen.sh because ./configure --enable-maintainer-mode says
# what to do if Makefile.am or configure.ac are changed.
#
# 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
# whether it is ok or required.
#
# 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
# 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
# is deliberate; UTSL.
#
clean=
maintainer=
while test $# -gt 0
do
case "$1" in
--maintainer)
maintainer=1;;
# WARNING: if you run this you will change the versions
# of the tools which are used and, maybe, required!
--clean)
clean=1;;
# You can define your own replacements in your environment.
# $AUTOCONF, $AUTOMAKE, $AUTOHEADER, $AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
*)
exec >&2
echo "$0: usage: ./autogen.sh"
if test -d .git
then
echo " ./autogen.sh generates the configure script and"
echo " Makefile.in, or refreshes them after changes to Makefile.am"
echo " or configure.ac. You may prefer to just run autoreconf."
elif test -z "$maintainer"
then
echo " DO NOT RUN THIS SCRIPT."
echo " If you need to change Makefile.am or configure.ac then you"
echo " also need to run ./configure --enable-maintainer-mode and"
echo " use the appropriate autotools, *NOT* this script, to update"
echo " everything, please check the documentation of autoreconf."
echo " WARNING: libpng is intentionally generated with a known,"
echo " fixed, set of autotools. It is known *NOT* to work with"
echo " the collection of autotools distributed on highly reputable"
echo " operating systems."
echo " Remember: autotools is GNU software, you are expected to"
echo " pay for support."
else
echo " You have run autogen.sh with --maintainer enabled and you"
echo " are not using a GIT distribution, then you have given an"
echo " unrecognized argument. This is not good. --maintainer"
echo " switches off any assumptions that you might not know what"
echo " you are doing."
fi
exit 1;;
esac
shift
done
#
# First check for a set of the autotools files; if absent then this is assumed
# to be a GIT version and the local autotools must be used. If present this
# is a tarball distribution and the script should not be used. If partially
# present bad things are happening.
#
# The autotools generated files:
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
config.sub configure depcomp install-sh ltmain.sh missing\
test-driver"
#
# Files generated by versions of 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.
libpng_libtool_files="scripts/autoconf/libtool.m4 scripts/autoconf/ltoptions.m4\
scripts/autoconf/ltsugar.m4 scripts/autoconf/ltversion.m4\
scripts/autoconf/lt~obsolete.m4"
libpng_autotools_dirs="autom4te.cache" # not required
#
# The configure generated files:
libpng_configure_files="Makefile config.h config.log config.status\
libpng-config libpng.pc libtool stamp-h1"
libpng_configure_dirs=".deps"
#
# We must remove the configure generated files as well as the autotools
# generated files if autotools are regenerated because otherwise if configure
# has been run without "--enable-maintainer-mode" make can do a partial update
# of Makefile. These functions do the two bits of cleaning.
clean_autotools(){
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
rm -rf $libpng_autotools_extra
}
clean_configure(){
rm -rf $libpng_configure_files $libpng_configure_dirs
}
#
# Clean: remove everything (this is to help with testing)
if test -n "$clean"
then
clean_configure
if test -n "$maintainer"
then
clean_autotools
fi
exit 0
fi
#
# Validate the distribution.
libpng_autotools_file_found=
libpng_autotools_file_missing=
for file in $libpng_autotools_files
do
if test -f "$file"
then
libpng_autotools_file_found=1
else
libpng_autotools_file_missing=1
fi
done
#
# Presence of one of these does not *invalidate* missing, but absence
# invalidates found.
for file in $libpng_libtool_files
do
if test ! -f "$file"
then
libpng_autotools_file_missing=1
fi
done
#
# The cache directory doesn't matter - it will be regenerated and does not exist
# anyway in a tarball.
#
# Either everything is missing or everything is there, the --maintainer option
# just changes this so that the mode is set to generate all the files.
mode=
if test -z "$libpng_autotools_file_found" -o -n "$maintainer"
then
mode="autoreconf"
else
if test -n "$libpng_autotools_file_missing"
then
mode="broken"
else
mode="configure"
fi
fi
#
# So:
case "$mode" in
autoreconf)
# Clean in case configure files exist
clean_configure
clean_autotools
# Everything must be initialized, so use --force
if autoreconf --warnings=all --force --install
then
missing=
for file in $libpng_autotools_files
do
test -f "$file" || missing=1
done
# ignore the cache directory
test -z "$missing" || {
exec >&2
echo "autoreconf was run, but did not produce all the expected"
echo "files. It is likely that your autotools installation is"
echo "not compatible with that expected by libpng."
exit 1
}
else
exec >&2
echo "autoreconf failed: your version of autotools is incompatible"
echo "with this libpng version. Please use a distributed archive"
echo "(which includes the autotools generated files) and run configure"
echo "instead."
exit 1
fi;;
configure)
if test -d .git
then
exec >&2
echo "ERROR: running autoreconf on an initialized system"
echo " This is not necessary; it is only necessary to remake the"
echo " autotools generated files if Makefile.am or configure.ac"
echo " change and make does the right thing with:"
echo
echo " ./configure --enable-maintainer-mode."
echo
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 " everything in the first place; this script is only for"
echo " compatibility with prior releases."
exit 1
else
exec >&2
echo "autogen.sh is intended only to generate 'configure' on systems"
echo "that do not have it. You have a complete 'configure', if you"
echo "need to change Makefile.am or configure.ac you also need to"
echo "run configure with the --enable-maintainer-mode option."
exit 1
fi;;
broken)
exec >&2
echo "Your system has a partial set of autotools generated files."
echo "autogen.sh is unable to proceed. The full set of files is"
echo "contained in the libpng 'tar' distribution archive and you do"
echo "not need to run autogen.sh if you use it."
exit 1;;
esac
touch Makefile.am configure.ac
{
LT=${LIBTOOLIZE-libtoolize}
echo "running $LT" >&2
$LT --force --copy --automake
} && {
AL=${ACLOCAL-aclocal}
echo "running $AL" >&2
$AL
} && {
AH=${AUTOHEADER-autoheader}
echo "running $AH [ignore the warnings]" >&2
$AH
} && {
AM=${AUTOMAKE-automake}
echo "running $AM" >&2
$AM --force-missing --foreign -a -c
} && {
AC=${AUTOCONF-autoconf}
echo "running $AC" >&2
$AC
} &&
echo "autogen complete" >&2 ||
echo "ERROR: autogen.sh failed, autogen is incomplete" >&2

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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 "$@"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

View File

@ -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
"

45
compile Executable file → Normal file
View File

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2025-06-18.21; # UTC
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2025 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2025-06-18.21; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# along with this program. If not, see <http://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
@ -37,11 +37,11 @@ IFS=" "" $nl"
file_conv=
# func_file_conv build_file unneeded_conversions
# func_file_conv build_file lazy
# 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.
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
@ -51,20 +51,9 @@ func_file_conv ()
# 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
file_conv=mingw
;;
CYGWIN*)
# Cygwin environment.
file_conv=cygwin
;;
*)
@ -74,14 +63,12 @@ func_file_conv ()
fi
case $file_conv/,$2, in
*,$file_conv,*)
# This is the optimization mentioned above:
# If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -w "$file" || echo "$file"`
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
@ -156,7 +143,7 @@ func_cl_wrapper ()
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.lo | *.[oO][bB][jJ])
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
@ -261,18 +248,14 @@ 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"
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -356,9 +339,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

1774
config.guess vendored Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,27 +3,33 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the 'feenableexcept' function. */
/* 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). */
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the 'z' library (-lz). */
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the 'pow' function. */
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@ -75,64 +81,31 @@
/* 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. */
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported only directly. */
supported 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__
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

3381
config.sub vendored Executable file → Normal file

File diff suppressed because it is too large Load Diff

9474
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,5 @@
# 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
dnl Minor upgrades (compatible ABI): increment the package version
@ -21,160 +14,65 @@ dnl Makefile.am to upgrade the package name.
dnl This is here to prevent earlier autoconf from being used, it
dnl should not be necessary to regenerate configure if the time
dnl stamps are correct
AC_PREREQ([2.68])
AC_PREREQ(2.59)
dnl Version number stuff here:
AC_INIT([libpng],[1.6.51.git],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts/autoconf])
# libpng does not follow GNU file name conventions (hence 'foreign')
# color-tests requires automake 1.11 or later
# silent-rules 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.13 is required for parallel tests
AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules subdir-objects])
# The following line causes --disable-maintainer-mode to be the default to
# configure. This is necessary because libpng distributions cannot rely on the
# time stamps of the autotools generated files being correct
AC_INIT([libpng], [1.5.29], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE([1.13 serial-tests subdir-objects])
dnl stop configure from automagically running automake
AM_MAINTAINER_MODE
dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
dnl version; aclocal.m4 will generate a failure if you use a prior version of
dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake
PNGLIB_VERSION=1.6.51.git
PNGLIB_VERSION=1.5.29
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
PNGLIB_RELEASE=51
PNGLIB_MINOR=5
PNGLIB_RELEASE=29
dnl End of version number stuff
AC_CONFIG_SRCDIR([pngget.c])
AC_CONFIG_HEADERS([config.h])
# Check the basic programs.
# Checks for programs.
AC_LANG([C])
AC_PROG_CC
AM_PROG_AS
LT_PATH_LD
AC_PROG_LD
AC_PROG_CPP
AC_PROG_SED
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any
dnl compatible later version may be used
LT_INIT([win32-dll])
LT_PREREQ([2.4.2])
dnl Declare the AWK variable.
AC_ARG_VAR(AWK, [AWK language processor])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
# Some awk implementations crash when confronted with pnglibconf.dfa.
# Run a test now, to make sure this doesn't happen.
AC_MSG_CHECKING([if awk ($AWK) works])
if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
${srcdir}/pngusr.dfa 1>&2
then
AC_MSG_RESULT([yes])
else
AC_MSG_FAILURE([no], 1)
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_C_RESTRICT
# This is a remnant of the old cc -E validation, where it may have been
# necessary to use a different preprocessor for .dfn files
DFNCPP="$CPP"
AC_SUBST(DFNCPP)
AC_ARG_ENABLE([tests],
AS_HELP_STRING([--disable-tests],
[do not build the test programs (default is to build)]),
[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,
[additional flags for the C compiler, to be used for options that would]
[cause configure itself to fail])
AC_ARG_ENABLE(werror,
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
[Pass -Werror or the given argument to the compiler if it is supported]),
[test "$enable_werror" = "yes" && enable_werror="-Werror"
if test "$enable_werror" != "no"; then
sav_CFLAGS="$CFLAGS"
CFLAGS="$enable_werror $CFLAGS"
AC_MSG_CHECKING([if the compiler allows $enable_werror])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
[int main(int argc, char **argv){]
[return argv[argc-1][0];]
[}]])],
AC_MSG_RESULT(yes)
PNG_COPTS="$PNG_COPTS $enable_werror",
AC_MSG_RESULT(no))
CFLAGS="$sav_CFLAGS"
fi],)
# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89.
# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
# _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
# we test for that and force the "-std=c89" compiler option:
AC_MSG_CHECKING([if we need to force back C standard to C89])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
[#define _POSIX_SOURCE 1]
[#include <stdio.h>]
])],
AC_MSG_RESULT(no),[
if test "x$GCC" != "xyes"; then
AC_MSG_ERROR(
[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.
AC_STRUCT_TM
AC_C_RESTRICT
# Checks for library functions.
AC_CHECK_FUNCS([pow], ,
[AC_CHECK_LIB([m], [pow], , [AC_MSG_ERROR([cannot find pow])])])
# Some later POSIX 1003.1 functions are required for test programs, failure
# here is soft (the corresponding test program is not built).
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
AC_ARG_WITH(zlib-prefix,
AS_HELP_STRING([[[--with-zlib-prefix]]],
[prefix that may have been used in installed zlib]),
[ZPREFIX=${withval}],
[ZPREFIX='z_'])
AC_CHECK_LIB([z], [zlibVersion], ,
[AC_CHECK_LIB([z], [${ZPREFIX}zlibVersion], ,
[AC_MSG_ERROR([zlib not installed])])])
AC_HELP_STRING([--with-zlib-prefix],
[prefix that may have been used in installed zlib]),
[ZPREFIX=${withval}],
[ZPREFIX='z_'])
AC_CHECK_LIB(z, zlibVersion, ,
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
AC_ERROR([zlib not installed])))
# The following is for pngvalid, to ensure it catches FP errors even on
# platforms that don't enable FP exceptions, the function appears in the math
@ -182,6 +80,10 @@ AC_CHECK_LIB([z], [zlibVersion], ,
AC_CHECK_LIB([m], [feenableexcept])
AC_CHECK_FUNCS([feenableexcept])
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
LIBPNG_DEFINES=$LIBPNG_DEFINES
AC_SUBST(LIBPNG_DEFINES)
AC_MSG_CHECKING([if using Solaris linker])
SLD=`$LD --version 2>&1 | grep Solaris`
if test "$SLD"; then
@ -226,9 +128,9 @@ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
if test "$have_ld_version_script" = "yes"; then
AC_MSG_CHECKING([for symbol prefix])
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
| ${CPP:-${CC:-gcc} -E} - 2>&1 \
| ${EGREP:-grep} "^PREFIX=" \
| ${SED:-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
| ${DFNCPP-${CC-gcc} -E} - 2>&1 \
| ${EGREP-grep} "^PREFIX=" \
| ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
AC_SUBST(SYMBOL_PREFIX)
AC_MSG_RESULT($SYMBOL_PREFIX)
fi
@ -242,38 +144,28 @@ AC_SUBST(PNGLIB_RELEASE)
# Additional arguments (and substitutions)
# Allow the pkg-config directory to be set
AC_ARG_WITH(pkgconfigdir,
AS_HELP_STRING([[[--with-pkgconfigdir]]],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_HELP_STRING([--with-pkgconfigdir],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
# Make the *-config binary config scripts optional
AC_ARG_WITH(binconfigs,
AS_HELP_STRING([[[--with-binconfigs]]],
[Generate shell libpng-config scripts as well as pkg-config data]
[@<:@default=yes@:>@]),
[if test "${withval}" = no; then
binconfigs=
AC_MSG_NOTICE([[libpng-config scripts will not be built]])
else
binconfigs='${binconfigs}'
fi],
[binconfigs='${binconfigs}'])
AC_HELP_STRING([--with-binconfigs],
[Generate shell libpng-config scripts as well as pkg-config data]
[@<:@default=yes@:>@]),
[if test "${withval}" = no; then
binconfigs=
AC_MSG_NOTICE([libpng-config scripts will not be built])
else
binconfigs='${binconfigs}'
fi],
[binconfigs='${binconfigs}'])
AC_SUBST([binconfigs])
# Support for prefixes to the API function names; this will generate defines
# at the start of the build to rename exported library functions
AC_ARG_WITH(libpng-prefix,
AS_HELP_STRING([[[--with-libpng-prefix]]],
[prefix libpng exported function (API) names with the given value]),
[if test "${withval:-no}" != "no"; then
AC_SUBST([PNG_PREFIX], [${withval}])
fi])
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
# Control over what links are made for installed files. Versioned files are
# always installed, when the following options are turned on corresponding
# unversioned links are also created (normally as symbolic links):
@ -313,90 +205,20 @@ AC_ARG_ENABLE([unversioned-libpng-config],
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
[test "$enable_unversioned_libpng_config" != "no"])
# HOST-SPECIFIC OPTIONS
# HOST SPECIFIC OPTIONS
# =====================
#
# DEFAULT
# =======
# ARM
# ===
#
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
# ========
# ARM NEON (SIMD) support.
AC_ARG_ENABLE([arm-neon],
AS_HELP_STRING([[[--enable-arm-neon]]],
[Enable ARM NEON optimizations: =no/off, check, api, yes/on.]
[no/off: disable the optimizations;]
[check: use internal checking code (deprecated and poorly supported);]
[api: disable by default, enable by a call to png_set_option;]
[yes/on: turn on unconditionally.]
[Enable ARM NEON optimizations: =no/off, check, api, yes/on:]
[no/off: disable the optimizations; check: use internal checking code]
[(deprecated and poorly supported); api: disable by default, enable by]
[a call to png_set_option; yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
@ -404,7 +226,7 @@ AC_ARG_ENABLE([arm-neon],
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
[Disable ARM Neon optimizations])
# Prevent inclusion of the assembler files below:
enable_arm_neon=no ;;
enable_arm_neon=no;;
check)
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
[Check for ARM Neon support at run-time]);;
@ -414,336 +236,29 @@ AC_ARG_ENABLE([arm-neon],
yes|on)
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
[Enable ARM Neon optimizations])
AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api';]
[if you want the optimizations unconditionally,]
[pass '-mfpu=neon' to the compiler.]);;
AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if]
[you want the optimizations unconditionally pass -mfpu=neon]
[to the compiler.]);;
*)
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}:]
[invalid argument])
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
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*'.)
# Add ARM specific files to all builds where the host_cpu is arm ('arm*') or
# where ARM optimizations were explicitly requested (this allows a fallback if a
# future host CPU does not match 'arm*')
AM_CONDITIONAL([PNG_ARM_NEON],
[test "$enable_arm_neon" != 'no' &&
case "$host_cpu" in
arm*|aarch64*) : ;;
*) test "$enable_arm_neon" != '' ;;
arm*) :;;
*) 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
# 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]])
# Config files, substituting as above
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
AC_CONFIG_FILES([libpng-config:libpng-config.in],
[chmod +x libpng-config])
[chmod +x libpng-config])
AC_OUTPUT

View File

@ -1,9 +0,0 @@
# https://editorconfig.org
root = false
[*.[ch]]
indent_size = unset
indent_style = unset
max_doc_length = unset
max_line_length = unset

View File

@ -1,7 +1,4 @@
External contributions to libpng
--------------------------------
This "contrib" directory contains contributions which are not necessarily under
the libpng license, although all are open source. They are not part of
libpng proper and are not used for building the library, although some are used
for testing the library via "make check".
libpng proper and are not used for building the library.

View File

@ -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.

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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