mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Clean up configure.ac
Remove the obsolete autoconf macros: AC_C_CONST, AC_HEADER_STDC, AC_TYPE_SIZE_T, AC_FUNC_STRTOD. Clean up comments and whitespace.
This commit is contained in:
parent
403422674d
commit
cc0e959722
61
configure.ac
61
configure.ac
@ -1,6 +1,6 @@
|
|||||||
# configure.ac
|
# configure.ac
|
||||||
|
|
||||||
# Copyright (c) 2018-2019 Cosmin Truta
|
# Copyright (c) 2018-2022 Cosmin Truta
|
||||||
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
|
||||||
|
|
||||||
# This code is released under the libpng license.
|
# This code is released under the libpng license.
|
||||||
@ -89,9 +89,9 @@ fi
|
|||||||
DFNCPP="$CPP"
|
DFNCPP="$CPP"
|
||||||
AC_SUBST(DFNCPP)
|
AC_SUBST(DFNCPP)
|
||||||
|
|
||||||
# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
|
# -Werror cannot be passed to GCC in CFLAGS because configure will fail
|
||||||
# checks the compiler with a program that generates a warning), add the
|
# (it checks the compiler with a program that generates a warning).
|
||||||
# following option to deal with this
|
# Add the following option to deal with this:
|
||||||
AC_ARG_VAR(PNG_COPTS,
|
AC_ARG_VAR(PNG_COPTS,
|
||||||
[additional flags for the C compiler, use this for options that would]
|
[additional flags for the C compiler, use this for options that would]
|
||||||
[cause configure itself to fail])
|
[cause configure itself to fail])
|
||||||
@ -114,10 +114,10 @@ AC_ARG_ENABLE(werror,
|
|||||||
CFLAGS="$sav_CFLAGS"
|
CFLAGS="$sav_CFLAGS"
|
||||||
fi],)
|
fi],)
|
||||||
|
|
||||||
# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89
|
# 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
|
# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
|
||||||
# This is incompatible with the new default mode, so we test for that and force the
|
# _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
|
||||||
# "-std=c89" compiler option:
|
# 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_MSG_CHECKING([if we need to force back C standard to C89])
|
||||||
AC_COMPILE_IFELSE(
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM([
|
[AC_LANG_PROGRAM([
|
||||||
@ -133,21 +133,15 @@ AC_COMPILE_IFELSE(
|
|||||||
CFLAGS="$CFLAGS -std=c89"
|
CFLAGS="$CFLAGS -std=c89"
|
||||||
])
|
])
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for structures and compiler characteristics.
|
||||||
AC_HEADER_STDC
|
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
|
||||||
AC_C_CONST
|
|
||||||
AC_TYPE_SIZE_T
|
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
AC_C_RESTRICT
|
AC_C_RESTRICT
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_FUNC_STRTOD
|
|
||||||
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)))
|
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)))
|
||||||
|
|
||||||
# Some later POSIX 1003.1 functions are required for test programs, failure here
|
# Some later POSIX 1003.1 functions are required for test programs, failure
|
||||||
# is soft (the corresponding test program is not built).
|
# here is soft (the corresponding test program is not built).
|
||||||
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
|
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
|
||||||
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
|
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
|
||||||
|
|
||||||
@ -296,7 +290,7 @@ AC_ARG_ENABLE([unversioned-libpng-config],
|
|||||||
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
|
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
|
||||||
[test "$enable_unversioned_libpng_config" != "no"])
|
[test "$enable_unversioned_libpng_config" != "no"])
|
||||||
|
|
||||||
# HOST SPECIFIC OPTIONS
|
# HOST-SPECIFIC OPTIONS
|
||||||
# =====================
|
# =====================
|
||||||
#
|
#
|
||||||
# DEFAULT
|
# DEFAULT
|
||||||
@ -383,9 +377,9 @@ AC_ARG_ENABLE([arm-neon],
|
|||||||
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
|
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
# Add ARM specific files to all builds where the host_cpu is arm ('arm*') or
|
# 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
|
# where ARM optimizations were explicitly requested (this allows a fallback
|
||||||
# future host CPU does not match 'arm*')
|
# if a future host CPU does not match 'arm*')
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_ARM_NEON],
|
AM_CONDITIONAL([PNG_ARM_NEON],
|
||||||
[test "$enable_arm_neon" != 'no' &&
|
[test "$enable_arm_neon" != 'no' &&
|
||||||
@ -395,7 +389,7 @@ AM_CONDITIONAL([PNG_ARM_NEON],
|
|||||||
esac])
|
esac])
|
||||||
|
|
||||||
# MIPS
|
# MIPS
|
||||||
# ===
|
# ====
|
||||||
#
|
#
|
||||||
# MIPS MSA (SIMD) support.
|
# MIPS MSA (SIMD) support.
|
||||||
|
|
||||||
@ -429,9 +423,9 @@ AC_ARG_ENABLE([mips-msa],
|
|||||||
AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value])
|
AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value])
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or
|
# 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
|
# where MIPS optimizations were explicitly requested (this allows a fallback
|
||||||
# future host CPU does not match 'mips*')
|
# if a future host CPU does not match 'mips*')
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_MIPS_MSA],
|
AM_CONDITIONAL([PNG_MIPS_MSA],
|
||||||
[test "$enable_mips_msa" != 'no' &&
|
[test "$enable_mips_msa" != 'no' &&
|
||||||
@ -464,9 +458,9 @@ AC_ARG_ENABLE([intel-sse],
|
|||||||
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
|
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
# Add Intel specific files to all builds where the host_cpu is Intel ('x86*')
|
# Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or
|
||||||
# or where Intel optimizations were explicitly requested (this allows a
|
# where Intel optimizations were explicitly requested (this allows a fallback
|
||||||
# fallback if a future host CPU does not match 'x86*')
|
# if a future host CPU does not match 'x86*')
|
||||||
AM_CONDITIONAL([PNG_INTEL_SSE],
|
AM_CONDITIONAL([PNG_INTEL_SSE],
|
||||||
[test "$enable_intel_sse" != 'no' &&
|
[test "$enable_intel_sse" != 'no' &&
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
@ -475,7 +469,7 @@ AM_CONDITIONAL([PNG_INTEL_SSE],
|
|||||||
esac])
|
esac])
|
||||||
|
|
||||||
# PowerPC
|
# PowerPC
|
||||||
# ===
|
# =======
|
||||||
#
|
#
|
||||||
# PowerPC VSX (SIMD) support.
|
# PowerPC VSX (SIMD) support.
|
||||||
|
|
||||||
@ -491,7 +485,7 @@ AS_HELP_STRING([[[--enable-powerpc-vsx]]],
|
|||||||
# disable the default enabling on __ppc64__ systems:
|
# disable the default enabling on __ppc64__ systems:
|
||||||
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
|
||||||
[Disable POWERPC VSX optimizations])
|
[Disable POWERPC VSX optimizations])
|
||||||
# Prevent inclusion of the platform specific files below:
|
# Prevent inclusion of the platform-specific files below:
|
||||||
enable_powerpc_vsx=no ;;
|
enable_powerpc_vsx=no ;;
|
||||||
check)
|
check)
|
||||||
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
|
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
|
||||||
@ -511,9 +505,9 @@ AS_HELP_STRING([[[--enable-powerpc-vsx]]],
|
|||||||
AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value])
|
AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value])
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
# Add PowerPC specific files to all builds where the host_cpu is powerpc('powerpc*') or
|
# Add PowerPC-specific files to all builds where $host_cpu is powerpc('powerpc*')
|
||||||
# where POWERPC optimizations were explicitly requested (this allows a fallback if a
|
# or where PowerPC optimizations were explicitly requested (this allows a fallback
|
||||||
# future host CPU does not match 'powerpc*')
|
# if a future host CPU does not match 'powerpc*')
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_POWERPC_VSX],
|
AM_CONDITIONAL([PNG_POWERPC_VSX],
|
||||||
[test "$enable_powerpc_vsx" != 'no' &&
|
[test "$enable_powerpc_vsx" != 'no' &&
|
||||||
@ -521,7 +515,6 @@ AM_CONDITIONAL([PNG_POWERPC_VSX],
|
|||||||
powerpc*|ppc64*) : ;;
|
powerpc*|ppc64*) : ;;
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
|
|
||||||
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
||||||
|
|
||||||
# Config files, substituting as above
|
# Config files, substituting as above
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user