1999-05-05 18:04:39 +08:00
|
|
|
dnl Process this with autoconf to create configure
|
|
|
|
|
2004-04-09 18:18:17 +08:00
|
|
|
AC_PREREQ(2.59)
|
|
|
|
AC_INIT
|
|
|
|
AC_CONFIG_SRCDIR([zlib.h])
|
2001-05-14 06:31:24 +08:00
|
|
|
|
2004-06-15 22:47:55 +08:00
|
|
|
AM_ENABLE_MULTILIB(, ..)
|
2001-05-14 06:31:24 +08:00
|
|
|
|
1999-05-05 18:04:39 +08:00
|
|
|
AC_CANONICAL_SYSTEM
|
2001-07-04 06:29:32 +08:00
|
|
|
|
|
|
|
# This works around an automake problem.
|
2002-05-17 01:43:21 +08:00
|
|
|
mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
|
2001-07-04 06:29:32 +08:00
|
|
|
AC_SUBST(mkinstalldirs)
|
|
|
|
|
2003-07-12 10:04:33 +08:00
|
|
|
AM_INIT_AUTOMAKE(zlib, 1.1.4)
|
1999-05-05 18:04:39 +08:00
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
dnl We use these options to decide which functions to include.
|
|
|
|
AC_ARG_WITH(target-subdir,
|
1999-08-10 13:30:10 +08:00
|
|
|
[ --with-target-subdir=SUBDIR
|
|
|
|
configuring in a subdirectory])
|
2004-04-09 18:18:17 +08:00
|
|
|
|
|
|
|
if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
|
|
|
|
COMPPATH=.
|
|
|
|
else
|
|
|
|
COMPPATH=..
|
|
|
|
fi
|
|
|
|
AC_SUBST(COMPPATH)
|
|
|
|
|
1999-05-05 18:04:39 +08:00
|
|
|
AC_ARG_WITH(cross-host,
|
1999-08-10 13:30:10 +08:00
|
|
|
[ --with-cross-host=HOST configuring with a cross compiler])
|
1999-05-05 18:04:39 +08:00
|
|
|
|
|
|
|
dnl Default to --enable-multilib
|
|
|
|
AC_ARG_ENABLE(multilib,
|
1999-08-10 13:30:10 +08:00
|
|
|
[ --enable-multilib build many library versions (default)],
|
1999-05-05 18:04:39 +08:00
|
|
|
[case "${enableval}" in
|
|
|
|
yes) multilib=yes ;;
|
|
|
|
no) multilib=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
|
2000-09-07 03:13:01 +08:00
|
|
|
esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
|
1999-05-05 18:04:39 +08:00
|
|
|
|
1999-05-10 16:05:43 +08:00
|
|
|
AC_ARG_WITH(system-zlib,
|
1999-08-10 13:30:10 +08:00
|
|
|
[ --with-system-zlib use installed libz])
|
1999-05-10 16:05:43 +08:00
|
|
|
|
2004-04-09 18:18:17 +08:00
|
|
|
# Make sure we don't test executables when making cross-tools.
|
|
|
|
GCC_NO_EXECUTABLES
|
1999-05-05 18:04:39 +08:00
|
|
|
|
2004-06-15 22:47:55 +08:00
|
|
|
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
|
|
|
|
# We must force CC to /not/ be precious variables; otherwise
|
|
|
|
# the wrong, non-multilib-adjusted value will be used in multilibs.
|
|
|
|
# As a side effect, we have to subst CFLAGS ourselves.
|
|
|
|
|
|
|
|
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
|
|
|
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
2004-04-09 18:18:17 +08:00
|
|
|
AC_PROG_CC
|
2004-06-15 22:47:55 +08:00
|
|
|
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
2004-04-09 18:18:17 +08:00
|
|
|
|
2004-06-15 22:47:55 +08:00
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
|
|
|
|
AC_PROG_LIBTOOL
|
1999-05-05 18:04:39 +08:00
|
|
|
|
2000-10-26 02:07:29 +08: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 18:04:39 +08: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 16:05:43 +08:00
|
|
|
|
|
|
|
# We ignore --with-system-zlib in this case.
|
|
|
|
target_all=libzgcj.la
|
1999-05-05 18:04:39 +08:00
|
|
|
else
|
|
|
|
AC_FUNC_MMAP
|
|
|
|
AC_CHECK_FUNCS(memcpy strerror)
|
1999-05-10 16:05:43 +08: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 18:04:39 +08:00
|
|
|
fi
|
|
|
|
|
1999-05-10 16:05:43 +08:00
|
|
|
AC_SUBST(target_all)
|
|
|
|
|
1999-05-05 18:04:39 +08:00
|
|
|
AC_CHECK_HEADERS(unistd.h)
|
|
|
|
|
2003-01-28 09:48:38 +08: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
|
2003-02-20 10:34:26 +08:00
|
|
|
if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
|
|
|
|
multiosdir=/`$CC -print-multi-os-directory`
|
2003-03-13 05:34:31 +08:00
|
|
|
case $multiosdir in
|
|
|
|
/.) multiosdir= ;; # Avoid trailing /.
|
|
|
|
esac
|
2003-02-20 10:34:26 +08:00
|
|
|
else
|
|
|
|
multiosdir=
|
|
|
|
fi
|
|
|
|
toolexeclibdir=${toolexeclibdir}${multiosdir}
|
2003-01-28 09:48:38 +08:00
|
|
|
AC_SUBST(toolexecdir)
|
|
|
|
AC_SUBST(toolexeclibdir)
|
|
|
|
|
2000-09-04 03:54:20 +08:00
|
|
|
AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
|
1999-06-21 21:03:47 +08:00
|
|
|
|
1999-05-05 18:04:39 +08:00
|
|
|
if test "${multilib}" = "yes"; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
|
|
|
|
2004-04-09 18:18:17 +08:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|