1 dnl Process this with autoconf to create configure
5 AC_CONFIG_SRCDIR([zlib.h])
7 # This works around the fact that libtool configuration may change LD
8 # for this particular configuration, but some shells, instead of
9 # keeping the changes in LD private, export them just because LD is
11 ORIGINAL_LD_FOR_MULTILIBS=$LD
13 dnl We may get other options which we dont document:
14 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
16 if test "x[$]{with_target_subdir}" != x && \
17 test "[$]{srcdir}" = "."; then
18 if test "[$]{with_target_subdir}" != "."; then
19 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
21 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
24 zlib_basedir="[$]{srcdir}/"
26 AC_SUBST(zlib_basedir)
27 AC_CONFIG_AUX_DIR($zlib_basedir..)
29 # This overrides the previous occurrence for automake, but not for
30 # autoconf, which is exactly what we want.
36 # This works around an automake problem.
37 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
38 AC_SUBST(mkinstalldirs)
40 AM_INIT_AUTOMAKE(zlib, 1.1.4)
44 dnl We use these options to decide which functions to include.
45 AC_ARG_WITH(target-subdir,
46 [ --with-target-subdir=SUBDIR
47 configuring in a subdirectory])
49 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
56 AC_ARG_WITH(cross-host,
57 [ --with-cross-host=HOST configuring with a cross compiler])
59 dnl Default to --enable-multilib
60 AC_ARG_ENABLE(multilib,
61 [ --enable-multilib build many library versions (default)],
62 [case "${enableval}" in
65 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
66 esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
68 AC_ARG_WITH(system-zlib,
69 [ --with-system-zlib use installed libz])
71 # Make sure we don't test executables when making cross-tools.
78 # Find CPP now so that any conditional tests below won't do it and
79 # thereby make the resulting definitions conditional.
82 if test -n "$with_cross_host"; then
83 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
84 # may not work correctly, because the compiler may not be able to
87 # We assume newlib. This lets us hard-code the functions we know
89 AC_DEFINE(HAVE_MEMCPY)
90 AC_DEFINE(HAVE_STRERROR)
92 # We ignore --with-system-zlib in this case.
96 AC_CHECK_FUNCS(memcpy strerror)
98 if test "$with_system_zlib" = yes; then
99 AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
101 target_all=libzgcj.la
107 AC_CHECK_HEADERS(unistd.h)
109 if test -n "$with_cross_host" &&
110 test x"$with_cross_host" != x"no"; then
111 toolexecdir='$(exec_prefix)/$(target_alias)'
112 toolexeclibdir='$(toolexecdir)/lib'
114 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
115 toolexeclibdir='$(libdir)'
117 if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
118 multiosdir=/`$CC -print-multi-os-directory`
120 /.) multiosdir= ;; # Avoid trailing /.
125 toolexeclibdir=${toolexeclibdir}${multiosdir}
126 AC_SUBST(toolexecdir)
127 AC_SUBST(toolexeclibdir)
129 AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
131 if test "${multilib}" = "yes"; then
132 multilib_arg="--enable-multilib"
137 AC_CONFIG_FILES([Makefile])
139 AC_CONFIG_COMMANDS([default],
140 [[if test -n "$CONFIG_FILES"; then
141 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
142 ac_file=Makefile . ${zlib_basedir}/../config-ml.in
147 with_multisubdir=${with_multisubdir}
148 ac_configure_args="${multilib_arg} ${ac_configure_args}"
149 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
150 zlib_basedir=${zlib_basedir}
153 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"