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