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".
This commit is contained in:
Robert Edmonds 2013-11-18 13:53:28 -05:00
parent 3128296851
commit 43b94a4bc4
4 changed files with 10 additions and 12 deletions

View File

@ -13,7 +13,9 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-include $(top_builddir)/config.h \ -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_CFLAGS = ${my_CFLAGS}
AM_LDFLAGS = AM_LDFLAGS =
@ -42,10 +44,6 @@ protobuf_c_libprotobuf_c_la_LDFLAGS = $(AM_LDFLAGS) \
-export-symbols-regex "^(protobuf_c_[a-z].*)" \ -export-symbols-regex "^(protobuf_c_[a-z].*)" \
-no-undefined -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 pkgconfig_DATA += protobuf-c/libprotobuf-c.pc
CLEANFILES += protobuf-c/libprotobuf-c.pc CLEANFILES += protobuf-c/libprotobuf-c.pc
EXTRA_DIST += protobuf-c/libprotobuf-c.pc.in EXTRA_DIST += protobuf-c/libprotobuf-c.pc.in
@ -168,13 +166,13 @@ t_generated_code2_cxx_generate_packed_data_LDADD = \
$(protobuf_LIBS) $(protobuf_LIBS)
t/test.pb-c.c t/test.pb-c.h: $(top_builddir)/protoc-c/protoc-c$(EXEEXT) $(top_srcdir)/t/test.proto 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 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 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) 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 $(AM_V_GEN)$(top_builddir)/t/generated-code2/cxx-generate-packed-data$(EXEEXT) > $(top_builddir)/t/generated-code2/test-full-cxx-output.inc

View File

@ -1,4 +1,4 @@
#include "../test.pb-c.h" #include "t/test.pb-c.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>

View File

@ -2,7 +2,7 @@
* these are tested against eachother to make sure the c and c++ agree. */ * these are tested against eachother to make sure the c and c++ agree. */
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#include "../test-full.pb.h" #include "t/test-full.pb.h"
#include <limits.h> #include <limits.h>
# if defined(_MSC_VER) # if defined(_MSC_VER)
/* On windows, in ms visual studio, define the types ourselves */ /* On windows, in ms visual studio, define the types ourselves */

View File

@ -1,8 +1,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "../test-full.pb-c.h" #include "t/test-full.pb-c.h"
#include "test-full-cxx-output.inc" #include "t/generated-code2/test-full-cxx-output.inc"
#define TEST_ENUM_SMALL_TYPE_NAME Foo__TestEnumSmall #define TEST_ENUM_SMALL_TYPE_NAME Foo__TestEnumSmall
#define TEST_ENUM_SMALL(shortname) FOO__TEST_ENUM_SMALL__##shortname #define TEST_ENUM_SMALL(shortname) FOO__TEST_ENUM_SMALL__##shortname