changeset 6439:b951f3e42322 HEAD

Yet another try at getting rquota code compiling properly with BSD make.
author Timo Sirainen <tss@iki.fi>
date Tue, 18 Sep 2007 18:14:29 +0300
parents 2ab3cb6af745
children e10e2147d994
files src/plugins/quota/Makefile.am src/plugins/quota/quota-fs.c
diffstat 2 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/Makefile.am	Mon Sep 17 15:57:11 2007 +0300
+++ b/src/plugins/quota/Makefile.am	Tue Sep 18 18:14:29 2007 +0300
@@ -17,7 +17,7 @@
 	-lrpcsvc
 endif
 
-lib10_quota_plugin_la_SOURCES = \
+quota_dist_sources = \
 	quota.c \
 	quota-count.c \
 	quota-fs.c \
@@ -27,19 +27,23 @@
         quota-plugin.c \
 	quota-storage.c
 
+lib10_quota_plugin_la_SOURCES = \
+	$(quota_dist_sources) \
+	$(RQUOTA_XDR)
+
 if HAVE_RQUOTA
-lib10_quota_plugin_la_DEPENDENCIES = \
-	rquota_xdr.c
-
+RQUOTA_XDR = rquota_xdr.c
 RQUOTA_X = /usr/include/rpcsvc/rquota.x
-rquota_xdr.c: Makefile rquota.h $(RQUOTA_X)
-	$(RPCGEN) -c $(RQUOTA_X) | \
+rquota_xdr.c: Makefile $(RQUOTA_X)
+	(printf '#include "lib.h"'; $(RPCGEN) -c $(RQUOTA_X) | \
 	  sed -e 's/IXDR_PUT/(void)IXDR_PUT/g' \
-	    -e 's/int32_t \*buf/int32_t *buf ATTR_UNUSED/' > rquota_xdr.c
+	    -e 's/int32_t \*buf/int32_t *buf ATTR_UNUSED/' ) > rquota_xdr.c
 
-# BSD rpcgen wants to include the .h from current directory, so generate it
-rquota.h:
+rquota.h: Makefile $(RQUOTA_X)
 	$(RPCGEN) -h $(RQUOTA_X) > rquota.h
+
+quota-fs.lo: rquota.h
+
 endif
 
 noinst_HEADERS = \
@@ -55,5 +59,7 @@
 	  $(LN_S) ../lib10_quota_plugin.so $(DESTDIR)$(moduledir)/$$d; \
 	done
 
-distclean-generic:
-	rm -f Makefile rquota_xdr.c
+DISTFILES = $(DIST_COMMON) $(quota_dist_sources) $(TEXINFOS) $(EXTRA_DIST)
+
+clean-generic:
+	rm -f rquota_xdr.c rquota.h
--- a/src/plugins/quota/quota-fs.c	Mon Sep 17 15:57:11 2007 +0300
+++ b/src/plugins/quota/quota-fs.c	Tue Sep 18 18:14:29 2007 +0300
@@ -25,7 +25,7 @@
 #endif
 
 #ifdef HAVE_RQUOTA
-#  include "rquota_xdr.c"
+#  include "rquota.h"
 #  define RQUOTA_GETQUOTA_TIMEOUT_SECS 10
 #endif