2006-03-02 13:23:18 +00: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 19:47:09 +00:00
|
|
|
dnl (third field in two places below) and set the PNGLIB_RELEASE
|
2006-03-02 13:23:18 +00: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
|
|
|
|
AC_PREREQ(2.59)
|
|
|
|
|
|
|
|
dnl Version number stuff here:
|
|
|
|
|
2011-08-17 12:52:32 +00:00
|
|
|
AC_INIT([libpng], [1.5.5beta06], [png-mng-implement@lists.sourceforge.net])
|
2006-03-02 13:23:18 +00:00
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
dnl stop configure from automagically running automake
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2011-08-17 12:52:32 +00:00
|
|
|
PNGLIB_VERSION=1.5.5beta06
|
2009-07-28 22:20:26 +00:00
|
|
|
PNGLIB_MAJOR=1
|
2010-02-08 00:08:50 +00:00
|
|
|
PNGLIB_MINOR=5
|
2011-07-08 18:15:20 +00:00
|
|
|
PNGLIB_RELEASE=5
|
2006-03-02 13:23:18 +00:00
|
|
|
|
|
|
|
dnl End of version number stuff
|
|
|
|
|
2004-12-03 00:14:51 +00:00
|
|
|
AC_CONFIG_SRCDIR([pngget.c])
|
2006-05-15 11:44:21 +00:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2004-12-03 00:14:51 +00:00
|
|
|
|
|
|
|
# Checks for programs.
|
2011-01-22 23:03:33 +00:00
|
|
|
AC_LANG([C])
|
2004-12-03 00:14:51 +00:00
|
|
|
AC_PROG_CC
|
2006-03-04 22:50:47 +00:00
|
|
|
AC_PROG_LD
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_CHECK_TOOL(SED, sed, :)
|
2010-03-16 12:52:34 +00:00
|
|
|
AC_CHECK_TOOL(AWK, awk, :)
|
2006-03-02 13:23:18 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
2004-12-03 00:14:51 +00:00
|
|
|
AC_PROG_MAKE_SET
|
2010-08-11 13:06:11 +00:00
|
|
|
LT_INIT([win32-dll])
|
2004-12-03 00:14:51 +00:00
|
|
|
|
2011-01-22 23:03:33 +00: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])
|
|
|
|
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
|
|
|
|
|
2004-12-03 00:14:51 +00:00
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2006-03-02 13:23:18 +00:00
|
|
|
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
|
2004-12-03 00:14:51 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_STRTOD
|
2006-03-02 13:23:18 +00:00
|
|
|
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
|
2006-03-07 13:09:22 +00:00
|
|
|
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
2011-01-04 15:07:45 +00:00
|
|
|
AC_ARG_WITH(zlib-prefix,
|
|
|
|
AC_HELP_STRING([--with-zlib-prefix],
|
2010-12-09 12:03:03 +00:00
|
|
|
[prefix that may have been used in installed zlib]),
|
2011-01-04 15:07:45 +00:00
|
|
|
[ZPREFIX=${withval}],
|
|
|
|
[ZPREFIX='z_'])
|
2010-12-09 12:03:03 +00:00
|
|
|
AC_CHECK_LIB(z, zlibVersion, ,
|
2011-01-04 15:07:45 +00:00
|
|
|
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
|
2010-12-09 12:03:03 +00:00
|
|
|
AC_ERROR([zlib not installed])))
|
|
|
|
|
2006-03-04 22:50:47 +00:00
|
|
|
|
2010-02-19 20:11:03 +00:00
|
|
|
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
2009-05-02 20:23:38 +00:00
|
|
|
LIBPNG_DEFINES=$LIBPNG_DEFINES
|
2006-04-17 19:33:23 +00:00
|
|
|
AC_SUBST(LIBPNG_DEFINES)
|
2006-04-17 00:45:31 +00:00
|
|
|
|
2006-03-04 22:50:47 +00:00
|
|
|
AC_MSG_CHECKING([if libraries can be versioned])
|
2010-08-11 13:06:11 +00:00
|
|
|
# Special case for PE/COFF platforms: ld reports
|
|
|
|
# support for version-script, but doesn't actually
|
|
|
|
# DO anything with it.
|
|
|
|
case $host in
|
2011-01-22 23:03:33 +00:00
|
|
|
*cygwin* | *mingw32* | *interix* )
|
2010-08-11 13:06:11 +00:00
|
|
|
have_ld_version_script=no
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
* )
|
2006-03-04 22:50:47 +00:00
|
|
|
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
|
|
|
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 12:20:46 +00:00
|
|
|
AC_MSG_WARN(*** You have not enabled versioned symbols.)
|
2006-03-04 22:50:47 +00:00
|
|
|
fi
|
2010-08-11 13:06:11 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2006-03-04 22:50:47 +00:00
|
|
|
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
2006-03-02 13:23:18 +00:00
|
|
|
|
2008-07-30 19:47:09 +00: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 13:23:18 +00:00
|
|
|
# Substitutions for .in files
|
|
|
|
AC_SUBST(PNGLIB_VERSION)
|
|
|
|
AC_SUBST(PNGLIB_MAJOR)
|
|
|
|
AC_SUBST(PNGLIB_MINOR)
|
2008-07-30 19:47:09 +00:00
|
|
|
AC_SUBST(PNGLIB_RELEASE)
|
2006-03-02 13:23:18 +00:00
|
|
|
|
|
|
|
# Additional arguments (and substitutions)
|
|
|
|
# Allow the pkg-config directory to be set
|
|
|
|
AC_ARG_WITH(pkgconfigdir,
|
|
|
|
AC_HELP_STRING([--with-pkgconfigdir],
|
2006-04-17 00:45:31 +00:00
|
|
|
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
|
2006-03-02 13:23:18 +00:00
|
|
|
[pkgconfigdir=${withval}],
|
|
|
|
[pkgconfigdir='${libdir}/pkgconfig'])
|
2004-12-03 00:14:51 +00:00
|
|
|
|
2006-03-02 13:23:18 +00:00
|
|
|
AC_SUBST([pkgconfigdir])
|
|
|
|
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
|
2004-12-03 00:14:51 +00:00
|
|
|
|
2006-03-02 13:23:18 +00:00
|
|
|
# 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])
|
2004-12-03 00:14:51 +00:00
|
|
|
|
2006-03-02 13:23:18 +00:00
|
|
|
# Config files, substituting as above
|
2009-12-25 22:17:30 +00:00
|
|
|
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
|
2009-11-13 22:29:45 +00:00
|
|
|
AC_CONFIG_FILES([libpng-config:libpng-config.in],
|
2006-03-02 13:23:18 +00:00
|
|
|
[chmod +x libpng-config])
|
2004-12-03 00:14:51 +00:00
|
|
|
|
|
|
|
AC_OUTPUT
|