mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
804 Commits
master
...
v1.7.0beta
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1c2e35ab73 | ||
![]() |
58cd558a43 | ||
![]() |
bdca749e35 | ||
![]() |
19855cd8b1 | ||
![]() |
9bda575f69 | ||
![]() |
66def3fb3c | ||
![]() |
8f4d83a881 | ||
![]() |
a9b02399ac | ||
![]() |
ba42eccb05 | ||
![]() |
7345c50aaa | ||
![]() |
20be5b5411 | ||
![]() |
750a023377 | ||
![]() |
e00c39596a | ||
![]() |
448fad2d02 | ||
![]() |
76a1f4bb3f | ||
![]() |
243d4e5f3f | ||
![]() |
48f8ca26e4 | ||
![]() |
6c9ecd348d | ||
![]() |
e6470a8876 | ||
![]() |
b14987b483 | ||
![]() |
7ed5c08fad | ||
![]() |
5a1f75289e | ||
![]() |
4caddaafbb | ||
![]() |
512336676e | ||
![]() |
0ea7a09ced | ||
![]() |
0b02a667cf | ||
![]() |
e1c7c0402c | ||
![]() |
2127ecd0fa | ||
![]() |
1757736115 | ||
![]() |
6f9a39848e | ||
![]() |
517fe770e2 | ||
![]() |
f911c1146a | ||
![]() |
28de8bf6cd | ||
![]() |
6f39846891 | ||
![]() |
07e2cf117f | ||
![]() |
f0ada4edee | ||
![]() |
3220f9c5a5 | ||
![]() |
5096cac90c | ||
![]() |
2a2373c1ec | ||
![]() |
4283e2bf66 | ||
![]() |
8ffea2e56b | ||
![]() |
99eb6b5d5d | ||
![]() |
096dbf8335 | ||
![]() |
9743d58bc0 | ||
![]() |
bdb730a593 | ||
![]() |
f1fb09c406 | ||
![]() |
83ca33b017 | ||
![]() |
aa78bc36d9 | ||
![]() |
f7b1d9a172 | ||
![]() |
ce67b437ea | ||
![]() |
86a3c4fb14 | ||
![]() |
4b846be113 | ||
![]() |
b9d7d5525b | ||
![]() |
0ecbe53243 | ||
![]() |
53bda5a7af | ||
![]() |
6a574a84bd | ||
![]() |
eaf7abfdc3 | ||
![]() |
0f5992051f | ||
![]() |
12c3c2e136 | ||
![]() |
d6037dcb09 | ||
![]() |
9dfdb2270b | ||
![]() |
29be8f11ed | ||
![]() |
8592a85535 | ||
![]() |
b21a37323f | ||
![]() |
7a0fe97841 | ||
![]() |
9a137f332f | ||
![]() |
8c8aea7fd4 | ||
![]() |
d52c8eba99 | ||
![]() |
b70b51ba17 | ||
![]() |
2b711a751c | ||
![]() |
2e68f96511 | ||
![]() |
8c7b59f2b9 | ||
![]() |
01ff090760 | ||
![]() |
120f80369b | ||
![]() |
1982dc6c2f | ||
![]() |
a1296131fe | ||
![]() |
5095b2adfb | ||
![]() |
5b19ac3019 | ||
![]() |
a5b340e20b | ||
![]() |
21f92eef89 | ||
![]() |
bf101dcea1 | ||
![]() |
764ae3995b | ||
![]() |
bd6fb5534f | ||
![]() |
f05407d292 | ||
![]() |
5652acdd48 | ||
![]() |
cf46e3748f | ||
![]() |
52c9e4fdd6 | ||
![]() |
4905ed4aae | ||
![]() |
ba356b4e4d | ||
![]() |
d23207b866 | ||
![]() |
a70f5053de | ||
![]() |
4cc89fb733 | ||
![]() |
e966fac5ac | ||
![]() |
cde9b583a8 | ||
![]() |
1fd42d849d | ||
![]() |
b6a1f48ab2 | ||
![]() |
bbe8ea6eb0 | ||
![]() |
6d2e06f25f | ||
![]() |
3fb14ea53b | ||
![]() |
af9ad9545d | ||
![]() |
5e88e9c396 | ||
![]() |
8498aa1c97 | ||
![]() |
8fb81acd98 | ||
![]() |
1a087bf921 | ||
![]() |
5a857b7d83 | ||
![]() |
e2414effed | ||
![]() |
023b399e40 | ||
![]() |
0b073f4a4d | ||
![]() |
a8b45d9f7e | ||
![]() |
c39c5640b4 | ||
![]() |
eb5e71cc8c | ||
![]() |
85cb69aa82 | ||
![]() |
dcb3f792d9 | ||
![]() |
9a6922896d | ||
![]() |
55d3b3226e | ||
![]() |
443694d7ac | ||
![]() |
f26fa77ef8 | ||
![]() |
e46cd2e6bc | ||
![]() |
f2a160299e | ||
![]() |
4697cbded6 | ||
![]() |
033a0d7b49 | ||
![]() |
eacf6f9637 | ||
![]() |
7912bf3037 | ||
![]() |
e4fad63915 | ||
![]() |
89287f10b8 | ||
![]() |
6271b4fc78 | ||
![]() |
3d024874a5 | ||
![]() |
2fce16e5c4 | ||
![]() |
fc322f6d48 | ||
![]() |
1afbb57994 | ||
![]() |
e393f19527 | ||
![]() |
79378d49b3 | ||
![]() |
d9d6b6e361 | ||
![]() |
b9014ed336 | ||
![]() |
faf68f8d57 | ||
![]() |
09a1afbb3d | ||
![]() |
27e11dc8cf | ||
![]() |
df4568f84b | ||
![]() |
6d5f00571d | ||
![]() |
4705951df1 | ||
![]() |
f33fe44b9f | ||
![]() |
43d0aa7218 | ||
![]() |
89ebb4dd52 | ||
![]() |
8d18e76f2b | ||
![]() |
fafbc6a458 | ||
![]() |
4253c4d759 | ||
![]() |
c90572ee77 | ||
![]() |
ef26a3f0fb | ||
![]() |
63ea57a796 | ||
![]() |
07c60a383a | ||
![]() |
8d124a250a | ||
![]() |
0340dcdcbd | ||
![]() |
ff57ec2126 | ||
![]() |
745a926a38 | ||
![]() |
4b1d9e8c2a | ||
![]() |
bb4bcecaa0 | ||
![]() |
28fa0d23c1 | ||
![]() |
1bfeb46881 | ||
![]() |
ace10ed9a2 | ||
![]() |
156006bb1a | ||
![]() |
8d48a512bd | ||
![]() |
c75a0a40b4 | ||
![]() |
fad9c9af47 | ||
![]() |
5695e897fd | ||
![]() |
0e249e9d93 | ||
![]() |
a78c4e286a | ||
![]() |
16424d20b5 | ||
![]() |
9c76207dbb | ||
![]() |
2023c4a0a5 | ||
![]() |
69ff249bc4 | ||
![]() |
844e264234 | ||
![]() |
61acc4c9ed | ||
![]() |
bd0bb3ca7f | ||
![]() |
386b2b0a7b | ||
![]() |
d103609ac5 | ||
![]() |
639f8a4668 | ||
![]() |
aed7f7aaf9 | ||
![]() |
15b6717221 | ||
![]() |
c9fda22f76 | ||
![]() |
4891f1a5a8 | ||
![]() |
abe4a4f049 | ||
![]() |
f3fa5dce47 | ||
![]() |
17bfbce61c | ||
![]() |
2933c2e361 | ||
![]() |
69f21bc6eb | ||
![]() |
454408799b | ||
![]() |
4c1ee27962 | ||
![]() |
26090a5f43 | ||
![]() |
bfd8446816 | ||
![]() |
605f8d046f | ||
![]() |
b8ab93dc6f | ||
![]() |
66b53bdd37 | ||
![]() |
dcbc357c46 | ||
![]() |
8ac1821831 | ||
![]() |
3407d0f7c4 | ||
![]() |
c8d2efcb50 | ||
![]() |
99436a407e | ||
![]() |
59136cc3b3 | ||
![]() |
afbaf7150b | ||
![]() |
86499967c3 | ||
![]() |
028d2c3fd6 | ||
![]() |
47ed19dfce | ||
![]() |
94a5189b1c | ||
![]() |
9fce04fcd6 | ||
![]() |
71c5123a4d | ||
![]() |
e9d567d9ec | ||
![]() |
37a50281cf | ||
![]() |
aacda27449 | ||
![]() |
b427d7216d | ||
![]() |
c46bd30b51 | ||
![]() |
0f2f0f7bbd | ||
![]() |
84a8bb8244 | ||
![]() |
8fe2eac47f | ||
![]() |
cb3402221b | ||
![]() |
8978eba436 | ||
![]() |
4792c8a751 | ||
![]() |
6bbc74d880 | ||
![]() |
b3a18efebf | ||
![]() |
14d11b9f35 | ||
![]() |
e41820cd0b | ||
![]() |
18211df70b | ||
![]() |
1775bdeb24 | ||
![]() |
8bffb48bc1 | ||
![]() |
edec44bfc4 | ||
![]() |
1c514557b6 | ||
![]() |
85d7eca204 | ||
![]() |
5357dd77f0 | ||
![]() |
5db709d83c | ||
![]() |
616ed1197b | ||
![]() |
0cb0a45721 | ||
![]() |
f476f13488 | ||
![]() |
8d93ec2eca | ||
![]() |
b0076faf1f | ||
![]() |
fa86bd2a61 | ||
![]() |
961d60b067 | ||
![]() |
764ae07652 | ||
![]() |
6803b09cb7 | ||
![]() |
7a7e4367d0 | ||
![]() |
b69df74b8e | ||
![]() |
a42416de9c | ||
![]() |
e51652b4db | ||
![]() |
771eb7d01e | ||
![]() |
368bb1b241 | ||
![]() |
504ebd427d | ||
![]() |
caa716d859 | ||
![]() |
0f2554a5e6 | ||
![]() |
9eb14136d8 | ||
![]() |
09c90236f4 | ||
![]() |
a3458a6ba0 | ||
![]() |
daf4b9dd18 | ||
![]() |
3a866cb451 | ||
![]() |
5592e0bc96 | ||
![]() |
57e92a8432 | ||
![]() |
d3c0359b23 | ||
![]() |
801608f8f4 | ||
![]() |
c09b3ab2c7 | ||
![]() |
722645fec5 | ||
![]() |
f72d0d01eb | ||
![]() |
97c4072cce | ||
![]() |
7a92725e17 | ||
![]() |
e916d9bb60 | ||
![]() |
ea41fd2161 | ||
![]() |
dbd98b8c68 | ||
![]() |
5cf6ed45c8 | ||
![]() |
9f7d5aa973 | ||
![]() |
5b05197604 | ||
![]() |
90992547c7 | ||
![]() |
13ce05daaf | ||
![]() |
2cd6d56ff6 | ||
![]() |
1af270dc19 | ||
![]() |
2ddd06c392 | ||
![]() |
33d4b5b66d | ||
![]() |
15a143e85e | ||
![]() |
bd55022b2d | ||
![]() |
c5bc9b668d | ||
![]() |
975d8fac6d | ||
![]() |
e76a320539 | ||
![]() |
eab2c419fa | ||
![]() |
23324b8559 | ||
![]() |
8dfa93beed | ||
![]() |
ed44394ad0 | ||
![]() |
c23bdb1445 | ||
![]() |
cbf4adee5c | ||
![]() |
1bc0781245 | ||
![]() |
7441965463 | ||
![]() |
8d6c21ce96 | ||
![]() |
8c94b1295f | ||
![]() |
1932e16c21 | ||
![]() |
a6278e7c87 | ||
![]() |
a5b993aaed | ||
![]() |
53e537439f | ||
![]() |
f1eec0ba62 | ||
![]() |
1e563f689c | ||
![]() |
0301cc2627 | ||
![]() |
9ee0b63b09 | ||
![]() |
2c13de800f | ||
![]() |
d394d889e1 | ||
![]() |
40d90d34a8 | ||
![]() |
3f6efbd8e2 | ||
![]() |
bf51c644f7 | ||
![]() |
05399c8c82 | ||
![]() |
8fae6609c0 | ||
![]() |
a2245a2c54 | ||
![]() |
46d3f863ca | ||
![]() |
7c9a08b8bc | ||
![]() |
c2a8a01b2a | ||
![]() |
8c025bcf3f | ||
![]() |
d555056b24 | ||
![]() |
69f2152c0f | ||
![]() |
e6a3e2456c | ||
![]() |
493bfd14a2 | ||
![]() |
8a9a3fb4dd | ||
![]() |
3e46c31961 | ||
![]() |
714515bc0c | ||
![]() |
38647d4b21 | ||
![]() |
f8d3e854cb | ||
![]() |
d280c3a6da | ||
![]() |
62dff2f97e | ||
![]() |
fea86b1c29 | ||
![]() |
601ae5387e | ||
![]() |
36ada4acae | ||
![]() |
bfc7affa0d | ||
![]() |
dba870122c | ||
![]() |
35abfe72d6 | ||
![]() |
497ff3400c | ||
![]() |
bb4e79c947 | ||
![]() |
b00bb570f8 | ||
![]() |
c68de14844 | ||
![]() |
cc7fa5e23f | ||
![]() |
ec99b373dd | ||
![]() |
3184947a25 | ||
![]() |
c5ead5d2cd | ||
![]() |
76c5c11168 | ||
![]() |
ddcca52933 | ||
![]() |
3bd90db79f | ||
![]() |
1fc5345bff | ||
![]() |
81b1cff052 | ||
![]() |
bc1d2b7d23 | ||
![]() |
a16d1ef27a | ||
![]() |
4b9fe200db | ||
![]() |
223aed9f90 | ||
![]() |
064ededa0f | ||
![]() |
92d7dd1ede | ||
![]() |
1b3d312513 | ||
![]() |
47b6a93924 | ||
![]() |
e1ff1cc930 | ||
![]() |
9acee8b4b2 | ||
![]() |
8ffa92dc25 | ||
![]() |
24382d838c | ||
![]() |
9307eef199 | ||
![]() |
3d1fec50e8 | ||
![]() |
0781bc4905 | ||
![]() |
188962a93b | ||
![]() |
e55c190818 | ||
![]() |
1a9eb510eb | ||
![]() |
77476d3c37 | ||
![]() |
a671f8baea | ||
![]() |
f32c657fc7 | ||
![]() |
381283fb5f | ||
![]() |
3dd43ae670 | ||
![]() |
13d83c6948 | ||
![]() |
f19f7a6c95 | ||
![]() |
e0fea61cd8 | ||
![]() |
689b9c58fe | ||
![]() |
dc6cddd798 | ||
![]() |
5d2841d272 | ||
![]() |
9012e3d108 | ||
![]() |
81d58f913e | ||
![]() |
0ee7a07a85 | ||
![]() |
6acc280403 | ||
![]() |
01358ecec2 | ||
![]() |
7a35bcac1a | ||
![]() |
673ae608ab | ||
![]() |
73ea393ab2 | ||
![]() |
dff4a834ce | ||
![]() |
ad817b9b2b | ||
![]() |
218b2d7c70 | ||
![]() |
67890a19f3 | ||
![]() |
53097f5bbb | ||
![]() |
36562c1032 | ||
![]() |
82fa6aed0e | ||
![]() |
382de60042 | ||
![]() |
06963c7841 | ||
![]() |
9f2fb72c67 | ||
![]() |
10ea5caef2 | ||
![]() |
2460d9494d | ||
![]() |
e8e7b6681e | ||
![]() |
033dd3f20a | ||
![]() |
341e23c009 | ||
![]() |
e4521a073c | ||
![]() |
5ff2d472e8 | ||
![]() |
f8eeac2b11 | ||
![]() |
e57ab4311b | ||
![]() |
9015c44736 | ||
![]() |
1d7f037627 | ||
![]() |
c4c28d7251 | ||
![]() |
0fba15c567 | ||
![]() |
c062330846 | ||
![]() |
0448d90f01 | ||
![]() |
127bede89c | ||
![]() |
3e4bd8c261 | ||
![]() |
cc085343ec | ||
![]() |
ea0197a3e3 | ||
![]() |
c2f0c9683f | ||
![]() |
79a332afd0 | ||
![]() |
352e2fe4c7 | ||
![]() |
3077b5e049 | ||
![]() |
98043c79a2 | ||
![]() |
2bf96d75ec | ||
![]() |
678020ae18 | ||
![]() |
58e69e45ff | ||
![]() |
7b51b8c13b | ||
![]() |
5f7e71fa78 | ||
![]() |
0cd3d25ae8 | ||
![]() |
83a2959908 | ||
![]() |
ab2ef2ceb1 | ||
![]() |
f0341bae80 | ||
![]() |
ed3543679a | ||
![]() |
9c7aee825c | ||
![]() |
d8055d7123 | ||
![]() |
92ef42d5e1 | ||
![]() |
1d3a1e36a7 | ||
![]() |
d368235da4 | ||
![]() |
06b0c83920 | ||
![]() |
2130a3cd20 | ||
![]() |
f1e4acb5b1 | ||
![]() |
7e56f5858d | ||
![]() |
82fca45d27 | ||
![]() |
f55ee011a2 | ||
![]() |
9c9009ec7d | ||
![]() |
01d91b4370 | ||
![]() |
1fd10de101 | ||
![]() |
9149259041 | ||
![]() |
8bc832389a | ||
![]() |
ba22b208ed | ||
![]() |
0f6d60e672 | ||
![]() |
6ce2d220b4 | ||
![]() |
d7312be749 | ||
![]() |
125eac0ee4 | ||
![]() |
ab95226db8 | ||
![]() |
3043819fb2 | ||
![]() |
565e1bc1ae | ||
![]() |
5bdcb914a4 | ||
![]() |
e8213aa68f | ||
![]() |
d4ac328617 | ||
![]() |
56e6741b25 | ||
![]() |
3e04e189d8 | ||
![]() |
eb67f8bcb1 | ||
![]() |
9c078fb7d2 | ||
![]() |
ae31a1ebdb | ||
![]() |
b1d49de5bc | ||
![]() |
d7e9c1c584 | ||
![]() |
28451a8797 | ||
![]() |
e6eb1d6fda | ||
![]() |
82dd5d3575 | ||
![]() |
a5b6764cea | ||
![]() |
56850aba35 | ||
![]() |
13f025c29a | ||
![]() |
d92b0f23e6 | ||
![]() |
eeab1cfefc | ||
![]() |
38d22ef928 | ||
![]() |
ab1ad88ecc | ||
![]() |
caa59e0007 | ||
![]() |
310ffb25f8 | ||
![]() |
c026b07529 | ||
![]() |
6988b31244 | ||
![]() |
b23a10f565 | ||
![]() |
201e9144a6 | ||
![]() |
ba8495bba9 | ||
![]() |
3393042627 | ||
![]() |
a072dfee8e | ||
![]() |
e39e182357 | ||
![]() |
ab71e135e7 | ||
![]() |
1b577e9bc6 | ||
![]() |
238fdc197d | ||
![]() |
8cfee5fa78 | ||
![]() |
44a9af81b0 | ||
![]() |
755f92fc41 | ||
![]() |
d9d1c997d8 | ||
![]() |
aeb4a22975 | ||
![]() |
9c0b5ab848 | ||
![]() |
05dcaffd38 | ||
![]() |
cca25b182f | ||
![]() |
f87df31c8c | ||
![]() |
41547820e8 | ||
![]() |
e5d462d829 | ||
![]() |
6f46730cb7 | ||
![]() |
67b88b8ee0 | ||
![]() |
7a4bfbdec1 | ||
![]() |
859254054a | ||
![]() |
515659d638 | ||
![]() |
fd409c8019 | ||
![]() |
9ee6678e1f | ||
![]() |
9b36280e31 | ||
![]() |
eaad9f9177 | ||
![]() |
70cd1a10f2 | ||
![]() |
7974d60f54 | ||
![]() |
c7e743d385 | ||
![]() |
b2e89f1af6 | ||
![]() |
ad30a1262b | ||
![]() |
35f88c1341 | ||
![]() |
4f8050416f | ||
![]() |
776d1768aa | ||
![]() |
d7078c52e2 | ||
![]() |
4a67ac3f1e | ||
![]() |
2799bf9a4f | ||
![]() |
34e49ae1bc | ||
![]() |
cea01951da | ||
![]() |
1a9c06b11a | ||
![]() |
f3b1eb68a6 | ||
![]() |
12845bc947 | ||
![]() |
3ac960f128 | ||
![]() |
eb2b0248e2 | ||
![]() |
e529698d38 | ||
![]() |
1a9e897289 | ||
![]() |
3a81956ffe | ||
![]() |
0acf4f9770 | ||
![]() |
b407af6503 | ||
![]() |
0fb41f05df | ||
![]() |
8ebdaa0700 | ||
![]() |
4e61b58980 | ||
![]() |
88e7d62fbc | ||
![]() |
43cd0a0bb5 | ||
![]() |
1345c5bff8 | ||
![]() |
39c420834f | ||
![]() |
f898f69f46 | ||
![]() |
352f43cdc6 | ||
![]() |
f99393490d | ||
![]() |
deb920b4a7 | ||
![]() |
148cdac18f | ||
![]() |
51ecc14a8a | ||
![]() |
713a20c57d | ||
![]() |
4526f546ba | ||
![]() |
0c5acfa19e | ||
![]() |
848eeacb41 | ||
![]() |
2ced844b0e | ||
![]() |
e2c5ed8d1d | ||
![]() |
76004ce6ed | ||
![]() |
258b986917 | ||
![]() |
50a09830b8 | ||
![]() |
9a3f244085 | ||
![]() |
fb1305faeb | ||
![]() |
3d7f3bbab7 | ||
![]() |
2d032e966d | ||
![]() |
8dd3784f7c | ||
![]() |
98b9371115 | ||
![]() |
d29413a2a9 | ||
![]() |
dc63b03da1 | ||
![]() |
cf354c2c82 | ||
![]() |
484dad1a19 | ||
![]() |
1695471118 | ||
![]() |
ae14dcd404 | ||
![]() |
302c58b8cf | ||
![]() |
39fee3cee1 | ||
![]() |
b7362c6738 | ||
![]() |
f2d8561fdc | ||
![]() |
1bd81ffa21 | ||
![]() |
6d2b1a7dbc | ||
![]() |
5daa97c2eb | ||
![]() |
9e441e96b9 | ||
![]() |
a0d314ce84 | ||
![]() |
b871b25997 | ||
![]() |
d38ebc9ded | ||
![]() |
995402ca6e | ||
![]() |
1982968dad | ||
![]() |
32cd66d619 | ||
![]() |
03a53fa429 | ||
![]() |
441de8f4fd | ||
![]() |
4e5c80034e | ||
![]() |
879d63156a | ||
![]() |
eb021245d0 | ||
![]() |
6607a3b905 | ||
![]() |
28711dff2a | ||
![]() |
4413d5dcd2 | ||
![]() |
206d1eed42 | ||
![]() |
114fa16ab3 | ||
![]() |
eb2af04bd3 | ||
![]() |
200fc68f52 | ||
![]() |
4cfd01a288 | ||
![]() |
e98229ceb0 | ||
![]() |
ad1a4c8cc3 | ||
![]() |
8df7c46e5b | ||
![]() |
99078ec8bd | ||
![]() |
a2c5f56e77 | ||
![]() |
9e168ea2c9 | ||
![]() |
06be739941 | ||
![]() |
448092b8eb | ||
![]() |
1faa6ff32c | ||
![]() |
3adf438f39 | ||
![]() |
d45a632529 | ||
![]() |
5a1b8d106d | ||
![]() |
05f896004f | ||
![]() |
a4f1de9109 | ||
![]() |
7ebb353944 | ||
![]() |
b1f0c7d0e5 | ||
![]() |
55df049962 | ||
![]() |
219ba1370e | ||
![]() |
4dc4471bb5 | ||
![]() |
a199a15b28 | ||
![]() |
e9446f2f95 | ||
![]() |
f70f2fcf48 | ||
![]() |
158c947ce2 | ||
![]() |
7e2707e2af | ||
![]() |
81824079b5 | ||
![]() |
e8e1add0a8 | ||
![]() |
a549223f91 | ||
![]() |
ebe7945b96 | ||
![]() |
e3e35aa980 | ||
![]() |
9f2fbcf5d8 | ||
![]() |
264ba68afe | ||
![]() |
3ef99c9316 | ||
![]() |
4b29f97f9b | ||
![]() |
fe6e6cf130 | ||
![]() |
547df4b9ca | ||
![]() |
a0d4a0b971 | ||
![]() |
72c2577302 | ||
![]() |
091fab713c | ||
![]() |
32aeb2cd4e | ||
![]() |
c1bcdc3a86 | ||
![]() |
553b8f85d3 | ||
![]() |
30666a6097 | ||
![]() |
0bfa63cd0d | ||
![]() |
b37a7c6674 | ||
![]() |
7657ac14f2 | ||
![]() |
d9f60caf72 | ||
![]() |
88c20ada06 | ||
![]() |
f3bfc4a142 | ||
![]() |
3fdef04d55 | ||
![]() |
eae431e514 | ||
![]() |
003590c361 | ||
![]() |
8e23262b2b | ||
![]() |
157e0649e0 | ||
![]() |
83f1287c02 | ||
![]() |
a1124a574a | ||
![]() |
6f27254a7e | ||
![]() |
79fc8fa0d9 | ||
![]() |
394bc6cdee | ||
![]() |
bb06552075 | ||
![]() |
a14071d814 | ||
![]() |
23f3e46518 | ||
![]() |
f97b2a6cde | ||
![]() |
23f4320775 | ||
![]() |
fb411867b0 | ||
![]() |
5aa2ca454d | ||
![]() |
7905286ffa | ||
![]() |
2edcb6ad0f | ||
![]() |
0f1599e6e5 | ||
![]() |
cbf22f30b4 | ||
![]() |
9bf3c70730 | ||
![]() |
1bc5747713 | ||
![]() |
4a7796faca | ||
![]() |
34081a0e2f | ||
![]() |
b88c94208a | ||
![]() |
30662f5e92 | ||
![]() |
46ad4c5bd4 | ||
![]() |
5c32606ec0 | ||
![]() |
a08ac031fc | ||
![]() |
c233ec8743 | ||
![]() |
d594be641a | ||
![]() |
4c9168875b | ||
![]() |
3c051ee282 | ||
![]() |
e1ded944f0 | ||
![]() |
c09dddc0cd | ||
![]() |
bd56d76417 | ||
![]() |
0cc23ac171 | ||
![]() |
cb10e19725 | ||
![]() |
9dba7219a0 | ||
![]() |
17c6af8c40 | ||
![]() |
6a02eb6d2c | ||
![]() |
40d41fe6f8 | ||
![]() |
7073d26e51 | ||
![]() |
cf76fe8654 | ||
![]() |
b780b64fbf | ||
![]() |
b1876ab6e2 | ||
![]() |
28a95d125f | ||
![]() |
993f68c006 | ||
![]() |
8d23524359 | ||
![]() |
e0f4aaa668 | ||
![]() |
3de174cd2f | ||
![]() |
eaf2f1dcbe | ||
![]() |
ea0b4c602e | ||
![]() |
371c3d4dfd | ||
![]() |
0bcf5fb451 | ||
![]() |
57d6907d89 | ||
![]() |
6cf97e37af | ||
![]() |
8ef61c4693 | ||
![]() |
25a116f97d | ||
![]() |
d6d41c847a | ||
![]() |
9e0297546f | ||
![]() |
d529363d13 | ||
![]() |
55e93d7090 | ||
![]() |
23674b75be | ||
![]() |
0ddf350360 | ||
![]() |
066f9862f0 | ||
![]() |
ae1a5c811c | ||
![]() |
5a1ce92c0c | ||
![]() |
7a498039c5 | ||
![]() |
40a93652aa | ||
![]() |
a1362f38de | ||
![]() |
30bc0333fe | ||
![]() |
55794013d4 | ||
![]() |
2e92b4dfa0 | ||
![]() |
f46106fa04 | ||
![]() |
0dcd32f39c | ||
![]() |
808ea281a4 | ||
![]() |
ec89aefb44 | ||
![]() |
6152dbd424 | ||
![]() |
fe18c0d9ea | ||
![]() |
1b0358302d | ||
![]() |
d20f9d5030 | ||
![]() |
fc447311aa | ||
![]() |
8e30e43587 | ||
![]() |
0403ccf1de | ||
![]() |
1a321cc088 | ||
![]() |
c9f99f487b | ||
![]() |
8360e60abc | ||
![]() |
2799f74489 | ||
![]() |
7363babe4f | ||
![]() |
e3a526f789 | ||
![]() |
8f0935b8dc | ||
![]() |
ae6503fe0e | ||
![]() |
851a6265a8 | ||
![]() |
ffa24d4108 | ||
![]() |
206f4d2678 | ||
![]() |
bb040784c2 | ||
![]() |
70e1af50ed | ||
![]() |
eb4a645eda | ||
![]() |
9f7f03a3c4 | ||
![]() |
395ddbd318 | ||
![]() |
9f0d36c85f | ||
![]() |
e9760e5e95 | ||
![]() |
b96b2b7e90 | ||
![]() |
9bb705e0a8 | ||
![]() |
e860f77393 | ||
![]() |
b5a7565908 | ||
![]() |
e88e221d91 | ||
![]() |
b10867cdc2 | ||
![]() |
bf7084b80d | ||
![]() |
6afcee826f | ||
![]() |
f15a5006c8 | ||
![]() |
cdbd5174bd | ||
![]() |
7a9b6203ef | ||
![]() |
803493e19c | ||
![]() |
4245e6b1b2 | ||
![]() |
81892f6b90 | ||
![]() |
862993827d | ||
![]() |
d304125332 | ||
![]() |
9124f3e29a | ||
![]() |
2969375aa6 | ||
![]() |
5e8ba1cbbf | ||
![]() |
8aee43d10a | ||
![]() |
e355657bbe | ||
![]() |
fb6ba9acf4 | ||
![]() |
815173a0b5 | ||
![]() |
7f489a77bb | ||
![]() |
8ec8e8fcd5 | ||
![]() |
a4e606dd5f | ||
![]() |
646de7962b | ||
![]() |
4accd423c2 | ||
![]() |
f62caaf4dc | ||
![]() |
b789bb84bb | ||
![]() |
ce60ad642b | ||
![]() |
ab097b1168 | ||
![]() |
3a737d86c7 | ||
![]() |
a1337e57a8 | ||
![]() |
247b3fcf49 | ||
![]() |
f01273b25c | ||
![]() |
8cb1a2ac6d | ||
![]() |
e6e5ac8cb7 | ||
![]() |
a4798fb83e | ||
![]() |
46369f35c5 | ||
![]() |
e699993d70 | ||
![]() |
5a0afcfa63 | ||
![]() |
3fc9cbf126 | ||
![]() |
36b628b19e | ||
![]() |
2c31365fd4 | ||
![]() |
e1e3c1a2a2 | ||
![]() |
b940e5dc5d | ||
![]() |
fbbbc620b8 | ||
![]() |
9b99600c4d | ||
![]() |
3129d7426e | ||
![]() |
325ceea971 | ||
![]() |
ac39fc3024 | ||
![]() |
99343407e6 | ||
![]() |
3e23f45ba9 | ||
![]() |
72389dec42 | ||
![]() |
1f0853f47e | ||
![]() |
32a60a4885 | ||
![]() |
5e07dc6970 | ||
![]() |
4b90a8d416 | ||
![]() |
d59c19b64c | ||
![]() |
bbabd977d1 | ||
![]() |
0cf9c7d63d | ||
![]() |
b4e241559e | ||
![]() |
1e15aee6be | ||
![]() |
d59e60d0fb | ||
![]() |
ec1d13a1d4 | ||
![]() |
d9002f94cb | ||
![]() |
1fa858db48 | ||
![]() |
0f2a5bac64 | ||
![]() |
eac85878bf | ||
![]() |
240ac287eb | ||
![]() |
3e42c81193 | ||
![]() |
ac3b4d9b69 |
@ -1,81 +0,0 @@
|
||||
version: 1.6.x-{build}
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /libpng[0-1][0-8]/
|
||||
- /v[0-1][.][0-8][.][0-9]+/
|
||||
|
||||
image:
|
||||
- Visual Studio 2022
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- TOOLCHAIN: vstudio
|
||||
AUTOMATION: cmake
|
||||
ARCH: x86
|
||||
- TOOLCHAIN: vstudio
|
||||
AUTOMATION: cmake
|
||||
ARCH: x64
|
||||
- TOOLCHAIN: vstudio
|
||||
AUTOMATION: cmake
|
||||
ARCH: arm64
|
||||
- TOOLCHAIN: llvm
|
||||
AUTOMATION: cmake
|
||||
ARCH: x64
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: cmake
|
||||
ARCH: i686
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: cmake
|
||||
ARCH: x86_64
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: configure
|
||||
ARCH: i686
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: configure
|
||||
ARCH: x86_64
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: makefiles
|
||||
ARCH: i686
|
||||
- TOOLCHAIN: msys2
|
||||
AUTOMATION: makefiles
|
||||
ARCH: x86_64
|
||||
|
||||
install:
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-ninja'
|
||||
|
||||
before_build:
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" set CI_CMAKE_GENERATOR=Ninja'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" set CI_CC=gcc'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set MSYSTEM=MINGW32'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set MSYSTEM=MINGW64'
|
||||
- 'set CI_CMAKE_BUILD_FLAGS=-j2'
|
||||
- 'set CI_CTEST_FLAGS=-j2'
|
||||
- 'set CI_MAKE_FLAGS=-j2'
|
||||
- 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
|
||||
|
||||
build_script:
|
||||
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
|
||||
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'
|
||||
|
||||
cache:
|
||||
- 'C:\tools\vcpkg\installed'
|
||||
- 'C:\msys64\var\cache\pacman'
|
@ -1,94 +0,0 @@
|
||||
# https://pypi.org/project/cmakelang
|
||||
# https://github.com/cheshirekow/cmake_format
|
||||
|
||||
# ----------------------
|
||||
# Options for formatting
|
||||
# ----------------------
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
# TODO: Reflow the CMake files to allow setting the maximum line width to 100.
|
||||
line_width: 255
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size: 2
|
||||
|
||||
# If true, lines are indented using tab characters (utf-8 0x09) instead of
|
||||
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
|
||||
# require a fractional tab character, the behavior of the fractional
|
||||
# indentation is governed by <fractional_tab_policy>
|
||||
use_tabchars: false
|
||||
|
||||
# If <use_tabchars> is True, then the value of this variable indicates how
|
||||
# fractional indentions are handled during whitespace replacement. If set to
|
||||
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
|
||||
# to `round-up` fractional indentation is replaced with a single tab character
|
||||
# (utf-8 0x09) effectively shifting the column to the next tabstop
|
||||
fractional_tab_policy: "use-space"
|
||||
|
||||
# Enable comment markup parsing and reflow
|
||||
enable_markup: false
|
||||
|
||||
# -------------------
|
||||
# Options for linting
|
||||
# -------------------
|
||||
|
||||
# Lint codes to disable
|
||||
disabled_codes: [
|
||||
# TODO:
|
||||
# Reconcile the CMake variable names with the patterns below, then
|
||||
# re-enable the "invalid variable name XXX" messages.
|
||||
"C0103",
|
||||
|
||||
# TODO:
|
||||
# Add brief COMMENT arguments to the `add_custom_target` commands.
|
||||
"C0113",
|
||||
]
|
||||
|
||||
# Regular expression pattern describing valid function names
|
||||
function_pattern: "[0-9a-z_]+"
|
||||
|
||||
# Regular expression pattern describing valid macro names
|
||||
macro_pattern: "[0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for variables with global
|
||||
# (cache) scope
|
||||
global_var_pattern: "[A-Z][0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for variables with global
|
||||
# scope (but internal semantic)
|
||||
internal_var_pattern: "_[A-Z][0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for variables with local
|
||||
# scope
|
||||
local_var_pattern: "[a-z][a-z0-9_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for privatedirectory
|
||||
# variables
|
||||
private_var_pattern: "_[0-9a-z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for public directory
|
||||
# variables
|
||||
public_var_pattern: "[A-Z][0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for function/macro
|
||||
# arguments and loop variables.
|
||||
argument_var_pattern: "[a-z][a-z0-9_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for keywords used in
|
||||
# functions or macros
|
||||
keyword_pattern: "[A-Z][0-9A-Z_]+"
|
||||
|
||||
# In the heuristic for C0201, how many conditionals to match within a loop in
|
||||
# before considering the loop a parser
|
||||
max_conditionals_custom_parser: 2
|
||||
|
||||
# Require at least this many newlines between statements;
|
||||
# require no more than this many newlines between statements;
|
||||
# etc.
|
||||
min_statement_spacing: 1
|
||||
max_statement_spacing: 2
|
||||
max_returns: 6
|
||||
max_branches: 12
|
||||
max_arguments: 5
|
||||
max_localvars: 15
|
||||
max_statements: 50
|
@ -1,55 +0,0 @@
|
||||
# https://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.txt]
|
||||
indent_size = unset
|
||||
indent_style = space
|
||||
|
||||
[*.[chS]]
|
||||
indent_size = 3
|
||||
indent_style = space
|
||||
max_doc_length = 80
|
||||
max_line_length = 80
|
||||
|
||||
[*.dfa]
|
||||
indent_size = 3
|
||||
indent_style = space
|
||||
max_doc_length = 80
|
||||
max_line_length = 80
|
||||
|
||||
[*.awk]
|
||||
indent_size = 3
|
||||
indent_style = space
|
||||
max_doc_length = 80
|
||||
max_line_length = 100
|
||||
|
||||
[*.cmake]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
max_doc_length = 80
|
||||
max_line_length = 100
|
||||
|
||||
[*.sh]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
max_doc_length = 100
|
||||
max_line_length = 100
|
||||
|
||||
[{Makefile.in,aclocal.m4,ltmain.sh}]
|
||||
indent_size = unset
|
||||
indent_style = unset
|
||||
insert_final_newline = unset
|
||||
max_doc_length = unset
|
||||
max_line_length = unset
|
||||
trim_trailing_whitespace = unset
|
||||
|
||||
[COMMIT_EDITMSG]
|
||||
indent_style = space
|
||||
max_doc_length = unset
|
||||
max_line_length = 72
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"Disable": {
|
||||
"IndentSize": true
|
||||
},
|
||||
"Exclude": [
|
||||
".git/",
|
||||
"out/"
|
||||
]
|
||||
}
|
31
.github/workflows/lint.yml
vendored
31
.github/workflows/lint.yml
vendored
@ -1,31 +0,0 @@
|
||||
name: Linting libpng
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- libpng16
|
||||
- libpng18
|
||||
pull_request:
|
||||
branches:
|
||||
- libpng16
|
||||
- libpng18
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Set up the cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/pip.txt') }}
|
||||
restore-keys: ${{ runner.os }}-pip-
|
||||
- name: Install yamllint
|
||||
run: pip install yamllint
|
||||
- name: Install editorconfig-checker
|
||||
uses: editorconfig-checker/action-editorconfig-checker@main
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v4
|
||||
- name: Run the linting script
|
||||
run: bash ./ci/ci_lint.sh
|
159
.gitignore
vendored
159
.gitignore
vendored
@ -1,159 +0,0 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Precompiled headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Linker output files
|
||||
*.exp
|
||||
*.ilk
|
||||
*.map
|
||||
|
||||
# Compiled dynamic libraries
|
||||
*.dll
|
||||
*.dylib
|
||||
*.so
|
||||
*.so.*
|
||||
|
||||
# Compiled static libraries
|
||||
*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.lib
|
||||
|
||||
# Compiled executables
|
||||
*.app/
|
||||
*.exe
|
||||
a.out
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.idb
|
||||
*.pdb
|
||||
*.su
|
||||
|
||||
# Tag files
|
||||
TAGS
|
||||
.TAGS
|
||||
!TAGS/
|
||||
tags
|
||||
.tags
|
||||
!tags/
|
||||
gtags.files
|
||||
GTAGS
|
||||
GRTAGS
|
||||
GPATH
|
||||
GSYMS
|
||||
cscope.files
|
||||
cscope.out
|
||||
cscope.*.out
|
||||
|
||||
# Text editing and text processing artifacts
|
||||
\#*\#
|
||||
.\#*
|
||||
[._]*.sw[a-p]
|
||||
[._]sw[a-p]
|
||||
*.bak
|
||||
*.orig
|
||||
*.rej
|
||||
*.tmp
|
||||
*~
|
||||
|
||||
# IDE files and directories
|
||||
## Eclipse
|
||||
.cproject/
|
||||
.project/
|
||||
.settings/
|
||||
## Embarcadero RAD Studio
|
||||
*.cbproj.*
|
||||
__recovery/
|
||||
## JetBrains
|
||||
.idea/
|
||||
## NetBeans
|
||||
nbbuild/
|
||||
nbdist/
|
||||
nbproject/
|
||||
## Visual Studio
|
||||
.vs/
|
||||
### Visual Studio user files
|
||||
*.rsuser
|
||||
*.sln.docstates
|
||||
*.suo
|
||||
*.user
|
||||
*.userprefs
|
||||
### Visual Studio cache files (for older versions)
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.VC.db
|
||||
*.VC.opendb
|
||||
ipch/
|
||||
## Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
## (Various)
|
||||
*.*cache
|
||||
*.cache*
|
||||
[._]*_history
|
||||
.history/
|
||||
[Bb]ackup*/
|
||||
|
||||
# Build, test and CI output directories
|
||||
*[Dd]ebug/
|
||||
[Dd]ebug*/
|
||||
*[Rr]elease/
|
||||
[Rr]elease*/
|
||||
[._]build*/
|
||||
/[Bb]uild*/
|
||||
/[Oo]ut/
|
||||
|
||||
# Libpng configuration and auxiliary build artifacts
|
||||
*.out
|
||||
*out.png
|
||||
[._]deps/
|
||||
[._]libs/
|
||||
.dirstamp
|
||||
/Makefile
|
||||
/autom4te.cache/
|
||||
/config*~
|
||||
/config.h
|
||||
/config.log
|
||||
/config.status
|
||||
/install*~
|
||||
/libpng*-config
|
||||
/libpng*.pc
|
||||
/libpng.vers
|
||||
/libtool
|
||||
/stamp-h1
|
||||
CMake*.json
|
||||
!CMakePresets.json
|
||||
CMakeLists.txt.*
|
||||
pnglibconf.[ch]
|
||||
pnglibconf.dfn
|
||||
pnglibconf.pre
|
||||
pngprefix.h
|
||||
|
||||
# Libpng test programs, scripts and artifacts
|
||||
/test-suite.log
|
||||
/tests/*.log
|
||||
/tests/*.trs
|
||||
/png-fix-itxt
|
||||
/pngcp
|
||||
/pngfix
|
||||
/pngimage
|
||||
/pngstest
|
||||
/pngtest
|
||||
/pngunknown
|
||||
/pngvalid
|
||||
/timepng
|
99
.travis.yml
Normal file
99
.travis.yml
Normal file
@ -0,0 +1,99 @@
|
||||
language: c
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/pip
|
||||
- $HOME/deps
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=normal
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=normal
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=coverage
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=ubsan
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=asan
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=lsan
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=msan
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=normal
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=normal
|
||||
|
||||
install:
|
||||
- pip install --user 'requests[security]'
|
||||
- pip install --user cpp-coveralls
|
||||
- |
|
||||
mkdir -p deps
|
||||
pushd deps
|
||||
export PREFIXDIR=`pwd`
|
||||
if [ ! -f "libtool-2.4.6.tar.xz" ]; then
|
||||
wget http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.xz
|
||||
fi
|
||||
if [ ! -f "automake-1.15.tar.xz" ]; then
|
||||
wget http://ftp.gnu.org/gnu/automake/automake-1.15.tar.xz
|
||||
fi
|
||||
if [ ! -d "libtool-2.4.6" ]; then
|
||||
tar xf libtool-2.4.6.tar.xz
|
||||
pushd libtool-2.4.6/
|
||||
./configure --prefix=$PREFIXDIR
|
||||
make && make install
|
||||
popd
|
||||
cp $PREFIXDIR/bin/libtool $PREFIXDIR/bin/glibtool
|
||||
cp $PREFIXDIR/bin/libtoolize $PREFIXDIR/bin/glibtoolize
|
||||
fi
|
||||
if [ ! -d "automake-1.15" ]; then
|
||||
tar xf automake-1.15.tar.xz
|
||||
pushd automake-1.15/
|
||||
./configure --prefix=$PREFIXDIR
|
||||
make && make install
|
||||
popd
|
||||
fi
|
||||
export PATH="$PREFIXDIR/bin:$PATH"
|
||||
popd
|
||||
before_script:
|
||||
- |
|
||||
if [ "$BUILD_TYPE" = "coverage" ]; then
|
||||
export CFLAGS="-fprofile-arcs -ftest-coverage"
|
||||
export LDFLAGS="-fprofile-arcs -ftest-coverage"
|
||||
fi
|
||||
- |
|
||||
if [ "$BUILD_TYPE" = "asan" ]; then
|
||||
export CFLAGS=-fsanitize=address
|
||||
export LDFLAGS=-fsanitize=address
|
||||
fi
|
||||
- |
|
||||
if [ "$BUILD_TYPE" = "lsan" ]; then
|
||||
export CFLAGS=-fsanitize=leak
|
||||
export LDFLAGS=-fsanitize=leak
|
||||
fi
|
||||
- |
|
||||
if [ "$BUILD_TYPE" = "msan" ]; then
|
||||
export CFLAGS=-fsanitize=memory
|
||||
export LDFLAGS=-fsanitize=memory
|
||||
fi
|
||||
- |
|
||||
if [ "$BUILD_TYPE" = "ubsan" ]; then
|
||||
export CFLAGS="-fsanitize=undefined -fno-sanitize-recover"
|
||||
export LDFLAGS="-fsanitize=undefined"
|
||||
fi
|
||||
script:
|
||||
- ./autogen.sh && ./configure && make && make check
|
||||
- |
|
||||
if [ "$BUILD_TYPE" = "coverage" ]; then
|
||||
cpp-coveralls --gcov-options '\-lp'
|
||||
fi
|
@ -1,7 +0,0 @@
|
||||
extends: default
|
||||
rules:
|
||||
document-start: disable
|
||||
document-end: disable
|
||||
line-length: disable
|
||||
truthy:
|
||||
check-keys: false
|
66
AUTHORS
66
AUTHORS
@ -1,66 +0,0 @@
|
||||
PNG REFERENCE LIBRARY AUTHORS
|
||||
=============================
|
||||
|
||||
This is the list of PNG Reference Library ("libpng") Contributing
|
||||
Authors, for copyright and licensing purposes.
|
||||
|
||||
* Adam Richter
|
||||
* Andreas Dilger
|
||||
* Chris Blume
|
||||
* Cosmin Truta
|
||||
* Dave Martindale
|
||||
* Eric S. Raymond
|
||||
* Gilles Vollant
|
||||
* Glenn Randers-Pehrson
|
||||
* Greg Roelofs
|
||||
* Guy Eric Schalnat
|
||||
* James Yu
|
||||
* John Bowler
|
||||
* Kevin Bracey
|
||||
* Lucas Chollet
|
||||
* Magnus Holmgren
|
||||
* Mandar Sahastrabuddhe
|
||||
* Manfred Schlaegl
|
||||
* Mans Rullgard
|
||||
* Matt Sarett
|
||||
* Mike Klein
|
||||
* Pascal Massimino
|
||||
* Paul Schmidt
|
||||
* Philippe Antoine
|
||||
* Qiang Zhou
|
||||
* Sam Bushell
|
||||
* Samuel Williams
|
||||
* Simon-Pierre Cadieux
|
||||
* Tim Wegner
|
||||
* Tom Lane
|
||||
* Tom Tanner
|
||||
* Vadim Barkov
|
||||
* Willem van Schaik
|
||||
* Zhijie Liang
|
||||
* Apple Inc.
|
||||
- Zixu Wang (王子旭)
|
||||
* Arm Holdings
|
||||
- Richard Townsend
|
||||
* Google LLC
|
||||
- Dan Field
|
||||
- Dragoș Tiselice
|
||||
- Leon Scroggins III
|
||||
- Matt Sarett
|
||||
- Mike Klein
|
||||
- Sami Boukortt
|
||||
- Wan-Teh Chang
|
||||
* Loongson Technology Corporation Ltd.
|
||||
- GuXiWei (顾希伟)
|
||||
- JinBo (金波)
|
||||
- ZhangLixia (张利霞)
|
||||
* Samsung Group
|
||||
- Filip Wasil
|
||||
|
||||
The build projects, the build scripts, the test scripts, and other
|
||||
files in the "projects", "scripts" and "tests" directories, have
|
||||
other copyright owners, but are released under the libpng license.
|
||||
|
||||
Some files in the "ci" and "contrib" directories, as well as some
|
||||
of the tools-generated files that are distributed with libpng, have
|
||||
other copyright owners, and are released under other open source
|
||||
licenses.
|
1451
CMakeLists.txt
1451
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
158
INSTALL
158
INSTALL
@ -1,3 +1,4 @@
|
||||
|
||||
Installing libpng
|
||||
|
||||
Contents
|
||||
@ -15,11 +16,10 @@ Contents
|
||||
XI. Prepending a prefix to exported symbols
|
||||
XII. Configuring for compiler xxx:
|
||||
XIII. Removing unwanted object code
|
||||
XIV. Enabling or disabling hardware optimizations
|
||||
XV. Changes to the build and configuration of libpng in libpng-1.5.x
|
||||
XVI. Setjmp/longjmp issues
|
||||
XVII. Common linking failures
|
||||
XVIII. Other sources of information about libpng
|
||||
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
|
||||
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,33 +190,36 @@ 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. Prepending a prefix to exported symbols
|
||||
|
||||
Starting with libpng-1.6.0, you can configure libpng (when using the
|
||||
"configure" script) to prefix all exported symbols by means of the
|
||||
@ -228,7 +230,7 @@ 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.
|
||||
@ -238,9 +240,10 @@ The files in libpng proper only include pngpriv.h and png.h, which
|
||||
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
|
||||
As of libpng-1.5.0, pngpriv.h also includes three other private header
|
||||
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
|
||||
that previously appeared in the public headers.
|
||||
that previously appeared in the public headers. As of libpng-1.7.0,
|
||||
pngchunk.h is also included, and is used privately by pngrutil.c.
|
||||
|
||||
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 +282,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 +373,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
|
||||
@ -442,7 +391,7 @@ 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 +403,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
|
||||
|
174
LICENSE
174
LICENSE
@ -1,82 +1,50 @@
|
||||
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.7.0beta88, August 6, 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
|
||||
James Yu
|
||||
|
||||
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 +52,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 +68,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 6, 2017
|
||||
|
126
Makefile.am
126
Makefile.am
@ -1,7 +1,7 @@
|
||||
# Makefile.am, the source file for Makefile.in (and hence Makefile), is
|
||||
#
|
||||
# Copyright (c) 2018-2025 Cosmin Truta
|
||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
||||
# Last changed in libpng 1.7.0 [(PENDING RELEASE)]
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
@ -9,24 +9,16 @@
|
||||
|
||||
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I scripts/autoconf
|
||||
ACLOCAL_AMFLAGS = -I scripts
|
||||
|
||||
# test programs - run on make check, make distcheck
|
||||
if ENABLE_TESTS
|
||||
check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp
|
||||
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,
|
||||
@ -38,7 +30,6 @@ endif
|
||||
# always wrong and always very confusing.
|
||||
BUILT_SOURCES = pnglibconf.h
|
||||
|
||||
if ENABLE_TESTS
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
@ -54,33 +45,29 @@ pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
pngimage_SOURCES = contrib/libtests/pngimage.c
|
||||
pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
pngfix_SOURCES = contrib/tools/pngfix.c
|
||||
pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
|
||||
png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c
|
||||
|
||||
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/pngtest\
|
||||
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-size tests/pngvalid-size\
|
||||
tests/pngvalid-progressive-interlace-standard\
|
||||
tests/pngvalid-transform\
|
||||
tests/pngvalid-transform tests/pngvalid-interlace-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\
|
||||
@ -88,7 +75,6 @@ TESTS =\
|
||||
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
|
||||
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
|
||||
tests/pngimage-quick tests/pngimage-full
|
||||
endif
|
||||
|
||||
# man pages
|
||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||
@ -104,50 +90,15 @@ lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
|
||||
pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\
|
||||
pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\
|
||||
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
|
||||
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngchunk.h \
|
||||
pngusr.dfa
|
||||
|
||||
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
|
||||
# Include libpng extensions, if appropriate. This uses a Makefile.am fragment,
|
||||
# pre-set things that might be changed by addition:
|
||||
AM_CPPFLAGS =
|
||||
DFA_EXTENSION =
|
||||
if LIBPNG_EXTENSIONS
|
||||
include $(top_srcdir)/contrib/extensions.am
|
||||
endif
|
||||
|
||||
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
||||
@ -170,14 +121,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
|
||||
@ -192,31 +135,31 @@ pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
|
||||
# from those directories being included. This only works if the configure is
|
||||
# not done in the source directory!
|
||||
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 \
|
||||
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
|
||||
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
|
||||
CMakeLists.txt example.c libpng-manual.txt
|
||||
|
||||
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk
|
||||
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.c
|
||||
|
||||
CLEANFILES= *.tf? 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 \
|
||||
pnglibconf.out pnglibconf.c pnglibconf.dfn 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
|
||||
# steps (unless targe_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
|
||||
# DFNCPP is normally just "CPP -E" - 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
|
||||
# parsing - and therefore fails with the .df files. configure.ac has special
|
||||
# checks for this and sets DFNCPP appropriately.
|
||||
@ -235,6 +178,8 @@ 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
|
||||
|
||||
pnglibconf.out: config.h
|
||||
|
||||
libpng.sym: scripts/sym.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
@ -246,7 +191,7 @@ 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
|
||||
pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst config.h
|
||||
rm -f $@
|
||||
$(AWK) 's==0 && NR>1{print prev}\
|
||||
s==0{prev=$$0}\
|
||||
@ -312,17 +257,17 @@ endif
|
||||
rm -f $@ $*.tf[12]
|
||||
test -d scripts || mkdir scripts || test -d scripts
|
||||
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
|
||||
$(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1
|
||||
$(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)
|
||||
pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_EXTENSION) $(DFA_XTRA)
|
||||
rm -f $@ $*.tf[45]
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
|
||||
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
|
||||
${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
|
||||
$(DFA_EXTENSION) ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
|
||||
rm $*.tf4
|
||||
mv $*.tf5 $@
|
||||
@ -340,8 +285,9 @@ scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.ou
|
||||
# be empty - no non-standard defines
|
||||
scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
|
||||
rm -f $@ pnglibconf.tf[67]
|
||||
test -z "$(CPPFLAGS)"
|
||||
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
|
||||
test -z "$(CPPFLAGS)" -a -z "$(AM_CPPFLAGS)"
|
||||
(echo "com libpng @PNGLIB_VERSION@ STANDARD API DEFINITION";\
|
||||
echo "com") |\
|
||||
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
|
||||
logunsupported=1 version=search ${srcdir}/pngconf.h -\
|
||||
${srcdir}/scripts/pnglibconf.dfa 1>&2
|
||||
@ -350,7 +296,7 @@ scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
|
||||
rm pnglibconf.tf6
|
||||
mv pnglibconf.tf7 $@
|
||||
|
||||
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
|
||||
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h pngchunk.h \
|
||||
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
|
||||
|
||||
test: check-am
|
||||
|
2610
Makefile.in
2610
Makefile.in
File diff suppressed because it is too large
Load Diff
344
README
344
README
@ -1,88 +1,56 @@
|
||||
README for libpng version 1.6.51.git
|
||||
====================================
|
||||
README for libpng version 1.7.0beta88 - August 6, 2017 (shared library 17.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See the note about version numbers near the top of `png.h`.
|
||||
See `INSTALL` for instructions on how to install libpng.
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
||||
Libpng comes in several distribution formats. Get `libpng-*.tar.gz`
|
||||
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,157 @@ 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)
|
||||
pngchunk.h => PNG chunk descriptions (private, new in libpng17)
|
||||
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
|
||||
examples => Example programs
|
||||
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
|
||||
tools => Various tools
|
||||
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
|
||||
|
51
TODO
51
TODO
@ -1,22 +1,31 @@
|
||||
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. As a start on
|
||||
this, minimize the use of png_error(), replacing them with
|
||||
png_warning(); return(0); or similar.
|
||||
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.
|
||||
Refactor preprocessor conditionals to compile entire statements
|
||||
Quiet compiler warnings (mostly -Wconversion warnings).
|
||||
|
||||
*/
|
||||
|
@ -1,8 +0,0 @@
|
||||
TRADEMARK
|
||||
=========
|
||||
|
||||
The name "libpng" has not been registered by the Copyright owners
|
||||
as a trademark in any jurisdiction. However, because libpng has
|
||||
been distributed and maintained world-wide, continually since 1995,
|
||||
the Copyright owners claim "common-law trademark protection" in any
|
||||
jurisdiction where common-law trademark is recognized.
|
1378
aclocal.m4
vendored
1378
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -1,60 +0,0 @@
|
||||
/* filter_neon.S - placeholder file
|
||||
*
|
||||
* Copyright (c) 2024 Cosmin Truta
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* IMPORTANT NOTE:
|
||||
*
|
||||
* Historically, the hand-coded assembler implementation of Neon optimizations
|
||||
* in this module had not been in sync with the intrinsics-based implementation
|
||||
* in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since
|
||||
* the introduction of riffled palette optimizations. Moreover, the assembler
|
||||
* code used to work on 32-bit ARM only, and it caused problems, even if empty,
|
||||
* on 64-bit ARM.
|
||||
*
|
||||
* All references to this module from our internal build scripts and projects
|
||||
* have been removed.
|
||||
*
|
||||
* For the external projects that might still expect this module to be present,
|
||||
* we leave this stub in place, for the remaining lifetime of libpng-1.6.x.
|
||||
* Everything should continue to function normally, as long as there are no
|
||||
* deliberate attempts to use the old hand-made assembler code. A build error
|
||||
* will be raised otherwise.
|
||||
*/
|
||||
|
||||
/* This is required to get the symbol renames, which are #defines, and the
|
||||
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
|
||||
*/
|
||||
#define PNG_VERSION_INFO_ONLY
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
|
||||
#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)
|
||||
#else
|
||||
#define GNUC_VERSION 0 /* not gcc */
|
||||
#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
|
||||
|
||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
|
||||
#endif /* READ */
|
@ -1,150 +0,0 @@
|
||||
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
|
||||
*
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
|
||||
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
|
||||
# include <arm64_neon.h>
|
||||
#else
|
||||
# include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
|
||||
void
|
||||
png_riffle_palette_neon(png_structrp png_ptr)
|
||||
{
|
||||
png_const_colorp palette = png_ptr->palette;
|
||||
png_bytep riffled_palette = png_ptr->riffled_palette;
|
||||
png_const_bytep trans_alpha = png_ptr->trans_alpha;
|
||||
int num_trans = png_ptr->num_trans;
|
||||
int i;
|
||||
|
||||
/* Initially black, opaque. */
|
||||
uint8x16x4_t w = {{
|
||||
vdupq_n_u8(0x00),
|
||||
vdupq_n_u8(0x00),
|
||||
vdupq_n_u8(0x00),
|
||||
vdupq_n_u8(0xff),
|
||||
}};
|
||||
|
||||
png_debug(1, "in png_riffle_palette_neon");
|
||||
|
||||
/* First, riffle the RGB colours into an RGBA8 palette.
|
||||
* The alpha component is set to opaque for now.
|
||||
*/
|
||||
for (i = 0; i < 256; i += 16)
|
||||
{
|
||||
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
|
||||
w.val[0] = v.val[0];
|
||||
w.val[1] = v.val[1];
|
||||
w.val[2] = v.val[2];
|
||||
vst4q_u8(riffled_palette + (i << 2), w);
|
||||
}
|
||||
|
||||
/* Fix up the missing transparency values. */
|
||||
for (i = 0; i < num_trans; i++)
|
||||
riffled_palette[(i << 2) + 3] = trans_alpha[i];
|
||||
}
|
||||
|
||||
/* Expands a palettized row into RGBA8. */
|
||||
int
|
||||
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
const png_uint_32 *riffled_palette =
|
||||
png_aligncastconst(png_const_uint_32p, png_ptr->riffled_palette);
|
||||
const png_uint_32 pixels_per_chunk = 4;
|
||||
png_uint_32 i;
|
||||
|
||||
png_debug(1, "in png_do_expand_palette_rgba8_neon");
|
||||
|
||||
PNG_UNUSED(row)
|
||||
if (row_width < pixels_per_chunk)
|
||||
return 0;
|
||||
|
||||
/* This function originally gets the last byte of the output row.
|
||||
* The NEON part writes forward from a given position, so we have
|
||||
* to seek this back by 4 pixels x 4 bytes.
|
||||
*/
|
||||
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1);
|
||||
|
||||
for (i = 0; i < row_width; i += pixels_per_chunk)
|
||||
{
|
||||
uint32x4_t cur;
|
||||
png_bytep sp = *ssp - i, dp = *ddp - (i << 2);
|
||||
cur = vld1q_dup_u32 (riffled_palette + *(sp - 3));
|
||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1);
|
||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2);
|
||||
cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3);
|
||||
vst1q_u32((void *)dp, cur);
|
||||
}
|
||||
if (i != row_width)
|
||||
{
|
||||
/* Remove the amount that wasn't processed. */
|
||||
i -= pixels_per_chunk;
|
||||
}
|
||||
|
||||
/* Decrement output pointers. */
|
||||
*ssp = *ssp - i;
|
||||
*ddp = *ddp - (i << 2);
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Expands a palettized row into RGB8. */
|
||||
int
|
||||
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
png_const_bytep palette = (png_const_bytep)png_ptr->palette;
|
||||
const png_uint_32 pixels_per_chunk = 8;
|
||||
png_uint_32 i;
|
||||
|
||||
png_debug(1, "in png_do_expand_palette_rgb8_neon");
|
||||
|
||||
PNG_UNUSED(row)
|
||||
if (row_width <= pixels_per_chunk)
|
||||
return 0;
|
||||
|
||||
/* Seeking this back by 8 pixels x 3 bytes. */
|
||||
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1);
|
||||
|
||||
for (i = 0; i < row_width; i += pixels_per_chunk)
|
||||
{
|
||||
uint8x8x3_t cur;
|
||||
png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i);
|
||||
cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7)));
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6);
|
||||
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7);
|
||||
vst3_u8((void *)dp, cur);
|
||||
}
|
||||
|
||||
if (i != row_width)
|
||||
{
|
||||
/* Remove the amount that wasn't processed. */
|
||||
i -= pixels_per_chunk;
|
||||
}
|
||||
|
||||
/* Decrement output pointers. */
|
||||
*ssp = *ssp - i;
|
||||
*ddp = *ddp - ((i << 1) + i);
|
||||
return i;
|
||||
}
|
||||
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION */
|
@ -77,14 +77,13 @@ 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
|
||||
# Files generated by versions of configue >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_libtool_files="scripts/libtool.m4 scripts/ltoptions.m4\
|
||||
scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4"
|
||||
|
||||
libpng_autotools_dirs="autom4te.cache" # not required
|
||||
#
|
||||
@ -195,7 +194,7 @@ case "$mode" in
|
||||
if test -d .git
|
||||
then
|
||||
exec >&2
|
||||
echo "ERROR: running autoreconf on an initialized system"
|
||||
echo "ERROR: running autoreconf on an initialized sytem"
|
||||
echo " This is not necessary; it is only necessary to remake the"
|
||||
echo " autotools generated files if Makefile.am or configure.ac"
|
||||
echo " change and make does the right thing with:"
|
||||
|
@ -1,11 +0,0 @@
|
||||
# Disable the "expressions don't expand in single quotes, use double quotes"
|
||||
# advice. We need the regular expressions to remain uninterpolated.
|
||||
disable=SC2016
|
||||
|
||||
# Disable the "variable appears unused" warning caused by the use of getopts
|
||||
# with an obligatory (but unused) variable name in the main function.
|
||||
disable=SC2034
|
||||
|
||||
# Disable all the "quote to prevent globbing or word splitting" advice.
|
||||
# We need word splitting for well-known variables like MAKEFLAGS and CFLAGS.
|
||||
disable=SC2086,SC2206
|
@ -1,19 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
25
ci/README.md
25
ci/README.md
@ -1,25 +0,0 @@
|
||||
Scripts for the Continuous Integration of the PNG Reference Library
|
||||
===================================================================
|
||||
|
||||
Copyright Notice
|
||||
----------------
|
||||
|
||||
Copyright (c) 2019-2025 Cosmin Truta.
|
||||
|
||||
Use, modification and distribution are subject to the MIT License.
|
||||
Please see the accompanying file `LICENSE_MIT.txt` or visit
|
||||
https://opensource.org/license/mit
|
||||
|
||||
File List
|
||||
---------
|
||||
|
||||
LICENSE_MIT.txt ==> The License file
|
||||
README.md ==> This file
|
||||
ci_lint.sh ==> Lint the source code
|
||||
ci_shellify.sh ==> Convert select definitions to shell syntax
|
||||
ci_verify_cmake.sh ==> Verify the build driven by CMakeLists.txt
|
||||
ci_verify_configure.sh ==> Verify the build driven by configure
|
||||
ci_verify_makefiles.sh ==> Verify the build driven by scripts/makefile.*
|
||||
ci_verify_version.sh ==> Verify the consistency of version definitions
|
||||
lib/ci.lib.sh ==> Shell utilities for the main ci_*.sh scripts
|
||||
targets/*/ci_env.*.sh ==> Shell environments for cross-platform testing
|
142
ci/ci_lint.sh
142
ci/ci_lint.sh
@ -1,142 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
# Initialize the global constants CI_{...}{CHECK,CHECKER,LINT}.
|
||||
CI_SHELLCHECK="${CI_SHELLCHECK:-shellcheck}"
|
||||
CI_EDITORCONFIG_CHECKER="${CI_EDITORCONFIG_CHECKER:-editorconfig-checker}"
|
||||
CI_YAMLLINT="${CI_YAMLLINT:-yamllint}"
|
||||
|
||||
# Initialize the global lint status.
|
||||
CI_LINT_STATUS=0
|
||||
|
||||
function ci_init_lint {
|
||||
ci_info "## START OF LINTING ##"
|
||||
local my_program
|
||||
# Complete the initialization of CI_SHELLCHECK.
|
||||
# Set it to the empty string if the shellcheck program is unavailable.
|
||||
my_program="$(command -v "$CI_SHELLCHECK")" || {
|
||||
ci_warn "program not found: '$CI_SHELLCHECK'"
|
||||
}
|
||||
CI_SHELLCHECK="$my_program"
|
||||
# Complete the initialization of CI_EDITORCONFIG_CHECKER.
|
||||
# Set it to the empty string if the editorconfig-checker program is unavailable.
|
||||
my_program="$(command -v "$CI_EDITORCONFIG_CHECKER")" || {
|
||||
ci_warn "program not found: '$CI_EDITORCONFIG_CHECKER'"
|
||||
}
|
||||
CI_EDITORCONFIG_CHECKER="$my_program"
|
||||
# Complete the initialization of CI_YAMLLINT.
|
||||
# Set it to the empty string if the yamllint program is unavailable.
|
||||
my_program="$(command -v "$CI_YAMLLINT")" || {
|
||||
ci_warn "program not found: '$CI_YAMLLINT'"
|
||||
}
|
||||
CI_YAMLLINT="$my_program"
|
||||
}
|
||||
|
||||
function ci_finish_lint {
|
||||
ci_info "## END OF LINTING ##"
|
||||
if [[ $CI_LINT_STATUS -eq 0 ]]
|
||||
then
|
||||
ci_info "## SUCCESS ##"
|
||||
else
|
||||
ci_info "linting failed"
|
||||
fi
|
||||
return "$CI_LINT_STATUS"
|
||||
}
|
||||
|
||||
function ci_lint_ci_scripts {
|
||||
[[ -x $CI_SHELLCHECK ]] || {
|
||||
ci_warn "## NOT LINTING: CI scripts ##"
|
||||
return 0
|
||||
}
|
||||
ci_info "## LINTING: CI scripts ##"
|
||||
ci_spawn "$CI_SHELLCHECK" --version
|
||||
find ./ci -name "ci_*.sh" -not -name "ci_env.*.sh" | {
|
||||
local my_file
|
||||
while IFS="" read -r my_file
|
||||
do
|
||||
ci_spawn "$CI_SHELLCHECK" -x "$my_file" || {
|
||||
# Linting failed.
|
||||
return 1
|
||||
}
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
function ci_lint_text_files {
|
||||
[[ -x $CI_EDITORCONFIG_CHECKER ]] || {
|
||||
ci_warn "## NOT LINTING: text files ##"
|
||||
return 0
|
||||
}
|
||||
ci_info "## LINTING: text files ##"
|
||||
ci_spawn "$CI_EDITORCONFIG_CHECKER" --version
|
||||
ci_spawn "$CI_EDITORCONFIG_CHECKER" --config .editorconfig-checker.json || {
|
||||
# Linting failed.
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
function ci_lint_yaml_files {
|
||||
[[ -x $CI_YAMLLINT ]] || {
|
||||
ci_warn "## NOT LINTING: YAML files ##"
|
||||
return 0
|
||||
}
|
||||
ci_info "## LINTING: YAML files ##"
|
||||
ci_spawn "$CI_YAMLLINT" --version
|
||||
# Considering that the YAML format is an extension of the JSON format,
|
||||
# we can lint both the YAML files and the plain JSON files here.
|
||||
find . \( -iname "*.yml" -o -iname "*.yaml" -o -iname "*.json" \) -not -path "./out/*" | {
|
||||
local my_file
|
||||
while IFS="" read -r my_file
|
||||
do
|
||||
ci_spawn "$CI_YAMLLINT" --strict "$my_file" || {
|
||||
# Linting failed.
|
||||
return 1
|
||||
}
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
function ci_lint {
|
||||
ci_init_lint
|
||||
ci_lint_ci_scripts || CI_LINT_STATUS=1
|
||||
ci_lint_text_files || CI_LINT_STATUS=1
|
||||
ci_lint_yaml_files || CI_LINT_STATUS=1
|
||||
# TODO: ci_lint_png_files, etc.
|
||||
ci_finish_lint
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# -eq 0 ]] || {
|
||||
echo >&2 "error: unexpected argument: '$1'"
|
||||
usage 2
|
||||
}
|
||||
# And... go!
|
||||
ci_lint
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,209 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
||||
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
|
||||
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
|
||||
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
|
||||
|
||||
function ci_init_build {
|
||||
# Ensure that the mandatory variables are initialized.
|
||||
CI_CMAKE="${CI_CMAKE:-cmake}"
|
||||
CI_CTEST="${CI_CTEST:-ctest}"
|
||||
CI_CMAKE_BUILD_TYPE="${CI_CMAKE_BUILD_TYPE:-Release}"
|
||||
if [[ $CI_CMAKE_GENERATOR == "Visual Studio"* ]]
|
||||
then
|
||||
# Clean up incidental mixtures of Windows and Bash-on-Windows
|
||||
# environment variables, to avoid confusing MSBuild.
|
||||
[[ $TEMP && ( $Temp || $temp ) ]] && unset TEMP
|
||||
[[ $TMP && ( $Tmp || $tmp ) ]] && unset TMP
|
||||
# Ensure that CI_CMAKE_GENERATOR_PLATFORM is initialized for this generator.
|
||||
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] || {
|
||||
ci_err_internal "missing \$CI_CMAKE_GENERATOR_PLATFORM"
|
||||
}
|
||||
elif [[ -x $(command -v ninja) ]]
|
||||
then
|
||||
CI_CMAKE_GENERATOR="${CI_CMAKE_GENERATOR:-Ninja}"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_trace_build {
|
||||
ci_info "## START OF CONFIGURATION ##"
|
||||
ci_info "build arch: $CI_BUILD_ARCH"
|
||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
||||
ci_info "target arch: $CI_TARGET_ARCH"
|
||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
||||
}
|
||||
ci_info "source directory: $CI_SRC_DIR"
|
||||
ci_info "build directory: $CI_BUILD_DIR"
|
||||
ci_info "install directory: $CI_INSTALL_DIR"
|
||||
ci_info "environment option: \$CI_CMAKE: '$CI_CMAKE'"
|
||||
ci_info "environment option: \$CI_CMAKE_GENERATOR: '$CI_CMAKE_GENERATOR'"
|
||||
ci_info "environment option: \$CI_CMAKE_GENERATOR_PLATFORM: '$CI_CMAKE_GENERATOR_PLATFORM'"
|
||||
ci_info "environment option: \$CI_CMAKE_BUILD_TYPE: '$CI_CMAKE_BUILD_TYPE'"
|
||||
ci_info "environment option: \$CI_CMAKE_BUILD_FLAGS: '$CI_CMAKE_BUILD_FLAGS'"
|
||||
ci_info "environment option: \$CI_CMAKE_TOOLCHAIN_FILE: '$CI_CMAKE_TOOLCHAIN_FILE'"
|
||||
ci_info "environment option: \$CI_CMAKE_VARS: '$CI_CMAKE_VARS'"
|
||||
ci_info "environment option: \$CI_CTEST: '$CI_CTEST'"
|
||||
ci_info "environment option: \$CI_CTEST_FLAGS: '$CI_CTEST_FLAGS'"
|
||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
||||
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
|
||||
ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
|
||||
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
||||
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
ci_info "executable: \$CI_CMAKE: $(command -V "$CI_CMAKE")"
|
||||
ci_info "executable: \$CI_CTEST: $(command -V "$CI_CTEST")"
|
||||
[[ $CI_CC ]] && {
|
||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
||||
}
|
||||
[[ $CI_AR ]] && {
|
||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
||||
}
|
||||
ci_info "## END OF CONFIGURATION ##"
|
||||
}
|
||||
|
||||
function ci_cleanup_old_build {
|
||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
||||
[[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
|
||||
ci_spawn rm -fr "$CI_BUILD_DIR"
|
||||
ci_spawn rm -fr "$CI_INSTALL_DIR"
|
||||
}
|
||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
||||
}
|
||||
|
||||
function ci_build {
|
||||
ci_info "## START OF BUILD ##"
|
||||
# Adjust the CI environment variables, as needed.
|
||||
CI_CMAKE="$(command -v "$CI_CMAKE")" || ci_err "bad or missing \$CI_CMAKE"
|
||||
ci_spawn "$CI_CMAKE" --version
|
||||
CI_CTEST="$(command -v "$CI_CTEST")" || ci_err "bad or missing \$CI_CTEST"
|
||||
ci_spawn "$CI_CTEST" --version
|
||||
[[ $CI_CMAKE_GENERATOR == *"Ninja"* ]] && {
|
||||
CI_NINJA="$(command -v ninja)" || ci_err "bad or missing ninja, no pun intended"
|
||||
ci_spawn "$CI_NINJA" --version
|
||||
}
|
||||
[[ $CI_AR ]] && {
|
||||
# Use the full path of CI_AR to work around a mysterious CMake error.
|
||||
CI_AR="$(command -v "$CI_AR")" || ci_err "bad or missing \$CI_AR"
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
# Use the full path of CI_RANLIB to work around a mysterious CMake error.
|
||||
CI_RANLIB="$(command -v "$CI_RANLIB")" || ci_err "bad or missing \$CI_RANLIB"
|
||||
}
|
||||
# Export the CMake environment variables.
|
||||
[[ $CI_CMAKE_GENERATOR ]] && {
|
||||
ci_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
|
||||
}
|
||||
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] && {
|
||||
ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
|
||||
}
|
||||
# Initialize and populate the local arrays.
|
||||
local all_cmake_vars=()
|
||||
local all_cmake_build_flags=()
|
||||
local all_ctest_flags=()
|
||||
[[ $CI_CMAKE_TOOLCHAIN_FILE ]] && {
|
||||
all_cmake_vars+=("-DCMAKE_TOOLCHAIN_FILE=$CI_CMAKE_TOOLCHAIN_FILE")
|
||||
}
|
||||
[[ $CI_CC ]] && {
|
||||
all_cmake_vars+=("-DCMAKE_C_COMPILER=$CI_CC")
|
||||
}
|
||||
[[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
|
||||
[[ $CI_SANITIZERS ]] && CI_CC_FLAGS+="${CI_CC_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
|
||||
all_cmake_vars+=("-DCMAKE_C_FLAGS=$CI_CC_FLAGS")
|
||||
}
|
||||
[[ $CI_AR ]] && {
|
||||
all_cmake_vars+=("-DCMAKE_AR=$CI_AR")
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
all_cmake_vars+=("-DCMAKE_RANLIB=$CI_RANLIB")
|
||||
}
|
||||
all_cmake_vars+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE")
|
||||
all_cmake_vars+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
|
||||
all_cmake_vars+=($CI_CMAKE_VARS)
|
||||
all_cmake_build_flags+=($CI_CMAKE_BUILD_FLAGS)
|
||||
all_ctest_flags+=($CI_CTEST_FLAGS)
|
||||
# And... build!
|
||||
ci_spawn mkdir -p "$CI_BUILD_DIR"
|
||||
# Spawn "cmake ...".
|
||||
ci_spawn "$CI_CMAKE" -B "$CI_BUILD_DIR" \
|
||||
-S . \
|
||||
-DCMAKE_INSTALL_PREFIX="$CI_INSTALL_DIR" \
|
||||
"${all_cmake_vars[@]}"
|
||||
ci_expr $((CI_NO_BUILD)) || {
|
||||
# Spawn "cmake --build ...".
|
||||
ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
|
||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
||||
"${all_cmake_build_flags[@]}"
|
||||
}
|
||||
ci_expr $((CI_NO_TEST)) || {
|
||||
# Spawn "ctest" if testing is not disabled.
|
||||
ci_spawn pushd "$CI_BUILD_DIR"
|
||||
ci_spawn "$CI_CTEST" --build-config "$CI_CMAKE_BUILD_TYPE" \
|
||||
"${all_ctest_flags[@]}"
|
||||
ci_spawn popd
|
||||
}
|
||||
ci_expr $((CI_NO_INSTALL)) || {
|
||||
# Spawn "cmake --build ... --target install" if installation is not disabled.
|
||||
ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
|
||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
||||
--target install \
|
||||
"${all_cmake_build_flags[@]}"
|
||||
}
|
||||
ci_expr $((CI_NO_CLEAN)) || {
|
||||
# Spawn "make --build ... --target clean" if cleaning is not disabled.
|
||||
ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
|
||||
--config "$CI_CMAKE_BUILD_TYPE" \
|
||||
--target clean \
|
||||
"${all_cmake_build_flags[@]}"
|
||||
}
|
||||
ci_info "## END OF BUILD ##"
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
# And... go!
|
||||
ci_init_build
|
||||
ci_trace_build
|
||||
[[ $# -eq 0 ]] || {
|
||||
echo >&2 "error: unexpected argument: '$1'"
|
||||
echo >&2 "note: this program accepts environment options only"
|
||||
usage 2
|
||||
}
|
||||
ci_cleanup_old_build
|
||||
ci_build
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,182 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
||||
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
|
||||
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
|
||||
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
|
||||
|
||||
function ci_init_build {
|
||||
# Ensure that the mandatory variables are initialized.
|
||||
CI_MAKE="${CI_MAKE:-make}"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] || {
|
||||
# For native builds, set CI_CC to "cc" by default if the cc command is available.
|
||||
# The configure script defaults CC to "gcc", which is not always a good idea.
|
||||
[[ -x $(command -v cc) ]] && CI_CC="${CI_CC:-cc}"
|
||||
}
|
||||
# Ensure that the CI_ variables that cannot be customized reliably are not initialized.
|
||||
[[ ! $CI_CONFIGURE_VARS ]] || {
|
||||
ci_err "unsupported: \$CI_CONFIGURE_VARS='$CI_CONFIGURE_VARS'"
|
||||
}
|
||||
[[ ! $CI_MAKE_VARS ]] || {
|
||||
ci_err "unsupported: \$CI_MAKE_VARS='$CI_MAKE_VARS'"
|
||||
}
|
||||
}
|
||||
|
||||
function ci_trace_build {
|
||||
ci_info "## START OF CONFIGURATION ##"
|
||||
ci_info "build arch: $CI_BUILD_ARCH"
|
||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
||||
ci_info "target arch: $CI_TARGET_ARCH"
|
||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
||||
}
|
||||
ci_info "source directory: $CI_SRC_DIR"
|
||||
ci_info "build directory: $CI_BUILD_DIR"
|
||||
ci_info "install directory: $CI_INSTALL_DIR"
|
||||
ci_info "environment option: \$CI_CONFIGURE_FLAGS: '$CI_CONFIGURE_FLAGS'"
|
||||
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
|
||||
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
|
||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
||||
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
|
||||
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
|
||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
||||
ci_info "environment option: \$CI_LD: '$CI_LD'"
|
||||
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
|
||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
||||
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
|
||||
ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
|
||||
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
||||
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
|
||||
[[ $CI_CC ]] && {
|
||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
||||
}
|
||||
[[ $CI_CPP ]] && {
|
||||
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
|
||||
}
|
||||
[[ $CI_AR ]] && {
|
||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
||||
}
|
||||
[[ $CI_LD ]] && {
|
||||
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
|
||||
}
|
||||
ci_info "## END OF CONFIGURATION ##"
|
||||
}
|
||||
|
||||
function ci_cleanup_old_build {
|
||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
||||
[[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
|
||||
ci_spawn rm -fr "$CI_BUILD_DIR"
|
||||
ci_spawn rm -fr "$CI_INSTALL_DIR"
|
||||
}
|
||||
[[ ! -e "$CI_SRC_DIR/config.status" ]] || {
|
||||
ci_warn "unexpected build configuration file: '$CI_SRC_DIR/config.status'"
|
||||
if ci_expr $((CI_FORCE))
|
||||
then
|
||||
# Delete the old config and (possibly) the old build.
|
||||
ci_info "note: forcing an in-tree build cleanup"
|
||||
if [[ -f $CI_SRC_DIR/Makefile ]]
|
||||
then
|
||||
ci_spawn make -C "$CI_SRC_DIR" distclean
|
||||
else
|
||||
ci_spawn rm -fr "$CI_SRC_DIR"/config.{log,status}
|
||||
fi
|
||||
else
|
||||
# Alert the user, but do not delete their files.
|
||||
ci_warn "the configure script might fail"
|
||||
ci_info "hint: consider using the option \$CI_FORCE=1"
|
||||
fi
|
||||
}
|
||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
||||
}
|
||||
|
||||
function ci_build {
|
||||
ci_info "## START OF BUILD ##"
|
||||
# Export the configure build environment.
|
||||
[[ $CI_CC ]] && ci_spawn export CC="$CI_CC"
|
||||
[[ $CI_CC_FLAGS ]] && ci_spawn export CFLAGS="$CI_CC_FLAGS"
|
||||
[[ $CI_CPP ]] && ci_spawn export CPP="$CI_CPP"
|
||||
[[ $CI_CPP_FLAGS ]] && ci_spawn export CPPFLAGS="$CI_CPP_FLAGS"
|
||||
[[ $CI_AR ]] && ci_spawn export AR="$CI_AR"
|
||||
[[ $CI_RANLIB ]] && ci_spawn export RANLIB="$CI_RANLIB"
|
||||
[[ $CI_LD ]] && ci_spawn export LD="$CI_LD"
|
||||
[[ $CI_LD_FLAGS ]] && ci_spawn export LDFLAGS="$CI_LD_FLAGS"
|
||||
[[ $CI_SANITIZERS ]] && {
|
||||
ci_spawn export CFLAGS="${CFLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
|
||||
ci_spawn export LDFLAGS="${LDFLAGS}${LDFLAGS:+" "}-fsanitize=$CI_SANITIZERS"
|
||||
}
|
||||
# Spawn "autogen.sh" if the configure script is not available.
|
||||
[[ -x "$CI_SRC_DIR/configure" ]] || {
|
||||
ci_spawn "$CI_SRC_DIR/autogen.sh" --maintainer
|
||||
}
|
||||
# And... build!
|
||||
ci_spawn mkdir -p "$CI_BUILD_DIR"
|
||||
ci_spawn cd "$CI_BUILD_DIR"
|
||||
# Spawn "configure".
|
||||
ci_spawn "$CI_SRC_DIR/configure" --prefix="$CI_INSTALL_DIR" $CI_CONFIGURE_FLAGS
|
||||
ci_expr $((CI_NO_BUILD)) || {
|
||||
# Spawn "make".
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS
|
||||
}
|
||||
ci_expr $((CI_NO_TEST)) || {
|
||||
# Spawn "make test" if testing is not disabled.
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS test
|
||||
}
|
||||
ci_expr $((CI_NO_INSTALL)) || {
|
||||
# Spawn "make install" if installation is not disabled.
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS install
|
||||
}
|
||||
ci_expr $((CI_NO_CLEAN)) || {
|
||||
# Spawn "make clean" and "make distclean" if cleaning is not disabled.
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS clean
|
||||
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS distclean
|
||||
}
|
||||
ci_info "## END OF BUILD ##"
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
# And... go!
|
||||
ci_init_build
|
||||
ci_trace_build
|
||||
[[ $# -eq 0 ]] || {
|
||||
echo >&2 "error: unexpected argument: '$1'"
|
||||
echo >&2 "note: this program accepts environment options only"
|
||||
usage 2
|
||||
}
|
||||
ci_cleanup_old_build
|
||||
ci_build
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,200 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
|
||||
|
||||
function ci_init_build {
|
||||
# Ensure that the mandatory variables are initialized.
|
||||
CI_MAKE="${CI_MAKE:-make}"
|
||||
case "$CI_CC" in
|
||||
( *clang* )
|
||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.clang"}" ;;
|
||||
( *gcc* )
|
||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.gcc"}" ;;
|
||||
( * )
|
||||
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.std"}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function ci_trace_build {
|
||||
ci_info "## START OF CONFIGURATION ##"
|
||||
ci_info "build arch: $CI_BUILD_ARCH"
|
||||
ci_info "build system: $CI_BUILD_SYSTEM"
|
||||
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
|
||||
ci_info "target arch: $CI_TARGET_ARCH"
|
||||
ci_info "target system: $CI_TARGET_SYSTEM"
|
||||
}
|
||||
ci_info "source directory: $CI_SRC_DIR"
|
||||
ci_info "environment option: \$CI_MAKEFILES: '$CI_MAKEFILES'"
|
||||
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
|
||||
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
|
||||
ci_info "environment option: \$CI_MAKE_VARS: '$CI_MAKE_VARS'"
|
||||
ci_info "environment option: \$CI_CC: '$CI_CC'"
|
||||
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
|
||||
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
|
||||
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
|
||||
ci_info "environment option: \$CI_AR: '$CI_AR'"
|
||||
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
|
||||
ci_info "environment option: \$CI_LD: '$CI_LD'"
|
||||
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
|
||||
ci_info "environment option: \$CI_LIBS: '$CI_LIBS'"
|
||||
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
|
||||
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
|
||||
ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
|
||||
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
|
||||
[[ $CI_CC ]] && {
|
||||
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
|
||||
}
|
||||
[[ $CI_CPP ]] && {
|
||||
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
|
||||
}
|
||||
[[ $CI_AR ]] && {
|
||||
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
|
||||
}
|
||||
[[ $CI_LD ]] && {
|
||||
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
|
||||
}
|
||||
ci_info "## END OF CONFIGURATION ##"
|
||||
}
|
||||
|
||||
function ci_cleanup_old_build {
|
||||
# Any old makefile-based build will most likely leave a mess
|
||||
# of object files behind if interrupted, e.g., via Ctrl+C.
|
||||
# There may be other files behind, depending on what makefile
|
||||
# had been used. We cannot easily enumerate all of those.
|
||||
# Fortunately, for a clean makefiles-based build, it should be
|
||||
# sufficient to remove the old object files only.
|
||||
ci_info "## START OF PRE-BUILD CLEANUP ##"
|
||||
local find_args=(-maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \))
|
||||
[[ ! $(find "$CI_SRC_DIR" "${find_args[@]}" | head -n1) ]] || {
|
||||
ci_warn "unexpected build found in '$CI_SRC_DIR'"
|
||||
if ci_expr $((CI_FORCE))
|
||||
then
|
||||
# Delete the old build.
|
||||
local my_file
|
||||
find "$CI_SRC_DIR" "${find_args[@]}" |
|
||||
while IFS="" read -r my_file
|
||||
do
|
||||
ci_spawn rm -fr "$my_file"
|
||||
done
|
||||
ci_info "## END OF PRE-BUILD CLEANUP ##"
|
||||
else
|
||||
# Alert the user, but do not delete their existing files,
|
||||
# and do not mess up their existing build.
|
||||
ci_info "hint: consider using the option \$CI_FORCE=1"
|
||||
ci_err "unable to continue"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
function ci_build {
|
||||
ci_info "## START OF BUILD ##"
|
||||
# Initialize and populate the local arrays.
|
||||
local all_make_flags=()
|
||||
local all_make_vars=()
|
||||
[[ $CI_MAKE_FLAGS ]] && {
|
||||
all_make_flags+=($CI_MAKE_FLAGS)
|
||||
}
|
||||
[[ $CI_CC ]] && {
|
||||
all_make_vars+=("CC=$CI_CC")
|
||||
}
|
||||
[[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
|
||||
[[ $CI_SANITIZERS ]] && CI_CC_FLAGS="${CI_CC_FLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
|
||||
all_make_vars+=("CFLAGS=$CI_CC_FLAGS")
|
||||
}
|
||||
[[ $CI_CPP ]] && {
|
||||
all_make_vars+=("CPP=$CI_CPP")
|
||||
}
|
||||
[[ $CI_CPP_FLAGS ]] && {
|
||||
all_make_vars+=("CPPFLAGS=$CI_CPP_FLAGS")
|
||||
}
|
||||
[[ $CI_AR ]] && {
|
||||
all_make_vars+=("AR=$CI_AR")
|
||||
}
|
||||
[[ $CI_RANLIB ]] && {
|
||||
all_make_vars+=("RANLIB=$CI_RANLIB")
|
||||
}
|
||||
[[ $CI_LD ]] && {
|
||||
all_make_vars+=("LD=$CI_LD")
|
||||
}
|
||||
[[ $CI_LD_FLAGS || $CI_SANITIZERS ]] && {
|
||||
[[ $CI_SANITIZERS ]] && CI_LD_FLAGS+="${CI_LD_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
|
||||
all_make_vars+=("LDFLAGS=$CI_LD_FLAGS")
|
||||
}
|
||||
[[ $CI_LIBS ]] && {
|
||||
all_make_vars+=("LIBS=$CI_LIBS")
|
||||
}
|
||||
all_make_vars+=($CI_MAKE_VARS)
|
||||
# And... build!
|
||||
local my_makefile
|
||||
for my_makefile in $CI_MAKEFILES
|
||||
do
|
||||
ci_info "using makefile: $my_makefile"
|
||||
ci_expr $((CI_NO_BUILD)) || {
|
||||
# Spawn "make".
|
||||
ci_spawn "$CI_MAKE" -f "$my_makefile" \
|
||||
"${all_make_flags[@]}" \
|
||||
"${all_make_vars[@]}"
|
||||
}
|
||||
ci_expr $((CI_NO_TEST)) || {
|
||||
# Spawn "make test" if testing is not disabled.
|
||||
ci_spawn "$CI_MAKE" -f "$my_makefile" \
|
||||
"${all_make_flags[@]}" \
|
||||
"${all_make_vars[@]}" \
|
||||
test
|
||||
}
|
||||
ci_expr $((CI_NO_CLEAN)) || {
|
||||
# Spawn "make clean" if cleaning is not disabled.
|
||||
ci_spawn "$CI_MAKE" -f "$my_makefile" \
|
||||
"${all_make_flags[@]}" \
|
||||
"${all_make_vars[@]}" \
|
||||
clean
|
||||
}
|
||||
done
|
||||
ci_info "## END OF BUILD ##"
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
# And... go!
|
||||
ci_init_build
|
||||
ci_trace_build
|
||||
[[ $# -eq 0 ]] || {
|
||||
echo >&2 "error: unexpected argument: '$1'"
|
||||
echo >&2 "note: this program accepts environment options only"
|
||||
usage 2
|
||||
}
|
||||
ci_cleanup_old_build
|
||||
ci_build
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,191 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/lib/ci.lib.sh"
|
||||
cd "$CI_TOPLEVEL_DIR"
|
||||
|
||||
# Declare the global environments collected from various sources.
|
||||
declare CI_ENV_LIBPNG_VER # collected from png.h
|
||||
declare CI_ENV_AUTOCONF_VER # collected from configure.ac
|
||||
declare CI_ENV_CMAKE_VER # collected from CMakeLists.txt
|
||||
declare CI_ENV_LIBPNGCONFIG_VER # collected from scripts/libpng-config-head.in
|
||||
|
||||
function ci_run_shellify {
|
||||
local my_script my_result
|
||||
my_script="$CI_SCRIPT_DIR/libexec/ci_shellify_${1#--}.sh"
|
||||
shift 1
|
||||
[[ -f $my_script ]] || {
|
||||
ci_err_internal "missing script: '$my_script'"
|
||||
}
|
||||
ci_info "shellifying:" "$@"
|
||||
"$BASH" "$my_script" "$@"
|
||||
echo "$my_result" | "$BASH" --posix || ci_err "bad shellify output"
|
||||
echo "$my_result"
|
||||
}
|
||||
|
||||
function ci_init_version_verification {
|
||||
ci_info "## START OF VERIFICATION ##"
|
||||
CI_ENV_LIBPNG_VER="$(ci_run_shellify --c png.h)"
|
||||
echo "$CI_ENV_LIBPNG_VER"
|
||||
CI_ENV_AUTOCONF_VER="$(ci_run_shellify --autoconf configure.ac)"
|
||||
echo "$CI_ENV_AUTOCONF_VER"
|
||||
CI_ENV_CMAKE_VER="$(ci_run_shellify --cmake CMakeLists.txt)"
|
||||
echo "$CI_ENV_CMAKE_VER"
|
||||
CI_ENV_LIBPNGCONFIG_VER="$(ci_run_shellify --shell scripts/libpng-config-head.in)"
|
||||
echo "$CI_ENV_LIBPNGCONFIG_VER"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
function ci_do_version_verification {
|
||||
local my_expect
|
||||
ci_info "## VERIFYING: version definitions in 'png.h' ##"
|
||||
eval "$CI_ENV_LIBPNG_VER"
|
||||
my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
|
||||
if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect"* ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_STRING == $my_expect*"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_STRING != $my_expect*"
|
||||
fi
|
||||
my_expect=$((PNG_LIBPNG_VER_MAJOR*10000 + PNG_LIBPNG_VER_MINOR*100 + PNG_LIBPNG_VER_RELEASE))
|
||||
if [[ "$PNG_LIBPNG_VER" == "$my_expect" ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER == $my_expect"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER != $my_expect"
|
||||
fi
|
||||
my_expect=$((PNG_LIBPNG_VER_MAJOR*10 + PNG_LIBPNG_VER_MINOR))
|
||||
if [[ "$PNG_LIBPNG_VER_SHAREDLIB" == "$my_expect" ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_SHAREDLIB == $my_expect"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_SHAREDLIB != $my_expect"
|
||||
fi
|
||||
if [[ "$PNG_LIBPNG_VER_SONUM" == "$my_expect" ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_SONUM == $my_expect"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_SONUM != $my_expect"
|
||||
fi
|
||||
if [[ "$PNG_LIBPNG_VER_DLLNUM" == "$my_expect" ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_DLLNUM == $my_expect"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_DLLNUM != $my_expect"
|
||||
fi
|
||||
if [[ "$PNG_LIBPNG_VER_BUILD" == [01] ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_BUILD == [01]"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != [01]"
|
||||
fi
|
||||
ci_info "## VERIFYING: build definitions in 'png.h' ##"
|
||||
my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
|
||||
if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect" ]]
|
||||
then
|
||||
if [[ $PNG_LIBPNG_VER_BUILD -eq 0 ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_BUILD -eq 0"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -ne 0"
|
||||
fi
|
||||
if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -eq $PNG_LIBPNG_BUILD_STABLE ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_STABLE"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_STABLE"
|
||||
fi
|
||||
elif [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect".git ]]
|
||||
then
|
||||
if [[ $PNG_LIBPNG_VER_BUILD -ne 0 ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_VER_BUILD -ne 0"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -eq 0"
|
||||
fi
|
||||
if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -ne $PNG_LIBPNG_BUILD_STABLE ]]
|
||||
then
|
||||
ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_STABLE"
|
||||
else
|
||||
ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_STABLE"
|
||||
fi
|
||||
else
|
||||
ci_err "unexpected: \$PNG_LIBPNG_VER_STRING == '$PNG_LIBPNG_VER_STRING'"
|
||||
fi
|
||||
ci_info "## VERIFYING: type definitions in 'png.h' ##"
|
||||
my_expect="$(echo "png_libpng_version_${PNG_LIBPNG_VER_STRING}" | tr . _)"
|
||||
ci_spawn grep -w -e "$my_expect" png.h
|
||||
ci_info "## VERIFYING: version definitions in 'configure.ac' ##"
|
||||
eval "$CI_ENV_AUTOCONF_VER"
|
||||
if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" ]]
|
||||
then
|
||||
ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
|
||||
else
|
||||
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
|
||||
fi
|
||||
ci_info "## VERIFYING: version definitions in 'CMakeLists.txt' ##"
|
||||
eval "$CI_ENV_CMAKE_VER"
|
||||
if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" && "$PNGLIB_SUBREVISION" == 0 ]]
|
||||
then
|
||||
ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
|
||||
ci_info "matched: \$PNGLIB_SUBREVISION == 0"
|
||||
elif [[ "$PNGLIB_VERSION.$PNGLIB_SUBREVISION" == "$PNG_LIBPNG_VER_STRING" ]]
|
||||
then
|
||||
ci_info "matched: \$PNGLIB_VERSION.\$PNGLIB_SUBREVISION == \$PNG_LIBPNG_VER_STRING"
|
||||
else
|
||||
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
|
||||
fi
|
||||
ci_info "## VERIFYING: version definitions in 'scripts/libpng-config-head.in' ##"
|
||||
eval "$CI_ENV_LIBPNGCONFIG_VER"
|
||||
if [[ "$version" == "$PNG_LIBPNG_VER_STRING" ]]
|
||||
then
|
||||
ci_info "matched: \$version == \$PNG_LIBPNG_VER_STRING"
|
||||
else
|
||||
ci_err "mismatched: \$version != \$PNG_LIBPNG_VER_STRING"
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_finish_version_verification {
|
||||
ci_info "## END OF VERIFICATION ##"
|
||||
# Relying on "set -o errexit" to not reach here in case of error.
|
||||
ci_info "## SUCCESS ##"
|
||||
}
|
||||
|
||||
function ci_verify_version {
|
||||
ci_init_version_verification
|
||||
ci_do_version_verification
|
||||
ci_finish_version_verification
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>]"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# -eq 0 ]] || {
|
||||
echo >&2 "error: unexpected argument: '$1'"
|
||||
usage 2
|
||||
}
|
||||
# And... go!
|
||||
ci_verify_version
|
||||
}
|
||||
|
||||
main "$@"
|
111
ci/lib/ci.lib.sh
111
ci/lib/ci.lib.sh
@ -1,111 +0,0 @@
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
test -f "$BASH_SOURCE" || {
|
||||
echo >&2 "warning: this module requires Bash version 3 or newer"
|
||||
}
|
||||
test "${#BASH_SOURCE[@]}" -gt 1 || {
|
||||
echo >&2 "warning: this module should be sourced from a Bash script"
|
||||
}
|
||||
|
||||
# Reset the locale to avoid surprises from locale-dependent commands.
|
||||
export LC_ALL=C
|
||||
export LANG=C
|
||||
export LANGUAGE=C
|
||||
|
||||
# Reset CDPATH to avoid surprises from the "cd" command.
|
||||
export CDPATH=""
|
||||
|
||||
# Initialize the global constants CI_SCRIPT_{NAME,DIR} and CI_TOPLEVEL_DIR.
|
||||
CI_SCRIPT_NAME="$(basename -- "$0")"
|
||||
CI_SCRIPT_DIR="$(cd "$(dirname -- "$0")" && pwd)"
|
||||
CI_TOPLEVEL_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
|
||||
# Initialize the global constants CI_BUILD_{...} for the host build platform.
|
||||
CI_BUILD_ARCH="${CI_BUILD_ARCH:-"$(uname -m | tr 'A-Z/\.-' 'a-z____')"}"
|
||||
CI_BUILD_SYSTEM="${CI_BUILD_SYSTEM:-"$(uname -s | tr 'A-Z/\.-' 'a-z____')"}"
|
||||
|
||||
# Initialize the global constants CI_TARGET_{...} for the target platform.
|
||||
CI_TARGET_ARCH="${CI_TARGET_ARCH:-"$CI_BUILD_ARCH"}"
|
||||
CI_TARGET_SYSTEM="${CI_TARGET_SYSTEM:-"$CI_BUILD_SYSTEM"}"
|
||||
|
||||
function ci_info {
|
||||
printf >&2 "%s: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
}
|
||||
|
||||
function ci_warn {
|
||||
printf >&2 "%s: warning: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
}
|
||||
|
||||
function ci_err {
|
||||
printf >&2 "%s: error: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
exit 2
|
||||
}
|
||||
|
||||
function ci_err_internal {
|
||||
printf >&2 "%s: internal error: %s\\n" "$CI_SCRIPT_NAME" "$*"
|
||||
printf >&2 "ABORTED\\n"
|
||||
# Exit with the conventional SIGABRT code.
|
||||
exit 134
|
||||
}
|
||||
|
||||
function ci_expr {
|
||||
if [[ ${*:-0} == [0-9] ]]
|
||||
then
|
||||
# This is the same as in the else-branch below, albeit much faster
|
||||
# for our intended use cases.
|
||||
return $((!$1))
|
||||
else
|
||||
# The funny-looking compound command "... && return $? || return $?"
|
||||
# allows the execution to continue uninterrupted under "set -e".
|
||||
expr >/dev/null "$@" && return $? || return $?
|
||||
fi
|
||||
}
|
||||
|
||||
function ci_spawn {
|
||||
printf >&2 "%s: executing:" "$CI_SCRIPT_NAME"
|
||||
printf >&2 " %q" "$@"
|
||||
printf >&2 "\\n"
|
||||
"$@"
|
||||
}
|
||||
|
||||
# Ensure that the internal initialization is correct.
|
||||
[[ $CI_TOPLEVEL_DIR/ci/lib/ci.lib.sh -ef ${BASH_SOURCE[0]} ]] || {
|
||||
ci_err_internal "bad or missing \$CI_TOPLEVEL_DIR"
|
||||
}
|
||||
[[ $CI_SCRIPT_DIR/$CI_SCRIPT_NAME -ef $0 ]] || {
|
||||
ci_err_internal "bad or missing \$CI_SCRIPT_DIR/\$CI_SCRIPT_NAME"
|
||||
}
|
||||
[[ $CI_BUILD_ARCH && $CI_BUILD_SYSTEM ]] || {
|
||||
ci_err_internal "missing \$CI_BUILD_ARCH or \$CI_BUILD_SYSTEM"
|
||||
}
|
||||
[[ $CI_TARGET_ARCH && $CI_TARGET_SYSTEM ]] || {
|
||||
ci_err_internal "missing \$CI_TARGET_ARCH or \$CI_TARGET_SYSTEM"
|
||||
}
|
||||
|
||||
# Ensure that the user initialization is correct.
|
||||
[[ ${CI_FORCE:-0} == [01] ]] || {
|
||||
ci_err "bad boolean option: \$CI_FORCE: '$CI_FORCE'"
|
||||
}
|
||||
[[ ${CI_NO_BUILD:-0} == [01] ]] || {
|
||||
ci_err "bad boolean option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
|
||||
}
|
||||
[[ ${CI_NO_TEST:-0} == [01] ]] || {
|
||||
ci_err "bad boolean option: \$CI_NO_TEST: '$CI_NO_TEST'"
|
||||
}
|
||||
[[ ${CI_NO_INSTALL:-0} == [01] ]] || {
|
||||
ci_err "bad boolean option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
|
||||
}
|
||||
[[ ${CI_NO_CLEAN:-0} == [01] ]] || {
|
||||
ci_err "bad boolean option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
|
||||
}
|
||||
if ci_expr $((CI_NO_BUILD))
|
||||
then
|
||||
ci_expr $((CI_NO_TEST && CI_NO_INSTALL)) || {
|
||||
ci_err "\$CI_NO_BUILD requires \$CI_NO_TEST and \$CI_NO_INSTALL"
|
||||
}
|
||||
fi
|
@ -1,48 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/../lib/ci.lib.sh"
|
||||
|
||||
function ci_shellify_autoconf {
|
||||
# Convert autoconf (M4) text, specifically originating
|
||||
# from configure.ac, to shell scripting text.
|
||||
# Select only the easy-to-parse definitions of PNGLIB_*.
|
||||
sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' |
|
||||
sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \
|
||||
-e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>] configure.ac"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# -eq 0 ]] && usage 2
|
||||
[[ $# -eq 1 ]] || ci_err "too many operands"
|
||||
# And... go!
|
||||
test -e "$1" || ci_err "no such file: '$1'"
|
||||
[[ $(basename -- "$1") == configure.ac ]] || {
|
||||
ci_err "incorrect operand: '$1' (expecting: 'configure.ac')"
|
||||
}
|
||||
ci_shellify_autoconf <"$1"
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/../lib/ci.lib.sh"
|
||||
|
||||
function ci_shellify_c {
|
||||
# Convert C preprocessor text, specifically originating
|
||||
# from png.h, to shell scripting text.
|
||||
# Select only the easy-to-parse definitions of PNG_LIBPNG_*.
|
||||
sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' |
|
||||
sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \
|
||||
-e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \
|
||||
-e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>] png.h"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# -eq 0 ]] && usage 2
|
||||
[[ $# -eq 1 ]] || ci_err "too many operands"
|
||||
# And... go!
|
||||
test -e "$1" || ci_err "no such file: '$1'"
|
||||
[[ $(basename -- "$1") == png.h ]] || {
|
||||
ci_err "incorrect operand: '$1' (expecting: 'png.h')"
|
||||
}
|
||||
ci_shellify_c <"$1"
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/../lib/ci.lib.sh"
|
||||
|
||||
function ci_shellify_cmake {
|
||||
# Convert CMake lists text, specifically originating
|
||||
# from CMakeLists.txt, to shell scripting text.
|
||||
# Select only the easy-to-parse definitions of PNGLIB_*.
|
||||
sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' |
|
||||
sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \
|
||||
-e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>] CMakeLists.txt"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# -eq 0 ]] && usage 2
|
||||
[[ $# -eq 1 ]] || ci_err "too many operands"
|
||||
# And... go!
|
||||
test -e "$1" || ci_err "no such file: '$1'"
|
||||
filename="$(basename -- "$1")"
|
||||
[[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || {
|
||||
ci_err "incorrect operand: '$1' (expecting: 'CMakeLists.txt')"
|
||||
}
|
||||
ci_shellify_cmake <"$1"
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit -o pipefail -o posix
|
||||
|
||||
# Copyright (c) 2019-2025 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# shellcheck source=ci/lib/ci.lib.sh
|
||||
source "$(dirname "$0")/../lib/ci.lib.sh"
|
||||
|
||||
function ci_shellify_shell {
|
||||
# Convert shell scripting text to shell scripting text.
|
||||
# Select only the easy-to-parse version definitions.
|
||||
sed -n -e '/^ *[A-Za-z_][0-9A-Za-z_]*=[0-9][^ #]* *$/ p' |
|
||||
sed -e 's/^ *\([^ ]*=[^ ]*\) *$/export \1;/'
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $CI_SCRIPT_NAME [<options>] libpng-config-head.in"
|
||||
echo "options: -?|-h|--help"
|
||||
exit "${@:-0}"
|
||||
}
|
||||
|
||||
function main {
|
||||
local opt
|
||||
while getopts ":" opt
|
||||
do
|
||||
# This ain't a while-loop. It only pretends to be.
|
||||
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
|
||||
ci_err "unknown option: '$1'"
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
[[ $# -eq 0 ]] && usage 2
|
||||
[[ $# -eq 1 ]] || ci_err "too many operands"
|
||||
# And... go!
|
||||
test -e "$1" || ci_err "no such file: '$1'"
|
||||
[[ $(basename -- "$1") == libpng-config-head.in ]] || {
|
||||
ci_err "incorrect operand: '$1' (expecting: 'libpng-config-head.in')"
|
||||
}
|
||||
ci_shellify_shell <"$1"
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=aarch64
|
||||
export CI_TARGET_ARCHVER=aarch64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=android
|
||||
export CI_TARGET_ABIVER=android29
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=arm
|
||||
export CI_TARGET_ARCHVER=armv7a
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=androideabi
|
||||
export CI_TARGET_ABIVER=androideabi29
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i686
|
||||
export CI_TARGET_ARCHVER=i686
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=android
|
||||
export CI_TARGET_ABIVER=android29
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_ARCHVER=x86_64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=android
|
||||
export CI_TARGET_ABIVER=android29
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i686
|
||||
export CI_TARGET_SYSTEM=cygwin
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc"
|
||||
export CI_AR="$CI_CC-ar"
|
||||
export CI_RANLIB="$CI_CC-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=CYGWIN
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_SYSTEM=cygwin
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc"
|
||||
export CI_AR="$CI_CC-ar"
|
||||
export CI_RANLIB="$CI_CC-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=CYGWIN
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,15 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=arm64
|
||||
export CI_TARGET_SYSTEM=darwin
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Darwin
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
-DCMAKE_OSX_ARCHITECTURES=$CI_TARGET_ARCH
|
||||
"
|
@ -1,15 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_SYSTEM=darwin
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Darwin
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
-DCMAKE_OSX_ARCHITECTURES=$CI_TARGET_ARCH
|
||||
"
|
@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=aarch64
|
||||
export CI_TARGET_SYSTEM=freebsd
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i686
|
||||
export CI_TARGET_SYSTEM=freebsd
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=riscv64
|
||||
export CI_TARGET_SYSTEM=freebsd
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_SYSTEM=freebsd
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=FreeBSD
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=aarch64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=arm
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnueabi
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=arm
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnueabihf
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i686
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mips
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mips64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnuabi64
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mips64el
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnuabi64
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mipsel
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mipsisa32r6
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mipsisa32r6el
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mipsisa64r6
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnuabi64
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=mipsisa64r6el
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnuabi64
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=powerpc
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=powerpc64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=powerpc64le
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=riscv64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_SYSTEM=linux
|
||||
export CI_TARGET_ABI=gnu
|
||||
|
||||
export CI_GCC="${CI_GCC-gcc}"
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
|
||||
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
|
||||
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Linux
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i386
|
||||
export CI_TARGET_SYSTEM=msdoswatcom
|
||||
|
||||
export CI_CC="wcl386"
|
||||
|
||||
# Open Watcom V2 CMake build
|
||||
# https://github.com/open-watcom/open-watcom-v2/discussions/716
|
||||
export CI_CMAKE_GENERATOR="Watcom WMake"
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=DOS
|
||||
"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i586
|
||||
export CI_TARGET_SYSTEM=msdosdjgpp
|
||||
|
||||
export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc"
|
||||
export CI_AR="$CI_CC-ar"
|
||||
export CI_RANLIB="$CI_CC-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Generic
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,19 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i86
|
||||
export CI_TARGET_SYSTEM=msdoswatcom
|
||||
|
||||
export CI_CC="wcl"
|
||||
|
||||
# Open Watcom V2 CMake build
|
||||
# https://github.com/open-watcom/open-watcom-v2/discussions/716
|
||||
export CI_CMAKE_GENERATOR="Watcom WMake"
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=DOS
|
||||
-DCMAKE_SYSTEM_PROCESSOR=I86
|
||||
"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=aarch64
|
||||
export CI_TARGET_SYSTEM=windows
|
||||
|
||||
export CI_CC="clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Windows
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i686
|
||||
export CI_TARGET_SYSTEM=mingw32
|
||||
|
||||
# The output of `uname -s` on MSYS2 is understandable, and so is
|
||||
# CI_TARGET_SYSTEM above, in simplified form. (See also Cygwin.)
|
||||
# But aside from that, the Mingw-w64 nomenclature is rather messy.
|
||||
export CI_CC="$CI_TARGET_ARCH-w64-mingw32-gcc"
|
||||
export CI_AR="$CI_CC-ar"
|
||||
export CI_RANLIB="$CI_CC-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Windows
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=i686
|
||||
export CI_TARGET_SYSTEM=windows
|
||||
|
||||
export CI_CC="clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Windows
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_SYSTEM=mingw64
|
||||
|
||||
# The output of `uname -s` on MSYS2 is understandable, and so is
|
||||
# CI_TARGET_SYSTEM above, in simplified form. (See also Cygwin.)
|
||||
# But aside from that, the Mingw-w64 nomenclature is rather messy.
|
||||
export CI_CC="$CI_TARGET_ARCH-w64-mingw32-gcc"
|
||||
export CI_AR="$CI_CC-ar"
|
||||
export CI_RANLIB="$CI_CC-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Windows
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2023-2024 Cosmin Truta.
|
||||
#
|
||||
# Use, modification and distribution are subject to the MIT License.
|
||||
# Please see the accompanying file LICENSE_MIT.txt
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
export CI_TARGET_ARCH=x86_64
|
||||
export CI_TARGET_SYSTEM=windows
|
||||
|
||||
export CI_CC="clang"
|
||||
export CI_AR="llvm-ar"
|
||||
export CI_RANLIB="llvm-ranlib"
|
||||
|
||||
export CI_CMAKE_VARS="
|
||||
-DCMAKE_SYSTEM_NAME=Windows
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
|
||||
"
|
364
compile
364
compile
@ -1,364 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2025-06-18.21; # UTC
|
||||
|
||||
# Copyright (C) 1999-2025 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file unneeded_conversions
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
|
||||
# conversion will take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
|
||||
# MSYS2 environment.
|
||||
file_conv=cygwin
|
||||
else
|
||||
# Original MinGW environment.
|
||||
file_conv=mingw
|
||||
fi
|
||||
;;
|
||||
MSYS*)
|
||||
# Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
|
||||
file_conv=cygwin
|
||||
;;
|
||||
CYGWIN*)
|
||||
# Cygwin environment.
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
# This is the optimization mentioned above:
|
||||
# If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -w "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.lo | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
1815
config.guess
vendored
1815
config.guess
vendored
File diff suppressed because it is too large
Load Diff
138
config.h.in
138
config.h.in
@ -1,138 +0,0 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the 'feenableexcept' function. */
|
||||
#undef HAVE_FEENABLEEXCEPT
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the 'm' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define to 1 if you have the 'z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the 'pow' function. */
|
||||
#undef HAVE_POW
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Turn on ARM Neon optimizations at run-time */
|
||||
#undef PNG_ARM_NEON_API_SUPPORTED
|
||||
|
||||
/* Check for ARM Neon support at run-time */
|
||||
#undef PNG_ARM_NEON_CHECK_SUPPORTED
|
||||
|
||||
/* Enable ARM Neon optimizations */
|
||||
#undef PNG_ARM_NEON_OPT
|
||||
|
||||
/* Enable Intel SSE optimizations */
|
||||
#undef PNG_INTEL_SSE_OPT
|
||||
|
||||
/* Enable LOONGARCH LSX optimizations */
|
||||
#undef PNG_LOONGARCH_LSX_OPT
|
||||
|
||||
/* Turn on MIPS MMI optimizations at run-time */
|
||||
#undef PNG_MIPS_MMI_API_SUPPORTED
|
||||
|
||||
/* Check for MIPS MMI support at run-time */
|
||||
#undef PNG_MIPS_MMI_CHECK_SUPPORTED
|
||||
|
||||
/* Enable MIPS MMI optimizations */
|
||||
#undef PNG_MIPS_MMI_OPT
|
||||
|
||||
/* Turn on MIPS MSA optimizations at run-time */
|
||||
#undef PNG_MIPS_MSA_API_SUPPORTED
|
||||
|
||||
/* Check for MIPS MSA support at run-time */
|
||||
#undef PNG_MIPS_MSA_CHECK_SUPPORTED
|
||||
|
||||
/* Enable MIPS MSA optimizations */
|
||||
#undef PNG_MIPS_MSA_OPT
|
||||
|
||||
/* Turn on POWERPC VSX optimizations at run-time */
|
||||
#undef PNG_POWERPC_VSX_API_SUPPORTED
|
||||
|
||||
/* Check for POWERPC VSX support at run-time */
|
||||
#undef PNG_POWERPC_VSX_CHECK_SUPPORTED
|
||||
|
||||
/* Enable POWERPC VSX optimizations */
|
||||
#undef PNG_POWERPC_VSX_OPT
|
||||
|
||||
/* Enable RISCV RVV optimizations */
|
||||
#undef PNG_RISCV_RVV_OPT
|
||||
|
||||
/* Define to 1 if all of the C89 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
||||
nothing if this is not supported. Do not define if restrict is
|
||||
supported only directly. */
|
||||
#undef restrict
|
||||
/* Work around a bug in older versions of Sun C++, which did not
|
||||
#define __restrict__ or support _Restrict or __restrict__
|
||||
even though the corresponding Sun C compiler ended up with
|
||||
"#define restrict _Restrict" or "#define restrict __restrict__"
|
||||
in the previous line. This workaround can be removed once
|
||||
we assume Oracle Developer Studio 12.5 (2016) or later. */
|
||||
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
|
||||
# define _Restrict
|
||||
# define __restrict__
|
||||
#endif
|
2354
config.sub
vendored
2354
config.sub
vendored
File diff suppressed because it is too large
Load Diff
677
configure.ac
677
configure.ac
@ -1,12 +1,13 @@
|
||||
# configure.ac
|
||||
|
||||
# Copyright (c) 2018-2024 Cosmin Truta
|
||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
||||
# Last changed in libpng 1.7.0 [(PENDING RELEASE)]
|
||||
|
||||
# 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
|
||||
@ -25,8 +26,8 @@ AC_PREREQ([2.68])
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng],[1.6.51.git],[png-mng-implement@lists.sourceforge.net])
|
||||
AC_CONFIG_MACRO_DIR([scripts/autoconf])
|
||||
AC_INIT([libpng],[1.7.0beta88],[png-mng-implement@lists.sourceforge.net])
|
||||
AC_CONFIG_MACRO_DIR([scripts])
|
||||
|
||||
# libpng does not follow GNU file name conventions (hence 'foreign')
|
||||
# color-tests requires automake 1.11 or later
|
||||
@ -34,7 +35,8 @@ AC_CONFIG_MACRO_DIR([scripts/autoconf])
|
||||
# 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])
|
||||
# 1.14.1 is required for %reldir% support
|
||||
AM_INIT_AUTOMAKE([1.15 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
|
||||
@ -46,17 +48,17 @@ dnl automake, so the following is not necessary (and is not defined anyway):
|
||||
dnl AM_PREREQ([1.11.2])
|
||||
dnl stop configure from automagically running automake
|
||||
|
||||
PNGLIB_VERSION=1.6.51.git
|
||||
PNGLIB_VERSION=1.7.0beta88
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=6
|
||||
PNGLIB_RELEASE=51
|
||||
PNGLIB_MINOR=7
|
||||
PNGLIB_RELEASE=0
|
||||
|
||||
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
|
||||
@ -67,54 +69,33 @@ 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 libtool/libtoolize; version 2.4.4 is the tested version, this or any
|
||||
dnl compatible later version may be used
|
||||
LT_INIT([win32-dll])
|
||||
LT_PREREQ([2.4.2])
|
||||
LT_PREREQ([2.4.4])
|
||||
|
||||
dnl Declare the AWK variable.
|
||||
AC_ARG_VAR(AWK, [AWK language processor])
|
||||
|
||||
# Some awk implementations crash when confronted with pnglibconf.dfa.
|
||||
# Run a test now, to make sure this doesn't happen.
|
||||
AC_MSG_CHECKING([if awk ($AWK) works])
|
||||
# Some awks crash when confronted with pnglibconf.dfa, do a test run now
|
||||
# to make sure this doesn't happen
|
||||
AC_MSG_CHECKING([that AWK works])
|
||||
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])
|
||||
AC_MSG_RESULT([ok])
|
||||
else
|
||||
AC_MSG_FAILURE([no], 1)
|
||||
AC_MSG_FAILURE([failed], 1)
|
||||
fi
|
||||
|
||||
# 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"
|
||||
DFNCPP="$CPP -E"
|
||||
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:
|
||||
# -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]
|
||||
[additional flags for the C compiler, use this for options that would]
|
||||
[cause configure itself to fail])
|
||||
AC_ARG_ENABLE(werror,
|
||||
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
|
||||
@ -135,52 +116,153 @@ AC_ARG_ENABLE(werror,
|
||||
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 header files.
|
||||
AC_HEADER_STDC
|
||||
# Headers used in pngpriv.h:
|
||||
AC_CHECK_HEADERS([assert.h stdlib.h string.h float.h fp.h math.h m68881.h])
|
||||
# Additional headers used in pngconf.h:
|
||||
AC_CHECK_HEADERS([limits.h stddef.h stdio.h setjmp.h time.h])
|
||||
# Used by pngread.c (for the simplified API):
|
||||
AC_CHECK_HEADERS([errno.h])
|
||||
# The following are not required for the standard 'make' build of libpng:
|
||||
# Additional requirements of contrib/libtests/makepng.c:
|
||||
AC_CHECK_HEADERS([ctype.h])
|
||||
# Additional requirements of contrib/libtests/pngvalid.c:
|
||||
AC_CHECK_HEADERS([fenv.h])
|
||||
|
||||
# Checks for structures and compiler characteristics.
|
||||
AC_STRUCT_TM
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
# Most of these have been removed from 1.7.0 because they checked for non-ANSI-C
|
||||
# behaviors and the result were, anyway, not used by earlier versions of libpng.
|
||||
AC_C_RESTRICT
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([pow], ,
|
||||
[AC_CHECK_LIB([m], [pow], , [AC_MSG_ERROR([cannot find pow])])])
|
||||
# Checks for library functions; these need to be in order, least demanding to
|
||||
# most because the -l directives are added to the head of the list at each
|
||||
# check.
|
||||
# ANSI-C functions: all are required but they don't have to be implemented in
|
||||
# libc, it is perfectly ok to configure with an extra, wrapper, library preset
|
||||
# in LIBS. NOTE: this list may not be complete
|
||||
AC_CHECK_FUNCS([memset memcpy strncpy],,
|
||||
AC_MSG_FAILURE([missing ANSI-C functions]))
|
||||
|
||||
# Some later POSIX 1003.1 functions are required for test programs, failure
|
||||
# here is soft (the corresponding test program is not built).
|
||||
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
|
||||
# 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_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])])])
|
||||
# floor and ceil are required for FLOATING_POINT, but they can be turned off on
|
||||
# the configure command line (and they are independent.) Default is to 'on'
|
||||
AC_ARG_ENABLE([floating-point],
|
||||
AS_HELP_STRING([[[--enabled-floating-point]]],
|
||||
[Enable floating point APIs (default: yes)]),,
|
||||
[enable_floating_point=yes])
|
||||
|
||||
AC_ARG_ENABLE([fixed-point],
|
||||
AS_HELP_STRING([[[--enable-fixed-point]]],
|
||||
[Enable fixed point APIs (default: yes)]),,
|
||||
[enable_fixed_point=yes])
|
||||
|
||||
AC_ARG_ENABLE([floating-arithmetic],
|
||||
AS_HELP_STRING([[[--enable-floating-arithmetic]]],
|
||||
[Use floating point arithmetic internally (default: yes)]),,
|
||||
[enable_floating_arithmetic=yes])
|
||||
|
||||
# Check for a requirement for math library support
|
||||
if test "$enable_floating_arithmetic" = yes
|
||||
then
|
||||
AC_SEARCH_LIBS([floor],[m],,
|
||||
[AC_MSG_WARN([not found])
|
||||
enable_floating_arithmetic=no])
|
||||
AC_SEARCH_LIBS([frexp],[m],,
|
||||
[AC_MSG_WARN([not found])
|
||||
enable_floating_arithmetic=no])
|
||||
AC_SEARCH_LIBS([modf],[m],,
|
||||
[AC_MSG_WARN([not found])
|
||||
enable_floating_arithmetic=no])
|
||||
AC_SEARCH_LIBS([atof],[m],,
|
||||
[AC_MSG_WARN([not found])
|
||||
enable_floating_arithmetic=no])
|
||||
AC_SEARCH_LIBS([pow],[m],,
|
||||
[AC_MSG_WARN([not found])
|
||||
enable_floating_arithmetic=no])
|
||||
fi
|
||||
|
||||
# Set the relevant defines if required (only if required). This will override
|
||||
# anything on the command line.
|
||||
if test "$enable_floating_point" != yes
|
||||
then
|
||||
AC_MSG_NOTICE([Floating point APIs disabled])
|
||||
AC_DEFINE([PNG_NO_FLOATING_POINT],[1],
|
||||
[No support for floating point APIs])
|
||||
fi
|
||||
if test "$enable_fixed_point" != yes
|
||||
then
|
||||
AC_MSG_NOTICE([Fixed point APIs disabled])
|
||||
AC_DEFINE([PNG_NO_FIXED_POINT],[1],
|
||||
[No support for fixed point APIs])
|
||||
fi
|
||||
if test "$enable_floating_arithmetic" != yes
|
||||
then
|
||||
AC_MSG_NOTICE([Fixed point arithmetic will be used])
|
||||
AC_DEFINE([PNG_NO_FLOATING_ARITHMETIC],[1],
|
||||
[No support for floating point arithmetic])
|
||||
fi
|
||||
|
||||
# The following is for pngvalid, to ensure it catches FP errors even on
|
||||
# platforms that don't enable FP exceptions, the function appears in the math
|
||||
# library (typically), it's not an error if it is not found.
|
||||
AC_CHECK_LIB([m], [feenableexcept])
|
||||
AC_CHECK_FUNCS([feenableexcept])
|
||||
AC_SEARCH_LIBS([feenableexcept],[m],AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],
|
||||
[Define to 1 if the feenableexcept function is available]))
|
||||
# Required by pngvalid:
|
||||
AC_SEARCH_LIBS([ceil],[m])
|
||||
|
||||
# zlib checks and arguments;
|
||||
# package zlib: argument is the name of the library
|
||||
# zlib-header: the name of the header file
|
||||
# zlib-prefix: the prefix for library functions, if any
|
||||
AC_ARG_WITH([zlib],
|
||||
AS_HELP_STRING([[[--with-zlib=<name>]]],
|
||||
[base name of the zlib implementation (e.g. 'z')]),,
|
||||
[with_zlib='z'])
|
||||
|
||||
z_prefix=
|
||||
AC_ARG_WITH([zlib-prefix],
|
||||
AS_HELP_STRING([[[--with-zlib-prefix=<prefix>]]],
|
||||
[prefix for zlib API functions]),
|
||||
[if test "$withval" = "" -o "$withval" = yes; then
|
||||
with_zlib_prefix='z_'
|
||||
AC_DEFINE([PNG_ZLIB_PREFIX],[z_],[Standard zlib prefix])
|
||||
elif test "${withval}" != "no"; then
|
||||
AC_DEFINE_UNQUOTED([PNG_ZLIB_PREFIX],[${withval}],
|
||||
[User defined zlib prefix])
|
||||
else
|
||||
with_zlib_prefix=
|
||||
fi
|
||||
if test "$with_zlib_prefix" != ""; then
|
||||
AC_DEFINE([Z_PREFIX],[1],[Tell zlib.h to prefix function names])
|
||||
z_prefix="#define Z_PREFIX 1"
|
||||
fi])
|
||||
|
||||
AC_ARG_WITH([zlib-header],
|
||||
AS_HELP_STRING([[[--with-zlib-header='<file>' or '"file"']]],
|
||||
[C include argument to locate zlib header file, e.g. <zlib.h>, take
|
||||
care to put single quotes round this on the command line]),
|
||||
[AC_DEFINE_UNQUOTED([PNG_ZLIB_HEADER],[${withval}],[Zlib header file])],
|
||||
with_zlib_header='<zlib.h>')
|
||||
|
||||
# AC_CHECK_LIB isn't quite enough for this because we need the special header
|
||||
# file too.
|
||||
LIBS="-l${with_zlib} $LIBS"
|
||||
AC_MSG_CHECKING(
|
||||
[[Library '${with_zlib}' and #include ${with_zlib_header} for symbol '${with_zlib_prefix}zlibVersion']])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
${z_prefix}
|
||||
#include ${with_zlib_header}
|
||||
]],
|
||||
[[(void)${with_zlib_prefix}zlibVersion();]])],
|
||||
AC_MSG_RESULT([ok]),
|
||||
AC_MSG_FAILURE([not found]))
|
||||
|
||||
AC_MSG_CHECKING([if using Solaris linker])
|
||||
SLD=`$LD --version 2>&1 | grep Solaris`
|
||||
@ -226,9 +308,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
|
||||
@ -313,437 +395,16 @@ AC_ARG_ENABLE([unversioned-libpng-config],
|
||||
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
|
||||
[test "$enable_unversioned_libpng_config" != "no"])
|
||||
|
||||
# HOST-SPECIFIC OPTIONS
|
||||
# =====================
|
||||
#
|
||||
# DEFAULT
|
||||
# =======
|
||||
#
|
||||
AC_ARG_ENABLE([hardware-optimizations],
|
||||
AS_HELP_STRING([[[--enable-hardware-optimizations]]],
|
||||
[Enable hardware optimizations: =no/off, yes/on.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable hardware optimization on all systems:
|
||||
enable_arm_neon=no
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
|
||||
[Disable ARM_NEON optimizations])
|
||||
enable_mips_msa=no
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
|
||||
[Disable MIPS_MSA optimizations])
|
||||
enable_mips_mmi=no
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
|
||||
[Disable MIPS_MMI optimizations])
|
||||
enable_powerpc_vsx=no
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
||||
[Disable POWERPC VSX optimizations])
|
||||
enable_intel_sse=no
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
||||
[Disable INTEL_SSE optimizations])
|
||||
enable_loongarch_lsx=no
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
|
||||
[Disable LOONGARCH_LSX optimizations])
|
||||
enable_riscv_rvv=no
|
||||
AC_DEFINE([PNG_RISCV_RVV_OPT], [0],
|
||||
[Disable RISC-V Vector optimizations])
|
||||
;;
|
||||
*)
|
||||
# allow enabling hardware optimization on any system:
|
||||
case "$host_cpu" in
|
||||
arm*|aarch64*)
|
||||
enable_arm_neon=yes
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
|
||||
[Enable ARM_NEON optimizations])
|
||||
;;
|
||||
mipsel*|mips64el*)
|
||||
enable_mips_mmi=yes
|
||||
enable_mips_msa=yes
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
|
||||
[Enable MIPS_MMI optimizations])
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
|
||||
[Enable MIPS_MSA optimizations])
|
||||
;;
|
||||
i?86|x86_64)
|
||||
enable_intel_sse=yes
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
||||
[Enable Intel SSE optimizations])
|
||||
;;
|
||||
powerpc*|ppc64*)
|
||||
enable_powerpc_vsx=yes
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
|
||||
[Enable POWERPC VSX optimizations])
|
||||
;;
|
||||
loongarch*)
|
||||
enable_loongarch_lsx=yes
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
||||
[Enable LOONGARCH_LSX optimizations])
|
||||
;;
|
||||
riscv64)
|
||||
enable_riscv_rvv=yes
|
||||
AC_DEFINE([PNG_RISCV_RVV_OPT], [2],
|
||||
[Enable RISC-V Vector optimizations])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac])
|
||||
|
||||
# ARM NEON
|
||||
# ========
|
||||
|
||||
AC_ARG_ENABLE([arm-neon],
|
||||
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.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __ARM_NEON__ systems:
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
|
||||
[Disable ARM Neon optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_arm_neon=no ;;
|
||||
check)
|
||||
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
|
||||
[Check for ARM Neon support at run-time]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
|
||||
[Turn on ARM Neon optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
|
||||
[Enable ARM Neon optimizations])
|
||||
AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api';]
|
||||
[if you want the optimizations unconditionally,]
|
||||
[pass '-mfpu=neon' to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}:]
|
||||
[invalid argument])
|
||||
esac])
|
||||
|
||||
# Add ARM-specific files to all builds where $host_cpu is arm ('arm*') or
|
||||
# where ARM optimizations were explicitly requested. (This allows a fallback
|
||||
# if a future host CPU does not match 'arm*'.)
|
||||
|
||||
AM_CONDITIONAL([PNG_ARM_NEON],
|
||||
[test "$enable_arm_neon" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
arm*|aarch64*) : ;;
|
||||
*) test "$enable_arm_neon" != '' ;;
|
||||
esac])
|
||||
|
||||
# MIPS MSA
|
||||
# ========
|
||||
|
||||
AC_ARG_ENABLE([mips-msa],
|
||||
AS_HELP_STRING([[[--enable-mips-msa]]],
|
||||
[Enable MIPS MSA optimizations: =no/off, check, api, yes/on.]
|
||||
[no/off: disable the optimizations;]
|
||||
[check: use internal checking code (deprecated and poorly supported);]
|
||||
[api: disable by default, enable by a call to png_set_option;]
|
||||
[yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __mips_msa systems:
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
|
||||
[Disable MIPS MSA optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_mips_msa=no ;;
|
||||
check)
|
||||
AC_DEFINE([PNG_MIPS_MSA_CHECK_SUPPORTED], [],
|
||||
[Check for MIPS MSA support at run-time]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_MIPS_MSA_API_SUPPORTED], [],
|
||||
[Turn on MIPS MSA optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
|
||||
[Enable MIPS MSA optimizations])
|
||||
AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api';]
|
||||
[if you want the optimizations unconditionally,]
|
||||
[pass '-mmsa -mfp64' to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}:]
|
||||
[invalid argument])
|
||||
esac])
|
||||
|
||||
# Add MIPS-specific files to all builds where $host_cpu is mips ('mips*') or
|
||||
# where MIPS optimizations were explicitly requested. (This allows a fallback
|
||||
# if a future host CPU does not match 'mips*'.)
|
||||
|
||||
AM_CONDITIONAL([PNG_MIPS_MSA],
|
||||
[test "$enable_mips_msa" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
mipsel*|mips64el*) : ;;
|
||||
esac])
|
||||
|
||||
# MIPS MMI
|
||||
# ========
|
||||
|
||||
AC_ARG_ENABLE([mips-mmi],
|
||||
AS_HELP_STRING([[[--enable-mips-mmi]]],
|
||||
[Enable MIPS MMI optimizations: =no/off, check, api, yes/on.]
|
||||
[no/off: disable the optimizations;]
|
||||
[check: use internal checking code (deprecated and poorly supported);]
|
||||
[api: disable by default, enable by a call to png_set_option;]
|
||||
[yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __mips_mmi systems:
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
|
||||
[Disable MIPS MMI optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_mips_mmi=no;;
|
||||
check)
|
||||
AC_DEFINE([PNG_MIPS_MMI_CHECK_SUPPORTED], [],
|
||||
[Check for MIPS MMI support at run-time]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_MIPS_MMI_API_SUPPORTED], [],
|
||||
[Turn on MIPS MMI optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
|
||||
[Enable MIPS MMI optimizations])
|
||||
AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api';]
|
||||
[if you want the optimizations unconditionally]
|
||||
[pass '-mloongson-mmi -march=loongson3a' to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}:]
|
||||
[invalid argument])
|
||||
esac])
|
||||
|
||||
# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or
|
||||
# where MIPS optimizations were explicitly requested. (This allows a fallback
|
||||
# if a future host CPU does not match 'mips*'.)
|
||||
|
||||
AM_CONDITIONAL([PNG_MIPS_MMI],
|
||||
[test "$enable_mips_mmi" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
mipsel*|mips64el*) : ;;
|
||||
esac])
|
||||
|
||||
# INTEL SSE
|
||||
# =========
|
||||
|
||||
AC_ARG_ENABLE([intel-sse],
|
||||
AS_HELP_STRING([[[--enable-intel-sse]]],
|
||||
[Enable Intel SSE optimizations: =no/off, yes/on.]
|
||||
[no/off: disable the optimizations;]
|
||||
[yes/on: enable the optimizations.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling:
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
||||
[Disable Intel SSE optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_intel_sse=no ;;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
||||
[Enable Intel SSE optimizations]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}:]
|
||||
[invalid argument])
|
||||
esac])
|
||||
|
||||
# Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or
|
||||
# where Intel optimizations were explicitly requested. (This allows a fallback
|
||||
# if a future host CPU does not match 'x86*'.)
|
||||
AM_CONDITIONAL([PNG_INTEL_SSE],
|
||||
[test "$enable_intel_sse" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
i?86|x86_64) : ;;
|
||||
*) test "$enable_intel_sse" != '' ;;
|
||||
esac])
|
||||
|
||||
# POWERPC VSX
|
||||
# ===========
|
||||
|
||||
AC_ARG_ENABLE([powerpc-vsx],
|
||||
AS_HELP_STRING([[[--enable-powerpc-vsx]]],
|
||||
[Enable POWERPC VSX optimizations: =no/off, check, api, yes/on.]
|
||||
[no/off: disable the optimizations;]
|
||||
[check: use internal checking code;]
|
||||
[api: disable by default, enable by a call to png_set_option;]
|
||||
[yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __ppc64__ systems:
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
||||
[Disable POWERPC VSX optimizations])
|
||||
# Prevent inclusion of the platform-specific files below:
|
||||
enable_powerpc_vsx=no ;;
|
||||
check)
|
||||
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
|
||||
[Check for POWERPC VSX support at run-time])
|
||||
AC_MSG_WARN([--enable-powerpc-vsx: please see contrib/powerpc/README]
|
||||
[for the list of supported systems.]);;
|
||||
api)
|
||||
AC_DEFINE([PNG_POWERPC_VSX_API_SUPPORTED], [],
|
||||
[Turn on POWERPC VSX optimizations at run-time]);;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
|
||||
[Enable POWERPC VSX optimizations])
|
||||
AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api';]
|
||||
[if you want the optimizations unconditionally,]
|
||||
[pass '-maltivec -mvsx' or '-mcpu=power8' to the compiler.]);;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}:]
|
||||
[invalid argument])
|
||||
esac])
|
||||
|
||||
# Add PowerPC-specific files to all builds where $host_cpu is powerpc
|
||||
# ('powerpc*') or where PowerPC optimizations were explicitly requested.
|
||||
# (This allows a fallback if a future host CPU does not match 'powerpc*'.)
|
||||
|
||||
AM_CONDITIONAL([PNG_POWERPC_VSX],
|
||||
[test "$enable_powerpc_vsx" != 'no' &&
|
||||
case "$host_cpu" in
|
||||
powerpc*|ppc64*) : ;;
|
||||
esac])
|
||||
|
||||
# LOONGARCH LSX
|
||||
# =============
|
||||
|
||||
AC_ARG_ENABLE([loongarch-lsx],
|
||||
AS_HELP_STRING([[[--enable-loongarch-lsx]]],
|
||||
[Enable LOONGARCH LSX optimizations: =no/off, yes/on:]
|
||||
[no/off: disable the optimizations;]
|
||||
[yes/on: turn on unconditionally.]
|
||||
[If not specified: determined by the compiler.]),
|
||||
[case "$enableval" in
|
||||
no|off)
|
||||
# disable the default enabling on __loongarch_simd systems:
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
|
||||
[Disable LOONGARCH LSX optimizations])
|
||||
# Prevent inclusion of the assembler files below:
|
||||
enable_loongarch_lsx=no;;
|
||||
yes|on)
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
||||
[Enable LOONGARCH LSX optimizations])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}:]
|
||||
[invalid argument])
|
||||
esac])
|
||||
|
||||
if test "$enable_loongarch_lsx" != "no" &&
|
||||
case "$host_cpu" in
|
||||
loongarch*) : ;;
|
||||
*) test "$enable_loongarch_lsx" != '' ;;
|
||||
esac
|
||||
then
|
||||
compiler_support_loongarch_lsx=no
|
||||
AC_MSG_CHECKING(whether to use LoongArch LSX intrinsics)
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LSX_CFLAGS="${LSX_CFLAGS:-"-mlsx"}"
|
||||
CFLAGS="$CFLAGS $LSX_CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <lsxintrin.h>
|
||||
int main(){
|
||||
__m128i a, b, c;
|
||||
a = __lsx_vadd_w(b, c);
|
||||
return 0;
|
||||
}]])],compiler_support_loongarch_lsx=yes)
|
||||
CFLAGS="$save_CFLAGS"
|
||||
AC_MSG_RESULT($compiler_support_loongarch_lsx)
|
||||
if test "$compiler_support_loongarch_lsx" = "yes"; then
|
||||
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
|
||||
[Enable LOONGARCH LSX optimizations])
|
||||
else
|
||||
AC_MSG_WARN([Compiler does not support loongarch LSX.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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])
|
||||
# EXTENSIONS
|
||||
# Configure (and all other) support for extensions is included when autoconf is
|
||||
# run by virtue of the existence (or not) of the following file:
|
||||
sinclude([contrib/extensions.ac])
|
||||
AM_CONDITIONAL([LIBPNG_EXTENSIONS],[test -n "$libpng_automake_extensions"])
|
||||
|
||||
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])
|
||||
AC_CONFIG_FILES([Makefile libpng.pc])
|
||||
AC_CONFIG_FILES([libpng-config], [chmod +x libpng-config])
|
||||
|
||||
AC_OUTPUT
|
||||
|
@ -1,9 +0,0 @@
|
||||
# https://editorconfig.org
|
||||
|
||||
root = false
|
||||
|
||||
[*.[ch]]
|
||||
indent_size = unset
|
||||
indent_style = unset
|
||||
max_doc_length = unset
|
||||
max_line_length = unset
|
@ -1,5 +1,3 @@
|
||||
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
|
||||
|
@ -2,6 +2,7 @@
|
||||
*
|
||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
||||
* Written by John Bowler, 2014.
|
||||
* Last changed in libpng 1.6.10 [March 6, 2014]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@ -23,7 +24,6 @@
|
||||
* 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
|
||||
|
@ -2,6 +2,7 @@
|
||||
*
|
||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
||||
* Written by Mans Rullgard, 2011.
|
||||
* Last changed in libpng 1.6.10 [March 6, 2014]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@ -21,7 +22,6 @@
|
||||
* 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 */
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* contrib/arm-neon/linux.c
|
||||
*
|
||||
* Copyright (c) 2014, 2017 Glenn Randers-Pehrson
|
||||
* Written by John Bowler, 2014, 2017.
|
||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
||||
* Written by John Bowler, 2014.
|
||||
* Last changed in libpng 1.6.16 [December 22, 2014]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@ -18,7 +19,6 @@
|
||||
* 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
|
||||
@ -62,7 +62,7 @@ png_have_neon(png_structp png_ptr)
|
||||
|
||||
counter=0;
|
||||
state = Feature;
|
||||
/* FALLTHROUGH */
|
||||
/* FALL THROUGH */
|
||||
|
||||
case Feature:
|
||||
/* Match 'FEATURE', ASCII case insensitive. */
|
||||
@ -75,7 +75,7 @@ png_have_neon(png_structp png_ptr)
|
||||
|
||||
/* did not match 'feature' */
|
||||
state = SkipLine;
|
||||
/* FALLTHROUGH */
|
||||
/* FALL THROUGH */
|
||||
|
||||
case SkipLine:
|
||||
skipLine:
|
||||
@ -110,7 +110,7 @@ png_have_neon(png_structp png_ptr)
|
||||
|
||||
state = Neon;
|
||||
counter = 0;
|
||||
/* FALLTHROUGH */
|
||||
/* FALL THROUGH */
|
||||
|
||||
case Neon:
|
||||
/* Look for 'neon' tag */
|
||||
@ -122,7 +122,7 @@ png_have_neon(png_structp png_ptr)
|
||||
}
|
||||
|
||||
state = SkipTag;
|
||||
/* FALLTHROUGH */
|
||||
/* FALL THROUGH */
|
||||
|
||||
case SkipTag:
|
||||
/* Skip non-space characters */
|
||||
|
@ -1,133 +0,0 @@
|
||||
# basic.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2024
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with basic read and write support. This enables the lowest
|
||||
# level libpng read and write APIs - the "row-by-row" ones.
|
||||
#
|
||||
# Support is enabled only for those transformations that are observed to be
|
||||
# required by widely used apps or are in the v3 specification.
|
||||
#
|
||||
|
||||
everything = off
|
||||
|
||||
# The sequential read code is enabled here; the progressive code can be used
|
||||
# instead but there is no point enabling both.
|
||||
|
||||
option READ on
|
||||
option SEQUENTIAL_READ on
|
||||
option EASY_ACCESS on
|
||||
option SET_USER_LIMITS on
|
||||
option INFO_IMAGE on
|
||||
option READ_16BIT on
|
||||
|
||||
# Errors: these can be disabled but then there won't be any error messages
|
||||
# just failures and the error messages are really needed for apps:
|
||||
option WARNINGS on
|
||||
option ERROR_TEXT on
|
||||
option BENIGN_READ_ERRORS on
|
||||
|
||||
# Required for many display programs such as web browsers:
|
||||
option PROGRESSIVE_READ on
|
||||
|
||||
# Switch on the write code - this makes a minimalist encoder but with
|
||||
# interlace support turned on; otherwise png_read_png..png_write_png will
|
||||
# fail on an interlaced image.
|
||||
option WRITE on
|
||||
option WRITE_INTERLACING on
|
||||
option WRITE_16BIT on
|
||||
|
||||
# Usages of the 'fixed' APIs are relatively rare but they do occur
|
||||
# one or the other for both the API and the internal math.
|
||||
|
||||
#Fixed point:
|
||||
option FIXED_POINT on
|
||||
|
||||
#Floating point:
|
||||
option FLOATING_POINT on
|
||||
option FLOATING_ARITHMETIC on
|
||||
|
||||
# Basic error handling, IO and user memory support. The latter allows the
|
||||
# application program to provide its own implementations of 'malloc' and 'free'.
|
||||
option SETJMP on
|
||||
option STDIO on
|
||||
option USER_MEM on
|
||||
|
||||
# Gamma handling: this needs to be on for the gamma handling
|
||||
option READ_GAMMA on
|
||||
|
||||
# The supported chunks
|
||||
chunk bKGD on
|
||||
chunk cHRM on
|
||||
chunk eXIf on
|
||||
chunk gAMA on
|
||||
chunk iCCP on
|
||||
chunk iTXt on
|
||||
chunk pHYs on
|
||||
chunk sBIT on
|
||||
chunk sRGB on
|
||||
chunk tEXt on
|
||||
chunk tIME on
|
||||
chunk tRNS on
|
||||
chunk zTXt on
|
||||
|
||||
# These don't seem to be used anywhere:
|
||||
# chunk pCAL
|
||||
# chunk sCAL
|
||||
# chunk sPLT
|
||||
|
||||
# The rest of this is app dependent: none of these options are required for
|
||||
# read/write of the full range of PNG files and the normal chunk handling on
|
||||
# read.
|
||||
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
|
||||
option WRITE_CUSTOMIZE_COMPRESSION on
|
||||
|
||||
option READ_EXPAND on
|
||||
option READ_FILLER on
|
||||
option READ_GRAY_TO_RGB on
|
||||
option READ_INVERT on
|
||||
option READ_PACK on
|
||||
option READ_RGB_TO_GRAY on
|
||||
option READ_SCALE_16_TO_8 on
|
||||
option READ_SHIFT on
|
||||
option READ_STRIP_16_TO_8 on
|
||||
option READ_STRIP_ALPHA on
|
||||
option READ_SWAP on
|
||||
|
||||
option CONVERT_tIME on
|
||||
|
||||
# optipng
|
||||
option IO_STATE on
|
||||
option STORE_UNKNOWN_CHUNKS on
|
||||
option HANDLE_AS_UNKNOWN on
|
||||
|
||||
# pngcrush
|
||||
option READ_USER_TRANSFORM on
|
||||
option WRITE_FLUSH on
|
||||
|
||||
# pnmtopng
|
||||
chunk hIST on
|
||||
|
||||
# cairo
|
||||
option WRITE_PACKSWAP on
|
||||
option WRITE_USER_TRANSFORM on
|
||||
|
||||
# graphicsmagick
|
||||
option READ_USER_CHUNKS on
|
||||
|
||||
# Qt5.15 qtgui (gentoo package split) Qt6.6 qtbase
|
||||
option READ_BGR on
|
||||
option WRITE_BGR on
|
||||
option READ_SWAP_ALPHA on
|
||||
option WRITE_SWAP_ALPHA on
|
||||
chunk oFFs on
|
||||
|
||||
# ghostscript-gpl
|
||||
option WRITE_INVERT_ALPHA on
|
||||
option WRITE_INVERT on
|
@ -1,15 +0,0 @@
|
||||
# fixed.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2025
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Test the standard libpng configuration without floating point (the internal
|
||||
# fixed point implementations are used instead).
|
||||
#
|
||||
option FLOATING_ARITHMETIC off
|
||||
option FLOATING_POINT off
|
@ -1,14 +0,0 @@
|
||||
# fixed-float.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2025
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Test the standard libpng configuration with the fixed point internal
|
||||
# implementation in place of the default floating point
|
||||
#
|
||||
option FLOATING_ARITHMETIC off
|
@ -1,21 +0,0 @@
|
||||
# nolimits.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2025
|
||||
#
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng without any limits and without run-time settable limits. Turning
|
||||
# USER_LIMITS off reduces libpng code size by allowing compile-time elimination
|
||||
# of some checking code.
|
||||
#
|
||||
option USER_LIMITS off
|
||||
|
||||
@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX
|
||||
@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX
|
||||
@# define PNG_USER_CHUNK_CACHE_MAX 0
|
||||
@# define PNG_USER_CHUNK_MALLOC_MAX 0
|
@ -1,19 +0,0 @@
|
||||
# nolimits.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2025
|
||||
#
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng without any limits. With these settigs run-time limits are still
|
||||
# possible.
|
||||
#
|
||||
@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX
|
||||
@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX
|
||||
@# define PNG_USER_CHUNK_CACHE_MAX 0
|
||||
@# define PNG_USER_CHUNK_MALLOC_MAX 0
|
||||
|
@ -13,30 +13,15 @@
|
||||
#
|
||||
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 WRITE_PNG on
|
||||
option READ_PNG on
|
||||
option EASY_ACCESS on
|
||||
option WRITE on
|
||||
option WRITE_16BIT on
|
||||
option WRITE_FILTER on
|
||||
option SELECT_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
|
||||
# pngcp can work without explicit known chunk reading suppport
|
||||
option SAVE_UNKNOWN_CHUNKS on
|
||||
option WRITE_UNKNOWN_CHUNKS on
|
||||
|
||||
@ -44,14 +29,10 @@ option WRITE_UNKNOWN_CHUNKS on
|
||||
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
|
||||
# these are are just required for specific customizations
|
||||
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
|
||||
option WRITE_CUSTOMIZE_COMPRESSION on
|
||||
|
@ -1,13 +0,0 @@
|
||||
# read-full.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2025
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with no write support and full read support.
|
||||
#
|
||||
option WRITE off
|
@ -1,13 +0,0 @@
|
||||
# write-full.dfa
|
||||
# Build time configuration of libpng
|
||||
#
|
||||
# Author: John Bowler
|
||||
# Copyright: (c) John Bowler, 2025
|
||||
# Usage rights:
|
||||
# To the extent possible under law, the author has waived all copyright and
|
||||
# related or neighboring rights to this work. This work is published from:
|
||||
# United States.
|
||||
#
|
||||
# Build libpng with no read support and full write support.
|
||||
#
|
||||
option READ off
|
@ -1,143 +0,0 @@
|
||||
---
|
||||
Language: Cpp
|
||||
AccessModifierOffset: -3
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignArrayOfStructures: None
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: false
|
||||
AlignConsecutiveBitFields:
|
||||
Enabled: false
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: false
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: false
|
||||
AlignConsecutiveShortCaseStatements:
|
||||
Enabled: false
|
||||
AlignEscapedNewlines: DontAlign
|
||||
AlignOperands: false
|
||||
AlignTrailingComments:
|
||||
Kind: Never
|
||||
OverEmptyLines: 0
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowBreakBeforeNoexceptSpecifier: Never
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseExpressionOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortCompoundRequirementOnASingleLine: true
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortNamespacesOnASingleLine: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: BinPack
|
||||
BitFieldColonSpacing: Both
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: Always
|
||||
AfterEnum: true
|
||||
AfterExternBlock: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakAdjacentStringLiterals: true
|
||||
BreakAfterAttributes: Leave
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakAfterReturnType: TopLevel
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakStringLiterals: false
|
||||
BreakTemplateDeclarations: MultiLine
|
||||
ColumnLimit: 79
|
||||
ContinuationIndentWidth: 3
|
||||
DerivePointerAlignment: true
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
FixNamespaceComments: true
|
||||
IncludeBlocks: Preserve
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseBlocks: true
|
||||
IndentCaseLabels: true
|
||||
IndentExportBlock: true
|
||||
IndentExternBlock: AfterExternBlock
|
||||
IndentGotoLabels: false
|
||||
IndentPPDirectives: None
|
||||
IndentRequiresClause: true
|
||||
IndentWidth: 3
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLines:
|
||||
AtEndOfFile: false
|
||||
AtStartOfBlock: false
|
||||
AtStartOfFile: false
|
||||
KeepFormFeed: false
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Left
|
||||
QualifierAlignment: Custom
|
||||
QualifierOrder: [static, inline, constexpr, const, volatile, restrict, type]
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: Never
|
||||
RequiresClausePosition: OwnLine
|
||||
RequiresExpressionIndentation: OuterScope
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: LexicographicNumeric
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeJsonColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterFunctionDefinitionName: false
|
||||
AfterFunctionDeclarationName: false
|
||||
AfterOverloadedOperator: false
|
||||
AfterPlacementOperator: true
|
||||
AfterRequiresInClause: false
|
||||
AfterRequiresInExpression: false
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: Never
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParens: Never
|
||||
SpacesInParensOptions:
|
||||
ExceptDoubleParentheses: false
|
||||
InCStyleCasts: false
|
||||
InConditionalStatements: false
|
||||
InEmptyParentheses: false
|
||||
Other: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Latest
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
WrapNamespaceBodyWithEmptyLines: Leave
|
||||
...
|
@ -1,3 +1,4 @@
|
||||
|
||||
This directory (contrib/examples) contains examples of libpng usage.
|
||||
|
||||
NO COPYRIGHT RIGHTS ARE CLAIMED TO ANY OF THE FILES IN THIS DIRECTORY.
|
||||
@ -20,4 +21,4 @@ ORIGINAL AUTHORS
|
||||
of the people below claim any rights with regard to the contents of this
|
||||
directory.
|
||||
|
||||
John Bowler <jbowler at acm.org>
|
||||
John Bowler <jbowler@acm.org>
|
||||
|
@ -10,7 +10,7 @@
|
||||
* without processing the image. Notice that some header information may occur
|
||||
* after the image data. Textual data and comments are an example; the approach
|
||||
* in this file won't work reliably for such data because it only looks for the
|
||||
* information in the section of the file that precedes the image data.
|
||||
* information in the section of the file that preceeds the image data.
|
||||
*
|
||||
* Compile and link against libpng and zlib, plus anything else required on the
|
||||
* system you use.
|
||||
@ -26,9 +26,8 @@
|
||||
|
||||
#include <png.h>
|
||||
|
||||
#if !defined(PNG_iCCP_SUPPORTED) || !defined(PNG_READ_SUPPORTED)
|
||||
#error This program requires libpng supporting the iCCP chunk and the read API
|
||||
#endif
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) && \
|
||||
defined (PNG_iCCP_SUPPORTED)
|
||||
|
||||
|
||||
static int verbose = 1;
|
||||
@ -37,8 +36,7 @@ static png_byte no_profile[] = "no profile";
|
||||
static png_bytep
|
||||
extract(FILE *fp, png_uint_32 *proflen)
|
||||
{
|
||||
png_structp png_ptr =
|
||||
png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);
|
||||
png_infop info_ptr = NULL;
|
||||
png_bytep result = NULL;
|
||||
|
||||
@ -71,7 +69,7 @@ extract(FILE *fp, png_uint_32 *proflen)
|
||||
png_bytep profile;
|
||||
|
||||
if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile,
|
||||
proflen) & PNG_INFO_iCCP)
|
||||
proflen) & PNG_INFO_iCCP)
|
||||
{
|
||||
result = malloc(*proflen);
|
||||
if (result != NULL)
|
||||
@ -82,7 +80,7 @@ extract(FILE *fp, png_uint_32 *proflen)
|
||||
}
|
||||
|
||||
else
|
||||
result = no_profile;
|
||||
result = no_profile;
|
||||
}
|
||||
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
@ -109,7 +107,7 @@ extract_one_file(const char *filename)
|
||||
const char *ep = strrchr(filename, '.');
|
||||
|
||||
if (ep != NULL)
|
||||
len = ep - filename;
|
||||
len = ep-filename;
|
||||
|
||||
else
|
||||
len = strlen(filename);
|
||||
@ -121,14 +119,14 @@ extract_one_file(const char *filename)
|
||||
FILE *of;
|
||||
|
||||
memcpy(output, filename, len);
|
||||
strcpy(output + len, ".icc");
|
||||
strcpy(output+len, ".icc");
|
||||
|
||||
of = fopen(output, "wb");
|
||||
if (of != NULL)
|
||||
{
|
||||
if (fwrite(profile, proflen, 1, of) == 1 &&
|
||||
fflush(of) == 0 &&
|
||||
fclose(of) == 0)
|
||||
fflush(of) == 0 &&
|
||||
fclose(of) == 0)
|
||||
{
|
||||
if (verbose)
|
||||
printf("%s -> %s\n", filename, output);
|
||||
@ -157,15 +155,12 @@ extract_one_file(const char *filename)
|
||||
}
|
||||
|
||||
else if (verbose && profile == no_profile)
|
||||
printf("%s has no profile\n", filename);
|
||||
printf("%s has no profile\n", filename);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "%s: could not open file\n", filename);
|
||||
|
||||
if (fp != NULL)
|
||||
fclose(fp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -175,7 +170,7 @@ main(int argc, char **argv)
|
||||
int i;
|
||||
int extracted = 0;
|
||||
|
||||
for (i = 1; i < argc; ++i)
|
||||
for (i=1; i<argc; ++i)
|
||||
{
|
||||
if (strcmp(argv[i], "-q") == 0)
|
||||
verbose = 0;
|
||||
@ -187,3 +182,4 @@ main(int argc, char **argv)
|
||||
/* Exit code is true if any extract succeeds */
|
||||
return extracted == 0;
|
||||
}
|
||||
#endif /* READ && STDIO && iCCP */
|
||||
|
@ -15,8 +15,8 @@
|
||||
* images. Normally you would call png_set_interlace_handling() to have libpng
|
||||
* deal with the interlace for you, but that obliges you to buffer half of the
|
||||
* image to assemble the interlaced rows. In this code
|
||||
* png_set_interlace_handling() is not called and, instead, the code handles
|
||||
* the interlace passes directly looking for the required pixel.
|
||||
* png_set_interlace_handling() is not called and, instead, the code handles the
|
||||
* interlace passes directly looking for the required pixel.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@ -27,37 +27,34 @@
|
||||
*/
|
||||
#include "../../png.h"
|
||||
|
||||
#if !defined(PNG_READ_SUPPORTED) || !defined(PNG_SEQUENTIAL_READ_SUPPORTED)
|
||||
#error This program requires libpng supporting the read and sequential read API
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)
|
||||
|
||||
/* Return component 'c' of pixel 'x' from the given row. */
|
||||
static unsigned int
|
||||
component(png_const_bytep row, png_uint_32 x, unsigned int c,
|
||||
unsigned int bit_depth, unsigned int channels)
|
||||
unsigned int bit_depth, unsigned int channels)
|
||||
{
|
||||
/* PNG images can be up to 2^31 pixels wide, which means they can be up to
|
||||
* 2^37 bits wide (for a 64-bit pixel - the largest possible) and hence
|
||||
* 2^34 bytes wide. Since the row fitted into memory, the following must
|
||||
/* PNG images can be up to 2^31 pixels wide, but this means they can be up to
|
||||
* 2^37 bits wide (for a 64-bit pixel - the largest possible) and hence 2^34
|
||||
* bytes wide. Since the row fitted into memory, however, the following must
|
||||
* work:
|
||||
*/
|
||||
png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels);
|
||||
png_uint_32 bit_offset_lo = bit_depth * ((x & 0x3f) * channels + c);
|
||||
|
||||
row = (png_const_bytep)(((const png_byte(*)[8])row) + bit_offset_hi);
|
||||
row = (png_const_bytep)(((PNG_CONST png_byte (*)[8])row) + bit_offset_hi);
|
||||
row += bit_offset_lo >> 3;
|
||||
bit_offset_lo &= 0x07;
|
||||
|
||||
/* PNG pixels are packed into bytes to put the first pixel in the highest
|
||||
* bits of the byte, and into two bytes for 16-bit values with the high
|
||||
* 8 bits first, so:
|
||||
* bits of the byte and into two bytes for 16-bit values with the high 8 bits
|
||||
* first, so:
|
||||
*/
|
||||
switch (bit_depth)
|
||||
{
|
||||
case 1: return (row[0] >> (7 - bit_offset_lo)) & 0x01;
|
||||
case 2: return (row[0] >> (6 - bit_offset_lo)) & 0x03;
|
||||
case 4: return (row[0] >> (4 - bit_offset_lo)) & 0x0f;
|
||||
case 1: return (row[0] >> (7-bit_offset_lo)) & 0x01;
|
||||
case 2: return (row[0] >> (6-bit_offset_lo)) & 0x03;
|
||||
case 4: return (row[0] >> (4-bit_offset_lo)) & 0x0f;
|
||||
case 8: return row[0];
|
||||
case 16: return (row[0] << 8) + row[1];
|
||||
default:
|
||||
@ -74,9 +71,9 @@ component(png_const_bytep row, png_uint_32 x, unsigned int c,
|
||||
*/
|
||||
static void
|
||||
print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
png_uint_32 x)
|
||||
png_uint_32 x)
|
||||
{
|
||||
unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
|
||||
PNG_CONST unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
|
||||
|
||||
switch (png_get_color_type(png_ptr, info_ptr))
|
||||
{
|
||||
@ -90,29 +87,27 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
*/
|
||||
case PNG_COLOR_TYPE_PALETTE:
|
||||
{
|
||||
int index = component(row, x, 0, bit_depth, 1);
|
||||
PNG_CONST int index = component(row, x, 0, bit_depth, 1);
|
||||
png_colorp palette = NULL;
|
||||
int num_palette = 0;
|
||||
|
||||
if ((png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) &
|
||||
PNG_INFO_PLTE) &&
|
||||
(num_palette > 0) &&
|
||||
(palette != NULL))
|
||||
PNG_INFO_PLTE) && num_palette > 0 && palette != NULL)
|
||||
{
|
||||
png_bytep trans_alpha = NULL;
|
||||
int num_trans = 0;
|
||||
if ((png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans,
|
||||
NULL) & PNG_INFO_tRNS) &&
|
||||
(num_trans > 0) &&
|
||||
(trans_alpha != NULL))
|
||||
NULL) & PNG_INFO_tRNS) && num_trans > 0 &&
|
||||
trans_alpha != NULL)
|
||||
printf("INDEXED %u = %d %d %d %d\n", index,
|
||||
palette[index].red, palette[index].green,
|
||||
palette[index].blue,
|
||||
index < num_trans ? trans_alpha[index] : 255);
|
||||
palette[index].red, palette[index].green,
|
||||
palette[index].blue,
|
||||
index < num_trans ? trans_alpha[index] : 255);
|
||||
|
||||
else /* no transparency */
|
||||
printf("INDEXED %u = %d %d %d\n", index, palette[index].red,
|
||||
palette[index].green, palette[index].blue);
|
||||
printf("INDEXED %u = %d %d %d\n", index,
|
||||
palette[index].red, palette[index].green,
|
||||
palette[index].blue);
|
||||
}
|
||||
|
||||
else
|
||||
@ -122,20 +117,20 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
|
||||
case PNG_COLOR_TYPE_RGB:
|
||||
printf("RGB %u %u %u\n", component(row, x, 0, bit_depth, 3),
|
||||
component(row, x, 1, bit_depth, 3),
|
||||
component(row, x, 2, bit_depth, 3));
|
||||
component(row, x, 1, bit_depth, 3),
|
||||
component(row, x, 2, bit_depth, 3));
|
||||
return;
|
||||
|
||||
case PNG_COLOR_TYPE_GRAY_ALPHA:
|
||||
printf("GRAY+ALPHA %u %u\n", component(row, x, 0, bit_depth, 2),
|
||||
component(row, x, 1, bit_depth, 2));
|
||||
component(row, x, 1, bit_depth, 2));
|
||||
return;
|
||||
|
||||
case PNG_COLOR_TYPE_RGB_ALPHA:
|
||||
printf("RGBA %u %u %u %u\n", component(row, x, 0, bit_depth, 4),
|
||||
component(row, x, 1, bit_depth, 4),
|
||||
component(row, x, 2, bit_depth, 4),
|
||||
component(row, x, 3, bit_depth, 4));
|
||||
component(row, x, 1, bit_depth, 4),
|
||||
component(row, x, 2, bit_depth, 4),
|
||||
component(row, x, 3, bit_depth, 4));
|
||||
return;
|
||||
|
||||
default:
|
||||
@ -143,8 +138,7 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, const char **argv)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
/* This program uses the default, <setjmp.h> based, libpng error handling
|
||||
* mechanism, therefore any local variable that exists before the call to
|
||||
@ -152,7 +146,7 @@ main(int argc, const char **argv)
|
||||
* be declared with 'volatile' to ensure that their values don't get
|
||||
* destroyed by longjmp:
|
||||
*/
|
||||
volatile int result = 1 /*fail*/;
|
||||
volatile int result = 1/*fail*/;
|
||||
|
||||
if (argc == 4)
|
||||
{
|
||||
@ -169,8 +163,8 @@ main(int argc, const char **argv)
|
||||
* writes error messages to stderr. Creating the png_struct is a
|
||||
* little tricky; just copy the following code.
|
||||
*/
|
||||
png_structp png_ptr =
|
||||
png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
@ -190,11 +184,11 @@ main(int argc, const char **argv)
|
||||
compression_method, filter_method;
|
||||
png_bytep row_tmp;
|
||||
|
||||
/* Now associate the recently opened FILE object with the
|
||||
* default libpng initialization functions. Sometimes libpng
|
||||
* is compiled without stdio support (it can be difficult to
|
||||
* do in some environments); in that case you will have to
|
||||
* write your own read callback to read data from the stream.
|
||||
/* Now associate the recently opened (FILE*) with the default
|
||||
* libpng initialization functions. Sometimes libpng is
|
||||
* compiled without stdio support (it can be difficult to do
|
||||
* in some environments); in that case you will have to write
|
||||
* your own read callback to read data from the (FILE*).
|
||||
*/
|
||||
png_init_io(png_ptr, f);
|
||||
|
||||
@ -208,21 +202,21 @@ main(int argc, const char **argv)
|
||||
* space. In this case png_malloc is used - it will not
|
||||
* return if memory isn't available.
|
||||
*/
|
||||
row =
|
||||
png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr));
|
||||
row = png_malloc(png_ptr, png_get_rowbytes(png_ptr,
|
||||
info_ptr));
|
||||
|
||||
/* Avoid the overhead of using a volatile auto copy row_tmp
|
||||
/* To avoid the overhead of using a volatile auto copy row_tmp
|
||||
* to a local here - just use row for the png_free below.
|
||||
*/
|
||||
row_tmp = row;
|
||||
|
||||
/* All the information we need is in the header returned by
|
||||
* png_get_IHDR. If this fails, we can use 'png_error' to
|
||||
/* All the information we need is in the header is returned by
|
||||
* png_get_IHDR, if this fails we can now use 'png_error' to
|
||||
* signal the error and return control to the setjmp above.
|
||||
*/
|
||||
if (png_get_IHDR(png_ptr, info_ptr, &width, &height,
|
||||
&bit_depth, &color_type, &interlace_method,
|
||||
&compression_method, &filter_method))
|
||||
&bit_depth, &color_type, &interlace_method,
|
||||
&compression_method, &filter_method))
|
||||
{
|
||||
int passes, pass;
|
||||
|
||||
@ -248,7 +242,7 @@ main(int argc, const char **argv)
|
||||
/* Now read the pixels, pass-by-pass, row-by-row: */
|
||||
png_start_read_image(png_ptr);
|
||||
|
||||
for (pass = 0; pass < passes; ++pass)
|
||||
for (pass=0; pass<passes; ++pass)
|
||||
{
|
||||
png_uint_32 ystart, xstart, ystep, xstep;
|
||||
png_uint_32 py;
|
||||
@ -305,27 +299,19 @@ main(int argc, const char **argv)
|
||||
* are, of course, much better ways of doing this
|
||||
* than using a for loop:
|
||||
*/
|
||||
if (y == py)
|
||||
if (y == py) for (px = xstart, ppx = 0;
|
||||
px < width; px += xstep, ++ppx) if (x == px)
|
||||
{
|
||||
for (px = xstart, ppx = 0;
|
||||
px < width;
|
||||
px += xstep, ++ppx)
|
||||
{
|
||||
if (x == px)
|
||||
{
|
||||
/* 'ppx' is the index of the pixel in the
|
||||
* row buffer.
|
||||
*/
|
||||
print_pixel(png_ptr, info_ptr, row_tmp,
|
||||
ppx);
|
||||
/* 'ppx' is the index of the pixel in the row
|
||||
* buffer.
|
||||
*/
|
||||
print_pixel(png_ptr, info_ptr, row_tmp, ppx);
|
||||
|
||||
/* Now terminate the loops early - we have
|
||||
* found and handled the required data.
|
||||
*/
|
||||
goto pass_loop_end;
|
||||
} /* x loop */
|
||||
}
|
||||
}
|
||||
/* Now terminate the loops early - we have
|
||||
* found and handled the required data.
|
||||
*/
|
||||
goto pass_loop_end;
|
||||
} /* x loop */
|
||||
} /* y loop */
|
||||
} /* pass loop */
|
||||
|
||||
@ -337,6 +323,7 @@ main(int argc, const char **argv)
|
||||
|
||||
else
|
||||
png_error(png_ptr, "pngpixel: png_get_IHDR failed");
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
@ -362,8 +349,7 @@ main(int argc, const char **argv)
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr,
|
||||
"pngpixel: out of memory allocating png_info\n");
|
||||
fprintf(stderr, "pngpixel: out of memory allocating png_info\n");
|
||||
|
||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||
}
|
||||
@ -382,3 +368,4 @@ main(int argc, const char **argv)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* READ && SEQUENTIAL_READ */
|
||||
|
@ -5,11 +5,13 @@
|
||||
* related or neighboring rights to this work. This work is published from:
|
||||
* United States.
|
||||
*
|
||||
* Last changed in libpng 1.6.29 [%RDATE%]
|
||||
*
|
||||
* Read a PNG and write it out in a fixed format, using the 'simplified API'
|
||||
* that was introduced in libpng-1.6.0.
|
||||
*
|
||||
* This sample code is just the code from 'example.c' with some error handling
|
||||
* added. See example.c in the top-level libpng directory for more comments.
|
||||
* This sample code is just the code from the top of 'example.c' with some error
|
||||
* handling added. See example.c for more comments.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
@ -20,15 +22,10 @@
|
||||
* ensure the code picks up the local libpng implementation:
|
||||
*/
|
||||
#include "../../png.h"
|
||||
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) && \
|
||||
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
|
||||
|
||||
#if !defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \
|
||||
!defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
|
||||
#error This program requires libpng supporting the simplified read/write API
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
main(int argc, const char **argv)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int result = 1;
|
||||
|
||||
@ -53,22 +50,22 @@ main(int argc, const char **argv)
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
if (png_image_finish_read(&image, NULL /*background*/, buffer,
|
||||
0 /*row_stride*/, NULL /*colormap */))
|
||||
if (png_image_finish_read(&image, NULL/*background*/, buffer,
|
||||
0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */))
|
||||
{
|
||||
if (png_image_write_to_file(
|
||||
&image, argv[2], 0 /*convert_to_8bit*/, buffer,
|
||||
0 /*row_stride*/, NULL /*colormap*/))
|
||||
if (png_image_write_to_file(&image, argv[2],
|
||||
0/*convert_to_8bit*/, buffer, 0/*row_stride*/,
|
||||
NULL/*colormap*/))
|
||||
result = 0;
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngtopng: write %s: %s\n", argv[2],
|
||||
image.message);
|
||||
image.message);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr, "pngtopng: read %s: %s\n", argv[1],
|
||||
image.message);
|
||||
image.message);
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
@ -76,7 +73,7 @@ main(int argc, const char **argv)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "pngtopng: out of memory: %lu bytes\n",
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
|
||||
/* This is the only place where a 'free' is required; libpng does
|
||||
* the cleanup on error and success, but in this case we couldn't
|
||||
@ -98,3 +95,4 @@ main(int argc, const char **argv)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* READ && WRITE */
|
||||
|
@ -6,9 +6,9 @@
|
||||
* United States.
|
||||
*
|
||||
* Read several PNG files, which should have an alpha channel or transparency
|
||||
* information, and composite them together to produce one or more 16-bit
|
||||
* linear RGBA intermediates. This involves doing the 'over' compositing
|
||||
* operation to combine the alpha channels and corresponding data.
|
||||
* information, and composite them together to produce one or more 16-bit linear
|
||||
* RGBA intermediates. This involves doing the correct 'over' composition to
|
||||
* combine the alpha channels and corresponding data.
|
||||
*
|
||||
* Finally read an output (background) PNG using the 24-bit RGB format (the
|
||||
* PNG will be composited on green (#00ff00) by default if it has an alpha
|
||||
@ -28,8 +28,8 @@
|
||||
* correctly. Apart from the libpng Simplified API the only work done in here
|
||||
* is to combine multiple input PNG images into a single sprite; this involves
|
||||
* a Porter-Duff 'over' operation and the input PNG images may, as a result,
|
||||
* be regarded as being layered one on top of the other with the first
|
||||
* (leftmost on the command line) being at the bottom and the last on the top.
|
||||
* be regarded as being layered one on top of the other with the first (leftmost
|
||||
* on the command line) being at the bottom and the last on the top.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
@ -44,61 +44,54 @@
|
||||
*/
|
||||
#include "../../png.h"
|
||||
|
||||
#if !defined(PNG_SIMPLIFIED_READ_SUPPORTED)
|
||||
#error This program requires libpng supporting the simplified read API
|
||||
#endif
|
||||
#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
|
||||
|
||||
#define sprite_name_chars 15
|
||||
struct sprite
|
||||
{
|
||||
FILE *file;
|
||||
png_uint_16p buffer;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
char name[sprite_name_chars + 1];
|
||||
struct sprite {
|
||||
FILE *file;
|
||||
png_uint_16p buffer;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
char name[sprite_name_chars+1];
|
||||
};
|
||||
|
||||
#if 0 /* div by 65535 test program */
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int main(void) {
|
||||
double err = 0;
|
||||
unsigned int xerr = 0;
|
||||
unsigned int r = 32769;
|
||||
unsigned int x = 0;
|
||||
|
||||
do
|
||||
{
|
||||
unsigned int t = x + (x >> 16) /*+ (x >> 31)*/ + r;
|
||||
double v = x, errtest;
|
||||
unsigned int x = 0;
|
||||
|
||||
if (t < x)
|
||||
{
|
||||
fprintf(stderr, "overflow: %u+%u -> %u\n", x, r, t);
|
||||
return 1;
|
||||
}
|
||||
do {
|
||||
unsigned int t = x + (x >> 16) /*+ (x >> 31)*/ + r;
|
||||
double v = x, errtest;
|
||||
|
||||
v /= 65535;
|
||||
errtest = v;
|
||||
t >>= 16;
|
||||
errtest -= t;
|
||||
|
||||
if (errtest > err)
|
||||
{
|
||||
err = errtest;
|
||||
xerr = x;
|
||||
|
||||
if (errtest >= .5)
|
||||
{
|
||||
fprintf(stderr, "error: %u/65535 = %f, not %u, error %f\n",
|
||||
x, v, t, errtest);
|
||||
return 0;
|
||||
if (t < x) {
|
||||
fprintf(stderr, "overflow: %u+%u -> %u\n", x, r, t);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} while (++x <= 65535U * 65535U);
|
||||
|
||||
v /= 65535;
|
||||
errtest = v;
|
||||
t >>= 16;
|
||||
errtest -= t;
|
||||
|
||||
if (errtest > err) {
|
||||
err = errtest;
|
||||
xerr = x;
|
||||
|
||||
if (errtest >= .5) {
|
||||
fprintf(stderr, "error: %u/65535 = %f, not %u, error %f\n",
|
||||
x, v, t, errtest);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} while (++x <= 65535U*65535U);
|
||||
}
|
||||
|
||||
printf("error %f @ %u\n", err, xerr);
|
||||
|
||||
@ -108,7 +101,7 @@ main(void)
|
||||
|
||||
static void
|
||||
sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
png_imagep image, const png_uint_16 *buffer)
|
||||
png_imagep image, const png_uint_16 *buffer)
|
||||
{
|
||||
/* This is where the Porter-Duff 'Over' operator is evaluated; change this
|
||||
* code to change the operator (this could be parameterized). Any other
|
||||
@ -119,8 +112,8 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
/* Check for an x or y offset that pushes any part of the image beyond the
|
||||
* right or bottom of the sprite:
|
||||
*/
|
||||
if ((y_offset < 0 || /*SAFE*/ (unsigned)y_offset < sprite->height) &&
|
||||
(x_offset < 0 || /*SAFE*/ (unsigned)x_offset < sprite->width))
|
||||
if ((y_offset < 0 || (unsigned)/*SAFE*/y_offset < sprite->height) &&
|
||||
(x_offset < 0 || (unsigned)/*SAFE*/x_offset < sprite->width))
|
||||
{
|
||||
unsigned int y = 0;
|
||||
|
||||
@ -137,7 +130,7 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
do
|
||||
{
|
||||
/* In and out are RGBA values, so: */
|
||||
const png_uint_16 *in_pixel = buffer + (y * image->width + x) * 4;
|
||||
const png_uint_16 *in_pixel = buffer + (y * image->width + x)*4;
|
||||
png_uint_32 in_alpha = in_pixel[3];
|
||||
|
||||
/* This is the optimized Porter-Duff 'Over' operation, when the
|
||||
@ -146,10 +139,10 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
if (in_alpha > 0)
|
||||
{
|
||||
png_uint_16 *out_pixel = sprite->buffer +
|
||||
((y + y_offset) * sprite->width + (x + x_offset)) * 4;
|
||||
((y+y_offset) * sprite->width + (x+x_offset))*4;
|
||||
|
||||
/* This is the weight to apply to the output: */
|
||||
in_alpha = 65535 - in_alpha;
|
||||
in_alpha = 65535-in_alpha;
|
||||
|
||||
if (in_alpha > 0)
|
||||
{
|
||||
@ -166,9 +159,9 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
*/
|
||||
png_uint_32 tmp;
|
||||
|
||||
# define compose(c) \
|
||||
tmp = out_pixel[c] * in_alpha; \
|
||||
tmp = (tmp + (tmp >> 16) + 32769) >> 16; \
|
||||
# define compose(c)\
|
||||
tmp = out_pixel[c] * in_alpha;\
|
||||
tmp = (tmp + (tmp >> 16) + 32769) >> 16;\
|
||||
out_pixel[c] = tmp + in_pixel[c]
|
||||
|
||||
/* The following is very vectorizable... */
|
||||
@ -179,15 +172,15 @@ sprite_op(const struct sprite *sprite, int x_offset, int y_offset,
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
out_pixel[0] = in_pixel[0];
|
||||
out_pixel[1] = in_pixel[1];
|
||||
out_pixel[2] = in_pixel[2];
|
||||
out_pixel[0] = in_pixel[0],
|
||||
out_pixel[1] = in_pixel[1],
|
||||
out_pixel[2] = in_pixel[2],
|
||||
out_pixel[3] = in_pixel[3];
|
||||
}
|
||||
}
|
||||
} while (++x < image->width);
|
||||
} while (++y < image->height);
|
||||
}
|
||||
while (++x < image->width);
|
||||
}
|
||||
while (++y < image->height);
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,8 +224,9 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv)
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
if (png_image_finish_read(&image, NULL /*background*/, buffer,
|
||||
0 /*row_stride*/, NULL /*colormap*/))
|
||||
if (png_image_finish_read(&image, NULL/*background*/, buffer,
|
||||
0/*row_stride*/,
|
||||
NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/))
|
||||
{
|
||||
/* This is the place where the Porter-Duff 'Over' operator
|
||||
* needs to be done by this code. In fact, any image
|
||||
@ -251,14 +245,14 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv)
|
||||
{
|
||||
free(buffer);
|
||||
fprintf(stderr, "simpleover: read %s: %s\n", (*argv)[0],
|
||||
image.message);
|
||||
image.message);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: out of memory: %lu bytes\n",
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
|
||||
/* png_image_free must be called if we abort the Simplified API
|
||||
* read because of a problem detected in this code. If problems
|
||||
@ -296,9 +290,8 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv)
|
||||
save.flags = PNG_IMAGE_FLAG_FAST;
|
||||
save.colormap_entries = 0;
|
||||
|
||||
if (png_image_write_to_stdio(&save, sprite->file, 1 /*convert_to_8_bit*/,
|
||||
sprite->buffer, 0 /*row_stride*/,
|
||||
NULL /*colormap*/))
|
||||
if (png_image_write_to_stdio(&save, sprite->file, 1/*convert_to_8_bit*/,
|
||||
sprite->buffer, 0/*row_stride*/, NULL/*colormap*/))
|
||||
{
|
||||
/* Success; the buffer is no longer needed: */
|
||||
free(sprite->buffer);
|
||||
@ -308,20 +301,19 @@ create_sprite(struct sprite *sprite, int *argc, const char ***argv)
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: write sprite %s: %s\n", sprite->name,
|
||||
save.message);
|
||||
save.message);
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(stderr,
|
||||
"simpleover: sprite %s: could not allocate tmpfile: %s\n",
|
||||
sprite->name, strerror(errno));
|
||||
fprintf(stderr, "simpleover: sprite %s: could not allocate tmpfile: %s\n",
|
||||
sprite->name, strerror(errno));
|
||||
|
||||
return 0; /* fail */
|
||||
}
|
||||
|
||||
static int
|
||||
add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
int *argc, const char ***argv)
|
||||
int *argc, const char ***argv)
|
||||
{
|
||||
/* Given a --add argument naming this sprite, perform the operations listed
|
||||
* in the following arguments. The arguments are expected to have the form
|
||||
@ -342,13 +334,13 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
* will fit.
|
||||
*/
|
||||
if (x < 0 || y < 0 ||
|
||||
/*SAFE*/ (unsigned)x >= output->width ||
|
||||
/*SAFE*/ (unsigned)y >= output->height ||
|
||||
sprite->width > output->width - x ||
|
||||
sprite->height > output->height - y)
|
||||
(unsigned)/*SAFE*/x >= output->width ||
|
||||
(unsigned)/*SAFE*/y >= output->height ||
|
||||
sprite->width > output->width-x ||
|
||||
sprite->height > output->height-y)
|
||||
{
|
||||
fprintf(stderr, "simpleover: sprite %s @ (%d,%d) outside image\n",
|
||||
sprite->name, x, y);
|
||||
sprite->name, x, y);
|
||||
/* Could just skip this, but for the moment it is an error */
|
||||
return 0; /* error */
|
||||
}
|
||||
@ -367,10 +359,10 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
{
|
||||
in.format = PNG_FORMAT_RGB; /* force compose */
|
||||
|
||||
if (png_image_finish_read(
|
||||
&in, NULL /*background*/,
|
||||
out_buf + (y * output->width + x) * 3 /*RGB*/,
|
||||
output->width * 3 /*row_stride*/, NULL /*colormap*/))
|
||||
if (png_image_finish_read(&in, NULL/*background*/,
|
||||
out_buf + (y*output->width + x)*3/*RGB*/,
|
||||
output->width*3/*row_stride*/,
|
||||
NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/))
|
||||
{
|
||||
++*argv, --*argc;
|
||||
continue;
|
||||
@ -379,7 +371,7 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
|
||||
/* The read failed: */
|
||||
fprintf(stderr, "simpleover: add sprite %s: %s\n", sprite->name,
|
||||
in.message);
|
||||
in.message);
|
||||
return 0; /* error */
|
||||
}
|
||||
}
|
||||
@ -387,7 +379,7 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: --add='%s': invalid position %s\n",
|
||||
sprite->name, (*argv)[0]);
|
||||
sprite->name, (*argv)[0]);
|
||||
return 0; /* error */
|
||||
}
|
||||
}
|
||||
@ -397,10 +389,10 @@ add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite,
|
||||
|
||||
static int
|
||||
simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
const char **argv)
|
||||
const char **argv)
|
||||
{
|
||||
int result = 1; /* success */
|
||||
# define csprites 10 /*limit*/
|
||||
# define csprites 10/*limit*/
|
||||
# define str(a) #a
|
||||
int nsprites = 0;
|
||||
struct sprite sprites[csprites];
|
||||
@ -420,25 +412,23 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
sprites[nsprites].width = sprites[nsprites].height = 0;
|
||||
sprites[nsprites].name[0] = 0;
|
||||
|
||||
n = sscanf(argv[0],
|
||||
"--sprite=%u,%u,%" str(sprite_name_chars) "s%c",
|
||||
&sprites[nsprites].width, &sprites[nsprites].height,
|
||||
sprites[nsprites].name, &tombstone);
|
||||
n = sscanf(argv[0], "--sprite=%u,%u,%" str(sprite_name_chars) "s%c",
|
||||
&sprites[nsprites].width, &sprites[nsprites].height,
|
||||
sprites[nsprites].name, &tombstone);
|
||||
|
||||
if ((n == 2 || n == 3) &&
|
||||
(sprites[nsprites].width > 0) &&
|
||||
(sprites[nsprites].height > 0))
|
||||
sprites[nsprites].width > 0 && sprites[nsprites].height > 0)
|
||||
{
|
||||
size_t buf_size, tmp;
|
||||
|
||||
/* Default a name if not given. */
|
||||
if (sprites[nsprites].name[0] == 0)
|
||||
sprintf(sprites[nsprites].name, "sprite-%d", nsprites + 1);
|
||||
sprintf(sprites[nsprites].name, "sprite-%d", nsprites+1);
|
||||
|
||||
/* Allocate a buffer for the sprite and calculate the buffer
|
||||
* size:
|
||||
*/
|
||||
buf_size = sizeof(png_uint_16[4]);
|
||||
buf_size = sizeof (png_uint_16 [4]);
|
||||
buf_size *= sprites[nsprites].width;
|
||||
buf_size *= sprites[nsprites].height;
|
||||
|
||||
@ -447,7 +437,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
tmp /= sprites[nsprites].width;
|
||||
tmp /= sprites[nsprites].height;
|
||||
|
||||
if (tmp == sizeof(png_uint_16[4]))
|
||||
if (tmp == sizeof (png_uint_16 [4]))
|
||||
{
|
||||
sprites[nsprites].buffer = malloc(buf_size);
|
||||
/* This buffer must be initialized to transparent: */
|
||||
@ -458,7 +448,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
sprites[nsprites].file = NULL;
|
||||
++argv, --argc;
|
||||
|
||||
if (create_sprite(sprites + nsprites++, &argc, &argv))
|
||||
if (create_sprite(sprites+nsprites++, &argc, &argv))
|
||||
{
|
||||
result = 1; /* still ok */
|
||||
continue;
|
||||
@ -476,8 +466,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: %s: invalid sprite (%u,%u)\n",
|
||||
argv[0],
|
||||
sprites[nsprites].width, sprites[nsprites].height);
|
||||
argv[0], sprites[nsprites].width, sprites[nsprites].height);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -491,7 +480,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
|
||||
else if (strncmp(argv[0], "--add=", 6) == 0)
|
||||
{
|
||||
const char *name = argv[0] + 6;
|
||||
const char *name = argv[0]+6;
|
||||
int isprite = nsprites;
|
||||
|
||||
++argv, --argc;
|
||||
@ -500,8 +489,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
{
|
||||
if (strcmp(sprites[isprite].name, name) == 0)
|
||||
{
|
||||
if (!add_sprite(output, out_buf, sprites + isprite,
|
||||
&argc, &argv))
|
||||
if (!add_sprite(output, out_buf, sprites+isprite, &argc, &argv))
|
||||
goto out; /* error in add_sprite */
|
||||
|
||||
break;
|
||||
@ -510,8 +498,7 @@ simpleover_process(png_imagep output, png_bytep out_buf, int argc,
|
||||
|
||||
if (isprite < 0) /* sprite not found */
|
||||
{
|
||||
fprintf(stderr, "simpleover: --add='%s': sprite not found\n",
|
||||
name);
|
||||
fprintf(stderr, "simpleover: --add='%s': sprite not found\n", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -539,8 +526,7 @@ out:
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, const char **argv)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int result = 1; /* default to fail */
|
||||
|
||||
@ -550,7 +536,7 @@ main(int argc, const char **argv)
|
||||
const char *output = NULL;
|
||||
png_image image;
|
||||
|
||||
if (argc > 2 && argv[2][0] != '-' /*an operation*/)
|
||||
if (argc > 2 && argv[2][0] != '-'/*an operation*/)
|
||||
{
|
||||
output = argv[2];
|
||||
argi = 3;
|
||||
@ -572,7 +558,7 @@ main(int argc, const char **argv)
|
||||
png_color background = {0, 0xff, 0}; /* fully saturated green */
|
||||
|
||||
if (png_image_finish_read(&image, &background, buffer,
|
||||
0 /*row_stride*/, NULL /*colormap*/))
|
||||
0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */))
|
||||
{
|
||||
/* At this point png_image_finish_read has cleaned up the
|
||||
* allocated data in png_image, and only the buffer needs to be
|
||||
@ -580,24 +566,22 @@ main(int argc, const char **argv)
|
||||
*
|
||||
* Perform the remaining operations:
|
||||
*/
|
||||
if (simpleover_process(&image, buffer,
|
||||
argc - argi, argv + argi))
|
||||
if (simpleover_process(&image, buffer, argc-argi, argv+argi))
|
||||
{
|
||||
/* Write the output: */
|
||||
if ((output != NULL &&
|
||||
png_image_write_to_file(
|
||||
&image, output, 0 /*convert_to_8bit*/, buffer,
|
||||
0 /*row_stride*/, NULL /*colormap*/)) ||
|
||||
png_image_write_to_file(&image, output,
|
||||
0/*convert_to_8bit*/, buffer, 0/*row_stride*/,
|
||||
NULL/*colormap*/)) ||
|
||||
(output == NULL &&
|
||||
png_image_write_to_stdio(
|
||||
&image, stdout, 0 /*convert_to_8bit*/, buffer,
|
||||
0 /*row_stride*/, NULL /*colormap*/)))
|
||||
png_image_write_to_stdio(&image, stdout,
|
||||
0/*convert_to_8bit*/, buffer, 0/*row_stride*/,
|
||||
NULL/*colormap*/)))
|
||||
result = 0;
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: write %s: %s\n",
|
||||
output == NULL ? "stdout" : output,
|
||||
image.message);
|
||||
output == NULL ? "stdout" : output, image.message);
|
||||
}
|
||||
|
||||
/* else simpleover_process writes an error message */
|
||||
@ -605,7 +589,7 @@ main(int argc, const char **argv)
|
||||
|
||||
else
|
||||
fprintf(stderr, "simpleover: read %s: %s\n", argv[1],
|
||||
image.message);
|
||||
image.message);
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
@ -613,7 +597,7 @@ main(int argc, const char **argv)
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "simpleover: out of memory: %lu bytes\n",
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
(unsigned long)PNG_IMAGE_SIZE(image));
|
||||
|
||||
/* This is the only place where a 'free' is required; libpng does
|
||||
* the cleanup on error and success, but in this case we couldn't
|
||||
@ -633,8 +617,7 @@ main(int argc, const char **argv)
|
||||
else
|
||||
{
|
||||
/* Usage message */
|
||||
fprintf(
|
||||
stderr,
|
||||
fprintf(stderr,
|
||||
"simpleover: usage: simpleover background.png [output.png]\n"
|
||||
" Output 'background.png' as a 24-bit RGB PNG file in 'output.png'\n"
|
||||
" or, if not given, stdout. 'background.png' will be composited\n"
|
||||
@ -645,13 +628,13 @@ main(int argc, const char **argv)
|
||||
" --sprite=width,height,name {[--at=x,y] {sprite.png}}\n"
|
||||
" Produce a transparent sprite of size (width,height) and with\n"
|
||||
" name 'name'.\n"
|
||||
" For each sprite.png composite it is using a Porter-Duff 'Over'\n"
|
||||
" operation at offset (x,y) in the sprite, defaulting to (0,0).\n"
|
||||
" For each sprite.png composite it using a Porter-Duff 'Over'\n"
|
||||
" operation at offset (x,y) in the sprite (defaulting to (0,0)).\n"
|
||||
" Input PNGs will be truncated to the area of the sprite.\n"
|
||||
"\n"
|
||||
" --add='name' {x,y}\n"
|
||||
" Optionally, before output, composite a sprite, 'name', which\n"
|
||||
" must have been previously produced using --sprite at each\n"
|
||||
" must have been previously produced using --sprite, at each\n"
|
||||
" offset (x,y) in the output image. Each sprite must fit\n"
|
||||
" completely within the output image.\n"
|
||||
"\n"
|
||||
@ -662,3 +645,4 @@ main(int argc, const char **argv)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* SIMPLIFIED_READ */
|
||||
|
16
contrib/extensions.ac
Normal file
16
contrib/extensions.ac
Normal file
@ -0,0 +1,16 @@
|
||||
# CONTRIBUTED EXTENSIONS
|
||||
#
|
||||
# The following extensions are part of a standard libpng distribution. They are
|
||||
# not supported parts of libpng and they are not necessarily released under the
|
||||
# same license as libpng. Please consult the relevant directory for copyright
|
||||
# and support information before uncommenting any of the lines below.
|
||||
#
|
||||
# After you change this file you MUST re-run "autoreconf" to regenerate the
|
||||
# configure script, otherwise the change may have no effect.
|
||||
#
|
||||
# Include the ARM NEON extension:
|
||||
#sinclude([contrib/neon/neon.ac])
|
||||
#
|
||||
# If any of the extensions require automake support (this is likely) automake
|
||||
# must include the file contrib/extensions.am
|
||||
#libpng_automake_extensions="yes"
|
7
contrib/extensions.am
Normal file
7
contrib/extensions.am
Normal file
@ -0,0 +1,7 @@
|
||||
# CONTRIBUTED EXTENSIONS
|
||||
#
|
||||
# Please read the file "contrib/extensions.ac" before making changes to this
|
||||
# file.
|
||||
#
|
||||
# Include the ARM NEON extension:
|
||||
#include %reldir%/neon/neon.am
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user