diff -ur gsoap-2.8.orig/gsoap/samples/autotest/Makefile.am gsoap-2.8/gsoap/samples/autotest/Makefile.am
--- gsoap-2.8.orig/gsoap/samples/autotest/Makefile.am	2023-12-23 15:54:31.000000000 +0100
+++ gsoap-2.8/gsoap/samples/autotest/Makefile.am	2024-08-06 22:58:23.355925359 +0200
@@ -5,8 +5,6 @@
 ## you have all needed files, that a GNU package needs
 AUTOMAKE_OPTIONS = subdir-objects foreign 1.4
 
-CPPFLAGS=-I$(top_srcdir)/gsoap -I$(top_srcdir)/gsoap/plugin
-AM_LDFLAGS=$(CPPFLAGS) -I$(top_srcdir)/gsoap/samples/autotest -L$(top_srcdir)/gsoap/samples/autotest
 SOAP=$(top_srcdir)/gsoap/src/soapcpp2$(EXEEXT)
 WSDL=$(top_srcdir)/gsoap/wsdl/wsdl2h$(EXEEXT)
 WSDL_FLAGS=-d -P -t $(top_srcdir)/gsoap/samples/autotest/typemap.dat
@@ -36,8 +34,7 @@
 
 noinst_PROGRAMS=autotest
 
-autotest_CFLAGS=$(C_DEBUG_FLAGS) -D$(platform)
-autotest_CPPFLAGS=$(C_DEBUG_FLAGS) -D$(platform)
+autotest_CPPFLAGS=$(C_DEBUG_FLAGS) -D$(platform) -I$(top_srcdir)/gsoap -I$(top_srcdir)/gsoap/plugin
 autotest_CXXFLAGS=$(WSDL2H_EXTRA_FLAGS)
 autotest_SOURCES=$(SOAP_CPP_SRC) soapTester.cpp duration.cpp long_time.cpp struct_tm.cpp struct_tm_date.cpp
 autotest_LDADD=$(SOAP_CPP_LIB) $(SAMPLE_EXTRA_LIBS)
diff -ur gsoap-2.8.orig/gsoap/samples/aws/Makefile.am gsoap-2.8/gsoap/samples/aws/Makefile.am
--- gsoap-2.8.orig/gsoap/samples/aws/Makefile.am	2023-12-23 15:54:32.000000000 +0100
+++ gsoap-2.8/gsoap/samples/aws/Makefile.am	2024-08-06 22:18:52.431708358 +0200
@@ -10,6 +10,6 @@
 include ../Makefile.cpp_proxy_rules_j
 SOAP_NS = AmazonS3SoapBinding.nsmap
 
-aws_CPPFLAGS = $(WSDL2H_EXTRA_FLAGS)
+aws_CPPFLAGS = $(AM_CPPFLAGS) $(WSDL2H_EXTRA_FLAGS)
 aws_SOURCES = aws-s3.cpp $(SOAPHEADER) $(SOAP_CPP_CORE) soapAmazonS3SoapBindingProxy.cpp
 aws_LDADD = $(SOAP_CPP_LIB_SSL) $(SAMPLE_EXTRA_LIBS) $(SAMPLE_SSL_LIBS)
diff -ur gsoap-2.8.orig/gsoap/samples/databinding/Makefile.am gsoap-2.8/gsoap/samples/databinding/Makefile.am
--- gsoap-2.8.orig/gsoap/samples/databinding/Makefile.am	2023-12-23 15:54:32.000000000 +0100
+++ gsoap-2.8/gsoap/samples/databinding/Makefile.am	2024-08-06 22:58:25.252931139 +0200
@@ -5,8 +5,6 @@
 ## you have all needed files, that a GNU package needs
 AUTOMAKE_OPTIONS = subdir-objects foreign 1.4
 
-CPPFLAGS=$(SAMPLE_INCLUDES) -I$(top_srcdir)/gsoap -I$(top_srcdir)/gsoap/plugin
-AM_LDFLAGS=$(AM_CPPFLAGS) -I$(top_srcdir)/gsoap/samples/databinding -L$(top_srcdir)/gsoap/samples/databinding
 SOAP=$(top_srcdir)/gsoap/src/soapcpp2$(EXEEXT)
 WSDL=$(top_srcdir)/gsoap/wsdl/wsdl2h$(EXEEXT)
 WSDL_FLAGS=-g -t $(top_srcdir)/gsoap/samples/databinding/addresstypemap.dat
