1 dnl Process this with autoconf to create configure
5 AC_CONFIG_SRCDIR([zlib.h])
7 if test -n "${with_target_subdir}"; then
8 AM_ENABLE_MULTILIB(, ..)
13 # This works around an automake problem.
14 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
15 AC_SUBST(mkinstalldirs)
17 AM_INIT_AUTOMAKE(zlib, 1.1.4)
21 dnl We use these options to decide which functions to include.
22 AC_ARG_WITH(target-subdir,
23 [ --with-target-subdir=SUBDIR
24 configuring in a subdirectory])
26 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
33 AC_ARG_WITH(cross-host,
34 [ --with-cross-host=HOST configuring with a cross compiler])
36 dnl Default to --enable-multilib
37 AC_ARG_ENABLE(multilib,
38 [ --enable-multilib build many library versions (default)],
39 [case "${enableval}" in
42 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
43 esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
45 AC_ARG_WITH(system-zlib,
46 [ --with-system-zlib use installed libz])
48 # Make sure we don't test executables when making cross-tools.
51 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
52 # We must force CC to /not/ be precious variables; otherwise
53 # the wrong, non-multilib-adjusted value will be used in multilibs.
54 # As a side effect, we have to subst CFLAGS ourselves.
56 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
57 m4_define([_AC_ARG_VAR_PRECIOUS],[])
59 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
65 # Find CPP now so that any conditional tests below won't do it and
66 # thereby make the resulting definitions conditional.
69 if test -n "$with_cross_host"; then
70 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
71 # may not work correctly, because the compiler may not be able to
74 # We assume newlib. This lets us hard-code the functions we know
76 AC_DEFINE(HAVE_MEMCPY)
77 AC_DEFINE(HAVE_STRERROR)
79 # We ignore --with-system-zlib in this case.
83 AC_CHECK_FUNCS(memcpy strerror)
85 if test "$with_system_zlib" = yes; then
86 AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
94 AC_CHECK_HEADERS(unistd.h)
96 if test -n "$with_cross_host" &&
97 test x"$with_cross_host" != x"no"; then
98 toolexecdir='$(exec_prefix)/$(target_alias)'
99 toolexeclibdir='$(toolexecdir)/lib'
101 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
102 toolexeclibdir='$(libdir)'
104 if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
105 multiosdir=/`$CC -print-multi-os-directory`
107 /.) multiosdir= ;; # Avoid trailing /.
112 toolexeclibdir=${toolexeclibdir}${multiosdir}
113 AC_SUBST(toolexecdir)
114 AC_SUBST(toolexeclibdir)
116 AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
118 if test "${multilib}" = "yes"; then
119 multilib_arg="--enable-multilib"
124 AC_ARG_ENABLE(host-shared,
125 [AS_HELP_STRING([--enable-host-shared],
126 [build host code as shared libraries])],
127 [PICFLAG=-fPIC], [PICFLAG=])
130 AC_CONFIG_FILES([Makefile])