Add python scons rules


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664860 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bootstrap.sh b/bootstrap.sh
index 9d8ac58..e994cc1 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -29,7 +29,6 @@
 .libs \
 libtool \
 ltmain.sh \
-Makefile.in \
 missing
 
 echo "SUBDIRS = ${subdirs}" > Makefile.am
diff --git a/lib/py/src/TSCons.py b/lib/py/src/TSCons.py
new file mode 100644
index 0000000..430b43f
--- /dev/null
+++ b/lib/py/src/TSCons.py
@@ -0,0 +1,11 @@
+from SCons.Builder import Builder
+
+def scons_env(env):
+  cppbuild = Builder(action = 'thrift --cpp $SOURCE')
+  env.Append(BUILDERS = {'ThriftCpp' : cppbuild})
+
+def gen_cpp(env, dir, file):
+  scons_env(env)
+  suffixes = ['_types.h', '_types.cpp']
+  targets = map(lambda s: 'gen-cpp/' + file + s, suffixes)
+  return env.ThriftCpp(targets, dir+file+'.thrift')
diff --git a/lib/py/src/__init__.py b/lib/py/src/__init__.py
index 9ddc3ce..11aeca9 100644
--- a/lib/py/src/__init__.py
+++ b/lib/py/src/__init__.py
@@ -1 +1 @@
-__all__ = ["Thrift"]
+__all__ = ["Thrift", "TSCons"]