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