+local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I.
+if BINDINGS_CXX
+local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
+endif
+# Ensure that local include directories are always searched first.
+AM_CPPFLAGS = $(local_includes) -D_DEFAULT_SOURCE -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
+
+# The tests CFLAGS are a superset of the libsigrok CFLAGS, and the
+# python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
+AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(TESTS_CFLAGS)
+AM_CXXFLAGS = $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)