Commit 2d20d595 authored by Roland Levillain's avatar Roland Levillain
Browse files

2005-10-20 Roland Levillain <roland@lrde.epita.fr>

	Update bison++.

	* configure.ac: Check for bison instead of yacc.
	(AC_CONFIG_FILES): Generate config/bison++.
	* config/bison++: Rename as...
	* config/bison++.in: ...this.
	Be robust to absolute srcdir paths.
	* config/Makefile.am (dist_noinst_SCRIPTS): Move bison++...
	(nodist_noinst_SCRIPTS): ...here (new variable).
	* src/parse/Makefile.am (BISONXX, BISONXX_IN): New.
	(BISONXX_IN): New rule.
	(EXTRA_DIST): Add $(srcdir)/asm-parse.yy.
	((srcdir)/bison++.stamp): Add $(srcdir)/asm-parse.yy as a
	dependency and ensure bison++ is up-to-date.
	(libparse_a_SOURCES): Remove asm-parse.yy.
	Add asm-parse.cc.
parent 11416d95
2005-10-20 Roland Levillain <roland@lrde.epita.fr>
Update bison++.
* configure.ac: Check for bison instead of yacc.
(AC_CONFIG_FILES): Generate config/bison++.
* config/bison++: Rename as...
* config/bison++.in: ...this.
Be robust to absolute srcdir paths.
* config/Makefile.am (dist_noinst_SCRIPTS): Move bison++...
(nodist_noinst_SCRIPTS): ...here (new variable).
* src/parse/Makefile.am (BISONXX, BISONXX_IN): New.
(BISONXX_IN): New rule.
(EXTRA_DIST): Add $(srcdir)/asm-parse.yy.
((srcdir)/bison++.stamp): Add $(srcdir)/asm-parse.yy as a
dependency and ensure bison++ is up-to-date.
(libparse_a_SOURCES): Remove asm-parse.yy.
Add asm-parse.cc.
2005-10-16 Benot Perrot <benoit@lrde.epita.fr>
Provide --system-library option.
......
## Makefile.am -- Process this file with automake to produce Makefile.in
##
dist_noinst_SCRIPTS = move-if-change bison++
dist_noinst_SCRIPTS = move-if-change
nodist_noinst_SCRIPTS = bison++
EXTRA_DIST = $(SPECIFIC_MACROS) $(STANDARD_MACROS) $(SPECIFIC_TOOLS)
......
......@@ -3,13 +3,16 @@
# Any tool failure is a failure of the script.
set -e
: ${BISON=@BISON@}
# bison++ SRCDIR INPUT OUTPUT OPTIONS
# -----------------------------------
me=$(basename $0)
auxdir=$(cd $(dirname $0) && pwd)
move_if_change='@abs_srcdir@/move-if-change'
srcdir=$1
abs_srcdir=$(cd $srcdir && pwd)
shift
input=$1
shift
......@@ -35,12 +38,26 @@ mkdir $tmp
# Don't use `ln -s' as its semantics of paths sucks.
cp $srcdir/$input $tmp
cd $tmp
bison $options -S lalr1.cc $input -o $output
$BISON $options -S lalr1.cc $input -o $output
# Bison 2.0 forgets to implement %lex-param for the C++ parsers.
lex_param=$(perl -ne 'print /^%lex-param\s*\{.*\b(\w+)\s*\}/' $input)
if test x"$lex_param" != x; then
# Replace the two-argument call to yylex to a three argument call.
perl -pi -e 's/(yylex \(&yylval, &yylloc)\)/$1, '"$lex_param)/" $output;
fi
for file in *
do
case $file in
$input) ;;
*) $auxdir/move-if-change $file ../$srcdir/$file;;
$input)
# Leave it here.
;;
*)
# Fix doxygen tags.
perl -pi -e "s|\Q\\file $file\E\b|\\\\file parse/$file|g;" "$file"
$move_if_change "$file" "$abs_srcdir/$file"
;;
esac
done
......
......@@ -24,8 +24,8 @@ AC_CONFIG_HEADERS([config.h])
## Development tools -------------------
# Look for a lex-like program.
AC_PROG_LEX
# Look for a yacc-like program.
AC_PROG_YACC
# Look for bison.
AC_CHECK_PROGS(BISON, bison)
# Look for a C++ compiler.
AC_PROG_CXX
......@@ -46,6 +46,9 @@ CXXFLAGS="${CXXFLAGS} -ansi -Wall -W -D__STDC_LIMIT_MACROS"
# gnulib modules
nolimips_GNULIB
# Bison wrapper.
AC_CONFIG_FILES([config/bison++], [chmod +x config/bison++])
## Epilogue ----------------------------
# Ask for the Makefile creations.
AC_CONFIG_FILES([
......
......@@ -30,10 +30,15 @@ asm-parse.yy.stamp: $(srcdir)/asm-parse.yy.gen.py $(top_srcdir)/dev/nolimips.xml
@mv -f $@.tmp $@
$(srcdir)/asm-parse.yy: asm-parse.yy.stamp
# A Bison wrapper for C++.
BISONXX = $(top_builddir)/config/bison++
BISONXX_IN = $(top_srcdir)/config/bison++.in
$(BISONXX): $(BISONXX_IN)
cd $(top_builddir)/config && $(MAKE) $(AM_MAKEFLAGS) bison++
BISONXX = $(top_srcdir)/config/bison++
EXTRA_DIST += $(srcdir)/bison++.stamp
$(srcdir)/bison++.stamp: $(srcdir)/asm-parse.yy
EXTRA_DIST += $(srcdir)/bison++.stamp $(srcdir)/asm-parse.yy
$(srcdir)/bison++.stamp: $(srcdir)/asm-parse.yy $(BISONXX_IN)
$(MAKE) $(AM_MAKEFLAGS) $(BISONXX)
@rm -rf bison++.stamp.tmp
@touch bison++.stamp.tmp
$(BISONXX) $(srcdir) asm-parse.yy asm-parse.cc -d -ra
......@@ -53,7 +58,7 @@ noinst_LIBRARIES = libparse.a
libparse_a_CPPFLAGS = -I $(top_srcdir)/src -I $(top_builddir)/src
libparse_a_SOURCES = \
asm-parse.yy asm-parse.yy.stamp \
asm-parse.cc asm-parse.yy.stamp \
$(FROM_ASM_PARSE_YY) \
asm-scan.ll asm-scan.hh asm-scan.ll.stamp \
libparse.hh libparse.cc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment