Blame configure.ac

Packit 0ba690
# configure.ac
Packit 0ba690
Packit 0ba690
dnl Process this file with autoconf to produce a configure script.
Packit 0ba690
dnl
Packit 0ba690
dnl Minor upgrades (compatible ABI): increment the package version
Packit 0ba690
dnl (third field in two places below) and set the PNGLIB_RELEASE
Packit 0ba690
dnl variable.
Packit 0ba690
dnl
Packit 0ba690
dnl Major upgrades (incompatible ABI): increment the package major
Packit 0ba690
dnl version (second field, or first if desired), set the minor
Packit 0ba690
dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
Packit 0ba690
dnl Makefile.am to upgrade the package name.
Packit 0ba690
Packit 0ba690
dnl This is here to prevent earlier autoconf from being used, it
Packit 0ba690
dnl should not be necessary to regenerate configure if the time
Packit 0ba690
dnl stamps are correct
Packit 0ba690
AC_PREREQ(2.59)
Packit 0ba690
Packit 0ba690
dnl Version number stuff here:
Packit 0ba690
Packit 0ba690
AC_INIT([libpng], [1.2.57], [png-mng-implement@lists.sourceforge.net])
Packit 0ba690
AM_INIT_AUTOMAKE
Packit 0ba690
dnl stop configure from automagically running automake
Packit 0ba690
AM_MAINTAINER_MODE
Packit 0ba690
Packit 0ba690
PNGLIB_VERSION=1.2.57
Packit 0ba690
PNGLIB_MAJOR=1
Packit 0ba690
PNGLIB_MINOR=2
Packit 0ba690
PNGLIB_RELEASE=57
Packit 0ba690
Packit 0ba690
dnl End of version number stuff
Packit 0ba690
Packit 0ba690
AC_CONFIG_SRCDIR([pngget.c])
Packit 0ba690
AC_CONFIG_HEADERS([config.h])
Packit 0ba690
Packit 0ba690
# Checks for programs.
Packit 0ba690
AC_PROG_CC
Packit 0ba690
AC_PROG_LD
Packit 0ba690
AC_PROG_CPP
Packit 0ba690
AC_CHECK_TOOL(SED, sed, :)
Packit 0ba690
AC_LIBTOOL_WIN32_DLL
Packit 0ba690
AC_PROG_INSTALL
Packit 0ba690
AC_PROG_LN_S
Packit 0ba690
AC_PROG_MAKE_SET
Packit 0ba690
AC_PROG_LIBTOOL
Packit 0ba690
Packit 0ba690
# Checks for header files.
Packit 0ba690
AC_HEADER_STDC
Packit 0ba690
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
Packit 0ba690
Packit 0ba690
# Checks for typedefs, structures, and compiler characteristics.
Packit 0ba690
AC_C_CONST
Packit 0ba690
AC_TYPE_SIZE_T
Packit 0ba690
AC_STRUCT_TM
Packit 0ba690
Packit 0ba690
# Checks for library functions.
Packit 0ba690
AC_FUNC_STRTOD
Packit 0ba690
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
Packit 0ba690
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
Packit 0ba690
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
Packit 0ba690
Packit 0ba690
case $host_os in
Packit 0ba690
  aix*)
Packit 0ba690
   LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -D_ALL_SOURCE;;
Packit 0ba690
  *)
Packit 0ba690
   LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG;;
