--- Makefile.am	2019-09-16 15:31:52.584052355 +0200
+++ Makefile.am	2019-09-16 17:06:33.643083502 +0200
@@ -593,7 +593,7 @@
 $(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc
 	mkdir -p $(PLUGIN_DIR) && \
 	cd $(PLUGIN_DIR) && \
-	$(CXX) $(CXXFLAGS) \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) \
 	   $(DEFS) $(VERSION_DEFS) \
 	  -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
 	  -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
@@ -614,10 +614,11 @@
 
 $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS))
 	cd $(PLUGIN_DIR) && \
-	$(CXX) $(CXXFLAGS) \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) \
 	  $(PLUGIN_OBJECTS) \
 	  $(GLIB_LIBS) \
 	  $(MOZILLA_LIBS) \
+	  $(LDFLAGS) \
 	  -shared -o $@
 
 # Start of CPP Unit test targets
@@ -629,7 +630,7 @@
 	for cppfile in $$(find $(CPP_UNITTEST_FRAMEWORK_SRCDIR) -name '*.cpp') ; \
 	do \
 	  objfile="$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$$(basename $${cppfile%.cpp}).o" ; \
-	  $(CXX) $(CXXFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \
+	  $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \
 	done ; \
 	ar cr $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o ; \
 	popd
@@ -648,7 +649,7 @@
 	do \
 	objfile="$(CPP_UNITTEST_DIR)/$$(basename $${cppfile%.cc}).o" ; \
 	echo "Compiling $$cppfile to $$objfile"; \
-	$(CXX) $(CXXFLAGS) \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) \
 	   $(DEFS) $(VERSION_DEFS) \
 	  -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
 	  -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
@@ -674,7 +675,7 @@
 
 $(CPP_UNITTEST_EXECUTABLE): $(CPP_UNITTEST_FRAMEWORK_LIB) stamps/cpp-unit-tests-compile.stamp 
 	cd $(CPP_UNITTEST_DIR) && \
-	$(CXX) $(CXXFLAGS) \
+	  $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) \
 	  $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) \
 	  $(CPP_UNITTEST_DIR)/*.o \
 	  -lrt \
@@ -1753,7 +1754,7 @@
 	
 $(COVERABLE_PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc
 	cd $(COVERABLE_PLUGIN_DIR) && \
-	$(CXX) $(CXXFLAGS) \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) \
 	   $(DEFS) $(VERSION_DEFS) \
 	  -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
 	  -DPLUGIN_NAME="\"IcedTea-Web Plugin with jacoco coverage agent\"" \
@@ -1775,7 +1776,7 @@
 
 $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS))
 	cd $(COVERABLE_PLUGIN_DIR) && \
-	$(CXX) $(CXXFLAGS) \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) \
 	  $(PLUGIN_OBJECTS) \
 	  $(GLIB_LIBS) \
 	  $(MOZILLA_LIBS) \
