]>
Commit | Line | Data |
---|---|---|
dfac8a13 TT |
1 | dnl Process this with autoconf to create configure |
2 | ||
a8aea176 NN |
3 | AC_PREREQ(2.59) |
4 | AC_INIT | |
5 | AC_CONFIG_SRCDIR([zlib.h]) | |
0fd91e0a | 6 | |
076e5443 | 7 | AM_ENABLE_MULTILIB(, ..) |
0fd91e0a | 8 | |
dfac8a13 | 9 | AC_CANONICAL_SYSTEM |
8b55628e TT |
10 | |
11 | # This works around an automake problem. | |
1e6347d8 | 12 | mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" |
8b55628e TT |
13 | AC_SUBST(mkinstalldirs) |
14 | ||
d59e375e | 15 | AM_INIT_AUTOMAKE(zlib, 1.1.4) |
dfac8a13 TT |
16 | |
17 | AM_MAINTAINER_MODE | |
dfac8a13 | 18 | |
dfac8a13 TT |
19 | dnl We use these options to decide which functions to include. |
20 | AC_ARG_WITH(target-subdir, | |
3ef1cea8 RO |
21 | [ --with-target-subdir=SUBDIR |
22 | configuring in a subdirectory]) | |
a8aea176 NN |
23 | |
24 | if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then | |
25 | COMPPATH=. | |
26 | else | |
27 | COMPPATH=.. | |
28 | fi | |
29 | AC_SUBST(COMPPATH) | |
30 | ||
dfac8a13 | 31 | AC_ARG_WITH(cross-host, |
3ef1cea8 | 32 | [ --with-cross-host=HOST configuring with a cross compiler]) |
dfac8a13 TT |
33 | |
34 | dnl Default to --enable-multilib | |
35 | AC_ARG_ENABLE(multilib, | |
3ef1cea8 | 36 | [ --enable-multilib build many library versions (default)], |
dfac8a13 TT |
37 | [case "${enableval}" in |
38 | yes) multilib=yes ;; | |
39 | no) multilib=no ;; | |
40 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; | |
67d08194 | 41 | esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl |
dfac8a13 | 42 | |
79a9a529 | 43 | AC_ARG_WITH(system-zlib, |
3ef1cea8 | 44 | [ --with-system-zlib use installed libz]) |
79a9a529 | 45 | |
a8aea176 NN |
46 | # Make sure we don't test executables when making cross-tools. |
47 | GCC_NO_EXECUTABLES | |
dfac8a13 | 48 | |
076e5443 PB |
49 | # The same as in boehm-gc and libstdc++. Have to borrow it from there. |
50 | # We must force CC to /not/ be precious variables; otherwise | |
51 | # the wrong, non-multilib-adjusted value will be used in multilibs. | |
52 | # As a side effect, we have to subst CFLAGS ourselves. | |
53 | ||
54 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
55 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
a8aea176 | 56 | AC_PROG_CC |
076e5443 | 57 | m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
a8aea176 | 58 | |
076e5443 PB |
59 | AC_SUBST(CFLAGS) |
60 | ||
61 | AC_PROG_LIBTOOL | |
dfac8a13 | 62 | |
35241f18 CD |
63 | # Find CPP now so that any conditional tests below won't do it and |
64 | # thereby make the resulting definitions conditional. | |
65 | AC_PROG_CPP | |
dfac8a13 TT |
66 | |
67 | if test -n "$with_cross_host"; then | |
68 | # We are being configured with a cross compiler. AC_REPLACE_FUNCS | |
69 | # may not work correctly, because the compiler may not be able to | |
70 | # link executables. | |
71 | ||
72 | # We assume newlib. This lets us hard-code the functions we know | |
73 | # we'll have. | |
74 | AC_DEFINE(HAVE_MEMCPY) | |
75 | AC_DEFINE(HAVE_STRERROR) | |
79a9a529 TT |
76 | |
77 | # We ignore --with-system-zlib in this case. | |
78 | target_all=libzgcj.la | |
dfac8a13 TT |
79 | else |
80 | AC_FUNC_MMAP | |
81 | AC_CHECK_FUNCS(memcpy strerror) | |
79a9a529 TT |
82 | |
83 | if test "$with_system_zlib" = yes; then | |
84 | AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la) | |
85 | else | |
86 | target_all=libzgcj.la | |
87 | fi | |
dfac8a13 TT |
88 | fi |
89 | ||
79a9a529 TT |
90 | AC_SUBST(target_all) |
91 | ||
dfac8a13 TT |
92 | AC_CHECK_HEADERS(unistd.h) |
93 | ||
0ccf2c33 AO |
94 | if test -n "$with_cross_host" && |
95 | test x"$with_cross_host" != x"no"; then | |
96 | toolexecdir='$(exec_prefix)/$(target_alias)' | |
97 | toolexeclibdir='$(toolexecdir)/lib' | |
98 | else | |
99 | toolexecdir='$(libdir)/gcc-lib/$(target_alias)' | |
100 | toolexeclibdir='$(libdir)' | |
101 | fi | |
905280ac AO |
102 | if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then |
103 | multiosdir=/`$CC -print-multi-os-directory` | |
ff8b9ca8 AS |
104 | case $multiosdir in |
105 | /.) multiosdir= ;; # Avoid trailing /. | |
106 | esac | |
905280ac AO |
107 | else |
108 | multiosdir= | |
109 | fi | |
110 | toolexeclibdir=${toolexeclibdir}${multiosdir} | |
0ccf2c33 AO |
111 | AC_SUBST(toolexecdir) |
112 | AC_SUBST(toolexeclibdir) | |
113 | ||
e093c992 | 114 | AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir") |
b48ed568 | 115 | |
dfac8a13 TT |
116 | if test "${multilib}" = "yes"; then |
117 | multilib_arg="--enable-multilib" | |
118 | else | |
119 | multilib_arg= | |
120 | fi | |
121 | ||
a8aea176 | 122 | AC_CONFIG_FILES([Makefile]) |
a8aea176 | 123 | AC_OUTPUT |