b91cfe
--- quota-tools/Makefile.in.orig	2008-01-24 06:52:54.658544000 -0500
b91cfe
+++ quota-tools/Makefile.in	2008-01-24 06:56:58.930806000 -0500
b91cfe
@@ -52,6 +52,10 @@ LIBOBJS += @LIBMALLOC@
cvsdist 902fba
  
cvsdist 902fba
 all: $(PROGS)
cvsdist 902fba
 
cvsdist 902fba
+                                                                                
cvsdist 902fba
+svc_socket.o rquota_server.o rquota_svc.o $(filter-out rquota_xdr.o,$(LIBOBJS)): %.o: %.c
cvsdist 902fba
+	$(CC) $(CFLAGS) -fpie -c $<
cvsdist 902fba
+
cvsdist 902fba
 clean:
cvsdist 902fba
 	-rm -f core *.o .*.d
cvsdist 902fba
 
b91cfe
@@ -130,7 +134,8 @@ setquota: setquota.o quotaops.o $(LIBOBJ
cvsdist 902fba
 convertquota: convertquota.o $(LIBOBJS)
cvsdist 902fba
 
cvsdist 902fba
 rpc.rquotad: rquota_server.o rquota_svc.o svc_socket.o $(LIBOBJS)
cvsdist 902fba
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
cvsdist 902fba
+	$(CC) $(LDFLAGS) -pie -o $@ $^ $(LIBS)
cvsdist 902fba
+	@if readelf -d $@|fgrep -q TEXTREL; then echo "*** Text relocation"; false; else true; fi
cvsdist 902fba
 
b91cfe
 ifneq ($(NETLINKLIBS),)
b91cfe
 quota_nld: quota_nld.o $(LIBOBJS)
b91cfe
@@ -146,7 +151,7 @@ rquota_xdr.c: rquota.x
cvsdist 902fba
 	$(RPCGEN) -c -o $@ $<
cvsdist 902fba
 
cvsdist 902fba
 rquota_xdr.o: rquota_xdr.c rquota.h
cvsdist 902fba
-	$(CC) $(CFLAGS) -Wno-unused -c $<
cvsdist 902fba
+	$(CC) $(CFLAGS) -Wno-unused -fpie -c $<
cvsdist 902fba
 
cvsdist 902fba
 rquota_clnt.c: rquota.x
cvsdist 902fba
 	$(RPCGEN) -l -o $@ $<