dnl dnl Copyright 2001-2006 Adrian Thurston dnl dnl This file is part of Ragel. dnl dnl Ragel is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl Ragel is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with Ragel; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA AC_INIT(ragel/main.cpp) AC_CONFIG_HEADER(common/config.h) dnl Set to true if build system should generate parsers from ragel, kelbt, and dnl gperf sources. Set to false if generated files are included and not to be dnl built (production). AC_SUBST(BUILD_PARSERS,true) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_CHECK_TOOL(AR, ar) AC_PROG_RANLIB AC_DEFINE_UNQUOTED(CC,$CC) AC_DEFINE_UNQUOTED(CXX,$CXX) AC_DEFINE_UNQUOTED(AR,$AR) AC_DEFINE_UNQUOTED(RANLIB,$RANLIB) dnl Set test on c++ compiler. AC_LANG_CPLUSPLUS dnl Check for definition of MAKE. AC_PROG_MAKE_SET if test $BUILD_PARSERS = true; then dnl Check for Ragel AC_CHECK_PROG(RAGEL, ragel, ragel) if test -z "$RAGEL"; then echo echo "error: ragel is required to build the parsers" echo exit 1 fi dnl Check for gperf AC_CHECK_PROG(GPERF, gperf, gperf) if test -z "$GPERF"; then echo echo "error: gperf is required to build the parsers" echo exit 1 fi dnl Check for Kelbt AC_CHECK_PROG(KELBT, kelbt, kelbt) if test -z "$KELBT"; then echo echo "error: kelbt is required to build the parsers" echo exit 1 fi fi # BUILD_PARSERS dnl Check for the D compiler AC_CHECK_PROG(GDC, gdc, gdc) if test -n "$GDC"; then AC_DEFINE_UNQUOTED(GDC,$GDC) fi dnl Check for the Objective-C compiler AC_MSG_CHECKING([for the Objective-C compiler]) cat > conftest.m </dev/null; then GOBJC="gcc -x objective-c" AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(GOBJC,$GOBJC) else AC_MSG_RESULT([no]) fi AC_SUBST(GOBJC) dnl Check for the Java compiler. AC_CHECK_PROG(JAVAC, javac, javac) if test -n "$JAVAC"; then AC_DEFINE_UNQUOTED(JAVAC,$JAVAC) fi dnl Check for TXL. AC_CHECK_PROG(TXL, txl, txl) if test -n "$TXL"; then AC_DEFINE_UNQUOTED(TXL,$TXL) fi dnl Check for Ruby. AC_CHECK_PROG(RUBY, ruby, ruby) if test -n "$RUBY"; then AC_DEFINE_UNQUOTED(RUBY,$RUBY) fi dnl Check for the C# compiler. AC_CHECK_PROG(GMCS, gmcs, gmcs) if test -n "$GMCS"; then AC_DEFINE_UNQUOTED(GMCS,$GMCS) fi dnl write output files 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) echo "configuration of ragel complete"