@@ -164,6 +164,24 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
164164
165165 ifeq ($(USE_EXTERNAL_LIBPNG), false)
166166 LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
167+ LIBSPLASHSCREEN_CFLAGS += -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
168+ -DPNG_ARM_NEON_IMPLEMENTATION=0 -DPNG_LOONGARCH_LSX_OPT=0
169+
170+ ifeq ($(call isTargetOs, linux)+$(call isTargetCpuArch, ppc), true+true)
171+ LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
172+ endif
173+
174+ # The libpng bundled with jdk is a reduced version which does not
175+ # contain .png_init_filter_functions_vsx.
176+ # Therefore we need to disable PNG_POWERPC_VSX_OPT explicitly by setting
177+ # it to 0. If this define is not set, it would be automatically set to 2,
178+ # because
179+ # "#if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)"
180+ # expands to true. This would results in the fact that
181+ # .png_init_filter_functions_vsx is needed in libpng.
182+ ifeq ($(call isTargetOs, aix), true)
183+ LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
184+ endif
167185 else
168186 LIBSPLASHSCREEN_EXCLUDES += libpng
169187 endif
@@ -176,25 +194,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
176194 LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += $(LIBZIP_OBJS)
177195 endif
178196
179- LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
180- -DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0 \
181- -DPNG_LOONGARCH_LSX_OPT=0
182-
183- ifeq ($(call isTargetOs, linux)+$(call isTargetCpuArch, ppc), true+true)
184- LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
185- endif
186-
187- # The external libpng submitted in the jdk is a reduced version
188- # which does not contain .png_init_filter_functions_vsx.
189- # Therefore we need to disable PNG_POWERPC_VSX_OPT explicitly by setting
190- # it to 0. If this define is not set, it would be automatically set to 2,
191- # because
192- # "#if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)"
193- # expands to true. This would results in the fact that
194- # .png_init_filter_functions_vsx is needed in libpng.
195- ifeq ($(call isTargetOs, aix), true)
196- LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
197- endif
197+ LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN
198198
199199 ifeq ($(call isTargetOs, macosx), true)
200200 # libsplashscreen on macosx does not use the unix code
0 commit comments