2 dnl Copyright 2001-2009 Adrian Thurston <thurston@complang.org>
5 dnl This file is part of Ragel.
7 dnl Ragel is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
12 dnl Ragel is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with Ragel; if not, write to the Free Software
19 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 AC_CONFIG_HEADER(ragel/config.h)
28 dnl Set to true if the build system should generate parsers from ragel and kelbt
29 dnl sources. Set to false if generated files are included and not to be built
32 AM_CONDITIONAL(BUILD_PARSERS, [test "x$build_parsers" = "xyes"])
34 dnl Set to true if the manual should be built.
36 AM_CONDITIONAL(BUILD_MANUAL, [test "x$build_manual" = "xyes"])
38 dnl Checks for programs.
44 dnl Set test on c++ compiler.
47 dnl Check for definition of MAKE.
50 if test "x$build_parsers" = "xyes"; then
53 AC_CHECK_PROG(RAGEL, ragel, ragel)
54 if test -z "$RAGEL"; then
56 echo "error: ragel is required to build the parsers"
62 AC_CHECK_PROG(KELBT, kelbt, kelbt)
63 if test -z "$KELBT"; then
65 echo "error: kelbt is required to build the parsers"
72 dnl Check for the D compiler
73 AC_CHECK_PROG(GDC, gdc, gdc)
75 dnl Check for the Objective-C compiler
76 AC_MSG_CHECKING([for the Objective-C compiler])
77 cat > conftest.m <<EOF
78 int main() { return 0; }
81 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
82 GOBJC="gcc -x objective-c"
89 dnl Check for the Java compiler.
90 AC_CHECK_PROG(JAVAC, javac, javac)
93 AC_CHECK_PROG(TXL, txl, txl)
96 AC_CHECK_PROG(RUBY, ruby, ruby)
98 dnl Check for the C# compiler.
99 AC_CHECK_PROG(GMCS, gmcs, gmcs)
101 dnl write output files
104 Makefile ragel/Makefile aapl/Makefile
105 doc/Makefile doc/ragel.1
107 test/Makefile test/runtests
109 [chmod +x test/runtests]
112 echo "configuration of ragel complete"