@@ -24,8 +22,7 @@
 
 noinst_PROGRAMS=address
 
-address_CFLAGS=$(C_DEBUG_FLAGS) -D$(platform)
-address_CPPFLAGS=$(C_DEBUG_FLAGS) -D$(platform)
+address_CPPFLAGS=$(C_DEBUG_FLAGS) -D$(platform) $(SAMPLE_INCLUDES) -I$(top_srcdir)/gsoap -I$(top_srcdir)/gsoap/plugin
 address_CXXFLAGS=$(WSDL2H_EXTRA_FLAGS)
 address_SOURCES=$(SOAP_CPP_SRC) address.cpp
 address_LDADD=$(SOAP_CPP_LIB)
diff -ur gsoap-2.8.orig/gsoap/samples/Makefile.defines gsoap-2.8/gsoap/samples/Makefile.defines
--- gsoap-2.8.orig/gsoap/samples/Makefile.defines	2023-12-23 15:54:32.000000000 +0100
+++ gsoap-2.8/gsoap/samples/Makefile.defines	2024-08-06 22:16:35.483293057 +0200
@@ -3,7 +3,7 @@
 
 AM_CFLAGS=-D$(platform)
 AM_CXXFLAGS=-D$(platform)
-CPPFLAGS=$(SAMPLE_INCLUDES) -I$(top_srcdir)/gsoap -I$(top_srcdir)/gsoap/plugin $(SOAPCPP2_NO_C_LOCALE)
+AM_CPPFLAGS=$(SAMPLE_INCLUDES) -I$(top_srcdir)/gsoap -I$(top_srcdir)/gsoap/plugin $(SOAPCPP2_NO_C_LOCALE)
 SOAP=$(top_srcdir)/gsoap/src/soapcpp2
 
 SOAP_NS_DEF=ns.nsmap ns.wsdl
diff -ur gsoap-2.8.orig/gsoap/samples/xml-rpc-json/Makefile.am gsoap-2.8/gsoap/samples/xml-rpc-json/Makefile.am
--- gsoap-2.8.orig/gsoap/samples/xml-rpc-json/Makefile.am	2023-12-23 15:54:31.000000000 +0100
+++ gsoap-2.8/gsoap/samples/xml-rpc-json/Makefile.am	2024-08-06 22:18:19.139607400 +0200
@@ -13,11 +13,11 @@
 jsoncpp_SOURCES = jsoncpp.cpp xml-rpc.cpp json.cpp $(SOAPHEADER) $(SOAP_CPP_CORE)
 jsoncpp_LDADD = $(SOAP_CPP_LIB) $(SAMPLE_EXTRA_LIBS)
 
-json_GitHub_CPPFLAGS = $(WSDL2H_EXTRA_FLAGS)
+json_GitHub_CPPFLAGS = $(AM_CPPFLAGS) $(WSDL2H_EXTRA_FLAGS)
 json_GitHub_SOURCES = json-GitHub.cpp xml-rpc.cpp json.cpp $(SOAPHEADER) $(SOAP_CPP_CORE)
 json_GitHub_LDADD = $(SOAP_CPP_LIB_SSL) $(SAMPLE_EXTRA_LIBS) $(SAMPLE_SSL_LIBS)
 
-json_gdm_CPPFLAGS = $(WSDL2H_EXTRA_FLAGS)
+json_gdm_CPPFLAGS = $(AM_CPPFLAGS) $(WSDL2H_EXTRA_FLAGS)
 json_gdm_SOURCES = json-GoogleDistanceMatrix.cpp xml-rpc.cpp json.cpp $(SOAPHEADER) $(SOAP_CPP_CORE)
 json_gdm_LDADD = $(SOAP_CPP_LIB_SSL) $(SAMPLE_EXTRA_LIBS) $(SAMPLE_SSL_LIBS)
 
