1 dnl----- Common files distribution --------------------------- *@--NOTICE--@*
3 dnl $Id: aclocal.m4,v 1.1 2000/05/21 11:28:30 mdw Exp $
5 dnl --- *@-AM_INIT_AUTOMAKE-@*
9 dnl Synopsis: AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11 dnl Arguments: PACKAGE = package name
12 dnl VERSION = version number
13 dnl NO-DEFINE = if set, don't define package and version number
15 dnl Use: Do all the work for Automake. This macro actually does too
16 dnl much -- some checks are only needed if your package does
17 dnl certain things. But this isn't really a big deal.
21 AC_DEFUN(AM_INIT_AUTOMAKE,
22 [AC_REQUIRE([AM_PROG_INSTALL])
27 dnl test to see if srcdir already configured
28 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
29 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
32 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
33 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
36 dnl FIXME This is truly gross.
37 missing_dir=`cd $ac_aux_dir && pwd`
38 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
39 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
40 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
41 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
42 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
45 dnl --- *@-AM_PROG_INSTALL-@* ---
47 dnl Author: Franc,ois Pinard
49 dnl Synopsis: AM_PROG_INSTALL
53 dnl Use: Calls `AC_PROG_INSTALL' to find an installer. Then it sets
54 dnl `INSTALL_SCRIPT' to a suitable value if necessary.
58 AC_DEFUN(AM_PROG_INSTALL,
60 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
61 AC_SUBST(INSTALL_SCRIPT)dnl
64 dnl --- *@-AM_MISSING_PROG-@* ---
68 dnl Synopsis: AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
70 dnl Arguments: NAME = variable to set to the file's location
71 dnl PROGRAM = name of program to find
72 dnl DIRECTORY = directory to look in
74 dnl Use: Fakes existence of a useful GNU maintainer tool.
76 AC_DEFUN(AM_MISSING_PROG,
77 [AC_MSG_CHECKING(for working $2)
78 # Run test in a subshell; some versions of sh will print an error if
79 # an executable is not found, even if stderr is redirected.
80 # Redirect stdin to placate older versions of autoconf. Sigh.
81 if ($2 --version) < /dev/null > /dev/null 2>&1; then
86 AC_MSG_RESULT(missing)
90 dnl --- *@-AM_SANITY_CHECK-@*
94 dnl Synopsis: AM_SANITY_CHECK
98 dnl Use: Check for build environment sanity.
100 AC_DEFUN(AM_SANITY_CHECK,
101 [AC_MSG_CHECKING([whether build environment is sane])
104 echo timestamp > conftestfile
105 # Do `set' in a subshell so we don't clobber the current shell's
106 # arguments. Must try -L first in case configure is actually a
107 # symlink; some systems play weird games with the mod time of symlinks
108 # (eg FreeBSD returns the mod time of the symlink's containing
111 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
112 if test "$@" = "X"; then
114 set X `ls -t $srcdir/configure conftestfile`
116 test "[$]2" = conftestfile
122 AC_MSG_ERROR([newly created file is older than distributed files!
123 Check your system clock])
128 dnl --- *@-mdw_GCC_FLAGS-@* ---
130 dnl Author: Mark Wooding
132 dnl Synopsis: mdw_GCC_FLAGS([FLAGS], [CFLAGS], [C++FLAGS])
134 dnl Arguments: FLAGS = GCC compiler flags to add (default is
135 dnl `-pedantic -Wall')
136 dnl CFLAGS = GCC C compiler flags to add (default is empty)
137 dnl C++FLAGS = GCC C++ compiler flags to add (default is
138 dnl `-fhandle-exceptions').
140 dnl Use: If the C compiler is GCC, add the compiler flags.
142 AC_DEFUN(mdw_GCC_FLAGS,
143 [if test "$GCC" = "yes"; then
144 CFLAGS="$CFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
145 CFLAGS="$CFLAGS ifelse([$2], [], [], [$2])"
147 if test "$GXX" = "yes"; then
148 CXXFLAGS="$CXXFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
149 CXXFLAGS="$CXXFLAGS ifelse([$3], [], [-fhandle-exceptions], [$3])"