Allow out-of-source builds.

- Clean up lib/cpp/Makefile.am to use AM_CXXFLAGS etc instead of
  target-specific so we can take advantage of default flags.
- Use top_builddir in a few places instead of top_srcdir.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666489 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/Makefile.am b/test/Makefile.am
index e34e033..ad60770 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -21,7 +21,7 @@
 	gen-cpp/ThriftTest.cpp \
 	gen-cpp/ThriftTest_types.cpp
 
-libtestgencpp_la_LIBADD = $(top_srcdir)/lib/cpp/libthrift.la
+libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
 
 noinst_PROGRAMS = Benchmark
 
@@ -56,7 +56,7 @@
 	TFDTransportTest.cpp
 
 TFDTransportTest_LDADD = \
-	$(top_srcdir)/lib/cpp/libthrift.la
+	$(top_builddir)/lib/cpp/libthrift.la
 
 
 #
@@ -66,7 +66,7 @@
 	TPipedTransportTest.cpp
 
 TPipedTransportTest_LDADD = \
-	$(top_srcdir)/lib/cpp/libthrift.la
+	$(top_builddir)/lib/cpp/libthrift.la
 
 #
 # DebugProtoTest
@@ -105,7 +105,7 @@
 #
 # Common thrift code generation rules
 #
-THRIFT = $(top_srcdir)/compiler/cpp/thrift
+THRIFT = $(top_builddir)/compiler/cpp/thrift
 
 gen-cpp/DebugProtoTest_types.cpp gen-cpp/PartiallyReflectable.cpp: DebugProtoTest.thrift
 	$(THRIFT) --gen cpp:dense,reflection_limited $<