source: trunk/src/gcc/zlib/configure.in@ 706

Last change on this file since 706 was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.2 KB
Line 
1dnl Process this with autoconf to create configure
2
3AC_INIT(zlib.h)
4
5# This works around the fact that libtool configuration may change LD
6# for this particular configuration, but some shells, instead of
7# keeping the changes in LD private, export them just because LD is
8# exported.
9ORIGINAL_LD_FOR_MULTILIBS=$LD
10
11dnl We may get other options which we dont document:
12dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
13
14if test "x[$]{with_target_subdir}" != x && \
15 test "[$]{srcdir}" = "."; then
16 if test "[$]{with_target_subdir}" != "."; then
17 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
18 else
19 zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
20 fi
21else
22 zlib_basedir="[$]{srcdir}/"
23fi
24AC_SUBST(zlib_basedir)
25AC_CONFIG_AUX_DIR($zlib_basedir..)
26if :; then :; else
27 # This overrides the previous occurrence for automake, but not for
28 # autoconf, which is exactly what we want.
29 AC_CONFIG_AUX_DIR(..)
30fi
31
32AC_CANONICAL_SYSTEM
33
34# This works around an automake problem.
35mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
36AC_SUBST(mkinstalldirs)
37
38AM_INIT_AUTOMAKE(zlib, 1.1.3)
39
40AM_MAINTAINER_MODE
41
42dnl We use these options to decide which functions to include.
43AC_ARG_WITH(target-subdir,
44[ --with-target-subdir=SUBDIR
45 configuring in a subdirectory])
46AC_ARG_WITH(cross-host,
47[ --with-cross-host=HOST configuring with a cross compiler])
48
49dnl Default to --enable-multilib
50AC_ARG_ENABLE(multilib,
51[ --enable-multilib build many library versions (default)],
52[case "${enableval}" in
53 yes) multilib=yes ;;
54 no) multilib=no ;;
55 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
56 esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
57
58AC_ARG_WITH(system-zlib,
59[ --with-system-zlib use installed libz])
60
61LIB_AC_PROG_CC
62# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
63# at least currently, we never actually build a program, so we never
64# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
65# fails, because we are probably configuring with a cross compiler
66# which cant create executables. So we include AC_EXEEXT to keep
67# automake happy, but we dont execute it, since we dont care about
68# the result.
69if false; then
70 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
71 # to nothing, so nothing would remain between `then' and `fi' if it
72 # were not for the `:' below.
73 :
74 AC_EXEEXT
75fi
76AM_PROG_LIBTOOL
77
78if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
79 COMPPATH=.
80else
81 COMPPATH=..
82fi
83AC_SUBST(COMPPATH)
84
85# Find CPP now so that any conditional tests below won't do it and
86# thereby make the resulting definitions conditional.
87AC_PROG_CPP
88
89if test -n "$with_cross_host"; then
90 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
91 # may not work correctly, because the compiler may not be able to
92 # link executables.
93
94 # We assume newlib. This lets us hard-code the functions we know
95 # we'll have.
96 AC_DEFINE(HAVE_MEMCPY)
97 AC_DEFINE(HAVE_STRERROR)
98
99 # We ignore --with-system-zlib in this case.
100 target_all=libzgcj.la
101else
102 AC_FUNC_MMAP
103 AC_CHECK_FUNCS(memcpy strerror)
104
105 if test "$with_system_zlib" = yes; then
106 AC_CHECK_LIB(z, deflate, target_all=, target_all=libzgcj.la)
107 else
108 target_all=libzgcj.la
109 fi
110fi
111
112AC_SUBST(target_all)
113
114AC_CHECK_HEADERS(unistd.h)
115
116if test -n "$with_cross_host" &&
117 test x"$with_cross_host" != x"no"; then
118 toolexecdir='$(exec_prefix)/$(target_alias)'
119 toolexeclibdir='$(toolexecdir)/lib'
120else
121 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
122 toolexeclibdir='$(libdir)'
123fi
124toolexeclibdir=$toolexeclibdir/`$CC -print-multi-os-directory 2>/dev/null || echo .`
125AC_SUBST(toolexecdir)
126AC_SUBST(toolexeclibdir)
127
128AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
129
130if test "${multilib}" = "yes"; then
131 multilib_arg="--enable-multilib"
132else
133 multilib_arg=
134fi
135
136AC_OUTPUT(Makefile,
137[if test -n "$CONFIG_FILES"; then
138 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
139 ac_file=Makefile . ${zlib_basedir}/../config-ml.in
140fi],
141srcdir=${srcdir}
142host=${host}
143target=${target}
144with_multisubdir=${with_multisubdir}
145ac_configure_args="${multilib_arg} ${ac_configure_args}"
146CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
147zlib_basedir=${zlib_basedir}
148CC="${CC}"
149CXX="${CXX}"
150)
Note: See TracBrowser for help on using the repository browser.