--- libtirpc-1.0.1.orig/Makefile.am	2015-10-30 16:15:14.000000000 +0100
+++ libtirpc-1.0.1/Makefile.am	2015-11-29 16:38:58.340674483 +0100
@@ -1,6 +1,12 @@
-SUBDIRS = src man doc
+SUBDIRS = src man doc rpcgen
 ACLOCAL_AMFLAGS = -I m4
 
+GENFILES	       = tirpc/rpcsvc/crypt.h \
+			 tirpc/rpcsvc/mount.h \
+			 tirpc/rpcsvc/nfs_prot.h \
+			 tirpc/rpcsvc/rquota.h \
+			 tirpc/rpc/rpcb_prot.h
+
 noinst_HEADERS	       = tirpc/reentrant.h \
 			 tirpc/getpeereid.h \
 			 tirpc/libc_private.h \
@@ -8,7 +14,9 @@ noinst_HEADERS	       = tirpc/reentrant.
 
 nobase_include_HEADERS = tirpc/netconfig.h \
 			 tirpc/rpcsvc/crypt.x \
-			 tirpc/rpcsvc/crypt.h \
+			 tirpc/rpcsvc/mount.x \
+			 tirpc/rpcsvc/nfs_prot.x \
+			 tirpc/rpcsvc/rquota.x \
 			 tirpc/rpc/xdr.h \
 			 tirpc/rpc/types.h \
 			 tirpc/rpc/svc_soc.h \
@@ -21,7 +29,6 @@ nobase_include_HEADERS = tirpc/netconfig
 			 tirpc/rpc/rpcent.h \
 			 tirpc/rpc/rpc_com.h \
 			 tirpc/rpc/rpcb_prot.x \
-			 tirpc/rpc/rpcb_prot.h \
 			 tirpc/rpc/rpcb_clnt.h \
 			 tirpc/rpc/raw.h \
 			 tirpc/rpc/pmap_rmt.h \
@@ -48,5 +55,17 @@ endif
 pkgconfigdir=$(libdir)/pkgconfig
 pkgconfig_DATA = libtirpc.pc
 
-CLEANFILES	       = cscope.* *~
+nobase_nodist_include_HEADERS = $(GENFILES)
+BUILT_SOURCES = $(GENFILES)
+
+$(GENFILES): %.h: %.x $(top_builddir)/rpcgen/rpcgen
+	mkdir -p $(dir $@)
+	$(top_builddir)/rpcgen/rpcgen -h -o $@ $<
+
+$(top_builddir)/rpcgen/rpcgen: force
+	cd rpcgen && $(MAKE)
+
+force:
+
+CLEANFILES	       = cscope.* *~ $(GENFILES)
 DISTCLEANFILES	       = Makefile.in libtirpc*.tar.gz
