Ok, based on feedback from Tom and Peter, here is another stab at moving
pg_autovacuum from: contrib/pg_autovacuum to: src/backend/postmaster

In summary pg_autovacuum.c has to be moved to src/backend/postmaster,
pg_autovacuum.h moves to src/include.  The apply the attached patch
which makes the required changes to src/include/pg_autovacuum.h,
contrib/Makefile and src/backend/postmaster/Makefile.

Please review my changes to src/backen/postmaster/Makefile as my make
skill are very limited and I would bet there is better way to do it.

Also, this keeps pg_autovacuum as a stand-alone executable for the time
being. Time permitting, I will make the postmaster launch and kill this
app as needed, or fold it into the postmaster more like the stats
collector.  But for now this gets it out of contrib.


Matthew O'Connor


*** ./contrib/Makefile.orig	2004-05-29 04:22:36.628996015 -0400
--- ./contrib/Makefile	2004-05-29 04:22:44.104175838 -0400
***************
*** 24,30 ****
  		miscutil	\
  		noupdate	\
  		oid2name	\
- 		pg_autovacuum	\
  		pg_dumplo	\
  		pg_logger	\
  		pgbench		\
--- 24,29 ----
*** ./src/backend/postmaster/Makefile.orig	2004-05-29 02:46:53.000000000 -0400
--- ./src/backend/postmaster/Makefile	2004-05-29 04:05:47.000000000 -0400
***************
*** 12,29 ****
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global
  
! OBJS = postmaster.o pgstat.o
  
! all: SUBSYS.o
  
  SUBSYS.o: $(OBJS)
  	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
  
  depend dep:
  	$(CC) -MM $(CFLAGS) *.c >depend
  
  clean: 
! 	rm -f SUBSYS.o $(OBJS) 
  
  ifeq (depend,$(wildcard depend))
  include depend
--- 12,35 ----
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global
  
! OBJS = postmaster.o pgstat.o 
  
! all: submake-libpq SUBSYS.o pg_autovacuum
  
  SUBSYS.o: $(OBJS)
  	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
  
+ pg_autovacuum: pg_autovacuum.o
+ 	$(CC) $(CFLAGS) -I $(libpq_srcdir) -DFRONTEND pg_autovacuum.o $(libpq) $(LDFLAGS) $(LIBS) -o [EMAIL PROTECTED](X)
+ 
+ install: all installdirs
+ 	$(INSTALL_PROGRAM) pg_autovacuum$(X) $(DESTDIR)$(bindir)/pg_autovacuum$(X)
+ 
  depend dep:
  	$(CC) -MM $(CFLAGS) *.c >depend
  
  clean: 
! 	rm -f SUBSYS.o pg_autovacuum.o $(OBJS) 
  
  ifeq (depend,$(wildcard depend))
  include depend
*** ./src/include/pg_autovacuum.h.orig	2004-05-29 02:44:35.000000000 -0400
--- ./src/include/pg_autovacuum.h	2004-05-29 03:24:58.000000000 -0400
***************
*** 14,20 ****
  
  /* These next two lines are correct when pg_autovaccum is compiled
     from within the postgresql source tree  */
! #include "libpq-fe.h"
  #include "lib/dllist.h"
  /* Had to change the last two lines to compile on
     Redhat outside of postgresql source tree */
--- 14,20 ----
  
  /* These next two lines are correct when pg_autovaccum is compiled
     from within the postgresql source tree  */
! #include "../interfaces/libpq/libpq-fe.h"
  #include "lib/dllist.h"
  /* Had to change the last two lines to compile on
     Redhat outside of postgresql source tree */
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to