When building with external libpng the PNG defines added to CFLAGS may conflict with the installed libpng header pnglibconf.h resulting in compilation errors. For example on OpenBSD/aarch64:
`/usr/local/include/pnglibconf.h:207:9: error: 'PNG_ARM_NEON_OPT' macro redefined [-Werror,-Wmacro-redefined]` This moves all `-DPNG_*` into the case where internal libpng is used. This has only been tested with the tier1 github actions so needs to be checked on Linux/ppc and AIX. ------------- Commit messages: - Only add libpng defines to CFLAGS when using internal libpng. Changes: https://git.openjdk.org/jdk/pull/28324/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28324&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371914 Stats: 37 lines in 1 file changed: 18 ins; 18 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28324.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28324/head:pull/28324 PR: https://git.openjdk.org/jdk/pull/28324
