1 dnl Process this with autoconf to create configure
3 AC_INIT([zlib], [1.1.4])
4 AC_CONFIG_SRCDIR([zlib.h])
6 if test -n "${with_target_subdir}"; then
7 AM_ENABLE_MULTILIB(, ..)
12 # This works around an automake problem.
13 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
14 AC_SUBST(mkinstalldirs)
20 dnl We use these options to decide which functions to include.
21 AC_ARG_WITH(target-subdir,
22 [ --with-target-subdir=SUBDIR
23 configuring in a subdirectory])
25 if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
32 AC_ARG_WITH(cross-host,
33 [ --with-cross-host=HOST configuring with a cross compiler])
35 dnl Default to --enable-multilib
36 AC_ARG_ENABLE(multilib,
37 [ --enable-multilib build many library versions (default)],
38 [case "${enableval}" in
41 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
42 esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
44 AC_ARG_WITH(system-zlib,
45 [ --with-system-zlib use installed libz])
47 # Make sure we don't test executables when making cross-tools.
50 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
51 # We must force CC to /not/ be precious variables; otherwise
52 # the wrong, non-multilib-adjusted value will be used in multilibs.
53 # As a side effect, we have to subst CFLAGS ourselves.
55 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
56 m4_define([_AC_ARG_VAR_PRECIOUS],[])
58 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
62 # Add CET specific flags if CET is enabled
63 GCC_CET_FLAGS(CET_FLAGS)
68 # Find CPP now so that any conditional tests below won't do it and
69 # thereby make the resulting definitions conditional.
72 if test -n "$with_cross_host"; then
73 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
74 # may not work correctly, because the compiler may not be able to
77 # We assume newlib. This lets us hard-code the functions we know
79 AC_DEFINE(HAVE_MEMCPY)
80 AC_DEFINE(HAVE_STRERROR)
83 AC_CHECK_FUNCS(memcpy strerror)
86 AC_CHECK_HEADERS(unistd.h)
88 GCC_WITH_TOOLEXECLIBDIR
90 if test -n "$with_cross_host" &&
91 test x"$with_cross_host" != x"no"; then
92 toolexecdir='$(exec_prefix)/$(target_alias)'
93 case ${with_toolexeclibdir} in
95 toolexeclibdir='$(toolexecdir)/lib'
98 toolexeclibdir=${with_toolexeclibdir}
102 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
103 toolexeclibdir='$(libdir)'
105 if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
106 multiosdir=/`$CC -print-multi-os-directory`
108 /.) multiosdir= ;; # Avoid trailing /.
113 toolexeclibdir=${toolexeclibdir}${multiosdir}
114 AC_SUBST(toolexecdir)
115 AC_SUBST(toolexeclibdir)
117 AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
119 if test "${multilib}" = "yes"; then
120 multilib_arg="--enable-multilib"
125 # Enable --enable-host-shared.
126 AC_ARG_ENABLE(host-shared,
127 [AS_HELP_STRING([--enable-host-shared],
128 [build host code as shared libraries])])
129 AC_SUBST(enable_host_shared)
131 # Enable --enable-host-pie.
132 AC_ARG_ENABLE(host-pie,
133 [AS_HELP_STRING([--enable-host-pie],
134 [build host code as PIE])])
135 AC_SUBST(enable_host_pie)
137 if test x$enable_host_shared = xyes; then
139 elif test x$enable_host_pie = xyes; then
146 AC_CONFIG_FILES([Makefile])