--- libtirpc-1.0.1.orig/configure.ac	2015-10-30 16:15:14.000000000 +0100
+++ libtirpc-1.0.1/configure.ac	2015-11-29 16:38:38.817971632 +0100
@@ -89,7 +89,19 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h li
 AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
 
-AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
+AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
+
+AC_MSG_CHECKING([for a C compiler for build tools])
+if test $cross_compiling = yes; then
+   AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
+else
+   CC_FOR_BUILD=$CC
+fi
+AC_MSG_RESULT([$CC_FOR_BUILD])
+AC_SUBST(CC_FOR_BUILD)
+
+AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile rpcgen/Makefile])
+
 AC_OUTPUT(libtirpc.pc)
 
 
