]>
Commit | Line | Data |
---|---|---|
fe5b2062 | 1 | dnl Process this with autoconf to create configure |
2 | ||
f00f02a3 | 3 | AC_INIT([zlib], [1.1.4]) |
f645ebe6 | 4 | AC_CONFIG_SRCDIR([zlib.h]) |
f4df1748 | 5 | |
9805e646 | 6 | if test -n "${with_target_subdir}"; then |
7 | AM_ENABLE_MULTILIB(, ..) | |
8 | fi | |
f4df1748 | 9 | |
fe5b2062 | 10 | AC_CANONICAL_SYSTEM |
8395b25b | 11 | |
12 | # This works around an automake problem. | |
3354d061 | 13 | mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" |
8395b25b | 14 | AC_SUBST(mkinstalldirs) |
15 | ||
f00f02a3 | 16 | AM_INIT_AUTOMAKE |
fe5b2062 | 17 | |
18 | AM_MAINTAINER_MODE | |
fe5b2062 | 19 | |
fe5b2062 | 20 | dnl We use these options to decide which functions to include. |
21 | AC_ARG_WITH(target-subdir, | |
7ce928ee | 22 | [ --with-target-subdir=SUBDIR |
23 | configuring in a subdirectory]) | |
f645ebe6 | 24 | |
25 | if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then | |
26 | COMPPATH=. | |
27 | else | |
28 | COMPPATH=.. | |
29 | fi | |
30 | AC_SUBST(COMPPATH) | |
31 | ||
fe5b2062 | 32 | AC_ARG_WITH(cross-host, |
7ce928ee | 33 | [ --with-cross-host=HOST configuring with a cross compiler]) |
fe5b2062 | 34 | |
35 | dnl Default to --enable-multilib | |
36 | AC_ARG_ENABLE(multilib, | |
7ce928ee | 37 | [ --enable-multilib build many library versions (default)], |
fe5b2062 | 38 | [case "${enableval}" in |
39 | yes) multilib=yes ;; | |
40 | no) multilib=no ;; | |
41 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; | |
912301f9 | 42 | esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl |
fe5b2062 | 43 | |
a709977c | 44 | AC_ARG_WITH(system-zlib, |
7ce928ee | 45 | [ --with-system-zlib use installed libz]) |
a709977c | 46 | |
f645ebe6 | 47 | # Make sure we don't test executables when making cross-tools. |
48 | GCC_NO_EXECUTABLES | |
fe5b2062 | 49 | |
d947df39 | 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. | |
54 | ||
55 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
56 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
f645ebe6 | 57 | AC_PROG_CC |
9abe4a66 | 58 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
f645ebe6 | 59 | |
d947df39 | 60 | AC_SUBST(CFLAGS) |
61 | ||
62 | AC_PROG_LIBTOOL | |
fe5b2062 | 63 | |
e4674dec | 64 | # Find CPP now so that any conditional tests below won't do it and |
65 | # thereby make the resulting definitions conditional. | |
66 | AC_PROG_CPP | |
fe5b2062 | 67 | |
68 | if test -n "$with_cross_host"; then | |
69 | # We are being configured with a cross compiler. AC_REPLACE_FUNCS | |
70 | # may not work correctly, because the compiler may not be able to | |
71 | # link executables. | |
72 | ||
73 | # We assume newlib. This lets us hard-code the functions we know | |
74 | # we'll have. | |
75 | AC_DEFINE(HAVE_MEMCPY) | |
76 | AC_DEFINE(HAVE_STRERROR) | |
77 | else | |
78 | AC_FUNC_MMAP | |
79 | AC_CHECK_FUNCS(memcpy strerror) | |
80 | fi | |
81 | ||
82 | AC_CHECK_HEADERS(unistd.h) | |
83 | ||
1f962a07 | 84 | if test -n "$with_cross_host" && |
85 | test x"$with_cross_host" != x"no"; then | |
86 | toolexecdir='$(exec_prefix)/$(target_alias)' | |
87 | toolexeclibdir='$(toolexecdir)/lib' | |
88 | else | |
89 | toolexecdir='$(libdir)/gcc-lib/$(target_alias)' | |
90 | toolexeclibdir='$(libdir)' | |
91 | fi | |
bc57af92 | 92 | if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then |
93 | multiosdir=/`$CC -print-multi-os-directory` | |
777bb3dc | 94 | case $multiosdir in |
95 | /.) multiosdir= ;; # Avoid trailing /. | |
96 | esac | |
bc57af92 | 97 | else |
98 | multiosdir= | |
99 | fi | |
100 | toolexeclibdir=${toolexeclibdir}${multiosdir} | |
1f962a07 | 101 | AC_SUBST(toolexecdir) |
102 | AC_SUBST(toolexeclibdir) | |
103 | ||
4583874f | 104 | AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir") |
c34aeb9d | 105 | |
fe5b2062 | 106 | if test "${multilib}" = "yes"; then |
107 | multilib_arg="--enable-multilib" | |
108 | else | |
109 | multilib_arg= | |
110 | fi | |
111 | ||
2bd17377 | 112 | AC_ARG_ENABLE(host-shared, |
113 | [AS_HELP_STRING([--enable-host-shared], | |
114 | [build host code as shared libraries])], | |
115 | [PICFLAG=-fPIC], [PICFLAG=]) | |
116 | AC_SUBST(PICFLAG) | |
117 | ||
f645ebe6 | 118 | AC_CONFIG_FILES([Makefile]) |
f645ebe6 | 119 | AC_OUTPUT |