]> git.ipfire.org Git - thirdparty/gcc.git/blame - zlib/configure.in
configure.in: Update to autoconf 2.59; clean up slightly.
[thirdparty/gcc.git] / zlib / configure.in
CommitLineData
dfac8a13
TT
1dnl Process this with autoconf to create configure
2
a8aea176
NN
3AC_PREREQ(2.59)
4AC_INIT
5AC_CONFIG_SRCDIR([zlib.h])
0fd91e0a 6
6706f116
AO
7# This works around the fact that libtool configuration may change LD
8# for this particular configuration, but some shells, instead of
9# keeping the changes in LD private, export them just because LD is
10# exported.
11ORIGINAL_LD_FOR_MULTILIBS=$LD
12
0fd91e0a
AO
13dnl We may get other options which we dont document:
14dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
15
16if test "x[$]{with_target_subdir}" != x && \
17 test "[$]{srcdir}" = "."; then
18 if test "[$]{with_target_subdir}" != "."; then
19 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
20 else
21 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
22 fi
23else
24 zlib_basedir="[$]{srcdir}/"
25fi
26AC_SUBST(zlib_basedir)
27AC_CONFIG_AUX_DIR($zlib_basedir..)
28if :; then :; else
29 # This overrides the previous occurrence for automake, but not for
30 # autoconf, which is exactly what we want.
31 AC_CONFIG_AUX_DIR(..)
32fi
33
dfac8a13 34AC_CANONICAL_SYSTEM
8b55628e
TT
35
36# This works around an automake problem.
1e6347d8 37mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
8b55628e
TT
38AC_SUBST(mkinstalldirs)
39
d59e375e 40AM_INIT_AUTOMAKE(zlib, 1.1.4)
dfac8a13
TT
41
42AM_MAINTAINER_MODE
dfac8a13 43
dfac8a13
TT
44dnl We use these options to decide which functions to include.
45AC_ARG_WITH(target-subdir,
3ef1cea8
RO
46[ --with-target-subdir=SUBDIR
47 configuring in a subdirectory])
a8aea176
NN
48
49if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
50 COMPPATH=.
51else
52 COMPPATH=..
53fi
54AC_SUBST(COMPPATH)
55
dfac8a13 56AC_ARG_WITH(cross-host,
3ef1cea8 57[ --with-cross-host=HOST configuring with a cross compiler])
dfac8a13
TT
58
59dnl Default to --enable-multilib
60AC_ARG_ENABLE(multilib,
3ef1cea8 61[ --enable-multilib build many library versions (default)],
dfac8a13
TT
62[case "${enableval}" in
63 yes) multilib=yes ;;
64 no) multilib=no ;;
65 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
67d08194 66 esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
dfac8a13 67
79a9a529 68AC_ARG_WITH(system-zlib,
3ef1cea8 69[ --with-system-zlib use installed libz])
79a9a529 70
a8aea176
NN
71# Make sure we don't test executables when making cross-tools.
72GCC_NO_EXECUTABLES
dfac8a13 73
a8aea176
NN
74AC_PROG_CC
75
76AM_PROG_LIBTOOL
dfac8a13 77
35241f18
CD
78# Find CPP now so that any conditional tests below won't do it and
79# thereby make the resulting definitions conditional.
80AC_PROG_CPP
dfac8a13
TT
81
82if test -n "$with_cross_host"; then
83 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
84 # may not work correctly, because the compiler may not be able to
85 # link executables.
86
87 # We assume newlib. This lets us hard-code the functions we know
88 # we'll have.
89 AC_DEFINE(HAVE_MEMCPY)
90 AC_DEFINE(HAVE_STRERROR)
79a9a529
TT
91
92 # We ignore --with-system-zlib in this case.
93 target_all=libzgcj.la
dfac8a13
TT
94else
95 AC_FUNC_MMAP
96 AC_CHECK_FUNCS(memcpy strerror)
79a9a529
TT
97
98 if test "$with_system_zlib" = yes; then
99 AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
100 else
101 target_all=libzgcj.la
102 fi
dfac8a13
TT
103fi
104
79a9a529
TT
105AC_SUBST(target_all)
106
dfac8a13
TT
107AC_CHECK_HEADERS(unistd.h)
108
0ccf2c33
AO
109if test -n "$with_cross_host" &&
110 test x"$with_cross_host" != x"no"; then
111 toolexecdir='$(exec_prefix)/$(target_alias)'
112 toolexeclibdir='$(toolexecdir)/lib'
113else
114 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
115 toolexeclibdir='$(libdir)'
116fi
905280ac
AO
117if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
118 multiosdir=/`$CC -print-multi-os-directory`
ff8b9ca8
AS
119 case $multiosdir in
120 /.) multiosdir= ;; # Avoid trailing /.
121 esac
905280ac
AO
122else
123 multiosdir=
124fi
125toolexeclibdir=${toolexeclibdir}${multiosdir}
0ccf2c33
AO
126AC_SUBST(toolexecdir)
127AC_SUBST(toolexeclibdir)
128
e093c992 129AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
b48ed568 130
dfac8a13
TT
131if test "${multilib}" = "yes"; then
132 multilib_arg="--enable-multilib"
133else
134 multilib_arg=
135fi
136
a8aea176
NN
137AC_CONFIG_FILES([Makefile])
138
139AC_CONFIG_COMMANDS([default],
140[[if test -n "$CONFIG_FILES"; then
6706f116 141 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
dfac8a13 142 ac_file=Makefile . ${zlib_basedir}/../config-ml.in
a8aea176
NN
143fi]],
144[[srcdir=${srcdir}
dfac8a13
TT
145host=${host}
146target=${target}
147with_multisubdir=${with_multisubdir}
148ac_configure_args="${multilib_arg} ${ac_configure_args}"
149CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
150zlib_basedir=${zlib_basedir}
151CC="${CC}"
152CXX="${CXX}"
3343fdd2 153ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
a8aea176
NN
154]])
155
156AC_OUTPUT