1999-05-05 12:04:39 +02:00
|
|
|
dnl Process this with autoconf to create configure
|
|
|
|
|
|
|
|
AC_INIT(zlib.h)
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
AM_INIT_AUTOMAKE(zlib, 1.1.3)
|
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
AC_EXEEXT
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR(..)
|
|
|
|
|
|
|
|
dnl We use these options to decide which functions to include.
|
|
|
|
AC_ARG_WITH(target-subdir,
|
|
|
|
[ --with-target-subdir=SUBDIR Configuring in a subdirectory])
|
|
|
|
AC_ARG_WITH(cross-host,
|
|
|
|
[ --with-cross-host=HOST Configuring with a cross compiler])
|
|
|
|
|
|
|
|
dnl Default to --enable-multilib
|
|
|
|
AC_ARG_ENABLE(multilib,
|
|
|
|
[ --enable-multilib build many library versions (default)],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) multilib=yes ;;
|
|
|
|
no) multilib=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
|
|
|
|
esac], [multilib=yes])dnl
|
|
|
|
|
|
|
|
dnl We may get other options which we dont document:
|
|
|
|
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
|
|
|
|
|
|
|
|
if test "[$]{srcdir}" = "."; then
|
|
|
|
if test "[$]{with_target_subdir}" != "."; then
|
|
|
|
zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
|
|
|
|
else
|
|
|
|
zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
zlib_basedir="[$]{srcdir}/"
|
|
|
|
fi
|
|
|
|
AC_SUBST(zlib_basedir)
|
|
|
|
|
1999-05-10 10:05:43 +02:00
|
|
|
AC_ARG_WITH(system-zlib,
|
|
|
|
[ --with-system-zlib Use installed libz])
|
|
|
|
|
1999-05-05 12:04:39 +02:00
|
|
|
LIB_AC_PROG_CC
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
|
|
|
if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
|
|
|
|
COMPPATH=.
|
|
|
|
else
|
|
|
|
COMPPATH=..
|
|
|
|
fi
|
|
|
|
AC_SUBST(COMPPATH)
|
|
|
|
|
|
|
|
|
|
|
|
if test -n "$with_cross_host"; then
|
|
|
|
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
|
|
|
|
# may not work correctly, because the compiler may not be able to
|
|
|
|
# link executables.
|
|
|
|
|
|
|
|
# We assume newlib. This lets us hard-code the functions we know
|
|
|
|
# we'll have.
|
|
|
|
AC_DEFINE(HAVE_MEMCPY)
|
|
|
|
AC_DEFINE(HAVE_STRERROR)
|
1999-05-10 10:05:43 +02:00
|
|
|
|
|
|
|
# We ignore --with-system-zlib in this case.
|
|
|
|
target_all=libzgcj.la
|
1999-05-05 12:04:39 +02:00
|
|
|
else
|
|
|
|
AC_FUNC_MMAP
|
|
|
|
AC_CHECK_FUNCS(memcpy strerror)
|
1999-05-10 10:05:43 +02:00
|
|
|
|
|
|
|
if test "$with_system_zlib" = yes; then
|
|
|
|
AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
|
|
|
|
else
|
|
|
|
target_all=libzgcj.la
|
|
|
|
fi
|
1999-05-05 12:04:39 +02:00
|
|
|
fi
|
|
|
|
|
1999-05-10 10:05:43 +02:00
|
|
|
AC_SUBST(target_all)
|
|
|
|
|
1999-05-05 12:04:39 +02:00
|
|
|
AC_CHECK_HEADERS(unistd.h)
|
|
|
|
|
|
|
|
if test "${multilib}" = "yes"; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile,
|
|
|
|
[if test -n "$CONFIG_FILES"; then
|
|
|
|
ac_file=Makefile . ${zlib_basedir}/../config-ml.in
|
|
|
|
fi],
|
|
|
|
srcdir=${srcdir}
|
|
|
|
host=${host}
|
|
|
|
target=${target}
|
|
|
|
with_multisubdir=${with_multisubdir}
|
|
|
|
ac_configure_args="${multilib_arg} ${ac_configure_args}"
|
|
|
|
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
|
|
|
zlib_basedir=${zlib_basedir}
|
|
|
|
CC="${CC}"
|
|
|
|
CXX="${CXX}"
|
|
|
|
)
|