2 dnl Copyright 2001-2006 Adrian Thurston <thurston@cs.queensu.ca>
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(common/config.h)
24 dnl Set to true if build system should generate parsers from ragel, kelbt, and
25 dnl gperf sources. Set to false if generated files are included and not to be
26 dnl built (production).
27 AC_SUBST(BUILD_PARSERS,true)
29 dnl Checks for programs.
31 AC_DEFINE_UNQUOTED(CC,$CC)
33 dnl Checks for programs.
35 AC_DEFINE_UNQUOTED(CXX,$CXX)
37 dnl Set test on c++ compiler.
40 dnl Check for definition of MAKE.
43 if test $BUILD_PARSERS = true; then
46 AC_CHECK_PROG(RAGEL, ragel, ragel)
47 if test -z "$RAGEL"; then
49 echo "error: ragel is required to build the parsers"
55 AC_CHECK_PROG(GPERF, gperf, gperf)
56 if test -z "$GPERF"; then
58 echo "error: gperf is required to build the parsers"
64 AC_CHECK_PROG(KELBT, kelbt, kelbt)
65 if test -z "$KELBT"; then
67 echo "error: kelbt is required to build the parsers"
74 dnl Check for the D compiler
75 AC_CHECK_PROG(GDC, gdc, gdc)
76 if test -n "$GDC"; then
77 AC_DEFINE_UNQUOTED(GDC,$GDC)
80 dnl Check for the Objective-C compiler
81 AC_MSG_CHECKING([for the Objective-C compiler])
82 cat > conftest.m <<EOF
83 int main() { return 0; }
86 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
87 GOBJC="gcc -x objective-c"
89 AC_DEFINE_UNQUOTED(GOBJC,$GOBJC)
95 dnl Check for the Java compiler.
96 AC_CHECK_PROG(JAVAC, javac, javac)
97 if test -n "$JAVAC"; then
98 AC_DEFINE_UNQUOTED(JAVAC,$JAVAC)
102 AC_CHECK_PROG(TXL, txl, txl)
103 if test -n "$TXL"; then
104 AC_DEFINE_UNQUOTED(TXL,$TXL)
108 AC_CHECK_PROG(RUBY, ruby, ruby)
109 if test -n "$RUBY"; then
110 AC_DEFINE_UNQUOTED(RUBY,$RUBY)
113 dnl write output files
114 AC_OUTPUT(Makefile common/Makefile ragel/Makefile redfsm/Makefile rlcodegen/Makefile rlgen-java/Makefile rlgen-ruby/Makefile doc/Makefile test/Makefile)
116 echo "configuration of ragel complete"