From 12736880ccdfb06d7bf85888af9a3e44da7fe727 Mon Sep 17 00:00:00 2001 From: thurston Date: Mon, 22 Jan 2007 04:46:37 +0000 Subject: [PATCH] The configure script now checks for ragel and kelbt instead of flex and bison. Cleaned up common/Makefile.in. git-svn-id: http://svn.complang.org/ragel/trunk@5 052ea7fc-9027-0410-9066-f65837a77df0 --- common/Makefile.in | 35 +----------------------------- configure | 63 ++++++++++++++++++++++++------------------------------ configure.in | 30 ++++++++++---------------- 3 files changed, 40 insertions(+), 88 deletions(-) diff --git a/common/Makefile.in b/common/Makefile.in index a08ce60..7c1ba7d 100644 --- a/common/Makefile.in +++ b/common/Makefile.in @@ -18,39 +18,12 @@ # along with Ragel; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCS = -Iaapl -DEFS = - -CFLAGS = -g -Wall -LDFLAGS = - -SUBDIRS = codegen test examples doc - -CC_SRCS = \ - rlparse.cpp rlscan.cpp main.cpp parsetree.cpp \ - parsedata.cpp fsmstate.cpp fsmbase.cpp fsmattach.cpp \ - fsmmin.cpp fsmgraph.cpp fsmap.cpp xmlcodegen.cpp - GEN_SRC = version.h -LIBS = @LIBS@ -PREFIX = @prefix@ - #************************************* include ../version.mk -# Programs -CXX = @CXX@ - -# What kind of header does bison put out? -BISON_HEAD_SUFFIX = @BISON_HEAD_SUFFIX@ - -# Get objects and dependencies from sources. -RAGEL_OBJS = $(RAGEL_CC_SRCS:%.cpp=%.o) -RLCG_OBJS = $(RLCG_CC_SRCS:%.cpp=%.o) -DEPS = $(RAGEL_CC_SRCS:%.cpp=.%.d) $(RLCG_CC_SRCS:%.cpp=.%.d) - # Rules. all: $(GEN_SRC) @@ -58,14 +31,8 @@ version.h: ../version.mk echo '#define VERSION "$(VERSION)"' > version.h echo '#define PUBDATE "$(PUBDATE)"' >> version.h -%.o: %.cpp - @$(CXX) -M $(DEFS) $(INCS) $< > .$*.d - $(CXX) -c $(CFLAGS) $(DEFS) $(INCS) -o $@ $< - distclean: clean rm -f Makefile config.h clean: - rm -f tags .*.d *.o version.h - --include $(DEPS) + rm -f tags version.h diff --git a/configure b/configure index 130108c..7b8764b 100755 --- a/configure +++ b/configure @@ -272,7 +272,7 @@ PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="ragel/main.cpp" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_PARSERS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX SET_MAKE FLEX GPERF BISON GDC GOBJC JAVAC TXL LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_PARSERS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX SET_MAKE RAGEL GPERF KELBT GDC GOBJC JAVAC TXL LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -2582,15 +2582,15 @@ fi if test $BUILD_PARSERS = true; then -# Extract the first word of "flex", so it can be a program name with args. -set dummy flex; ac_word=$2 +# Extract the first word of "ragel", so it can be a program name with args. +set dummy ragel; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_FLEX+set}" = set; then +if test "${ac_cv_prog_RAGEL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$FLEX"; then - ac_cv_prog_FLEX="$FLEX" # Let the user override the test. + if test -n "$RAGEL"; then + ac_cv_prog_RAGEL="$RAGEL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2599,7 +2599,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FLEX="flex" + ac_cv_prog_RAGEL="ragel" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2608,18 +2608,18 @@ done fi fi -FLEX=$ac_cv_prog_FLEX -if test -n "$FLEX"; then - echo "$as_me:$LINENO: result: $FLEX" >&5 -echo "${ECHO_T}$FLEX" >&6 +RAGEL=$ac_cv_prog_RAGEL +if test -n "$RAGEL"; then + echo "$as_me:$LINENO: result: $RAGEL" >&5 +echo "${ECHO_T}$RAGEL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi -if test -z "$FLEX"; then +if test -z "$RAGEL"; then echo - echo "error: flex is required to compile ragel" + echo "error: ragel is required to build the parsers" echo exit 1 fi @@ -2661,20 +2661,20 @@ fi if test -z "$GPERF"; then echo - echo "error: gperf is required to compile ragel" + echo "error: gperf is required to build the parsers" echo exit 1 fi -# Extract the first word of "bison", so it can be a program name with args. -set dummy bison; ac_word=$2 +# Extract the first word of "kelbt", so it can be a program name with args. +set dummy kelbt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_BISON+set}" = set; then +if test "${ac_cv_prog_KELBT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$BISON"; then - ac_cv_prog_BISON="$BISON" # Let the user override the test. + if test -n "$KELBT"; then + ac_cv_prog_KELBT="$KELBT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2683,7 +2683,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_BISON="bison" + ac_cv_prog_KELBT="kelbt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2692,25 +2692,18 @@ done fi fi -BISON=$ac_cv_prog_BISON -if test -n "$BISON"; then - echo "$as_me:$LINENO: result: $BISON" >&5 -echo "${ECHO_T}$BISON" >&6 +KELBT=$ac_cv_prog_KELBT +if test -n "$KELBT"; then + echo "$as_me:$LINENO: result: $KELBT" >&5 +echo "${ECHO_T}$KELBT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi -if test -z "$BISON"; then +if test -z "$KELBT"; then echo - echo "error: bison is required to compile ragel" - echo - exit 1 -fi - -if "$BISON" --version | grep 'bison++'; then - echo - echo "error: sorry, ragel cannot be compiled with bison++" + echo "error: kelbt is required to build the parsers" echo exit 1 fi @@ -3491,9 +3484,9 @@ s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@SET_MAKE@,$SET_MAKE,;t t -s,@FLEX@,$FLEX,;t t +s,@RAGEL@,$RAGEL,;t t s,@GPERF@,$GPERF,;t t -s,@BISON@,$BISON,;t t +s,@KELBT@,$KELBT,;t t s,@GDC@,$GDC,;t t s,@GOBJC@,$GOBJC,;t t s,@JAVAC@,$JAVAC,;t t diff --git a/configure.in b/configure.in index a8e55e6..a441f39 100644 --- a/configure.in +++ b/configure.in @@ -21,8 +21,8 @@ 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 true if build system should generate parsers from flex, bison, and -dnl gperf sources. Set false if generated files are included and not to be +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) @@ -42,11 +42,11 @@ AC_PROG_MAKE_SET if test $BUILD_PARSERS = true; then -dnl Check for flex -AC_CHECK_PROG(FLEX, flex, flex) -if test -z "$FLEX"; then +dnl Check for Ragel +AC_CHECK_PROG(RAGEL, ragel, ragel) +if test -z "$RAGEL"; then echo - echo "error: flex is required to compile ragel" + echo "error: ragel is required to build the parsers" echo exit 1 fi @@ -55,24 +55,16 @@ dnl Check for gperf AC_CHECK_PROG(GPERF, gperf, gperf) if test -z "$GPERF"; then echo - echo "error: gperf is required to compile ragel" + echo "error: gperf is required to build the parsers" echo exit 1 fi -dnl Check for bison -AC_CHECK_PROG(BISON, bison, bison) -if test -z "$BISON"; then +dnl Check for Kelbt +AC_CHECK_PROG(KELBT, kelbt, kelbt) +if test -z "$KELBT"; then echo - echo "error: bison is required to compile ragel" - echo - exit 1 -fi - -dnl Sorry, Ragel will not compile with bison++. -if "$BISON" --version | grep 'bison++'; then - echo - echo "error: sorry, ragel cannot be compiled with bison++" + echo "error: kelbt is required to build the parsers" echo exit 1 fi -- 2.7.4