mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00

switched 'off'. Previously the ARM NEON specific files were still built if the option was switched 'off' as opposed to being explicitly disabled.
220 lines
6.5 KiB
Plaintext
220 lines
6.5 KiB
Plaintext
# configure.ac
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
dnl
|
|
dnl Minor upgrades (compatible ABI): increment the package version
|
|
dnl (third field in two places below) and set the PNGLIB_RELEASE
|
|
dnl variable.
|
|
dnl
|
|
dnl Major upgrades (incompatible ABI): increment the package major
|
|
dnl version (second field, or first if desired), set the minor
|
|
dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
|
|
dnl Makefile.am to upgrade the package name.
|
|
|
|
dnl This is here to prevent earlier autoconf from being used, it
|
|
dnl should not be necessary to regenerate configure if the time
|
|
dnl stamps are correct
|
|
AC_PREREQ(2.59)
|
|
|
|
dnl Version number stuff here:
|
|
|
|
AC_INIT([libpng], [1.5.16beta01], [png-mng-implement@lists.sourceforge.net])
|
|
AM_INIT_AUTOMAKE([serial-tests])
|
|
dnl stop configure from automagically running automake
|
|
AM_MAINTAINER_MODE
|
|
|
|
PNGLIB_VERSION=1.5.16beta01
|
|
PNGLIB_MAJOR=1
|
|
PNGLIB_MINOR=5
|
|
PNGLIB_RELEASE=16
|
|
|
|
dnl End of version number stuff
|
|
|
|
AC_CONFIG_SRCDIR([pngget.c])
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
# Checks for programs.
|
|
AC_LANG([C])
|
|
AC_PROG_CC
|
|
AM_PROG_AS
|
|
AC_PROG_LD
|
|
AC_PROG_CPP
|
|
AC_PROG_SED
|
|
AC_PROG_AWK
|
|
AC_PROG_INSTALL
|
|
AC_PROG_LN_S
|
|
AC_PROG_MAKE_SET
|
|
LT_INIT([win32-dll])
|
|
|
|
# Checks for header files.
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
AC_C_CONST
|
|
AC_TYPE_SIZE_T
|
|
AC_STRUCT_TM
|
|
AC_C_RESTRICT
|
|
|
|
# This is a remnant of the old cc -E validation, where it may have been
|
|
# necessary to use a different preprocessor for .dfn files
|
|
DFNCPP="$CPP"
|
|
AC_SUBST(DFNCPP)
|
|
|
|
# Checks for library functions.
|
|
AC_FUNC_STRTOD
|
|
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
|
|
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
|
AC_ARG_WITH(zlib-prefix,
|
|
AC_HELP_STRING([--with-zlib-prefix],
|
|
[prefix that may have been used in installed zlib]),
|
|
[ZPREFIX=${withval}],
|
|
[ZPREFIX='z_'])
|
|
AC_CHECK_LIB(z, zlibVersion, ,
|
|
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
|
|
AC_ERROR([zlib not installed])))
|
|
|
|
# The following is for pngvalid, to ensure it catches FP errors even on
|
|
# platforms that don't enable FP exceptions, the function appears in the math
|
|
# library (typically), it's not an error if it is not found.
|
|
AC_CHECK_LIB([m], [feenableexcept])
|
|
AC_CHECK_FUNCS([feenableexcept])
|
|
|
|
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
|
LIBPNG_DEFINES=$LIBPNG_DEFINES
|
|
AC_SUBST(LIBPNG_DEFINES)
|
|
|
|
AC_MSG_CHECKING([if using Solaris linker])
|
|
SLD=`$LD --version 2>&1 | grep Solaris`
|
|
if test "$SLD"; then
|
|
have_solaris_ld=yes
|
|
AC_MSG_RESULT(yes)
|
|
else
|
|
have_solaris_ld=no
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes")
|
|
|
|
AC_MSG_CHECKING([if libraries can be versioned])
|
|
# Special case for PE/COFF platforms: ld reports
|
|
# support for version-script, but doesn't actually
|
|
# DO anything with it.
|
|
case $host in
|
|
*cygwin* | *mingw32* | *interix* )
|
|
have_ld_version_script=no
|
|
AC_MSG_RESULT(no)
|
|
;;
|
|
* )
|
|
|
|
if test "$have_solaris_ld" = "yes"; then
|
|
GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'`
|
|
else
|
|
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
|
fi
|
|
|
|
if test "$GLD"; then
|
|
have_ld_version_script=yes
|
|
AC_MSG_RESULT(yes)
|
|
else
|
|
have_ld_version_script=no
|
|
AC_MSG_RESULT(no)
|
|
AC_MSG_WARN(*** You have not enabled versioned symbols.)
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
|
|
|
if test "$have_ld_version_script" = "yes"; then
|
|
AC_MSG_CHECKING([for symbol prefix])
|
|
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
|
|
| ${CPP-${CC-gcc} -E} - 2>&1 \
|
|
| ${EGREP-grep} "^PREFIX=" \
|
|
| ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
|
|
AC_SUBST(SYMBOL_PREFIX)
|
|
AC_MSG_RESULT($SYMBOL_PREFIX)
|
|
fi
|
|
|
|
# Substitutions for .in files
|
|
AC_SUBST(PNGLIB_VERSION)
|
|
AC_SUBST(PNGLIB_MAJOR)
|
|
AC_SUBST(PNGLIB_MINOR)
|
|
AC_SUBST(PNGLIB_RELEASE)
|
|
|
|
# Additional arguments (and substitutions)
|
|
# Allow the pkg-config directory to be set
|
|
AC_ARG_WITH(pkgconfigdir,
|
|
AC_HELP_STRING([--with-pkgconfigdir],
|
|
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
|
|
[pkgconfigdir=${withval}],
|
|
[pkgconfigdir='${libdir}/pkgconfig'])
|
|
|
|
AC_SUBST([pkgconfigdir])
|
|
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
|
|
|
|
# Make the *-config binary config scripts optional
|
|
AC_ARG_WITH(binconfigs,
|
|
AC_HELP_STRING([--with-binconfigs],
|
|
[Generate shell libpng-config scripts as well as pkg-config data]
|
|
[@<:@default=yes@:>@]),
|
|
[if test "${withval}" = no; then
|
|
binconfigs=
|
|
AC_MSG_NOTICE([libpng-config scripts will not be built])
|
|
else
|
|
binconfigs='${binconfigs}'
|
|
fi],
|
|
[binconfigs='${binconfigs}'])
|
|
AC_SUBST([binconfigs])
|
|
|
|
# HOST SPECIFIC OPTIONS
|
|
# =====================
|
|
#
|
|
# ARM
|
|
# ===
|
|
#
|
|
# ARM NEON (SIMD) support.
|
|
|
|
AC_ARG_ENABLE([arm-neon],
|
|
AS_HELP_STRING([[[--enable-arm-neon]]],
|
|
[Enable ARM NEON 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.]),
|
|
[case "$enableval" in
|
|
no|off)
|
|
# disable the default enabling on __ARM_NEON__ systems:
|
|
AC_DEFINE([PNG_NO_ARM_NEON], [],
|
|
[Disable ARM Neon optimizations])
|
|
# Prevent inclusion of the assembler files below:
|
|
enable_arm_neon=no;;
|
|
check)
|
|
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
|
|
[Check for ARM Neon support at run-time]);;
|
|
api)
|
|
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
|
|
[Turn on ARM Neon optimizations at run-time]);;
|
|
yes|on)
|
|
AC_DEFINE([PNG_ARM_NEON_SUPPORTED], [],
|
|
[Enable ARM Neon optimizations]);;
|
|
*)
|
|
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
|
|
esac])
|
|
|
|
# If enable/disable was not specified default to using the optimizations if the
|
|
# host CPU is ARM and the comppiler is targeting a NEON host. The latter test
|
|
# is done in scripts/pnglibconf.dfa by checking for __ARM_NEON__. The
|
|
# AM_CONDITIONAL below controls whether the ARM NEON source files are built.
|
|
|
|
AM_CONDITIONAL([PNG_ARM_NEON],
|
|
[test "$enable_arm_neon" != 'no' &&
|
|
test "$host_cpu" = 'arm' -o "$enable_arm_neon" != ''])
|
|
|
|
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
|
|
|
# Config files, substituting as above
|
|
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
|
|
AC_CONFIG_FILES([libpng-config:libpng-config.in],
|
|
[chmod +x libpng-config])
|
|
|
|
AC_OUTPUT
|