- generate parser / lexer files only if both flex and yacc are present and also

disable it if configuring for MSVC
This commit is contained in:
Volker Ruppert 2012-08-11 07:16:23 +00:00
parent fc927773fd
commit 5054b5f836
2 changed files with 19 additions and 14 deletions

View File

@ -93,17 +93,17 @@ parse-clean:
dbg_main.o: debug.h
parser.c: parser.y
@/bin/rm -f y.tab.c parser.c
@/bin/rm -f y.tab.h parser.h
$(YACC) -p bx -d $<
@/bin/mv -f y.tab.c parser.c
@/bin/mv -f y.tab.h parser.h
@echo '#endif /* if BX_DEBUGGER */' >> parser.c
@echo '/* The #endif is appended by the makefile after running yacc. */' >> parser.c
@NO_FLEX_YACC@parser.c: parser.y
@NO_FLEX_YACC@ @/bin/rm -f y.tab.c parser.c
@NO_FLEX_YACC@ @/bin/rm -f y.tab.h parser.h
@NO_FLEX_YACC@ $(YACC) -p bx -d $<
@NO_FLEX_YACC@ @/bin/mv -f y.tab.c parser.c
@NO_FLEX_YACC@ @/bin/mv -f y.tab.h parser.h
@NO_FLEX_YACC@ @echo '#endif /* if BX_DEBUGGER */' >> parser.c
@NO_FLEX_YACC@ @echo '/* The #endif is appended by the makefile after running yacc. */' >> parser.c
@NOFLEX@lexer.c: lexer.l
@NOFLEX@ $(LEX) -Pbx -t $< > lexer.c
@NO_FLEX_YACC@lexer.c: lexer.l
@NO_FLEX_YACC@ $(LEX) -Pbx -t $< > lexer.c
###########################################
# dependencies generated by

View File

@ -1076,12 +1076,17 @@ AC_ARG_ENABLE(debugger,
AC_MSG_RESULT(yes)
AC_DEFINE(BX_DEBUGGER, 1)
DEBUGGER_VAR='$(DEBUGGER_LIB)'
NOFLEX=''
NO_FLEX_YACC=''
AC_PATH_PROG(FLEX, flex, not_found)
if test "$FLEX" = not_found; then
NOFLEX='#'
AC_PATH_PROG(YACC, yacc, not_found)
AC_MSG_CHECKING(whether to generate parser / lexer files)
if test "$FLEX" = not_found -o "$YACC" = not_found -o "$MSVC_TARGET" = 1; then
NO_FLEX_YACC='#'
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
AC_SUBST(NOFLEX)
AC_SUBST(NO_FLEX_YACC)
bx_debugger=1
else
AC_MSG_RESULT(no)