From 453ac684258684e0e8413f4d9ef9822e753d9dbb Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 20 Mar 2007 11:15:29 +1100 Subject: [PATCH] Add --with-rpcgen= for configure so that the system rpcgen can be used. Ultimately it makes sense to remove remove rpcgen from the nfs-utils release as it is already in the glibc release. With this patch you can use the system rpcgen to make sure it works. It is not default yet, but it might be in a future release. --- configure.in | 11 ++++++++++- support/export/Makefile.am | 6 +++++- tools/Makefile.am | 8 +++++++- utils/rquotad/Makefile.am | 7 +++++-- utils/statd/Makefile.am | 7 +++++-- 5 files changed, 32 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 4f64523..1240656 100644 --- a/configure.in +++ b/configure.in @@ -115,7 +115,16 @@ AC_ARG_ENABLE(rquotad, RQUOTAD= fi AM_CONDITIONAL(CONFIG_RQUOTAD, [test "$enable_rquotad" = "yes"]) - +AC_ARG_WITH(rpcgen, + [AC_HELP_STRING([--with-rpcgen=/usr/bin/rpcgen], [use system rpcgen instead of compiling our own])], + if test "$withval" == "yes"; then + for p in /usr/local/bin/rpcgen /usr/bin/rpcgen /bin/rpcgen + do if test -f $p ; then withval=$p ; break; fi ; done + fi + RPCGEN_PATH=$withval, + RPCGEN_PATH= ) + AC_SUBST(RPCGEN_PATH) + AM_CONDITIONAL(CONFIG_RPCGEN, [test "$RPCGEN_PATH" == ""]) AC_ARG_ENABLE(mount, [AC_HELP_STRING([--enable-mount], [Create mount.nfs and don't use the util-linux mount(8) functionality. @<:@default=no@:>@])], diff --git a/support/export/Makefile.am b/support/export/Makefile.am index 7a6a441..1ea1539 100644 --- a/support/export/Makefile.am +++ b/support/export/Makefile.am @@ -1,6 +1,5 @@ ## Process this file with automake to produce Makefile.in -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen GENFILES_CLNT = mount_clnt.c GENFILES_XDR = mount_xdr.c @@ -22,8 +21,13 @@ dist-hook: rm ${distdir}/$$f; \ done +if CONFIG_RPCGEN +RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen $(RPCGEN): make -C $(top_srcdir)/tools/rpcgen all +else +RPCGEN = @RPCGEN_PATH@ +endif $(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN) test -f $@ && rm -rf $@ || true diff --git a/tools/Makefile.am b/tools/Makefile.am index 09f0c44..db15346 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,11 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = locktest rpcdebug rpcgen nlmtest +OPTDIRS = + +if CONFIG_RPCGEN +OPTDIRS += rpcgen +endif + +SUBDIRS = locktest rpcdebug nlmtest $(OPTDIRS) MAINTAINERCLEANFILES = Makefile.in diff --git a/utils/rquotad/Makefile.am b/utils/rquotad/Makefile.am index dcc15ac..4bc036f 100644 --- a/utils/rquotad/Makefile.am +++ b/utils/rquotad/Makefile.am @@ -1,6 +1,5 @@ ## Process this file with automake to produce Makefile.in -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen GENFILES_XDR = rquota_xdr.c GENFILES_H = rquota.h @@ -27,9 +26,13 @@ rquotad_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \ MAINTAINERCLEANFILES = Makefile.in - +if CONFIG_RPCGEN +RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen $(RPCGEN): make -C $(top_srcdir)/tools/rpcgen all +else +RPCGEN = @RPCGEN_PATH@ +endif $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) test -f $@ && rm -rf $@ || true diff --git a/utils/statd/Makefile.am b/utils/statd/Makefile.am index efe9356..2f71e29 100644 --- a/utils/statd/Makefile.am +++ b/utils/statd/Makefile.am @@ -2,8 +2,6 @@ man8_MANS = statd.man sm-notify.man -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen - GENFILES_CLNT = sm_inter_clnt.c GENFILES_SVC = sm_inter_svc.c GENFILES_XDR = sm_inter_xdr.c @@ -29,8 +27,13 @@ sm_notify_LDADD = $(LIBNSL) EXTRA_DIST = sim_sm_inter.x sm_inter.x $(man8_MANS) COPYRIGHT simulate.c +if CONFIG_RPCGEN +RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen $(RPCGEN): make -C ../../tools/rpcgen all +else +RPCGEN = @RPCGEN_PATH@ +endif $(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN) test -f $@ && rm -rf $@ || true -- 2.39.2