aclocal.m4 revision 54359
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# Like AC_CONFIG_HEADER, but automatically create stamp file.
14
15AC_DEFUN(AM_CONFIG_HEADER,
16[AC_PREREQ([2.12])
17AC_CONFIG_HEADER([$1])
18dnl When config.status generates a header, we must update the stamp-h file.
19dnl This file resides in the same directory as the config header
20dnl that is generated.  We must strip everything past the first ":",
21dnl and everything past the last "/".
22AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
23ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
25<<am_indx=1
26for am_file in <<$1>>; do
27  case " <<$>>CONFIG_HEADERS " in
28  *" <<$>>am_file "*<<)>>
29    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
30    ;;
31  esac
32  am_indx=`expr "<<$>>am_indx" + 1`
33done<<>>dnl>>)
34changequote([,]))])
35
36# Do all the work for Automake.  This macro actually does too much --
37# some checks are only needed if your package does certain things.
38# But this isn't really a big deal.
39
40# serial 1
41
42dnl Usage:
43dnl AM_INIT_AUTOMAKE(package,version, [no-define])
44
45AC_DEFUN(AM_INIT_AUTOMAKE,
46[AC_REQUIRE([AC_PROG_INSTALL])
47dnl We require 2.13 because we rely on SHELL being computed by configure.
48AC_PREREQ([2.13])
49PACKAGE=[$1]
50AC_SUBST(PACKAGE)
51VERSION=[$2]
52AC_SUBST(VERSION)
53dnl test to see if srcdir already configured
54if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
55  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
56fi
57ifelse([$3],,
58AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
59AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
60AC_REQUIRE([AM_SANITY_CHECK])
61AC_REQUIRE([AC_ARG_PROGRAM])
62dnl FIXME This is truly gross.
63missing_dir=`cd $ac_aux_dir && pwd`
64AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
65AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
66AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
67AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
68AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
69dnl We check for tar when the user configures the end package.
70dnl This is sad, since we only need this for "dist".  However,
71dnl there's no other good way to do it.  We prefer GNU tar if
72dnl we can find it.  If we can't find a tar, it doesn't really matter.
73AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
74AMTARFLAGS=
75if test -n "$AMTAR"; then
76  if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
77    dnl We have GNU tar.
78    AMTARFLAGS=o
79  fi
80fi
81AC_SUBST(AMTARFLAGS)
82AC_REQUIRE([AC_PROG_MAKE_SET])])
83
84#
85# Check to make sure that the build environment is sane.
86#
87
88AC_DEFUN(AM_SANITY_CHECK,
89[AC_MSG_CHECKING([whether build environment is sane])
90# Just in case
91sleep 1
92echo timestamp > conftestfile
93# Do `set' in a subshell so we don't clobber the current shell's
94# arguments.  Must try -L first in case configure is actually a
95# symlink; some systems play weird games with the mod time of symlinks
96# (eg FreeBSD returns the mod time of the symlink's containing
97# directory).
98if (
99   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
100   if test "[$]*" = "X"; then
101      # -L didn't work.
102      set X `ls -t $srcdir/configure conftestfile`
103   fi
104   if test "[$]*" != "X $srcdir/configure conftestfile" \
105      && test "[$]*" != "X conftestfile $srcdir/configure"; then
106
107      # If neither matched, then we have a broken ls.  This can happen
108      # if, for instance, CONFIG_SHELL is bash and it inherits a
109      # broken ls alias from the environment.  This has actually
110      # happened.  Such a system could not be considered "sane".
111      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
112alias in your environment])
113   fi
114
115   test "[$]2" = conftestfile
116   )
117then
118   # Ok.
119   :
120else
121   AC_MSG_ERROR([newly created file is older than distributed files!
122Check your system clock])
123fi
124rm -f conftest*
125AC_MSG_RESULT(yes)])
126
127dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
128dnl The program must properly implement --version.
129AC_DEFUN(AM_MISSING_PROG,
130[AC_MSG_CHECKING(for working $2)
131# Run test in a subshell; some versions of sh will print an error if
132# an executable is not found, even if stderr is redirected.
133# Redirect stdin to placate older versions of autoconf.  Sigh.
134if ($2 --version) < /dev/null > /dev/null 2>&1; then
135   $1=$2
136   AC_MSG_RESULT(found)
137else
138   $1="$3/missing $2"
139   AC_MSG_RESULT(missing)
140fi
141AC_SUBST($1)])
142
143
144# serial 1
145
146AC_DEFUN(AM_C_PROTOTYPES,
147[AC_REQUIRE([AM_PROG_CC_STDC])
148AC_REQUIRE([AC_PROG_CPP])
149AC_MSG_CHECKING([for function prototypes])
150if test "$am_cv_prog_cc_stdc" != no; then
151  AC_MSG_RESULT(yes)
152  AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
153  U= ANSI2KNR=
154else
155  AC_MSG_RESULT(no)
156  U=_ ANSI2KNR=./ansi2knr
157  # Ensure some checks needed by ansi2knr itself.
158  AC_HEADER_STDC
159  AC_CHECK_HEADERS(string.h)
160fi
161AC_SUBST(U)dnl
162AC_SUBST(ANSI2KNR)dnl
163])
164
165
166# serial 1
167
168# @defmac AC_PROG_CC_STDC
169# @maindex PROG_CC_STDC
170# @ovindex CC
171# If the C compiler in not in ANSI C mode by default, try to add an option
172# to output variable @code{CC} to make it so.  This macro tries various
173# options that select ANSI C on some system or another.  It considers the
174# compiler to be in ANSI C mode if it handles function prototypes correctly.
175#
176# If you use this macro, you should check after calling it whether the C
177# compiler has been set to accept ANSI C; if not, the shell variable
178# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
179# code in ANSI C, you can make an un-ANSIfied copy of it by using the
180# program @code{ansi2knr}, which comes with Ghostscript.
181# @end defmac
182
183AC_DEFUN(AM_PROG_CC_STDC,
184[AC_REQUIRE([AC_PROG_CC])
185AC_BEFORE([$0], [AC_C_INLINE])
186AC_BEFORE([$0], [AC_C_CONST])
187dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
188dnl a magic option to avoid problems with ANSI preprocessor commands
189dnl like #elif.
190dnl FIXME: can't do this because then AC_AIX won't work due to a
191dnl circular dependency.
192dnl AC_BEFORE([$0], [AC_PROG_CPP])
193AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
194AC_CACHE_VAL(am_cv_prog_cc_stdc,
195[am_cv_prog_cc_stdc=no
196ac_save_CC="$CC"
197# Don't try gcc -ansi; that turns off useful extensions and
198# breaks some systems' header files.
199# AIX			-qlanglvl=ansi
200# Ultrix and OSF/1	-std1
201# HP-UX 10.20 and later	-Ae
202# HP-UX older versions	-Aa -D_HPUX_SOURCE
203# SVR4			-Xc -D__EXTENSIONS__
204for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
205do
206  CC="$ac_save_CC $ac_arg"
207  AC_TRY_COMPILE(
208[#include <stdarg.h>
209#include <stdio.h>
210#include <sys/types.h>
211#include <sys/stat.h>
212/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
213struct buf { int x; };
214FILE * (*rcsopen) (struct buf *, struct stat *, int);
215static char *e (p, i)
216     char **p;
217     int i;
218{
219  return p[i];
220}
221static char *f (char * (*g) (char **, int), char **p, ...)
222{
223  char *s;
224  va_list v;
225  va_start (v,p);
226  s = g (p, va_arg (v,int));
227  va_end (v);
228  return s;
229}
230int test (int i, double x);
231struct s1 {int (*f) (int a);};
232struct s2 {int (*f) (double a);};
233int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
234int argc;
235char **argv;
236], [
237return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
238],
239[am_cv_prog_cc_stdc="$ac_arg"; break])
240done
241CC="$ac_save_CC"
242])
243if test -z "$am_cv_prog_cc_stdc"; then
244  AC_MSG_RESULT([none needed])
245else
246  AC_MSG_RESULT($am_cv_prog_cc_stdc)
247fi
248case "x$am_cv_prog_cc_stdc" in
249  x|xno) ;;
250  *) CC="$CC $am_cv_prog_cc_stdc" ;;
251esac
252])
253
254