]> git.ipfire.org Git - thirdparty/gcc.git/blame - zlib/aclocal.m4
acinclude.m4: Use ../libtool.m4.
[thirdparty/gcc.git] / zlib / aclocal.m4
CommitLineData
dfac8a13
TT
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13# FIXME: We temporarily define our own version of AC_PROG_CC. This is
14# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
15# are probably using a cross compiler, which will not be able to fully
16# link an executable. This should really be fixed in autoconf
17# itself.
18
19AC_DEFUN(LIB_AC_PROG_CC,
20[AC_BEFORE([$0], [AC_PROG_CPP])dnl
025fd00e
TT
21dnl Fool anybody using AC_PROG_CC.
22AC_PROVIDE([AC_PROG_CC])
dfac8a13
TT
23AC_CHECK_PROG(CC, gcc, gcc)
24if test -z "$CC"; then
25 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
26 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
27fi
28
29AC_PROG_CC_GNU
30
31if test $ac_cv_prog_gcc = yes; then
32 GCC=yes
33dnl Check whether -g works, even if CFLAGS is set, in case the package
34dnl plays around with CFLAGS (such as to build both debugging and
35dnl normal versions of a library), tasteless as that idea is.
36 ac_test_CFLAGS="${CFLAGS+set}"
37 ac_save_CFLAGS="$CFLAGS"
38 CFLAGS=
39 AC_PROG_CC_G
40 if test "$ac_test_CFLAGS" = set; then
41 CFLAGS="$ac_save_CFLAGS"
42 elif test $ac_cv_prog_cc_g = yes; then
43 CFLAGS="-g -O2"
44 else
45 CFLAGS="-O2"
46 fi
47else
48 GCC=
49 test "${CFLAGS+set}" = set || CFLAGS="-g"
50fi
51])
52
0fd91e0a
AO
53sinclude(../libtool.m4)
54dnl The lines below arrange for aclocal not to bring libtool.m4
55dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
56dnl to add a definition of LIBTOOL to Makefile.in.
57ifelse(yes,no,[
58AC_DEFUN([AM_PROG_LIBTOOL],)
59AC_SUBST(LIBTOOL)
60])
61
dfac8a13
TT
62# Do all the work for Automake. This macro actually does too much --
63# some checks are only needed if your package does certain things.
64# But this isn't really a big deal.
65
66# serial 1
67
68dnl Usage:
69dnl AM_INIT_AUTOMAKE(package,version, [no-define])
70
71AC_DEFUN(AM_INIT_AUTOMAKE,
72[AC_REQUIRE([AC_PROG_INSTALL])
73PACKAGE=[$1]
74AC_SUBST(PACKAGE)
75VERSION=[$2]
76AC_SUBST(VERSION)
77dnl test to see if srcdir already configured
78if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
79 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
80fi
81ifelse([$3],,
82AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
83AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
84AC_REQUIRE([AM_SANITY_CHECK])
85AC_REQUIRE([AC_ARG_PROGRAM])
86dnl FIXME This is truly gross.
87missing_dir=`cd $ac_aux_dir && pwd`
88AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
89AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
90AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
91AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
92AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
93AC_REQUIRE([AC_PROG_MAKE_SET])])
94
95#
96# Check to make sure that the build environment is sane.
97#
98
99AC_DEFUN(AM_SANITY_CHECK,
100[AC_MSG_CHECKING([whether build environment is sane])
101# Just in case
102sleep 1
103echo timestamp > conftestfile
104# Do `set' in a subshell so we don't clobber the current shell's
105# arguments. Must try -L first in case configure is actually a
106# symlink; some systems play weird games with the mod time of symlinks
107# (eg FreeBSD returns the mod time of the symlink's containing
108# directory).
109if (
110 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
111 if test "[$]*" = "X"; then
112 # -L didn't work.
113 set X `ls -t $srcdir/configure conftestfile`
114 fi
115 if test "[$]*" != "X $srcdir/configure conftestfile" \
116 && test "[$]*" != "X conftestfile $srcdir/configure"; then
117
118 # If neither matched, then we have a broken ls. This can happen
119 # if, for instance, CONFIG_SHELL is bash and it inherits a
120 # broken ls alias from the environment. This has actually
121 # happened. Such a system could not be considered "sane".
122 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
123alias in your environment])
124 fi
125
126 test "[$]2" = conftestfile
127 )
128then
129 # Ok.
130 :
131else
132 AC_MSG_ERROR([newly created file is older than distributed files!
133Check your system clock])
134fi
135rm -f conftest*
136AC_MSG_RESULT(yes)])
137
138dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
139dnl The program must properly implement --version.
140AC_DEFUN(AM_MISSING_PROG,
141[AC_MSG_CHECKING(for working $2)
142# Run test in a subshell; some versions of sh will print an error if
143# an executable is not found, even if stderr is redirected.
144# Redirect stdin to placate older versions of autoconf. Sigh.
145if ($2 --version) < /dev/null > /dev/null 2>&1; then
146 $1=$2
147 AC_MSG_RESULT(found)
148else
149 $1="$3/missing $2"
150 AC_MSG_RESULT(missing)
151fi
152AC_SUBST($1)])
153
154# Add --enable-maintainer-mode option to configure.
155# From Jim Meyering
156
157# serial 1
158
159AC_DEFUN(AM_MAINTAINER_MODE,
160[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
161 dnl maintainer-mode is disabled by default
162 AC_ARG_ENABLE(maintainer-mode,
163[ --enable-maintainer-mode enable make rules and dependencies not useful
164 (and sometimes confusing) to the casual installer],
165 USE_MAINTAINER_MODE=$enableval,
166 USE_MAINTAINER_MODE=no)
167 AC_MSG_RESULT($USE_MAINTAINER_MODE)
168 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
169 MAINT=$MAINTAINER_MODE_TRUE
170 AC_SUBST(MAINT)dnl
171]
172)
173
174# Define a conditional.
175
176AC_DEFUN(AM_CONDITIONAL,
177[AC_SUBST($1_TRUE)
178AC_SUBST($1_FALSE)
179if $2; then
180 $1_TRUE=
181 $1_FALSE='#'
182else
183 $1_TRUE='#'
184 $1_FALSE=
185fi])
186