From 3cedc5fd080731a3cd2c47e2f40fc140bba1accb Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 26 Jan 2024 03:44:51 +0000 Subject: libpng 1.6.41 git-svn-id: svn://tug.org/texlive/trunk@69596 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/libpng/libpng-src/configure.ac | 150 ++++++++++++++++++++++- 1 file changed, 145 insertions(+), 5 deletions(-) (limited to 'Build/source/libs/libpng/libpng-src/configure.ac') diff --git a/Build/source/libs/libpng/libpng-src/configure.ac b/Build/source/libs/libpng/libpng-src/configure.ac index 43c682e9f62..d81a580021c 100644 --- a/Build/source/libs/libpng/libpng-src/configure.ac +++ b/Build/source/libs/libpng/libpng-src/configure.ac @@ -1,6 +1,6 @@ # configure.ac -# Copyright (c) 2018-2022 Cosmin Truta +# Copyright (c) 2018-2024 Cosmin Truta # Copyright (c) 2004-2016 Glenn Randers-Pehrson # This code is released under the libpng license. @@ -25,8 +25,8 @@ AC_PREREQ([2.68]) dnl Version number stuff here: -AC_INIT([libpng],[1.6.40],[png-mng-implement@lists.sourceforge.net]) -AC_CONFIG_MACRO_DIR([scripts]) +AC_INIT([libpng],[1.6.41],[png-mng-implement@lists.sourceforge.net]) +AC_CONFIG_MACRO_DIR([scripts/autoconf]) # libpng does not follow GNU file name conventions (hence 'foreign') # color-tests requires automake 1.11 or later @@ -46,10 +46,10 @@ 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.40 +PNGLIB_VERSION=1.6.41 PNGLIB_MAJOR=1 PNGLIB_MINOR=6 -PNGLIB_RELEASE=40 +PNGLIB_RELEASE=41 dnl End of version number stuff @@ -89,6 +89,24 @@ fi DFNCPP="$CPP" AC_SUBST(DFNCPP) +AC_ARG_ENABLE([tests], + AS_HELP_STRING([--disable-tests], + [do not build the test programs (default is to build)]), + [enable_tests="$enableval"], + [enable_tests=yes]) + +AM_CONDITIONAL([ENABLE_TESTS], + [test "$enable_tests" != "no"]) + +AC_ARG_ENABLE([tools], + AS_HELP_STRING([--disable-tools], + [do not build the auxiliary tools (default is to build)]), + [enable_tools="$enableval"], + [enable_tools=yes]) + +AM_CONDITIONAL([ENABLE_TOOLS], + [test "$enable_tools" != "no"]) + # -Werror cannot be passed to GCC in CFLAGS because configure will fail # (it checks the compiler with a program that generates a warning). # Add the following option to deal with this: @@ -310,12 +328,18 @@ AC_ARG_ENABLE([hardware-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]) ;; *) # allow enabling hardware optimization on any system: @@ -326,7 +350,10 @@ AC_ARG_ENABLE([hardware-optimizations], [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]) ;; @@ -340,6 +367,11 @@ AC_ARG_ENABLE([hardware-optimizations], 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]) + ;; esac ;; esac]) @@ -435,6 +467,51 @@ AM_CONDITIONAL([PNG_MIPS_MSA], mipsel*|mips64el*) : ;; esac]) +# MIPS +# === +# +# MIPS MMI (SIMD) support. + +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 value]) + 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 # ===== # @@ -517,6 +594,69 @@ AM_CONDITIONAL([PNG_POWERPC_VSX], powerpc*|ppc64*) : ;; esac]) +# LOONGARCH +# === +# +# LOONGARCH LSX (SIMD) support + +if test "$LSX_CFLAGS" = ''; then + LSX_CFLAGS="-mlsx" +fi + +compiler_support_loongarch_lsx=no +AC_MSG_CHECKING(whether to use loongarch LSX intrinsics) +save_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS $LSX_CFLAGS" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +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) + +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 value]) + esac]) + +if test "$enable_loongarch_lsx" != 'no'; then + 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]) + AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]]) # Config files, substituting as above -- cgit v1.2.3