From e9e132dd29dee37924884a16619f9a6739c427ea Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 19 Jun 2012 17:21:28 +0200 Subject: [PATCH] [lbtt] Adjust parsers to accommodate old and new versions of Automake. * src/Config-parse.yy, src/Ltl-parse.yy, src/NeverClaim-parse.yy: Rename these as.. * src/Config-parse.y, src/Ltl-parse.y, src/NeverClaim-parse.y: ... these. * src/Config-parse_.cc, src/Ltl-parse_.cc, src/NeverClaim-parse_.cc: New files to hack around incompatibilities between Automake 1.12 and Automake 1.11. * src/Makefile.am: Adjust. * NEWS: Mention this change. --- lbtt/ChangeLog | 14 ++++++++++++++ lbtt/NEWS | 1 + lbtt/src/{Config-parse.yy => Config-parse.y} | 0 lbtt/src/Config-parse_.cc | 16 ++++++++++++++++ lbtt/src/{Ltl-parse.yy => Ltl-parse.y} | 0 lbtt/src/Ltl-parse_.cc | 16 ++++++++++++++++ lbtt/src/Makefile.am | 14 +++++++------- .../{NeverClaim-parse.yy => NeverClaim-parse.y} | 0 lbtt/src/NeverClaim-parse_.cc | 16 ++++++++++++++++ 9 files changed, 70 insertions(+), 7 deletions(-) rename lbtt/src/{Config-parse.yy => Config-parse.y} (100%) create mode 100644 lbtt/src/Config-parse_.cc rename lbtt/src/{Ltl-parse.yy => Ltl-parse.y} (100%) create mode 100644 lbtt/src/Ltl-parse_.cc rename lbtt/src/{NeverClaim-parse.yy => NeverClaim-parse.y} (100%) create mode 100644 lbtt/src/NeverClaim-parse_.cc diff --git a/lbtt/ChangeLog b/lbtt/ChangeLog index 3991569cc..ca669bdb5 100644 --- a/lbtt/ChangeLog +++ b/lbtt/ChangeLog @@ -1,3 +1,17 @@ +2012-06-19 Alexandre Duret-Lutz + + Adjust parsers to accommodate old and new versions of Automake. + + * src/Config-parse.yy, src/Ltl-parse.yy, src/NeverClaim-parse.yy: + Rename these as.. + * src/Config-parse.y, src/Ltl-parse.y, src/NeverClaim-parse.y: + ... these. + * src/Config-parse_.cc, src/Ltl-parse_.cc, + src/NeverClaim-parse_.cc: New files to hack around + incompatibilities between Automake 1.12 and Automake 1.11. + * src/Makefile.am: Adjust. + * NEWS: Mention this change. + 2012-05-21 Alexandre Duret-Lutz Make it clearer this is not LBTT 1.2.1. diff --git a/lbtt/NEWS b/lbtt/NEWS index 60808be37..4ea8422ee 100644 --- a/lbtt/NEWS +++ b/lbtt/NEWS @@ -23,6 +23,7 @@ Version 1.2.1a * Fix compilation with newer versions of Bison. * Fix compilation on Intel's icpc, and with recent version of G++. +* Fix compilation with newer versions of Automake. * Fix construction of manual ("make dvi" and "make pdf") for recent version of texinfo. * Fix generation of random formulae on 64bit machines. (They were diff --git a/lbtt/src/Config-parse.yy b/lbtt/src/Config-parse.y similarity index 100% rename from lbtt/src/Config-parse.yy rename to lbtt/src/Config-parse.y diff --git a/lbtt/src/Config-parse_.cc b/lbtt/src/Config-parse_.cc new file mode 100644 index 000000000..1e567fde8 --- /dev/null +++ b/lbtt/src/Config-parse_.cc @@ -0,0 +1,16 @@ +// This is a hack to support both Automake <= 1.11.x, and Automake >= +// 1.12.x The problem with is that old versions used to create +// parse.h, and parse.cc from a parse.yxx grammar, while new versions +// create parse.hxx and parse.cc. +// +// We want to support both version of Automake, because 1.11.x is +// fairly well distributed, and 1.12 did not make it into Debian 7.0. +// +// Yet it's difficult to support both versions because of the name +// change. Our hack is to rename parse.yxx as parse.y, so that +// automake will generate rule to build parse.h and parse.c, and then +// this parse_.cc file is used to compile parse.c in C++. This way we +// always have a parse.h file regardless of the Automake version. +// +// We can fix this mess once Automake 1.12 is available everywhere. +#include "Config-parse.c" diff --git a/lbtt/src/Ltl-parse.yy b/lbtt/src/Ltl-parse.y similarity index 100% rename from lbtt/src/Ltl-parse.yy rename to lbtt/src/Ltl-parse.y diff --git a/lbtt/src/Ltl-parse_.cc b/lbtt/src/Ltl-parse_.cc new file mode 100644 index 000000000..49e910798 --- /dev/null +++ b/lbtt/src/Ltl-parse_.cc @@ -0,0 +1,16 @@ +// This is a hack to support both Automake <= 1.11.x, and Automake >= +// 1.12.x The problem with is that old versions used to create +// parse.h, and parse.cc from a parse.yxx grammar, while new versions +// create parse.hxx and parse.cc. +// +// We want to support both version of Automake, because 1.11.x is +// fairly well distributed, and 1.12 did not make it into Debian 7.0. +// +// Yet it's difficult to support both versions because of the name +// change. Our hack is to rename parse.yxx as parse.y, so that +// automake will generate rule to build parse.h and parse.c, and then +// this parse_.cc file is used to compile parse.c in C++. This way we +// always have a parse.h file regardless of the Automake version. +// +// We can fix this mess once Automake 1.12 is available everywhere. +#include "Ltl-parse.c" diff --git a/lbtt/src/Makefile.am b/lbtt/src/Makefile.am index bc244ba83..3dd7ad820 100644 --- a/lbtt/src/Makefile.am +++ b/lbtt/src/Makefile.am @@ -1,4 +1,4 @@ -BUILT_SOURCES = Config-parse.h NeverClaim-parse.h +BUILT_SOURCES = Config-parse.c NeverClaim-parse.c Ltl-parse.c AM_YFLAGS = -d bin_PROGRAMS = lbtt lbtt-translate @@ -10,7 +10,7 @@ lbtt_SOURCES = \ BuchiAutomaton.cc \ BuchiProduct.h \ BuchiProduct.cc \ - Config-parse.yy \ + Config-parse_.cc \ Config-lex.ll \ Configuration.h \ Configuration.cc \ @@ -26,7 +26,7 @@ lbtt_SOURCES = \ LbttAlloc.h \ LtlFormula.h \ LtlFormula.cc \ - Ltl-parse.yy \ + Ltl-parse_.cc \ main.cc \ PathEvaluator.h \ PathEvaluator.cc \ @@ -56,7 +56,7 @@ lbtt_SOURCES = \ UserCommandReader.cc \ UserCommands.h \ UserCommands.cc -EXTRA_lbtt_SOURCES = gnu-getopt.h +EXTRA_lbtt_SOURCES = gnu-getopt.h Config-parse.y Ltl-parse.y lbtt_LDADD = @LIBOBJS@ @READLINELIBS@ lbtt_translate_SOURCES = \ @@ -72,8 +72,8 @@ lbtt_translate_SOURCES = \ LbtWrapper.h \ LtlFormula.h \ LtlFormula.cc \ - Ltl-parse.yy \ - NeverClaim-parse.yy \ + Ltl-parse_.cc \ + NeverClaim-parse_.cc \ NeverClaim-lex.ll \ NeverClaimAutomaton.h \ NeverClaimAutomaton.cc \ @@ -88,5 +88,5 @@ lbtt_translate_SOURCES = \ translate.h \ translate.cc \ TranslatorInterface.h -EXTRA_lbtt_translate_SOURCES = gnu-getopt.h +EXTRA_lbtt_translate_SOURCES = gnu-getopt.h Ltl-parse.y NeverClaim-parse.y lbtt_translate_LDADD = @LIBOBJS@ diff --git a/lbtt/src/NeverClaim-parse.yy b/lbtt/src/NeverClaim-parse.y similarity index 100% rename from lbtt/src/NeverClaim-parse.yy rename to lbtt/src/NeverClaim-parse.y diff --git a/lbtt/src/NeverClaim-parse_.cc b/lbtt/src/NeverClaim-parse_.cc new file mode 100644 index 000000000..b3bec99bd --- /dev/null +++ b/lbtt/src/NeverClaim-parse_.cc @@ -0,0 +1,16 @@ +// This is a hack to support both Automake <= 1.11.x, and Automake >= +// 1.12.x The problem with is that old versions used to create +// parse.h, and parse.cc from a parse.yxx grammar, while new versions +// create parse.hxx and parse.cc. +// +// We want to support both version of Automake, because 1.11.x is +// fairly well distributed, and 1.12 did not make it into Debian 7.0. +// +// Yet it's difficult to support both versions because of the name +// change. Our hack is to rename parse.yxx as parse.y, so that +// automake will generate rule to build parse.h and parse.c, and then +// this parse_.cc file is used to compile parse.c in C++. This way we +// always have a parse.h file regardless of the Automake version. +// +// We can fix this mess once Automake 1.12 is available everywhere. +#include "NeverClaim-parse.c"