Packit 0ba690
esac
Packit 0ba690
AC_MSG_CHECKING(
Packit 0ba690
  [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
Packit 0ba690
AC_TRY_COMPILE(
Packit 26e6cb
  [#define PNG_CONFIGURE_LIBPNG
Packit 26e6cb
   #include "$srcdir/pnggccrd.c"],
Packit 0ba690
  [return 0;],
Packit 0ba690
  AC_MSG_RESULT(yes)
Packit 0ba690
  LIBPNG_NO_MMX="",
Packit 0ba690
  AC_MSG_RESULT(no)
Packit 0ba690
  LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE)
Packit 0ba690
LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX
Packit 0ba690
AC_SUBST(LIBPNG_DEFINES)
Packit 0ba690
AC_SUBST(LIBPNG_NO_MMX)
Packit 0ba690
Packit 0ba690
AC_MSG_CHECKING([if libraries can be versioned])
Packit 0ba690
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
Packit 0ba690
if test "$GLD"; then
Packit 0ba690
    have_ld_version_script=yes
Packit 0ba690
    AC_MSG_RESULT(yes)
Packit 0ba690
else
Packit 0ba690
    have_ld_version_script=no
Packit 0ba690
    AC_MSG_RESULT(no)
Packit 0ba690
    AC_MSG_WARN(*** You have not enabled versioned symbols.)
Packit 0ba690
fi
Packit 0ba690
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
Packit 0ba690
Packit 0ba690
if test "$have_ld_version_script" = "yes"; then
Packit 0ba690
    AC_MSG_CHECKING([for symbol prefix])
Packit 0ba690
    SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
Packit 0ba690
                   | ${CPP-${CC-gcc} -E} - 2>&1 \
Packit 0ba690
                   | ${EGREP-grep} "^PREFIX=" \
Packit 0ba690
                   | ${SED-sed} "s:^PREFIX=::"`
Packit 0ba690
    AC_SUBST(SYMBOL_PREFIX)
Packit 0ba690
    AC_MSG_RESULT($SYMBOL_PREFIX)
Packit 0ba690
fi
Packit 0ba690
Packit 0ba690
# Substitutions for .in files
Packit 0ba690
AC_SUBST(PNGLIB_VERSION)
Packit 0ba690
AC_SUBST(PNGLIB_MAJOR)
Packit 0ba690
AC_SUBST(PNGLIB_MINOR)
Packit 0ba690
AC_SUBST(PNGLIB_RELEASE)
Packit 0ba690
Packit 0ba690
# Additional arguments (and substitutions)
Packit 0ba690
# Allow the pkg-config directory to be set
Packit 0ba690
AC_ARG_WITH(pkgconfigdir,
Packit 0ba690
	AC_HELP_STRING([--with-pkgconfigdir],
Packit 0ba690
	[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
Packit 0ba690
	[pkgconfigdir=${withval}],
Packit 0ba690
	[pkgconfigdir='${libdir}/pkgconfig'])
Packit 0ba690
Packit 0ba690
AC_SUBST([pkgconfigdir])
Packit 0ba690
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
Packit 0ba690
Packit 0ba690
# Make the *-config binary config scripts optional
Packit 0ba690
AC_ARG_WITH(binconfigs,
Packit 0ba690
	AC_HELP_STRING([--with-binconfigs],
Packit 0ba690
		[Generate shell libpng-config scripts as well as pkg-config data]
Packit 0ba690
		[@<:@default=yes@:>@]),
Packit 0ba690
	[if test "${withval}" = no; then
Packit 0ba690
		binconfigs=
Packit 0ba690
		AC_MSG_NOTICE([libpng-config scripts will not be built])
Packit 0ba690
	else
Packit 0ba690
		binconfigs='${binconfigs}'
Packit 0ba690
	fi],
Packit 0ba690
	[binconfigs='${binconfigs}'])
Packit 0ba690
AC_SUBST([binconfigs])
Packit 0ba690
Packit 0ba690
# Allow the old version number library, libpng.so, to be removed from
Packit 0ba690
# the build
Packit 0ba690
AC_ARG_WITH(libpng-compat,
Packit 0ba690
	AC_HELP_STRING([--with-libpng-compat],
Packit 0ba690
		[Generate the obsolete libpng.so library @<:@default=yes@:>@]),
Packit 0ba690
	[if test "${withval}" = no; then
Packit 0ba690
		compatlib=
Packit 0ba690
		AC_MSG_NOTICE([libpng.so will not be built])
Packit 0ba690
	else
Packit 0ba690
		compatlib=libpng.la
Packit 0ba690
	fi],
Packit 0ba690
	[compatlib=libpng.la])
Packit 0ba690
AC_SUBST([compatlib])
Packit 0ba690
Packit 0ba690
# Config files, substituting as above
Packit 0ba690
AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc-configure.in])
Packit 0ba690
AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
Packit 0ba690
		[chmod +x libpng-config])
Packit 0ba690
Packit 0ba690
AC_OUTPUT