aclocal.m4 revision 54359
154359Srobertodnl aclocal.m4 generated automatically by aclocal 1.4
254359Sroberto
354359Srobertodnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
454359Srobertodnl This file is free software; the Free Software Foundation
554359Srobertodnl gives unlimited permission to copy and/or distribute it,
654359Srobertodnl with or without modifications, as long as this notice is preserved.
754359Sroberto
854359Srobertodnl This program is distributed in the hope that it will be useful,
954359Srobertodnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1054359Srobertodnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1154359Srobertodnl PARTICULAR PURPOSE.
1254359Sroberto
1354359Sroberto# Like AC_CONFIG_HEADER, but automatically create stamp file.
1454359Sroberto
1554359SrobertoAC_DEFUN(AM_CONFIG_HEADER,
1654359Sroberto[AC_PREREQ([2.12])
1754359SrobertoAC_CONFIG_HEADER([$1])
1854359Srobertodnl When config.status generates a header, we must update the stamp-h file.
1954359Srobertodnl This file resides in the same directory as the config header
2054359Srobertodnl that is generated.  We must strip everything past the first ":",
2154359Srobertodnl and everything past the last "/".
2254359SrobertoAC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2354359Srobertoifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2454359Sroberto<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2554359Sroberto<<am_indx=1
2654359Srobertofor am_file in <<$1>>; do
2754359Sroberto  case " <<$>>CONFIG_HEADERS " in
2854359Sroberto  *" <<$>>am_file "*<<)>>
2954359Sroberto    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
3054359Sroberto    ;;
3154359Sroberto  esac
3254359Sroberto  am_indx=`expr "<<$>>am_indx" + 1`
3354359Srobertodone<<>>dnl>>)
3454359Srobertochangequote([,]))])
3554359Sroberto
3654359Sroberto# Do all the work for Automake.  This macro actually does too much --
3754359Sroberto# some checks are only needed if your package does certain things.
3854359Sroberto# But this isn't really a big deal.
3954359Sroberto
4054359Sroberto# serial 1
4154359Sroberto
4254359Srobertodnl Usage:
4354359Srobertodnl AM_INIT_AUTOMAKE(package,version, [no-define])
4454359Sroberto
4554359SrobertoAC_DEFUN(AM_INIT_AUTOMAKE,
4654359Sroberto[AC_REQUIRE([AC_PROG_INSTALL])
4754359Srobertodnl We require 2.13 because we rely on SHELL being computed by configure.
4854359SrobertoAC_PREREQ([2.13])
4954359SrobertoPACKAGE=[$1]
5054359SrobertoAC_SUBST(PACKAGE)
5154359SrobertoVERSION=[$2]
5254359SrobertoAC_SUBST(VERSION)
5354359Srobertodnl test to see if srcdir already configured
5454359Srobertoif test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
5554359Sroberto  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
5654359Srobertofi
5754359Srobertoifelse([$3],,
5854359SrobertoAC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
5954359SrobertoAC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
6054359SrobertoAC_REQUIRE([AM_SANITY_CHECK])
6154359SrobertoAC_REQUIRE([AC_ARG_PROGRAM])
6254359Srobertodnl FIXME This is truly gross.
6354359Srobertomissing_dir=`cd $ac_aux_dir && pwd`
6454359SrobertoAM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
6554359SrobertoAM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
6654359SrobertoAM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
6754359SrobertoAM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
6854359SrobertoAM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
6954359Srobertodnl We check for tar when the user configures the end package.
7054359Srobertodnl This is sad, since we only need this for "dist".  However,
7154359Srobertodnl there's no other good way to do it.  We prefer GNU tar if
7254359Srobertodnl we can find it.  If we can't find a tar, it doesn't really matter.
7354359SrobertoAC_CHECK_PROGS(AMTAR, gnutar gtar tar)
7454359SrobertoAMTARFLAGS=
7554359Srobertoif test -n "$AMTAR"; then
7654359Sroberto  if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
7754359Sroberto    dnl We have GNU tar.
7854359Sroberto    AMTARFLAGS=o
7954359Sroberto  fi
8054359Srobertofi
8154359SrobertoAC_SUBST(AMTARFLAGS)
8254359SrobertoAC_REQUIRE([AC_PROG_MAKE_SET])])
8354359Sroberto
8454359Sroberto#
8554359Sroberto# Check to make sure that the build environment is sane.
8654359Sroberto#
8754359Sroberto
8854359SrobertoAC_DEFUN(AM_SANITY_CHECK,
8954359Sroberto[AC_MSG_CHECKING([whether build environment is sane])
9054359Sroberto# Just in case
9154359Srobertosleep 1
9254359Srobertoecho timestamp > conftestfile
9354359Sroberto# Do `set' in a subshell so we don't clobber the current shell's
9454359Sroberto# arguments.  Must try -L first in case configure is actually a
9554359Sroberto# symlink; some systems play weird games with the mod time of symlinks
9654359Sroberto# (eg FreeBSD returns the mod time of the symlink's containing
9754359Sroberto# directory).
9854359Srobertoif (
9954359Sroberto   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
10054359Sroberto   if test "[$]*" = "X"; then
10154359Sroberto      # -L didn't work.
10254359Sroberto      set X `ls -t $srcdir/configure conftestfile`
10354359Sroberto   fi
10454359Sroberto   if test "[$]*" != "X $srcdir/configure conftestfile" \
10554359Sroberto      && test "[$]*" != "X conftestfile $srcdir/configure"; then
10654359Sroberto
10754359Sroberto      # If neither matched, then we have a broken ls.  This can happen
10854359Sroberto      # if, for instance, CONFIG_SHELL is bash and it inherits a
10954359Sroberto      # broken ls alias from the environment.  This has actually
11054359Sroberto      # happened.  Such a system could not be considered "sane".
11154359Sroberto      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
11254359Srobertoalias in your environment])
11354359Sroberto   fi
11454359Sroberto
11554359Sroberto   test "[$]2" = conftestfile
11654359Sroberto   )
11754359Srobertothen
11854359Sroberto   # Ok.
11954359Sroberto   :
12054359Srobertoelse
12154359Sroberto   AC_MSG_ERROR([newly created file is older than distributed files!
12254359SrobertoCheck your system clock])
12354359Srobertofi
12454359Srobertorm -f conftest*
12554359SrobertoAC_MSG_RESULT(yes)])
12654359Sroberto
12754359Srobertodnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
12854359Srobertodnl The program must properly implement --version.
12954359SrobertoAC_DEFUN(AM_MISSING_PROG,
13054359Sroberto[AC_MSG_CHECKING(for working $2)
13154359Sroberto# Run test in a subshell; some versions of sh will print an error if
13254359Sroberto# an executable is not found, even if stderr is redirected.
13354359Sroberto# Redirect stdin to placate older versions of autoconf.  Sigh.
13454359Srobertoif ($2 --version) < /dev/null > /dev/null 2>&1; then
13554359Sroberto   $1=$2
13654359Sroberto   AC_MSG_RESULT(found)
13754359Srobertoelse
13854359Sroberto   $1="$3/missing $2"
13954359Sroberto   AC_MSG_RESULT(missing)
14054359Srobertofi
14154359SrobertoAC_SUBST($1)])
14254359Sroberto
14354359Sroberto
14454359Sroberto# serial 1
14554359Sroberto
14654359SrobertoAC_DEFUN(AM_C_PROTOTYPES,
14754359Sroberto[AC_REQUIRE([AM_PROG_CC_STDC])
14854359SrobertoAC_REQUIRE([AC_PROG_CPP])
14954359SrobertoAC_MSG_CHECKING([for function prototypes])
15054359Srobertoif test "$am_cv_prog_cc_stdc" != no; then
15154359Sroberto  AC_MSG_RESULT(yes)
15254359Sroberto  AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
15354359Sroberto  U= ANSI2KNR=
15454359Srobertoelse
15554359Sroberto  AC_MSG_RESULT(no)
15654359Sroberto  U=_ ANSI2KNR=./ansi2knr
15754359Sroberto  # Ensure some checks needed by ansi2knr itself.
15854359Sroberto  AC_HEADER_STDC
15954359Sroberto  AC_CHECK_HEADERS(string.h)
16054359Srobertofi
16154359SrobertoAC_SUBST(U)dnl
16254359SrobertoAC_SUBST(ANSI2KNR)dnl
16354359Sroberto])
16454359Sroberto
16554359Sroberto
16654359Sroberto# serial 1
16754359Sroberto
16854359Sroberto# @defmac AC_PROG_CC_STDC
16954359Sroberto# @maindex PROG_CC_STDC
17054359Sroberto# @ovindex CC
17154359Sroberto# If the C compiler in not in ANSI C mode by default, try to add an option
17254359Sroberto# to output variable @code{CC} to make it so.  This macro tries various
17354359Sroberto# options that select ANSI C on some system or another.  It considers the
17454359Sroberto# compiler to be in ANSI C mode if it handles function prototypes correctly.
17554359Sroberto#
17654359Sroberto# If you use this macro, you should check after calling it whether the C
17754359Sroberto# compiler has been set to accept ANSI C; if not, the shell variable
17854359Sroberto# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
17954359Sroberto# code in ANSI C, you can make an un-ANSIfied copy of it by using the
18054359Sroberto# program @code{ansi2knr}, which comes with Ghostscript.
18154359Sroberto# @end defmac
18254359Sroberto
18354359SrobertoAC_DEFUN(AM_PROG_CC_STDC,
18454359Sroberto[AC_REQUIRE([AC_PROG_CC])
18554359SrobertoAC_BEFORE([$0], [AC_C_INLINE])
18654359SrobertoAC_BEFORE([$0], [AC_C_CONST])
18754359Srobertodnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
18854359Srobertodnl a magic option to avoid problems with ANSI preprocessor commands
18954359Srobertodnl like #elif.
19054359Srobertodnl FIXME: can't do this because then AC_AIX won't work due to a
19154359Srobertodnl circular dependency.
19254359Srobertodnl AC_BEFORE([$0], [AC_PROG_CPP])
19354359SrobertoAC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
19454359SrobertoAC_CACHE_VAL(am_cv_prog_cc_stdc,
19554359Sroberto[am_cv_prog_cc_stdc=no
19654359Srobertoac_save_CC="$CC"
19754359Sroberto# Don't try gcc -ansi; that turns off useful extensions and
19854359Sroberto# breaks some systems' header files.
19954359Sroberto# AIX			-qlanglvl=ansi
20054359Sroberto# Ultrix and OSF/1	-std1
20154359Sroberto# HP-UX 10.20 and later	-Ae
20254359Sroberto# HP-UX older versions	-Aa -D_HPUX_SOURCE
20354359Sroberto# SVR4			-Xc -D__EXTENSIONS__
20454359Srobertofor ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
20554359Srobertodo
20654359Sroberto  CC="$ac_save_CC $ac_arg"
20754359Sroberto  AC_TRY_COMPILE(
20854359Sroberto[#include <stdarg.h>
20954359Sroberto#include <stdio.h>
21054359Sroberto#include <sys/types.h>
21154359Sroberto#include <sys/stat.h>
21254359Sroberto/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
21354359Srobertostruct buf { int x; };
21454359SrobertoFILE * (*rcsopen) (struct buf *, struct stat *, int);
21554359Srobertostatic char *e (p, i)
21654359Sroberto     char **p;
21754359Sroberto     int i;
21854359Sroberto{
21954359Sroberto  return p[i];
22054359Sroberto}
22154359Srobertostatic char *f (char * (*g) (char **, int), char **p, ...)
22254359Sroberto{
22354359Sroberto  char *s;
22454359Sroberto  va_list v;
22554359Sroberto  va_start (v,p);
22654359Sroberto  s = g (p, va_arg (v,int));
22754359Sroberto  va_end (v);
22854359Sroberto  return s;
22954359Sroberto}
23054359Srobertoint test (int i, double x);
23154359Srobertostruct s1 {int (*f) (int a);};
23254359Srobertostruct s2 {int (*f) (double a);};
23354359Srobertoint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
23454359Srobertoint argc;
23554359Srobertochar **argv;
23654359Sroberto], [
23754359Srobertoreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
23854359Sroberto],
23954359Sroberto[am_cv_prog_cc_stdc="$ac_arg"; break])
24054359Srobertodone
24154359SrobertoCC="$ac_save_CC"
24254359Sroberto])
24354359Srobertoif test -z "$am_cv_prog_cc_stdc"; then
24454359Sroberto  AC_MSG_RESULT([none needed])
24554359Srobertoelse
24654359Sroberto  AC_MSG_RESULT($am_cv_prog_cc_stdc)
24754359Srobertofi
24854359Srobertocase "x$am_cv_prog_cc_stdc" in
24954359Sroberto  x|xno) ;;
25054359Sroberto  *) CC="$CC $am_cv_prog_cc_stdc" ;;
25154359Srobertoesac
25254359Sroberto])
25354359Sroberto
254