Merged in the ragel-6.4-am branch.
[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 AM_INIT_AUTOMAKE
23
24 AC_CONFIG_HEADER(ragel/config.h)
25
26 dnl Set to true if the build system should generate parsers from ragel and kelbt
27 dnl sources. Set to false if generated files are included and not to be built
28 dnl (production).
29 build_parsers=yes;
30 AM_CONDITIONAL(BUILD_PARSERS, [test "x$build_parsers" = "xyes"])
31
32 dnl Checks for programs.
33 AC_PROG_CC
34 AC_PROG_CXX
35 AC_CHECK_TOOL(AR, ar)
36 AC_PROG_RANLIB
37 #AC_DEFINE_UNQUOTED(CC,$CC)
38 #AC_DEFINE_UNQUOTED(CXX,$CXX)
39 #AC_DEFINE_UNQUOTED(AR,$AR)
40 #AC_DEFINE_UNQUOTED(RANLIB,$RANLIB)
41
42 dnl Set test on c++ compiler.
43 AC_LANG_CPLUSPLUS
44
45 dnl Check for definition of MAKE.
46 AC_PROG_MAKE_SET
47
48 if test "x$enable_parsers" = "xyes"; then
49
50 dnl Check for Ragel
51 AC_CHECK_PROG(RAGEL, ragel, ragel)
52 if test -z "$RAGEL"; then
53         echo
54         echo "error: ragel is required to build the parsers"
55         echo
56         exit 1
57 fi
58
59 dnl Check for Kelbt
60 AC_CHECK_PROG(KELBT, kelbt, kelbt)
61 if test -z "$KELBT"; then
62         echo
63         echo "error: kelbt is required to build the parsers"
64         echo
65         exit 1
66 fi
67
68 fi # BUILD_PARSERS
69
70 dnl Check for the D compiler
71 AC_CHECK_PROG(GDC, gdc, gdc)
72 #if test -n "$GDC"; then
73 #       AC_DEFINE_UNQUOTED(GDC,$GDC)
74 #fi
75
76 dnl Check for the Objective-C compiler
77 AC_MSG_CHECKING([for the Objective-C compiler])
78 cat > conftest.m <<EOF
79 int main() { return 0; }
80 EOF
81 GOBJC=""
82 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
83         GOBJC="gcc -x objective-c"
84         AC_MSG_RESULT([yes])
85 #       AC_DEFINE_UNQUOTED(GOBJC,$GOBJC)
86 else
87         AC_MSG_RESULT([no])
88 fi
89 AC_SUBST(GOBJC)
90
91 dnl Check for the Java compiler.
92 AC_CHECK_PROG(JAVAC, javac, javac)
93 #if test -n "$JAVAC"; then
94 #       AC_DEFINE_UNQUOTED(JAVAC,$JAVAC)
95 #fi
96
97 dnl Check for TXL.
98 AC_CHECK_PROG(TXL, txl, txl)
99 #if test -n "$TXL"; then
100 #       AC_DEFINE_UNQUOTED(TXL,$TXL)
101 #fi
102
103 dnl Check for Ruby.
104 AC_CHECK_PROG(RUBY, ruby, ruby)
105 #if test -n "$RUBY"; then
106 #       AC_DEFINE_UNQUOTED(RUBY,$RUBY)
107 #fi
108
109 dnl Check for the C# compiler.
110 AC_CHECK_PROG(GMCS, gmcs, gmcs)
111 #if test -n "$GMCS"; then
112 #       AC_DEFINE_UNQUOTED(GMCS,$GMCS)
113 #fi
114
115 dnl write output files
116 AC_OUTPUT(Makefile ragel/Makefile aapl/Makefile doc/Makefile test/Makefile)
117
118 echo "configuration of ragel complete"