2 dnl Copyright 2001-2006 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
21 AC_INIT(ragel/main.cpp)
22 AC_CONFIG_HEADER(ragel/config.h)
24 dnl Set to true if the build system should generate parsers from ragel and kelbt
25 dnl sources. Set to false if generated files are included and not to be built
27 AC_SUBST(BUILD_PARSERS,true)
29 dnl Checks for programs.
34 AC_DEFINE_UNQUOTED(CC,$CC)
35 AC_DEFINE_UNQUOTED(CXX,$CXX)
36 AC_DEFINE_UNQUOTED(AR,$AR)
37 AC_DEFINE_UNQUOTED(RANLIB,$RANLIB)
39 dnl Set test on c++ compiler.
42 dnl Check for definition of MAKE.
45 if test $BUILD_PARSERS = true; then
48 AC_CHECK_PROG(RAGEL, ragel, ragel)
49 if test -z "$RAGEL"; then
51 echo "error: ragel is required to build the parsers"
57 AC_CHECK_PROG(KELBT, kelbt, kelbt)
58 if test -z "$KELBT"; then
60 echo "error: kelbt is required to build the parsers"
67 dnl Check for the D compiler
68 AC_CHECK_PROG(GDC, gdc, gdc)
69 if test -n "$GDC"; then
70 AC_DEFINE_UNQUOTED(GDC,$GDC)
73 dnl Check for the Objective-C compiler
74 AC_MSG_CHECKING([for the Objective-C compiler])
75 cat > conftest.m <<EOF
76 int main() { return 0; }
79 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
80 GOBJC="gcc -x objective-c"
82 AC_DEFINE_UNQUOTED(GOBJC,$GOBJC)
88 dnl Check for the Java compiler.
89 AC_CHECK_PROG(JAVAC, javac, javac)
90 if test -n "$JAVAC"; then
91 AC_DEFINE_UNQUOTED(JAVAC,$JAVAC)
95 AC_CHECK_PROG(TXL, txl, txl)
96 if test -n "$TXL"; then
97 AC_DEFINE_UNQUOTED(TXL,$TXL)
101 AC_CHECK_PROG(RUBY, ruby, ruby)
102 if test -n "$RUBY"; then
103 AC_DEFINE_UNQUOTED(RUBY,$RUBY)
106 dnl Check for the C# compiler.
107 AC_CHECK_PROG(GMCS, gmcs, gmcs)
108 if test -n "$GMCS"; then
109 AC_DEFINE_UNQUOTED(GMCS,$GMCS)
112 dnl write output files
113 AC_OUTPUT(Makefile ragel/Makefile doc/Makefile test/Makefile)
115 echo "configuration of ragel complete"