$(SUBDIRS) needs to go inside DIST_SUBDIRS.
[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.5)
22 PUBDATE="May 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 dnl Set to true if the manual should be built.
35 build_manual=yes;
36 AM_CONDITIONAL(BUILD_MANUAL, [test "x$build_manual" = "xyes"])
37
38 dnl Checks for programs.
39 AC_PROG_CC
40 AC_PROG_CXX
41 AC_CHECK_TOOL(AR, ar)
42 AC_PROG_RANLIB
43
44 # Default flags.
45 CXXFLAGS="-g"
46
47 dnl Set test on c++ compiler.
48 AC_LANG_CPLUSPLUS
49
50 dnl Check for definition of MAKE.
51 AC_PROG_MAKE_SET
52
53 if test "x$build_parsers" = "xyes"; then
54
55 dnl Check for Ragel
56 AC_CHECK_PROG(RAGEL, ragel, ragel)
57 if test -z "$RAGEL"; then
58         echo
59         echo "error: ragel is required to build the parsers"
60         echo
61         exit 1
62 fi
63
64 dnl Check for Kelbt
65 AC_CHECK_PROG(KELBT, kelbt, kelbt)
66 if test -z "$KELBT"; then
67         echo
68         echo "error: kelbt is required to build the parsers"
69         echo
70         exit 1
71 fi
72
73 fi # BUILD_PARSERS
74
75 dnl Check for the D compiler
76 AC_CHECK_PROG(GDC, gdc, gdc)
77
78 dnl Check for the Objective-C compiler
79 AC_MSG_CHECKING([for the Objective-C compiler])
80 cat > conftest.m <<EOF
81 int main() { return 0; }
82 EOF
83 GOBJC=""
84 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
85         GOBJC="gcc -x objective-c"
86         AC_MSG_RESULT([yes])
87 else
88         AC_MSG_RESULT([no])
89 fi
90 AC_SUBST(GOBJC)
91
92 dnl Check for the Java compiler.
93 AC_CHECK_PROG(JAVAC, javac, javac)
94
95 dnl Check for TXL.
96 AC_CHECK_PROG(TXL, txl, txl)
97
98 dnl Check for Ruby.
99 AC_CHECK_PROG(RUBY, ruby, ruby)
100
101 dnl Check for the C# compiler.
102 AC_CHECK_PROG(GMCS, gmcs, gmcs)
103
104 dnl write output files
105 AC_OUTPUT(
106         [
107                 Makefile ragel/Makefile aapl/Makefile 
108                 doc/Makefile doc/ragel.1
109                 contrib/Makefile
110                 test/Makefile test/runtests
111                 examples/Makefile
112         ],
113         [chmod +x test/runtests]
114 )
115
116 echo "configuration of ragel complete"