dnl Version number stuff here:
-AC_INIT([libpng], [1.2.34], [png-mng-implement@lists.sourceforge.net])
+AC_INIT([libpng], [1.5.7], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE
dnl stop configure from automagically running automake
AM_MAINTAINER_MODE
-PNGLIB_VERSION=1.2.34
+PNGLIB_VERSION=1.5.7
PNGLIB_MAJOR=1
-PNGLIB_MINOR=2
-PNGLIB_RELEASE=34
+PNGLIB_MINOR=5
+PNGLIB_RELEASE=7
dnl End of version number stuff
AM_CONFIG_HEADER(config.h)
# Checks for programs.
+AC_LANG([C])
AC_PROG_CC
+AM_PROG_AS
AC_PROG_LD
AC_PROG_CPP
AC_CHECK_TOOL(SED, sed, :)
-AC_LIBTOOL_WIN32_DLL
+AC_CHECK_TOOL(AWK, awk, :)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
-AC_PROG_LIBTOOL
+LT_INIT([win32-dll])
+
+# On Solaris 10 and 12 CPP gets set to cc -E, however this still
+# does some input parsing. We need strict ANSI-C style tokenization,
+# check this:
+AC_REQUIRE_CPP
+AC_MSG_CHECKING([for a C preprocessor that does not parse its input])
+AC_TRY_CPP([1.5.0 16BIT],
+ [DFNCPP="$CPP"],
+ [DFNCPP=""
+ sav_CPP="$CPP"
+ for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"; do
+ AC_TRY_CPP([1.5.0 16BIT],
+ [DFNCPP="$CPP"]
+ [break],,)
+ done
+ CPP="$sav_CPP"])
+if test -n "$DFNCPP"; then
+ AC_MSG_RESULT([$DFNCPP])
+ AC_SUBST(DFNCPP)
+else
+ AC_MSG_FAILURE([not found], 1)
+fi
# Checks for header files.
AC_HEADER_STDC
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM
+AC_C_RESTRICT
# 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_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
+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
-AC_MSG_CHECKING(
- [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
-AC_TRY_COMPILE(
- [#include "$srcdir/pnggccrd.c"],
- [return 0;],
- AC_MSG_RESULT(yes)
- LIBPNG_NO_MMX="",
- AC_MSG_RESULT(no)
- LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE)
-LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX
+LIBPNG_DEFINES=$LIBPNG_DEFINES
AC_SUBST(LIBPNG_DEFINES)
-AC_SUBST(LIBPNG_NO_MMX)
AC_MSG_CHECKING([if libraries can be versioned])
-GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
+
+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")
+
+# 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)
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
[binconfigs='${binconfigs}'])
AC_SUBST([binconfigs])
-# Allow the old version number library, libpng.so, to be removed from
-# the build
-AC_ARG_WITH(libpng-compat,
- AC_HELP_STRING([--with-libpng-compat],
- [Generate the obsolete libpng.so library @<:@default=yes@:>@]),
- [if test "${withval}" = no; then
- compatlib=
- AC_MSG_NOTICE([libpng.so will not be built])
- else
- compatlib=libpng.la
- fi],
- [compatlib=libpng.la])
-AC_SUBST([compatlib])
+# Because GCC by default assembles code with an executable stack, even though it
+# compiles C code with a non-executable stack, it is necessary to do a fixup
+# here (this may by GCC specific)
+AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack])
+
+AC_ARG_ENABLE([arm-neon],
+ AC_HELP_STRING([--enable-arm-neon], [Enable ARM NEON optimizations]),
+ [if test "${enableval}" = yes; then
+ AC_DEFINE([PNG_ARM_NEON], [1], [Enable ARM NEON optimizations])
+ AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], [Align row buffers])
+ fi])
+AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes])
# Config files, substituting as above
-AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc-configure.in])
-AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
+AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
+AC_CONFIG_FILES([libpng-config:libpng-config.in],
[chmod +x libpng-config])
AC_OUTPUT