THRIFT-4896 - prevent cpp and c_glib include directories from leaking into other targets (#1821)
- enable the automake `nostdinc` option
- fix up include paths
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index 114ff17..9b5fb4c 100755
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -17,7 +17,7 @@
# under the License.
#
-AUTOMAKE_OPTIONS = subdir-objects
+AUTOMAKE_OPTIONS = subdir-objects nostdinc
moc__%.cpp: %.h
$(QT5_MOC) $(QT5_CFLAGS) $< -o $@
diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am
index 5bb9eb7..2a0b9e6 100755
--- a/lib/cpp/test/Makefile.am
+++ b/lib/cpp/test/Makefile.am
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-AUTOMAKE_OPTIONS = subdir-objects serial-tests
+AUTOMAKE_OPTIONS = subdir-objects serial-tests nostdinc
BUILT_SOURCES = gen-cpp/AnnotationTest_types.h \
gen-cpp/DebugProtoTest_types.h \
@@ -408,7 +408,7 @@
gen-cpp/ChildService.cpp gen-cpp/ChildService.h gen-cpp/ParentService.cpp gen-cpp/ParentService.h gen-cpp/proc_types.cpp gen-cpp/proc_types.h: processor/proc.thrift
$(THRIFT) --gen cpp:templates,cob_style $<
-AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I.
+AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -I$(top_srcdir)/lib/cpp/src/thrift -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I.
AM_LDFLAGS = $(BOOST_LDFLAGS)
AM_CXXFLAGS = -Wall -Wextra -pedantic