+# Make libguestfs use the convenience library.
+noinst_LTLIBRARIES = librc_protocol.la
+guestfish_LDADD += librc_protocol.la ../gnulib/lib/libgnu.la
+
+if HAVE_RPCGEN
+rc_protocol.c: rc_protocol.x
+ rm -f $@-t $@-t2
+ $(RPCGEN) -c -o $@-t $<
+ sed 's,\.\./\.\./fish/,,' < $@-t > $@-t2
+ rm $@-t
+ mv $@-t2 $@
+
+rc_protocol.h: rc_protocol.x
+ rm -f $@-t
+ $(RPCGEN) -h -o $@-t $<
+ mv $@-t $@
+endif