From 43b94a4bc46e374167472b4e6d012e795bb1f1e5 Mon Sep 17 00:00:00 2001 From: Robert Edmonds Date: Mon, 18 Nov 2013 13:53:28 -0500 Subject: [PATCH] fix VPATH builds this commit fixes VPATH builds where the build tree is separate from the source tree. this will allow us to run "make distcheck". --- Makefile.am | 14 ++++++-------- t/generated-code/test-generated-code.c | 2 +- t/generated-code2/cxx-generate-packed-data.cc | 2 +- t/generated-code2/test-generated-code2.c | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am index 587488a..84eb2ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,9 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ - -I${top_srcdir}/protobuf-c + -I${top_srcdir}/protobuf-c \ + -I${top_builddir} \ + -I${top_srcdir} AM_CFLAGS = ${my_CFLAGS} AM_LDFLAGS = @@ -42,10 +44,6 @@ protobuf_c_libprotobuf_c_la_LDFLAGS = $(AM_LDFLAGS) \ -export-symbols-regex "^(protobuf_c_[a-z].*)" \ -no-undefined -install-exec-hook: - rm -f $(DESTDIR)$(libdir)/libprotobuf-c.la - rm -f $(DESTDIR)$(libdir)/libprotobuf-c-rpc.la - pkgconfig_DATA += protobuf-c/libprotobuf-c.pc CLEANFILES += protobuf-c/libprotobuf-c.pc EXTRA_DIST += protobuf-c/libprotobuf-c.pc.in @@ -168,13 +166,13 @@ t_generated_code2_cxx_generate_packed_data_LDADD = \ $(protobuf_LIBS) t/test.pb-c.c t/test.pb-c.h: $(top_builddir)/protoc-c/protoc-c$(EXEEXT) $(top_srcdir)/t/test.proto - $(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) --c_out=$(top_builddir) $(top_srcdir)/t/test.proto + $(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test.proto t/test-full.pb-c.c t/test-full.pb-c.h: $(top_builddir)/protoc-c/protoc-c$(EXEEXT) $(top_srcdir)/t/test-full.proto - $(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) --c_out=$(top_builddir) $(top_srcdir)/t/test-full.proto + $(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-full.proto t/test-full.pb.cc t/test-full.pb.h: @PROTOC@ $(top_srcdir)/t/test-full.proto - $(AM_V_GEN)@PROTOC@ --cpp_out=$(top_builddir) $(top_srcdir)/t/test-full.proto + $(AM_V_GEN)@PROTOC@ -I$(top_srcdir) --cpp_out=$(top_builddir) $(top_srcdir)/t/test-full.proto t/generated-code2/test-full-cxx-output.inc: t/generated-code2/cxx-generate-packed-data$(EXEEXT) $(AM_V_GEN)$(top_builddir)/t/generated-code2/cxx-generate-packed-data$(EXEEXT) > $(top_builddir)/t/generated-code2/test-full-cxx-output.inc diff --git a/t/generated-code/test-generated-code.c b/t/generated-code/test-generated-code.c index 7db9910..1d62094 100644 --- a/t/generated-code/test-generated-code.c +++ b/t/generated-code/test-generated-code.c @@ -1,4 +1,4 @@ -#include "../test.pb-c.h" +#include "t/test.pb-c.h" #include #include #include diff --git a/t/generated-code2/cxx-generate-packed-data.cc b/t/generated-code2/cxx-generate-packed-data.cc index 0e60975..6d3fd7b 100644 --- a/t/generated-code2/cxx-generate-packed-data.cc +++ b/t/generated-code2/cxx-generate-packed-data.cc @@ -2,7 +2,7 @@ * these are tested against eachother to make sure the c and c++ agree. */ #define __STDC_LIMIT_MACROS -#include "../test-full.pb.h" +#include "t/test-full.pb.h" #include # if defined(_MSC_VER) /* On windows, in ms visual studio, define the types ourselves */ diff --git a/t/generated-code2/test-generated-code2.c b/t/generated-code2/test-generated-code2.c index a3fc400..817c2e2 100644 --- a/t/generated-code2/test-generated-code2.c +++ b/t/generated-code2/test-generated-code2.c @@ -1,8 +1,8 @@ #include #include #include -#include "../test-full.pb-c.h" -#include "test-full-cxx-output.inc" +#include "t/test-full.pb-c.h" +#include "t/generated-code2/test-full-cxx-output.inc" #define TEST_ENUM_SMALL_TYPE_NAME Foo__TestEnumSmall #define TEST_ENUM_SMALL(shortname) FOO__TEST_ENUM_SMALL__##shortname