Index: configure.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/configure.in,v retrieving revision 1.311 diff -c -r1.311 configure.in *** configure.in 19 Jan 2004 21:20:05 -0000 1.311 --- configure.in 2 Feb 2004 06:29:03 -0000 *************** *** 261,267 **** # We already have this in Makefile.win32, but configure needs it too if test "$PORTNAME" = "win32"; then ! CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32" fi # Check if the compiler still works with the template settings --- 261,267 ---- # We already have this in Makefile.win32, but configure needs it too if test "$PORTNAME" = "win32"; then ! CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND" fi # Check if the compiler still works with the template settings *************** *** 905,912 **** # Win32 can't to rename or unlink on an open file case $host_os in mingw*) - AC_LIBOBJ(dirmod) AC_LIBOBJ(copydir) AC_LIBOBJ(gettimeofday) AC_LIBOBJ(pipe) ;; esac --- 905,912 ---- # Win32 can't to rename or unlink on an open file case $host_os in mingw*) AC_LIBOBJ(copydir) + AC_LIBOBJ(rand) AC_LIBOBJ(gettimeofday) AC_LIBOBJ(pipe) ;; esac Index: src/backend/port/win32/Makefile =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/port/win32/Makefile,v retrieving revision 1.2 diff -c -r1.2 Makefile *** src/backend/port/win32/Makefile 29 Nov 2003 19:51:54 -0000 1.2 --- src/backend/port/win32/Makefile 2 Feb 2004 06:29:10 -0000 *************** *** 12,18 **** top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global ! OBJS = sema.o shmem.o all: SUBSYS.o --- 12,18 ---- top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global ! OBJS = dirmod.o sema.o shmem.o all: SUBSYS.o *************** *** 22,28 **** depend dep: $(CC) -MM $(CFLAGS) *.c >depend ! clean: rm -f SUBSYS.o $(OBJS) ifeq (depend,$(wildcard depend)) --- 22,28 ---- depend dep: $(CC) -MM $(CFLAGS) *.c >depend ! clean: rm -f SUBSYS.o $(OBJS) ifeq (depend,$(wildcard depend)) Index: src/bin/pg_resetxlog/Makefile =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_resetxlog/Makefile,v retrieving revision 1.3 diff -c -r1.3 Makefile *** src/bin/pg_resetxlog/Makefile 29 Nov 2003 19:52:06 -0000 1.3 --- src/bin/pg_resetxlog/Makefile 2 Feb 2004 06:29:19 -0000 *************** *** 12,20 **** top_builddir = ../../.. include $(top_builddir)/src/Makefile.global ! OBJS= pg_resetxlog.o pg_crc.o ! all: submake-libpgport pg_resetxlog pg_resetxlog: $(OBJS) $(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@ --- 12,22 ---- top_builddir = ../../.. include $(top_builddir)/src/Makefile.global ! OBJS= pg_resetxlog.o pg_crc.o dirmod.o ! override CPPFLAGS := $(CPPFLAGS) -DFRONTEND ! ! all: submake-libpq submake-libpgport pg_resetxlog pg_resetxlog: $(OBJS) $(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@ *************** *** 22,27 **** --- 24,32 ---- pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c rm -f $@ && $(LN_S) $< . + dirmod.c: $(top_srcdir)/src/backend/port/win32/dirmod.c + rm -f $@ && $(LN_S) $< . + install: all installdirs $(INSTALL_PROGRAM) pg_resetxlog$(X) $(DESTDIR)$(bindir)/pg_resetxlog$(X) *************** *** 32,35 **** rm -f $(DESTDIR)$(bindir)/pg_resetxlog$(X) clean distclean maintainer-clean: ! rm -f pg_resetxlog$(X) pg_resetxlog.o pg_crc.o pg_crc.c --- 37,40 ---- rm -f $(DESTDIR)$(bindir)/pg_resetxlog$(X) clean distclean maintainer-clean: ! rm -f pg_resetxlog$(X) pg_resetxlog.o pg_crc.o pg_crc.c dirmod.o dirmod.c Index: src/include/port.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/port.h,v retrieving revision 1.17 diff -c -r1.17 port.h *** src/include/port.h 2 Feb 2004 00:17:23 -0000 1.17 --- src/include/port.h 2 Feb 2004 06:29:19 -0000 *************** *** 30,38 **** extern off_t ftello(FILE *stream); #endif ! #if !defined(FRONTEND) && (defined(WIN32) || defined(CYGWIN)) /* ! * Win32 doesn't have reliable rename/unlink during concurrent access */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); --- 30,40 ---- extern off_t ftello(FILE *stream); #endif ! #if (defined(WIN32) || defined(CYGWIN)) /* ! * Win32 doesn't have reliable rename/unlink during concurrent access, so ! * this is provided by dirmod.c in backend/port/; FRONTEND applications, ! * like pg_resetxlog, are expected to compile + link in dirmod for themselves. */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); Index: src/port/dirmod.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.9 diff -c -r1.9 dirmod.c *** src/port/dirmod.c 2 Feb 2004 00:17:23 -0000 1.9 --- src/port/dirmod.c 2 Feb 2004 06:29:19 -0000 *************** *** 17,23 **** --- 17,29 ---- #ifndef TEST_VERSION + #if (defined(WIN32) || defined(CYGWIN)) + + #ifndef FRONTEND #include "postgres.h" + #else + #include "postgres_fe.h" + #endif #undef rename #undef unlink *************** *** 95,100 **** --- 101,107 ---- return 0; } + #endif #else