chiark / gitweb /
Fix licence text.
[storin] / aclocal.m4
CommitLineData
e6e0e332
MW
1dnl----- Common files distribution --------------------------- *@--NOTICE--@*
2dnl
3dnl $Id: aclocal.m4,v 1.1 2000/05/21 11:28:30 mdw Exp $
4
5dnl --- *@-AM_INIT_AUTOMAKE-@*
6dnl
7dnl Author: Unknown
8dnl
9dnl Synopsis: AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
10dnl
11dnl Arguments: PACKAGE = package name
12dnl VERSION = version number
13dnl NO-DEFINE = if set, don't define package and version number
14dnl
15dnl Use: Do all the work for Automake. This macro actually does too
16dnl much -- some checks are only needed if your package does
17dnl certain things. But this isn't really a big deal.
18
19# serial 1
20
21AC_DEFUN(AM_INIT_AUTOMAKE,
22[AC_REQUIRE([AM_PROG_INSTALL])
23PACKAGE=[$1]
24AC_SUBST(PACKAGE)
25VERSION=[$2]
26AC_SUBST(VERSION)
27dnl test to see if srcdir already configured
28if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
29 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
30fi
31ifelse([$3],,
32AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
33AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
34AM_SANITY_CHECK
35AC_ARG_PROGRAM
36dnl FIXME This is truly gross.
37missing_dir=`cd $ac_aux_dir && pwd`
38AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
39AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
40AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
41AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
42AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
43AC_PROG_MAKE_SET])
44
45dnl --- *@-AM_PROG_INSTALL-@* ---
46dnl
47dnl Author: Franc,ois Pinard
48dnl
49dnl Synopsis: AM_PROG_INSTALL
50dnl
51dnl Arguments: ---
52dnl
53dnl Use: Calls `AC_PROG_INSTALL' to find an installer. Then it sets
54dnl `INSTALL_SCRIPT' to a suitable value if necessary.
55
56# serial 1
57
58AC_DEFUN(AM_PROG_INSTALL,
59[AC_PROG_INSTALL
60test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
61AC_SUBST(INSTALL_SCRIPT)dnl
62])
63
64dnl --- *@-AM_MISSING_PROG-@* ---
65dnl
66dnl Author: Unknown
67dnl
68dnl Synopsis: AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
69dnl
70dnl Arguments: NAME = variable to set to the file's location
71dnl PROGRAM = name of program to find
72dnl DIRECTORY = directory to look in
73dnl
74dnl Use: Fakes existence of a useful GNU maintainer tool.
75
76AC_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.
81if ($2 --version) < /dev/null > /dev/null 2>&1; then
82 $1=$2
83 AC_MSG_RESULT(found)
84else
85 $1="$3/missing $2"
86 AC_MSG_RESULT(missing)
87fi
88AC_SUBST($1)])
89
90dnl --- *@-AM_SANITY_CHECK-@*
91dnl
92dnl Author: Unknown
93dnl
94dnl Synopsis: AM_SANITY_CHECK
95dnl
96dnl Arguments: ---
97dnl
98dnl Use: Check for build environment sanity.
99
100AC_DEFUN(AM_SANITY_CHECK,
101[AC_MSG_CHECKING([whether build environment is sane])
102# Just in case
103sleep 1
104echo 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
109# directory).
110if (
111 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
112 if test "$@" = "X"; then
113 # -L didn't work.
114 set X `ls -t $srcdir/configure conftestfile`
115 fi
116 test "[$]2" = conftestfile
117 )
118then
119 # Ok.
120 :
121else
122 AC_MSG_ERROR([newly created file is older than distributed files!
123Check your system clock])
124fi
125rm -f conftest*
126AC_MSG_RESULT(yes)])
127
128dnl --- *@-mdw_GCC_FLAGS-@* ---
129dnl
130dnl Author: Mark Wooding
131dnl
132dnl Synopsis: mdw_GCC_FLAGS([FLAGS], [CFLAGS], [C++FLAGS])
133dnl
134dnl Arguments: FLAGS = GCC compiler flags to add (default is
135dnl `-pedantic -Wall')
136dnl CFLAGS = GCC C compiler flags to add (default is empty)
137dnl C++FLAGS = GCC C++ compiler flags to add (default is
138dnl `-fhandle-exceptions').
139dnl
140dnl Use: If the C compiler is GCC, add the compiler flags.
141
142AC_DEFUN(mdw_GCC_FLAGS,
143[if test "$GCC" = "yes"; then
144 CFLAGS="$CFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
145 CFLAGS="$CFLAGS ifelse([$2], [], [], [$2])"
146fi
147if test "$GXX" = "yes"; then
148 CXXFLAGS="$CXXFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
149 CXXFLAGS="$CXXFLAGS ifelse([$3], [], [-fhandle-exceptions], [$3])"
150fi])
151