dnl Process this with autoconf to create configure
AC_INIT(zlib.h)
+
+# 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
+
+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
+
AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(zlib, 1.1.3)
-AM_MAINTAINER_MODE
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
-AC_CONFIG_AUX_DIR(..)
+AM_INIT_AUTOMAKE(zlib, 1.1.4)
+
+AM_MAINTAINER_MODE
dnl We use these options to decide which functions to include.
AC_ARG_WITH(target-subdir,
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
-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_ARG_WITH(system-zlib,
[ --with-system-zlib use installed libz])
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
+ # 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.
+ :
AC_EXEEXT
fi
AM_PROG_LIBTOOL
fi
AC_SUBST(COMPPATH)
+# Find CPP now so that any conditional tests below won't do it and
+# thereby make the resulting definitions conditional.
+AC_PROG_CPP
if test -n "$with_cross_host"; then
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
AC_CHECK_HEADERS(unistd.h)
-AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
+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
+if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
+ multiosdir=/`$CC -print-multi-os-directory`
+ case $multiosdir in
+ /.) multiosdir= ;; # Avoid trailing /.
+ esac
+else
+ multiosdir=
+fi
+toolexeclibdir=${toolexeclibdir}${multiosdir}
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
if test "${multilib}" = "yes"; then
AC_OUTPUT(Makefile,
[if test -n "$CONFIG_FILES"; then
+ LD="${ORIGINAL_LD_FOR_MULTILIBS}"
ac_file=Makefile . ${zlib_basedir}/../config-ml.in
fi],
srcdir=${srcdir}
zlib_basedir=${zlib_basedir}
CC="${CC}"
CXX="${CXX}"
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
)