Added doc to automake control. Using another conditional to control the
[external/ragel.git] / configure.in
1 dnl 
2 dnl   Copyright 2001-2009 Adrian Thurston <thurston@complang.org>
3 dnl
4
5 dnl   This file is part of Ragel.
6 dnl  
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.
11 dnl   
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.
16 dnl   
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 
20   
21 AC_INIT(ragel, 6.4)
22 PUBDATE="March 2009"
23
24 AM_INIT_AUTOMAKE
25 AC_SUBST(PUBDATE)
26 AC_CONFIG_HEADER(ragel/config.h)
27
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
30 dnl (production).
31 build_parsers=yes;
32 AM_CONDITIONAL(BUILD_PARSERS, [test "x$build_parsers" = "xyes"])
33
34 build_manual=yes;
35 AM_CONDITIONAL(BUILD_MANUAL, [test "x$build_manual" = "xyes"])
36
37 dnl Checks for programs.
38 AC_PROG_CC
39 AC_PROG_CXX
40 AC_CHECK_TOOL(AR, ar)
41 AC_PROG_RANLIB
42
43 dnl Set test on c++ compiler.
44 AC_LANG_CPLUSPLUS
45
46 dnl Check for definition of MAKE.
47 AC_PROG_MAKE_SET
48
49 if test "x$enable_parsers" = "xyes"; then
50
51 dnl Check for Ragel
52 AC_CHECK_PROG(RAGEL, ragel, ragel)
53 if test -z "$RAGEL"; then
54         echo
55         echo "error: ragel is required to build the parsers"
56         echo
57         exit 1
58 fi
59
60 dnl Check for Kelbt
61 AC_CHECK_PROG(KELBT, kelbt, kelbt)
62 if test -z "$KELBT"; then
63         echo
64         echo "error: kelbt is required to build the parsers"
65         echo
66         exit 1
67 fi
68
69 fi # BUILD_PARSERS
70
71 dnl Check for the D compiler
72 AC_CHECK_PROG(GDC, gdc, gdc)
73
74 dnl Check for the Objective-C compiler
75 AC_MSG_CHECKING([for the Objective-C compiler])
76 cat > conftest.m <<EOF
77 int main() { return 0; }
78 EOF
79 GOBJC=""
80 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
81         GOBJC="gcc -x objective-c"
82         AC_MSG_RESULT([yes])
83 else
84         AC_MSG_RESULT([no])
85 fi
86 AC_SUBST(GOBJC)
87
88 dnl Check for the Java compiler.
89 AC_CHECK_PROG(JAVAC, javac, javac)
90
91 dnl Check for TXL.
92 AC_CHECK_PROG(TXL, txl, txl)
93
94 dnl Check for Ruby.
95 AC_CHECK_PROG(RUBY, ruby, ruby)
96
97 dnl Check for the C# compiler.
98 AC_CHECK_PROG(GMCS, gmcs, gmcs)
99
100 dnl write output files
101 AC_OUTPUT(
102         [
103                 Makefile ragel/Makefile aapl/Makefile doc/Makefile test/Makefile test/runtests
104                 doc/ragel.1
105         ],
106         [chmod +x test/runtests]
107 )
108
109 echo "configuration of ragel complete"