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
15 configuring in a subdirectory])
16 AC_ARG_WITH(cross-host,
17 [ --with-cross-host=HOST configuring with a cross compiler])
19 dnl Default to --enable-multilib
20 AC_ARG_ENABLE(multilib,
21 [ --enable-multilib build many library versions (default)],
22 [case "${enableval}" in
25 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
26 esac], [multilib=yes])dnl
28 dnl We may get other options which we dont document:
29 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
31 if test "[$]{srcdir}" = "."; then
32 if test "[$]{with_target_subdir}" != "."; then
33 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
35 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
38 zlib_basedir="[$]{srcdir}/"
40 AC_SUBST(zlib_basedir)
42 AC_ARG_WITH(system-zlib,
43 [ --with-system-zlib use installed libz])
48 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
56 if test -n "$with_cross_host"; then
57 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
58 # may not work correctly, because the compiler may not be able to
61 # We assume newlib. This lets us hard-code the functions we know
63 AC_DEFINE(HAVE_MEMCPY)
64 AC_DEFINE(HAVE_STRERROR)
66 # We ignore --with-system-zlib in this case.
70 AC_CHECK_FUNCS(memcpy strerror)
72 if test "$with_system_zlib" = yes; then
73 AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
81 AC_CHECK_HEADERS(unistd.h)
83 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
85 if test "${multilib}" = "yes"; then
86 multilib_arg="--enable-multilib"
92 [if test -n "$CONFIG_FILES"; then
93 ac_file=Makefile . ${zlib_basedir}/../config-ml.in
98 with_multisubdir=${with_multisubdir}
99 ac_configure_args="${multilib_arg} ${ac_configure_args}"
100 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
101 zlib_basedir=${zlib_basedir}