From 866b651bcb9f93f47582e5e2e4f1eb3155025298 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 10 Nov 2012 16:21:01 +0100
Subject: [PATCH] Add rpcgen program from nfs-utils sources
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr: update for 0.3.1]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
rpcgen/Makefile.am | 22 ++
rpcgen/rpc_clntout.c | 217 ++++++++++
rpcgen/rpc_cout.c | 706 +++++++++++++++++++++++++++++++++
rpcgen/rpc_hout.c | 490 +++++++++++++++++++++++
rpcgen/rpc_main.c | 1067 ++++++++++++++++++++++++++++++++++++++++++++++++++
rpcgen/rpc_output.h | 16 +
rpcgen/rpc_parse.c | 609 ++++++++++++++++++++++++++++
rpcgen/rpc_parse.h | 166 ++++++++
rpcgen/rpc_sample.c | 247 ++++++++++++
rpcgen/rpc_scan.c | 474 ++++++++++++++++++++++
rpcgen/rpc_scan.h | 103 +++++
rpcgen/rpc_svcout.c | 882 +++++++++++++++++++++++++++++++++++++++++
rpcgen/rpc_tblout.c | 165 ++++++++
rpcgen/rpc_util.c | 479 ++++++++++++++++++++++
rpcgen/rpc_util.h | 166 ++++++++
rpcgen/rpcgen.1 | 521 ++++++++++++++++++++++++
18 files changed, 6344 insertions(+), 2 deletions(-)
create mode 100644 rpcgen/Makefile.am
create mode 100644 rpcgen/rpc_clntout.c
create mode 100644 rpcgen/rpc_cout.c
create mode 100644 rpcgen/rpc_hout.c
create mode 100644 rpcgen/rpc_main.c
create mode 100644 rpcgen/rpc_output.h
create mode 100644 rpcgen/rpc_parse.c
create mode 100644 rpcgen/rpc_parse.h
create mode 100644 rpcgen/rpc_sample.c
create mode 100644 rpcgen/rpc_scan.c
create mode 100644 rpcgen/rpc_scan.h
create mode 100644 rpcgen/rpc_svcout.c
create mode 100644 rpcgen/rpc_tblout.c
create mode 100644 rpcgen/rpc_util.c
create mode 100644 rpcgen/rpc_util.h
create mode 100644 rpcgen/rpcgen.1
diff --git a/Makefile.am b/Makefile.am
index 466b6dd..8558289 100644
+SUBDIRS = src man doc rpcgen
noinst_HEADERS = tirpc/reentrant.h \
diff --git a/configure.ac b/configure.ac
index e3cb8af..0ea2e6e 100644
@@ -58,6 +58,18 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netine
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)
+AC_MSG_RESULT([$CC_FOR_BUILD])
+AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile rpcgen/Makefile])
diff --git a/rpcgen/Makefile.am b/rpcgen/Makefile.am
+COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -I../tirpc $(AM_CPPFLAGS) \
+ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
+LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
+noinst_PROGRAMS = rpcgen