From 92e3860cfbaab5132439b9bac2e18dba06494bcc Mon Sep 17 00:00:00 2001 From: Chris Piro Date: Thu, 7 Mar 2013 11:24:51 -0500 Subject: [PATCH] THRIFT-1614: handle automake >= 1.12 yacc output name (thrifty.hh) --- .gitignore | 1 + bootstrap.sh | 3 +++ compiler/cpp/Makefile.am | 3 ++- compiler/cpp/README_Windows.txt | 8 ++++---- compiler/cpp/compiler.vcxproj | 10 +++++----- compiler/cpp/compiler.vcxproj.filters | 2 +- compiler/cpp/src/thriftl.ll | 2 +- rat_exclude | 1 + 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 403321ed..eb2ae4d4 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ gen-* /compiler/cpp/thriftl.cc /compiler/cpp/thrifty.cc /compiler/cpp/thrifty.h +/compiler/cpp/thrifty.hh /compiler/cpp/version.h /config.* /configure diff --git a/bootstrap.sh b/bootstrap.sh index 0c2b8868..26d93c8f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -38,6 +38,9 @@ else exit 1 fi +# automake <= 1.11 names yacc output .h rather than .hh -- see THRIFT-1614 +echo '#include "thrifty.h"' > compiler/cpp/thrifty.hh + autoscan $LIBTOOLIZE --copy --automake aclocal -I ./aclocal diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am index f47b15f0..8a8f394a 100644 --- a/compiler/cpp/Makefile.am +++ b/compiler/cpp/Makefile.am @@ -106,6 +106,7 @@ EXTRA_DIST = \ $(WINDOWS_DIST) clean-local: - $(RM) thriftl.cc thrifty.cc thrifty.h version.h windows/version.h + $(RM) thriftl.cc thrifty.cc thrifty.h thrifty.hh version.h windows/version.h + echo '#include "thrifty.h"' > compiler/cpp/thrifty.hh src/main.cc: version.h diff --git a/compiler/cpp/README_Windows.txt b/compiler/cpp/README_Windows.txt index a7fccea1..438ce046 100644 --- a/compiler/cpp/README_Windows.txt +++ b/compiler/cpp/README_Windows.txt @@ -1,8 +1,8 @@ Building the Thrift IDL compiler in Windows ------------------------------------------- -The Visual Studio project contains pre-build commands to generate the -thriftl.cc, thrifty.cc and thrifty.h files which are necessary to build +The Visual Studio project contains pre-build commands to generate the +thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build the compiler. These depend on bison, flex and their dependencies to work properly. If this doesn't work on a system, try these manual pre-build steps. @@ -22,9 +22,9 @@ In the generated thriftl.cc, comment out #include Place a copy of bison.simple in thrift/compiler/cpp > bison -y -o "src/thrifty.cc" --defines src/thrifty.yy -> move src\thrifty.cc.h src\thrifty.h +> move src\thrifty.cc.hh src\thrifty.hh -Download inttypes.h from the interwebs and place it in an include path +Download inttypes.h from the interwebs and place it in an include path location (e.g. thrift/compiler/cpp/src). Build the compiler in Visual Studio. diff --git a/compiler/cpp/compiler.vcxproj b/compiler/cpp/compiler.vcxproj index f46aaabb..6fe2d9d8 100644 --- a/compiler/cpp/compiler.vcxproj +++ b/compiler/cpp/compiler.vcxproj @@ -45,7 +45,7 @@ - + @@ -166,7 +166,7 @@ flex -o "src\\thriftl.cc" src/thriftl.ll -bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy +bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy @@ -185,7 +185,7 @@ bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy flex -o "src\thriftl.cc" src/thriftl.ll -bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy +bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy @@ -208,7 +208,7 @@ bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy flex -o "src\thriftl.cc" src/thriftl.ll -bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy +bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy @@ -231,7 +231,7 @@ bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy flex -o "src\thriftl.cc" src/thriftl.ll -bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy +bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy diff --git a/compiler/cpp/compiler.vcxproj.filters b/compiler/cpp/compiler.vcxproj.filters index 6836f0db..7e2d933e 100644 --- a/compiler/cpp/compiler.vcxproj.filters +++ b/compiler/cpp/compiler.vcxproj.filters @@ -71,7 +71,7 @@ parse - + windows diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll index 00e98505..fda6b331 100644 --- a/compiler/cpp/src/thriftl.ll +++ b/compiler/cpp/src/thriftl.ll @@ -48,7 +48,7 @@ * Must be included AFTER parse/t_program.h, but I can't remember why anymore * because I wrote this a while ago. */ -#include "thrifty.h" +#include "thrifty.hh" void thrift_reserved_keyword(char* keyword) { yyerror("Cannot use reserved language keyword: \"%s\"\n", keyword); diff --git a/rat_exclude b/rat_exclude index e0cced52..feafe8ba 100644 --- a/rat_exclude +++ b/rat_exclude @@ -18,6 +18,7 @@ ylwrap *.m4 autom4te.cache thrifty.h +thrifty.hh version.h version.h.in md5.c -- 2.17.1