Closed XiWeiGu closed 7 months ago
@jinboson,please help me review the code.
For the record I feel that all hardware optimisations should require an explicit "switch on" in the build. All of them, without exception. I can test loongson compiles (I haven't tested this one) and I can test the compiles of, I believe, all the other hardware opts that are in there but I have no way of verifying that they work when run on the required very wide variety of hardware.
There's too much danger of whack-a-mole here with the wide range of different hardware available; fix one instance, break another. I had previously thought that compiler checks would be sufficient but anything that uses a run-time check of any form has the very real chance of failing on some hardware; this has happened in the past with Intel runtime checks.
For the record I feel that all hardware optimisations should require an explicit "switch on" in the build.
I concur. This is what I want us to do in "libpng-ng".
But for libpng-1.6.x, that ship has sailed. The CMake file is rather atrocious, and it doesn't need to be. The configure script is even worse. The simplest of the makefiles (e.g. scripts/makefile.gcc
) require that NOHWOPT
thing (take a look!)
At the time of libpng-1.0, the makefiles were the second-simplest thing to use after
ls png*.c | xargs gcc
Now, of course, I understand the need of everything that came after that. And yet, grabbing all source files and writing a shell command or two on top of those should work intuitively, without requiring anything like -DPNG_OBSCURE_THING=1
The files scripts/makefile.*
were broken for a very long time during the life of libpng-1.6.x, while nobody (myself included) was looking.
And, let's fix that.
Agreed. But if you start with just *.[ch] you end up with the same mess. It's necessary to delete most of the code too. Much of it is never used and most of it is hardly used.
I guess I might try on my gentoo system with a pngusr.dfa that starts "everything=off". The big players have their own, heavily hacked, version of libpng and the small players, real people, don't need most of it.
The author of PR #225 is no longer maintaining it. I have updated this portion of the code and made several fixes on top of it.