removed unused function
[external/ragel.git] / configure.in
1 dnl 
2 dnl   Copyright 2001-2006 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/main.cpp)
22 AC_CONFIG_HEADER(common/config.h)
23
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)
28
29 dnl Checks for programs.
30 AC_PROG_CC
31 AC_PROG_CXX
32 AC_CHECK_TOOL(AR, ar)
33 AC_PROG_RANLIB
34 AC_DEFINE_UNQUOTED(CC,$CC)
35 AC_DEFINE_UNQUOTED(CXX,$CXX)
36 AC_DEFINE_UNQUOTED(AR,$AR)
37 AC_DEFINE_UNQUOTED(RANLIB,$RANLIB)
38
39 dnl Set test on c++ compiler.
40 AC_LANG_CPLUSPLUS
41
42 dnl Check for definition of MAKE.
43 AC_PROG_MAKE_SET
44
45 if test $BUILD_PARSERS = true; then
46
47 dnl Check for Ragel
48 AC_CHECK_PROG(RAGEL, ragel, ragel)
49 if test -z "$RAGEL"; then
50         echo
51         echo "error: ragel is required to build the parsers"
52         echo
53         exit 1
54 fi
55
56 dnl Check for gperf
57 AC_CHECK_PROG(GPERF, gperf, gperf)
58 if test -z "$GPERF"; then
59         echo
60         echo "error: gperf is required to build the parsers"
61         echo
62         exit 1
63 fi
64
65 dnl Check for Kelbt
66 AC_CHECK_PROG(KELBT, kelbt, kelbt)
67 if test -z "$KELBT"; then
68         echo
69         echo "error: kelbt is required to build the parsers"
70         echo
71         exit 1
72 fi
73
74 fi # BUILD_PARSERS
75
76 dnl Check for the D compiler
77 AC_CHECK_PROG(GDC, gdc, gdc)
78 if test -n "$GDC"; then
79         AC_DEFINE_UNQUOTED(GDC,$GDC)
80 fi
81
82 dnl Check for the Objective-C compiler
83 AC_MSG_CHECKING([for the Objective-C compiler])
84 cat > conftest.m <<EOF
85 int main() { return 0; }
86 EOF
87 GOBJC=""
88 if gcc -x objective-c conftest.m -o conftest.bin 2>/dev/null; then
89         GOBJC="gcc -x objective-c"
90         AC_MSG_RESULT([yes])
91         AC_DEFINE_UNQUOTED(GOBJC,$GOBJC)
92 else
93         AC_MSG_RESULT([no])
94 fi
95 AC_SUBST(GOBJC)
96
97 dnl Check for the Java compiler.
98 AC_CHECK_PROG(JAVAC, javac, javac)
99 if test -n "$JAVAC"; then
100         AC_DEFINE_UNQUOTED(JAVAC,$JAVAC)
101 fi
102
103 dnl Check for TXL.
104 AC_CHECK_PROG(TXL, txl, txl)
105 if test -n "$TXL"; then
106         AC_DEFINE_UNQUOTED(TXL,$TXL)
107 fi
108
109 dnl Check for Ruby.
110 AC_CHECK_PROG(RUBY, ruby, ruby)
111 if test -n "$RUBY"; then
112         AC_DEFINE_UNQUOTED(RUBY,$RUBY)
113 fi
114
115 dnl Check for the C# compiler.
116 AC_CHECK_PROG(GMCS, gmcs, gmcs)
117 if test -n "$GMCS"; then
118         AC_DEFINE_UNQUOTED(GMCS,$GMCS)
119 fi
120
121 dnl write output files
122 AC_OUTPUT(Makefile common/Makefile ragel/Makefile redfsm/Makefile rlgen-cd/Makefile rlgen-java/Makefile rlgen-ruby/Makefile rlgen-dot/Makefile rlgen-csharp/Makefile doc/Makefile test/Makefile)
123
124 echo "configuration of ragel complete"