diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 2fbc4b7595c1abc26989437c2e2e47834545cfe9..1009b27d0813cd739976a5f977fa085704dc717a 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -6,7 +6,7 @@
 # Copyright (c) 1998, Regents of the University of California
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.80 2004/10/12 01:04:09 momjian Exp $
+#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.81 2004/10/12 04:48:34 neilc Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -245,9 +245,9 @@ endif # enable_shared
 
 all-lib: all-static-lib all-shared-lib
 
-all-static-lib: $(PTHREAD_H_WIN32) $(top_srcdir)/src/port/pg_config_paths.h lib$(NAME).a
+all-static-lib: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h lib$(NAME).a
 
-all-shared-lib: $(PTHREAD_H_WIN32) $(top_srcdir)/src/port/pg_config_paths.h $(shlib)
+all-shared-lib: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h $(shlib)
 
 ifneq ($(PORTNAME), cygwin)
 ifneq ($(PORTNAME), win32)
diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile
index 7868929abac471fc8148842cb6f4f8f61a3a5767..13cd6207aca44941075aa3869a4155d0ff3e3087 100644
--- a/src/interfaces/ecpg/ecpglib/Makefile
+++ b/src/interfaces/ecpg/ecpglib/Makefile
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.27 2004/10/12 01:04:10 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.28 2004/10/12 04:48:35 neilc Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -30,7 +30,7 @@ OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
 SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
 	$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
 
-all: $(top_srcdir)/src/port/pg_config_paths.h all-lib
+all: $(top_builddir)/src/port/pg_config_paths.h all-lib
 
 # Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 9a1a8d8198601b836627d35f63e7481e51e3aef6..e8a418c92b05b6faf97ac33f15ae7603189c28a0 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.116 2004/10/12 01:04:11 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.117 2004/10/12 04:48:36 neilc Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -51,7 +51,7 @@ SHLIB_LINK += -lwsock32 -lws2_32 $(filter -leay32 -lssleay32, $(LIBS))
 endif
 
 
-all: $(PTHREAD_H_WIN32) $(top_srcdir)/src/port/pg_config_paths.h all-lib
+all: $(PTHREAD_H_WIN32) $(top_builddir)/src/port/pg_config_paths.h all-lib
 
 # Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib