@@ -22,22 +22,23 @@ dist-hook:
done
if CONFIG_RPCGEN
-RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen
-$(RPCGEN):
+RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen
+$(RPCGEN_DEP):
make -C $(top_srcdir)/tools/rpcgen all
+RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen
else
-RPCGEN = @RPCGEN_PATH@
+RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen
endif
-$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
+$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -l -o $@ $<
-$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
+$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -c -o $@ $<
-$(GENFILES_H): %.h: %.x $(RPCGEN)
+$(GENFILES_H): %.h: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -h -o $@ $<
rm -f $(top_builddir)/support/include/mount.h
@@ -15,26 +15,27 @@ libnsm_a_SOURCES = $(GENFILES) file.c rpc.c
BUILT_SOURCES = $(GENFILES)
if CONFIG_RPCGEN
-RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen
-$(RPCGEN):
- make -C ../../tools/rpcgen all
+RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen
+$(RPCGEN_DEP):
+ make -C $(top_srcdir)/tools/rpcgen all
+RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen
else
-RPCGEN = @RPCGEN_PATH@
+RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen
endif
-$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
+$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -l -o $@ $<
-$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN)
+$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -m -o $@ $<
-$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
+$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -c -o $@ $<
-$(GENFILES_H): %.h: %.x $(RPCGEN)
+$(GENFILES_H): %.h: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -h -o $@ $<
rm -f $(top_builddir)/support/include/sm_inter.h
@@ -17,26 +17,27 @@ nsm_client_LDADD = ../../support/nfs/libnfs.a \
../../support/nsm/libnsm.a $(LIBCAP) $(LIBTIRPC)
if CONFIG_RPCGEN
-RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen
-$(RPCGEN):
- make -C ../../tools/rpcgen all
+RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen
+$(RPCGEN_DEP):
+ make -C $(top_srcdir)/tools/rpcgen all
+RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen
else
-RPCGEN = @RPCGEN_PATH@
+RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen
endif
-$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
+$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -l -o $@ $<
-$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN)
+$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -m -o $@ $<
-$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
+$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -c -o $@ $<
-$(GENFILES_H): %.h: %.x $(RPCGEN)
+$(GENFILES_H): %.h: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -h -o $@ $<
new file mode 100755
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# This script is use solely by rpcgen when run during the build.
+# It allows using CPP from the environment rather than a hardcoded path.
+
+exec ${CPP} "$@"
@@ -23,26 +23,27 @@ sm_notify_LDADD = ../../support/nsm/libnsm.a \
EXTRA_DIST = sim_sm_inter.x $(man8_MANS) simulate.c
if CONFIG_RPCGEN
-RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen
-$(RPCGEN):
- make -C ../../tools/rpcgen all
+RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen
+$(RPCGEN_DEP):
+ make -C $(top_srcdir)/tools/rpcgen all
+RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen
else
-RPCGEN = @RPCGEN_PATH@
+RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen
endif
-$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
+$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -l -o $@ $<
-$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN)
+$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -m -o $@ $<
-$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
+$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -c -o $@ $<
-$(GENFILES_H): %.h: %.x $(RPCGEN)
+$(GENFILES_H): %.h: %.x $(RPCGEN_DEP)
test -f $@ && rm -rf $@ || true
$(RPCGEN) -h -o $@ $<