dnl dnl Copyright 2006-2012 Adrian Thurston dnl dnl This file is part of Colm. dnl dnl Colm 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 Colm 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 Colm; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA AC_INIT(colm, 0.6) PUBDATE="June 2012" AM_INIT_AUTOMAKE([foreign]) AC_SUBST(PUBDATE) AC_CONFIG_HEADER([src/config.h src/defs.h]) dnl Choose defaults for the build_parsers and build_manual vars. If the dist dnl file is present in the root then default to no, otherwise go for it. AC_CHECK_FILES( [$srcdir/DIST], [. $srcdir/DIST;], [build_parsers=yes; build_manual=yes; ] ) dnl Set to true if the build system should generate parsers from ragel and kelbt dnl sources. Set to false if generated files are included and not to be built dnl (production). AM_CONDITIONAL(BUILD_PARSERS, [test "x$build_parsers" = "xyes"]) dnl Set to true if the manual should be built. AM_CONDITIONAL(BUILD_MANUAL, [test "x$build_manual" = "xyes"]) AC_CHECK_SIZEOF([long]) CFLAGS="$CFLAGS -Wall" CXXFLAGS="$CFLAGS -Wall" 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). dnl AC_SUBST(BUILD_PARSERS,true) dnl Checks for programs. AC_PROG_CC dnl Checks for programs. AC_PROG_CXX AC_PROG_LIBTOOL dnl Set test on c++ compiler. AC_LANG_CPLUSPLUS dnl Check for definition of MAKE. AC_PROG_MAKE_SET AC_ARG_ENABLE(pool-malloc, AC_HELP_STRING([--enable-pool-malloc], [allocate pool objects with malloc]), AC_DEFINE([POOL_MALLOC], [1], [allocate pool objects with malloc])) AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debug statements]), AC_DEFINE([DEBUG], [1], [enable debug statements])) # Logging features # AC_ARG_ENABLE(log, "turn on logging", AC_DEFINE(COLM_LOG)) # AC_ARG_ENABLE(log-bytecode, "turns on bytecode logging", AC_DEFINE(COLM_LOG_BYTECODE)) # AC_ARG_ENABLE(log-parse, "turns on parse logging", AC_DEFINE(COLM_LOG_PARSE)) # AC_ARG_ENABLE(log-match, "turns on match logging", AC_DEFINE(COLM_LOG_MATCH)) # AC_ARG_ENABLE(log-compile, "turns on compile logging", AC_DEFINE(COLM_LOG_COMPILE)) if test "x$build_parsers" = "xyes"; then dnl Check for Ragel AC_ARG_WITH(ragel, [AC_HELP_STRING([--with-ragel], [location of ragel install])], [ # with value specified RAGEL="$withval/bin/ragel" AC_CHECK_FILES( [$RAGEL], [], [AC_ERROR([ragel is required to build this package])] ) ], [ 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 Kelbt AC_ARG_WITH(kelbt, [AC_HELP_STRING([--with-kelbt], [location of kelbt install])], [ # with value specified KELBT="$withval/bin/kelbt" AC_CHECK_FILES( [$RAGEL], [], [AC_ERROR([kelbt is required to build this package])] ) ], [ 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 ] ) AC_SUBST(RAGEL) AC_SUBST(KELBT) fi # build_parsers dnl write output files AC_OUTPUT(Makefile src/Makefile aapl/Makefile test/Makefile) echo "configuration of colm complete"