2006-03-02 08:23:18 -05:00
|
|
|
# configure.ac
|
|
|
|
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
dnl
|
|
|
|
dnl Minor upgrades (compatible ABI): increment the package version
|
2008-07-30 15:47:09 -04:00
|
|
|
dnl (third field in two places below) and set the PNGLIB_RELEASE
|
2006-03-02 08:23:18 -05:00
|
|
|
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
|
2012-01-28 01:48:08 -05:00
|
|
|
AC_PREREQ([2.68])
|
2006-03-02 08:23:18 -05:00
|
|
|
|
|
|
|
dnl Version number stuff here:
|
|
|
|
|
2012-03-19 11:58:34 -04:00
|
|
|
AC_INIT([libpng],[1.6.0beta20],[png-mng-implement@lists.sourceforge.net])
|
2012-01-27 11:24:21 -05:00
|
|
|
AC_CONFIG_MACRO_DIR([scripts])
|
2012-01-28 19:06:55 -05:00
|
|
|
|
|
|
|
# libpng does not follow GNU file name conventions (hence 'foreign')
|
|
|
|
# color-tests requires automake 1.11 or later
|
|
|
|
# silent-rules requires automake 1.11 or later
|
|
|
|
# dist-xz requires automake 1.11 or later
|
|
|
|
# 1.11.1 fixes a security issue in 1.11
|
|
|
|
AM_INIT_AUTOMAKE([1.11.1 foreign dist-xz dist-bzip2 color-tests silent-rules])
|
2012-01-31 23:21:32 -05:00
|
|
|
# was:
|
|
|
|
# AM_INIT_AUTOMAKE
|
2006-03-02 08:23:18 -05:00
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2012-01-28 01:48:08 -05:00
|
|
|
dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
|
|
|
|
dnl version; aclocal.m4 will generate a failure if you use a prior version of
|
|
|
|
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
|
|
|
|
|
2012-03-19 11:58:34 -04:00
|
|
|
PNGLIB_VERSION=1.6.0beta20
|
2009-07-28 18:20:26 -04:00
|
|
|
PNGLIB_MAJOR=1
|
2011-11-23 16:28:01 -05:00
|
|
|
PNGLIB_MINOR=6
|
|
|
|
PNGLIB_RELEASE=0
|
2006-03-02 08:23:18 -05:00
|
|
|
|
|
|
|
dnl End of version number stuff
|
|
|
|
|
2004-12-02 19:14:51 -05:00
|
|
|
AC_CONFIG_SRCDIR([pngget.c])
|
2012-01-25 09:07:29 -05:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
|
|
|
# Checks for programs.
|
2011-01-22 18:03:33 -05:00
|
|
|
AC_LANG([C])
|
2004-12-02 19:14:51 -05:00
|
|
|
AC_PROG_CC
|
2011-11-03 01:42:58 -04:00
|
|
|
AM_PROG_AS
|
2012-01-25 09:07:29 -05:00
|
|
|
LT_PATH_LD
|
2006-03-04 17:50:47 -05:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_CHECK_TOOL(SED, sed, :)
|
2010-03-16 08:52:34 -04:00
|
|
|
AC_CHECK_TOOL(AWK, awk, :)
|
2006-03-02 08:23:18 -05:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
2004-12-02 19:14:51 -05:00
|
|
|
AC_PROG_MAKE_SET
|
2012-01-28 01:48:08 -05:00
|
|
|
|
|
|
|
dnl libtool/libtoolize; version 2.4.2 is the tested version, this or any
|
|
|
|
dnl compatible later version may be used
|
2010-08-11 09:06:11 -04:00
|
|
|
LT_INIT([win32-dll])
|
2012-01-28 01:48:08 -05:00
|
|
|
LT_PREREQ([2.4.2])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
2011-01-22 18:03:33 -05:00
|
|
|
# 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])
|
2012-01-25 09:07:29 -05:00
|
|
|
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
|
2011-01-22 18:03:33 -05:00
|
|
|
[DFNCPP="$CPP"],
|
2012-01-25 09:07:29 -05:00
|
|
|
[ DFNCPP=""
|
|
|
|
sav_CPP="$CPP"
|
|
|
|
for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"
|
|
|
|
do
|
|
|
|
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
|
|
|
|
[DFNCPP="$CPP"]
|
|
|
|
[break],,)
|
|
|
|
done
|
|
|
|
CPP="$sav_CPP"
|
|
|
|
])
|
2011-01-22 18:03:33 -05:00
|
|
|
if test -n "$DFNCPP"; then
|
|
|
|
AC_MSG_RESULT([$DFNCPP])
|
|
|
|
AC_SUBST(DFNCPP)
|
|
|
|
else
|
|
|
|
AC_MSG_FAILURE([not found], 1)
|
|
|
|
fi
|
|
|
|
|
2012-01-25 09:07:29 -05:00
|
|
|
# -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
|
|
|
|
AC_ARG_VAR(PNG_COPTS,
|
|
|
|
[additional flags for the C compiler, use this for options that would]
|
|
|
|
[cause configure itself to fail])
|
|
|
|
AC_ARG_ENABLE(werror,
|
|
|
|
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
|
|
|
|
[Pass -Werror or the given argument to the compiler if it is supported]),
|
|
|
|
[test "$enable_werror" = "yes" && enable_werror="-Werror"
|
|
|
|
if test "$enable_werror" != "no"; then
|
|
|
|
sav_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$enable_werror $CFLAGS"
|
|
|
|
AC_MSG_CHECKING([if the compiler allows $enable_werror])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_SOURCE([
|
|
|
|
[int main(int argc, char **argv){]
|
|
|
|
[return argv[argc-1][0];]
|
|
|
|
[}]])],
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
PNG_COPTS="$PNG_COPTS $enable_werror",
|
|
|
|
AC_MSG_RESULT(no))
|
|
|
|
CFLAGS="$sav_CFLAGS"
|
|
|
|
fi],)
|
|
|
|
|
2004-12-02 19:14:51 -05:00
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2006-03-02 08:23:18 -05:00
|
|
|
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_STRUCT_TM
|
2011-11-04 22:03:39 -04:00
|
|
|
AC_C_RESTRICT
|
2004-12-02 19:14:51 -05:00
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_STRTOD
|
2012-01-25 09:07:29 -05:00
|
|
|
AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc))
|
|
|
|
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
|
2011-01-04 10:07:45 -05:00
|
|
|
AC_ARG_WITH(zlib-prefix,
|
2012-01-25 09:07:29 -05:00
|
|
|
AS_HELP_STRING([[[--with-zlib-prefix]]],
|
|
|
|
[prefix that may have been used in installed zlib]),
|
|
|
|
[ZPREFIX=${withval}],
|
|
|
|
[ZPREFIX='z_'])
|
2010-12-09 07:03:03 -05:00
|
|
|
AC_CHECK_LIB(z, zlibVersion, ,
|
2012-01-25 09:07:29 -05:00
|
|
|
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))
|
2010-12-09 07:03:03 -05:00
|
|
|
|
2011-11-04 22:03:39 -04:00
|
|
|
# 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])
|
2006-03-04 17:50:47 -05:00
|
|
|
|
2011-09-01 15:06:49 -04:00
|
|
|
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")
|
|
|
|
|
2011-12-26 14:10:01 -05:00
|
|
|
AC_MSG_CHECKING([if libraries can be versioned])
|
2011-09-09 08:55:25 -04:00
|
|
|
# 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)
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
|
2011-09-01 15:06:49 -04:00
|
|
|
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
|
|
|
|
|
2006-03-04 17:50:47 -05:00
|
|
|
if test "$GLD"; then
|
|
|
|
have_ld_version_script=yes
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
have_ld_version_script=no
|
|
|
|
AC_MSG_RESULT(no)
|
2006-04-20 08:20:46 -04:00
|
|
|
AC_MSG_WARN(*** You have not enabled versioned symbols.)
|
2006-03-04 17:50:47 -05:00
|
|
|
fi
|
2010-08-11 09:06:11 -04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2006-03-04 17:50:47 -05:00
|
|
|
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
2006-03-02 08:23:18 -05:00
|
|
|
|
2008-07-30 15:47:09 -04:00
|
|
|
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} "s:^PREFIX=::"`
|
|
|
|
AC_SUBST(SYMBOL_PREFIX)
|
|
|
|
AC_MSG_RESULT($SYMBOL_PREFIX)
|
|
|
|
fi
|
|
|
|
|
2006-03-02 08:23:18 -05:00
|
|
|
# Substitutions for .in files
|
|
|
|
AC_SUBST(PNGLIB_VERSION)
|
|
|
|
AC_SUBST(PNGLIB_MAJOR)
|
|
|
|
AC_SUBST(PNGLIB_MINOR)
|
2008-07-30 15:47:09 -04:00
|
|
|
AC_SUBST(PNGLIB_RELEASE)
|
2006-03-02 08:23:18 -05:00
|
|
|
|
|
|
|
# Additional arguments (and substitutions)
|
|
|
|
# Allow the pkg-config directory to be set
|
|
|
|
AC_ARG_WITH(pkgconfigdir,
|
2012-01-25 09:07:29 -05:00
|
|
|
AS_HELP_STRING([[[--with-pkgconfigdir]]],
|
|
|
|
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
|
|
|
|
[pkgconfigdir=${withval}],
|
|
|
|
[pkgconfigdir='${libdir}/pkgconfig'])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
2006-03-02 08:23:18 -05:00
|
|
|
AC_SUBST([pkgconfigdir])
|
2012-01-25 09:07:29 -05:00
|
|
|
AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
2006-03-02 08:23:18 -05:00
|
|
|
# Make the *-config binary config scripts optional
|
|
|
|
AC_ARG_WITH(binconfigs,
|
2012-01-25 09:07:29 -05:00
|
|
|
AS_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}'])
|
2006-03-02 08:23:18 -05:00
|
|
|
AC_SUBST([binconfigs])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
2012-01-31 08:28:13 -05:00
|
|
|
# Support for prefixes to the API function names; this will generate defines
|
|
|
|
# at the start of the build to rename exported library functions
|
|
|
|
AC_ARG_WITH(libpng-prefix,
|
|
|
|
AS_HELP_STRING([[[--with-libpng-prefix]]],
|
|
|
|
[prefix libpng exported function (API) names with the given value]),
|
|
|
|
[if test "${withval:-no}" != "no"; then
|
|
|
|
AC_SUBST([PNG_PREFIX], [${withval}])
|
|
|
|
fi])
|
2012-02-01 08:14:24 -05:00
|
|
|
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
|
2012-01-31 08:28:13 -05:00
|
|
|
|
2011-11-16 15:30:24 -05:00
|
|
|
# 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)
|
2011-11-17 22:03:07 -05:00
|
|
|
AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack])
|
2011-11-16 23:25:47 -05:00
|
|
|
|
2011-11-03 01:42:58 -04:00
|
|
|
AC_ARG_ENABLE([arm-neon],
|
2012-01-25 09:07:29 -05:00
|
|
|
AS_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])
|
2011-11-03 01:42:58 -04:00
|
|
|
AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes])
|
|
|
|
|
2012-01-25 09:07:29 -05:00
|
|
|
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
|
|
|
|
2006-03-02 08:23:18 -05:00
|
|
|
# Config files, substituting as above
|
2009-12-25 17:17:30 -05:00
|
|
|
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
|
2009-11-13 17:29:45 -05:00
|
|
|
AC_CONFIG_FILES([libpng-config:libpng-config.in],
|
2012-01-25 09:07:29 -05:00
|
|
|
[chmod +x libpng-config])
|
2004-12-02 19:14:51 -05:00
|
|
|
|
|
|
|
AC_OUTPUT
|