Thrift: Revamp build to use a single configure.ac.

Summary:
Ben Maurer suggested that it would make sense for Thrift to build as
a single project, with one configure.ac and multiple Makefile.am.
He was also kind enough to do the heavy lifting, and this commit
is the application of his patch (with minor modifications).
The most significant visible change from this diff is that
in order to buidl one of the thrift sub-projects (i.e.: the compiler,
the C++ library, or the Python library) you must run bootstrap.sh
and configure in the Thrift root, then make in the specific project.
Users who want to build and install the Python library but
can't run configure because they don't have Boost can simply
run setup.py directly.

Reviewed By: mcslee

Test Plan: Built Thrift from scratch.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665409 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/COPYING b/compiler/cpp/COPYING
deleted file mode 100644
index 039f21e..0000000
--- a/compiler/cpp/COPYING
+++ /dev/null
@@ -1,24 +0,0 @@
-Thrift Software License
-Copyright (c) 2006- Facebook, Inc. 
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/compiler/cpp/LICENSE b/compiler/cpp/LICENSE
deleted file mode 100644
index 039f21e..0000000
--- a/compiler/cpp/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-Thrift Software License
-Copyright (c) 2006- Facebook, Inc. 
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index 254f9b5..921a6a9 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -20,7 +20,7 @@
                  src/generate/t_erl_generator.cc \
                  src/generate/t_hs_generator.cc \
                  src/generate/t_cocoa_generator.cc \
-                 src/generate/t_st_generator.cc	\
+                 src/generate/t_st_generator.cc \
                  src/globals.h \
                  src/main.h \
                  src/md5.h \
@@ -57,12 +57,12 @@
                  src/generate/t_cocoa_generator.h \
                  src/generate/t_st_generator.h
 
-thrift_CXXFLAGS = -Wall -Isrc $(BOOST_CPPFLAGS)
+thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
 thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
 
 thrift_LDADD = @LEXLIB@
 
-EXTRA_DIST = bootstrap.sh cleanup.sh LICENSE
+EXTRA_DIST = README
 
 clean-local:
 	rm -rf thriftl.cc thrifty.cc thrifty.h
diff --git a/compiler/cpp/bootstrap.sh b/compiler/cpp/bootstrap.sh
deleted file mode 100755
index de6f055..0000000
--- a/compiler/cpp/bootstrap.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-./cleanup.sh
-autoscan
-aclocal -I ../../lib/cpp/aclocal
-if libtoolize --version 1 >/dev/null 2>/dev/null; then
-  libtoolize --automake
-elif glibtoolize --version 1 >/dev/null 2>/dev/null; then
-  glibtoolize --automake
-fi
-touch NEWS README AUTHORS ChangeLog
-autoconf
-automake -ac
diff --git a/compiler/cpp/cleanup.sh b/compiler/cpp/cleanup.sh
deleted file mode 100755
index e2ab8f8..0000000
--- a/compiler/cpp/cleanup.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-make clean 1>/dev/null 2>/dev/null
-rm -rf \
-AUTHORS \
-ChangeLog \
-INSTALL \
-Makefile \
-Makefile.in \
-Makefile.orig \
-NEWS \
-aclocal.m4 \
-autom4te.cache \
-autoscan.log \
-config.guess \
-config.h \
-config.hin \
-config.log \
-config.status \
-config.sub \
-configure \
-configure.scan \
-depcomp \
-.deps \
-install-sh \
-.libs \
-.in \
-libtool \
-ltmain.sh \
-Makefile.in \
-missing
diff --git a/compiler/cpp/configure.ac b/compiler/cpp/configure.ac
deleted file mode 100644
index 83b6bb0..0000000
--- a/compiler/cpp/configure.ac
+++ /dev/null
@@ -1,61 +0,0 @@
-AC_PREREQ(2.59)
-
-AC_INIT(thrift, 1.0)
-
-AM_INIT_AUTOMAKE
-
-AM_PROG_LEX
-
-AC_PROG_YACC
-
-AC_CHECK_HEADERS([stddef.h])
-
-AX_BOOST_BASE([1.33.1])
-
-AC_CHECK_FUNCS([memset])
-
-AC_CHECK_FUNCS([mkdir])
-
-AC_CHECK_FUNCS([realpath])
-
-AC_CHECK_FUNCS([strdup])
-
-AC_CHECK_FUNCS([strerror])
-
-AC_STRUCT_TM
-
-AC_FUNC_STRFTIME
-
-AC_FUNC_MALLOC
-
-AC_FUNC_REALLOC
-
-AC_FUNC_STAT
-
-AC_FUNC_VPRINTF
-
-AC_TYPE_SIZE_T
-
-AC_C_INLINE
-
-AC_C_CONST
-
-AC_C_VOLATILE
-
-AC_HEADER_STDBOOL
-
-AC_HEADER_STDC
-
-AC_HEADER_TIME
-
-AC_PROG_CC
-
-AC_PROG_CXX
-
-AC_PROG_INSTALL
-
-AC_PROG_LIBTOOL
-
-AC_PROG_MAKE_SET
-
-AC_OUTPUT(Makefile)
diff --git a/compiler/cpp/src/generate/t_st_generator.cc b/compiler/cpp/src/generate/t_st_generator.cc
index 413e8ae..c8456bc 100644
--- a/compiler/cpp/src/generate/t_st_generator.cc
+++ b/compiler/cpp/src/generate/t_st_generator.cc
@@ -371,14 +371,14 @@
 }
 
 string t_st_generator::a_type(t_type* type) {
-	string prefix;
+  string prefix;
 
-	if (is_vowel(type_name(type)[0]))
+  if (is_vowel(type_name(type)[0]))
     prefix = "an";
   else
     prefix = "a";
 
-	return prefix + capitalize(type_name(type));
+  return prefix + capitalize(type_name(type));
 }
 
 void t_st_generator::generate_accessors(std::ofstream& out, t_struct* tstruct) {
@@ -456,7 +456,7 @@
 
   out << "]." << endl <<
     indent() << "iprot readMapEnd." << endl <<
-	indent() << val << "] value";
+  indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -500,7 +500,7 @@
 
   out << "]." << endl <<
     indent() << "iprot readListEnd." << endl <<
-	indent() << val << "] value";
+  indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -544,7 +544,7 @@
 
   out << "]." << endl <<
     indent() << "iprot readSetEnd." << endl <<
-	indent() << val << "] value";
+  indent() << val << "] value";
   indent_down();
 
   return out.str();
@@ -749,7 +749,7 @@
   st_method(f_, client_class_name(), "recv" + capitalize(funname));
   f_ << "| f msg res | " << endl <<
     indent() << "msg := oprot readMessageBegin." << endl <<
-		indent() << "self validateRemoteMessage: msg." << endl <<
+    indent() << "self validateRemoteMessage: msg." << endl <<
     indent() << "res := " << struct_reader(&result) << "." << endl <<
     indent() << "oprot readMessageEnd." << endl <<
     indent() << "oprot transport flush." << endl <<