1 dnl Process this with autoconf to create configure
5 AM_INIT_AUTOMAKE(zlib, 1.1.3)
12 dnl We use these options to decide which functions to include.
13 AC_ARG_WITH(target-subdir,
14 [ --with-target-subdir=SUBDIR Configuring in a subdirectory])
15 AC_ARG_WITH(cross-host,
16 [ --with-cross-host=HOST Configuring with a cross compiler])
18 dnl Default to --enable-multilib
19 AC_ARG_ENABLE(multilib,
20 [ --enable-multilib build many library versions (default)],
21 [case "${enableval}" in
24 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
25 esac], [multilib=yes])dnl
27 dnl We may get other options which we dont document:
28 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
30 if test "[$]{srcdir}" = "."; then
31 if test "[$]{with_target_subdir}" != "."; then
32 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
34 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
37 zlib_basedir="[$]{srcdir}/"
39 AC_SUBST(zlib_basedir)
41 AC_ARG_WITH(system-zlib,
42 [ --with-system-zlib Use installed libz])
47 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
55 if test -n "$with_cross_host"; then
56 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
57 # may not work correctly, because the compiler may not be able to
60 # We assume newlib. This lets us hard-code the functions we know
62 AC_DEFINE(HAVE_MEMCPY)
63 AC_DEFINE(HAVE_STRERROR)
65 # We ignore --with-system-zlib in this case.
69 AC_CHECK_FUNCS(memcpy strerror)
71 if test "$with_system_zlib" = yes; then
72 AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
80 AC_CHECK_HEADERS(unistd.h)
82 if test "${multilib}" = "yes"; then
83 multilib_arg="--enable-multilib"
89 [if test -n "$CONFIG_FILES"; then
90 ac_file=Makefile . ${zlib_basedir}/../config-ml.in
95 with_multisubdir=${with_multisubdir}
96 ac_configure_args="${multilib_arg} ${ac_configure_args}"
97 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
98 zlib_basedir=${zlib_basedir}