--- a/doc/Makefile.am	2016-08-10 20:19:02.000000000 +0600
+++ b/doc/Makefile.am	2018-08-15 14:54:01.497955600 +0600
@@ -34,7 +34,7 @@
 
 mkdefsinc: mkdefsinc.c Makefile $(top_builddir)/conf/config.h
 	$(CC_FOR_BUILD) -I. -I$(top_builddir)/conf  -I$(srcdir) \
-	   $(AM_CPPFLAGS) -o $@ $(srcdir)/mkdefsinc.c
+	   $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/mkdefsinc.c
 
 dist-hook: defsincdate
 
