THRIFT-1614: handle automake >= 1.12 yacc output name (thrifty.hh)
diff --git a/.gitignore b/.gitignore
index 403321e..eb2ae4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@
 /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 0c2b886..26d93c8 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -38,6 +38,9 @@
   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 f47b15f..8a8f394 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -106,6 +106,7 @@
              $(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 a7fccea..438ce04 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 @@
 
 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 f46aaab..6fe2d9d 100644
--- a/compiler/cpp/compiler.vcxproj
+++ b/compiler/cpp/compiler.vcxproj
@@ -45,7 +45,7 @@
     <ClInclude Include="src\parse\t_type.h" />
     <ClInclude Include="src\parse\t_typedef.h" />
     <ClInclude Include="src\platform.h" />
-    <ClInclude Include="src\thrifty.h" />
+    <ClInclude Include="src\thrifty.hh" />
     <ClInclude Include="src\windows\config.h" />
     <ClInclude Include="src\windows\version.h" />
   </ItemGroup>
@@ -166,7 +166,7 @@
     </Link>
     <PreBuildEvent>
       <Command>flex -o "src\\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -185,7 +185,7 @@
     </Link>
     <PreBuildEvent>
       <Command>flex -o "src\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -208,7 +208,7 @@
     </Link>
     <PreBuildEvent>
       <Command>flex -o "src\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -231,7 +231,7 @@
     </Link>
     <PreBuildEvent>
       <Command>flex -o "src\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/compiler/cpp/compiler.vcxproj.filters b/compiler/cpp/compiler.vcxproj.filters
index 6836f0d..7e2d933 100644
--- a/compiler/cpp/compiler.vcxproj.filters
+++ b/compiler/cpp/compiler.vcxproj.filters
@@ -71,7 +71,7 @@
       <Filter>parse</Filter>
     </ClInclude>
     <ClInclude Include="src\platform.h" />
-    <ClInclude Include="src\thrifty.h" />
+    <ClInclude Include="src\thrifty.hh" />
     <ClInclude Include="src\windows\config.h">
       <Filter>windows</Filter>
     </ClInclude>
diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll
index 00e9850..fda6b33 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 e0cced5..feafe8b 100644
--- a/rat_exclude
+++ b/rat_exclude
@@ -18,6 +18,7 @@
 *.m4
 autom4te.cache
 thrifty.h
+thrifty.hh
 version.h
 version.h.in
 md5.c