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/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index df64353..5ba3f64 100644
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -16,8 +16,8 @@
pkgconfig_DATA += thrift-z.pc
endif
-common_cxxflags = -Wall -Isrc $(BOOST_CPPFLAGS)
-common_ldflags = -Wall $(BOOST_LDFLAGS)
+AM_CXXFLAGS = -Wall
+AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(srcdir)/src
# Define the source files for the module
@@ -54,19 +54,13 @@
# Flags for the various libraries
-
-libthrift_la_CXXFLAGS = $(common_cxxflags)
-
-libthriftnb_la_CXXFLAGS = $(common_cxxflags)
-libthriftnb_la_CPPFLAGS = $(LIBEVENT_CPPFLAGS)
-
-libthriftz_la_CXXFLAGS = $(common_cxxflags)
-libthriftz_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
+libthriftnb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBEVENT_CPPFLAGS)
+libthriftz_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS)
include_thriftdir = $(includedir)/thrift
include_thrift_HEADERS = \
- $(top_srcdir)/config.h \
+ $(top_builddir)/config.h \
src/Thrift.h \
src/TReflectionLocal.h \
src/reflection_limited_types.h \
@@ -133,9 +127,6 @@
concurrency_test_LDADD = libthrift.la
-concurrency_test_CXXFLAGS = $(common_cxxflags)
-concurrency_test_LDFLAGS = $(common_ldflags)
-
EXTRA_DIST = \
README \
thrift-nb.pc.in \
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 $<