From c6c6498b0227119abf0fd7b41cf63b12f4c013b8 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 01:16:45 +0000 Subject: [PATCH] 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 --- lib/cpp/Makefile.am | 19 +++++-------------- test/Makefile.am | 8 ++++---- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index df64353e..5ba3f64a 100644 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -16,8 +16,8 @@ lib_LTLIBRARIES += libthriftz.la 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 @@ libthriftz_la_SOURCES = src/transport/TZlibTransport.cpp # 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_SOURCES = src/concurrency/test/Tests.cpp \ 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 e34e033d..ad607702 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -21,7 +21,7 @@ libtestgencpp_la_SOURCES = \ 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_SOURCES = \ TFDTransportTest.cpp TFDTransportTest_LDADD = \ - $(top_srcdir)/lib/cpp/libthrift.la + $(top_builddir)/lib/cpp/libthrift.la # @@ -66,7 +66,7 @@ TPipedTransportTest_SOURCES = \ TPipedTransportTest.cpp TPipedTransportTest_LDADD = \ - $(top_srcdir)/lib/cpp/libthrift.la + $(top_builddir)/lib/cpp/libthrift.la # # DebugProtoTest @@ -105,7 +105,7 @@ ReflectionTest_LDADD = libtestgencpp.la # # 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 $< -- 2.17.1