1999-05-05 12:04:39 +02:00
|
|
|
dnl Process this with autoconf to create configure
|
|
|
|
|
|
|
|
AC_INIT(zlib.h)
|
2001-05-14 00:31:24 +02:00
|
|
|
|
2002-05-08 06:38:00 +02:00
|
|
|
# This works around the fact that libtool configuration may change LD
|
|
|
|
# for this particular configuration, but some shells, instead of
|
|
|
|
# keeping the changes in LD private, export them just because LD is
|
|
|
|
# exported.
|
|
|
|
ORIGINAL_LD_FOR_MULTILIBS=$LD
|
|
|
|
|
2001-05-14 00:31:24 +02:00
|
|
|
dnl We may get other options which we dont document:
|
|
|
|
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
|
|
|
|
|
|
|
|
if test "x[$]{with_target_subdir}" != x && \
|
|
|
|
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)
|
|
|
|
AC_CONFIG_AUX_DIR($zlib_basedir..)
|
|
|
|
if :; then :; else
|
|
|
|
# This overrides the previous occurrence for automake, but not for
|
|
|
|
# autoconf, which is exactly what we want.
|
|
|
|
AC_CONFIG_AUX_DIR(..)
|
|
|
|
fi
|
|
|
|
|
1999-05-05 12:04:39 +02:00
|
|
|
AC_CANONICAL_SYSTEM
|
2001-07-04 00:29:32 +02:00
|
|
|
|
|
|
|
# This works around an automake problem.
|
2002-05-16 19:43:21 +02:00
|
|
|
mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
|
2001-07-04 00:29:32 +02:00
|
|
|
AC_SUBST(mkinstalldirs)
|
|
|
|
|
1999-05-05 12:04:39 +02:00
|
|
|
AM_INIT_AUTOMAKE(zlib, 1.1.3)
|
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
dnl We use these options to decide which functions to include.
|
|
|
|
AC_ARG_WITH(target-subdir,
|
1999-08-10 07:30:10 +02:00
|
|
|
[ --with-target-subdir=SUBDIR
|
|
|
|
configuring in a subdirectory])
|
1999-05-05 12:04:39 +02:00
|
|
|
AC_ARG_WITH(cross-host,
|
1999-08-10 07:30:10 +02:00
|
|
|
[ --with-cross-host=HOST configuring with a cross compiler])
|
1999-05-05 12:04:39 +02:00
|
|
|
|
|
|
|
dnl Default to --enable-multilib
|
|
|
|
AC_ARG_ENABLE(multilib,
|
1999-08-10 07:30:10 +02:00
|
|
|
[ --enable-multilib build many library versions (default)],
|
1999-05-05 12:04:39 +02:00
|
|
|
[case "${enableval}" in
|
|
|
|
yes) multilib=yes ;;
|
|
|
|
no) multilib=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
|
2000-09-06 21:13:01 +02:00
|
|
|
esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
|
1999-05-05 12:04:39 +02:00
|
|
|
|
1999-05-10 10:05:43 +02:00
|
|
|
AC_ARG_WITH(system-zlib,
|
1999-08-10 07:30:10 +02:00
|
|
|
[ --with-system-zlib use installed libz])
|
1999-05-10 10:05:43 +02:00
|
|
|
|
1999-05-05 12:04:39 +02:00
|
|
|
LIB_AC_PROG_CC
|
1999-10-05 00:08:42 +02:00
|
|
|
# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
|
|
|
|
# at least currently, we never actually build a program, so we never
|
|
|
|
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
|
|
|
|
# fails, because we are probably configuring with a cross compiler
|
|
|
|
# which cant create executables. So we include AC_EXEEXT to keep
|
|
|
|
# automake happy, but we dont execute it, since we dont care about
|
|
|
|
# the result.
|
|
|
|
if false; then
|
2001-06-09 22:31:13 +02:00
|
|
|
# autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
|
|
|
|
# to nothing, so nothing would remain between `then' and `fi' if it
|
|
|
|
# were not for the `:' below.
|
|
|
|
:
|
1999-10-05 00:08:42 +02:00
|
|
|
AC_EXEEXT
|
|
|
|
fi
|
1999-05-05 12:04:39 +02:00
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
|
|
|
if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
|
|
|
|
COMPPATH=.
|
|
|
|
else
|
|
|
|
COMPPATH=..
|
|
|
|
fi
|
|
|
|
AC_SUBST(COMPPATH)
|
|
|
|
|
2000-10-25 20:07:29 +02:00
|
|
|
# Find CPP now so that any conditional tests below won't do it and
|
|
|
|
# thereby make the resulting definitions conditional.
|
|
|
|
AC_PROG_CPP
|
1999-05-05 12:04:39 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2003-01-28 02:48:38 +01:00
|
|
|
if test -n "$with_cross_host" &&
|
|
|
|
test x"$with_cross_host" != x"no"; then
|
|
|
|
toolexecdir='$(exec_prefix)/$(target_alias)'
|
|
|
|
toolexeclibdir='$(toolexecdir)/lib'
|
|
|
|
else
|
|
|
|
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
|
|
|
toolexeclibdir='$(libdir)'
|
|
|
|
fi
|
|
|
|
toolexeclibdir=$toolexeclibdir/`$CC -print-multi-os-directory 2>/dev/null || echo .`
|
|
|
|
AC_SUBST(toolexecdir)
|
|
|
|
AC_SUBST(toolexeclibdir)
|
|
|
|
|
2000-09-03 21:54:20 +02:00
|
|
|
AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
|
1999-06-21 15:03:47 +02:00
|
|
|
|
1999-05-05 12:04:39 +02:00
|
|
|
if test "${multilib}" = "yes"; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile,
|
|
|
|
[if test -n "$CONFIG_FILES"; then
|
2002-05-08 06:38:00 +02:00
|
|
|
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
|
1999-05-05 12:04:39 +02:00
|
|
|
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}"
|
|
|
|
)
|