--- postgresql-8.0.0cvs/src/bin/pg_ctl/pg_ctl.c.orig 2004-10-15 13:35:42.000000000 +0200 +++ postgresql-8.0.0cvs/src/bin/pg_ctl/pg_ctl.c 2004-10-15 18:17:30.093750000 +0200 @@ -23,6 +23,9 @@ #if defined(__CYGWIN__) #include +#ifndef WIN32 +#define WIN32 +#endif #endif #ifndef HAVE_OPTRESET @@ -99,7 +102,7 @@ static void do_status(void); static void do_kill(pgpid_t pid); -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) static bool pgwin32_IsInstalled(SC_HANDLE); static char *pgwin32_CommandLine(bool); static void pgwin32_doRegister(); @@ -120,7 +123,7 @@ static char conf_file[MAXPGPATH]; -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) static void write_eventlog(int level, const char *line) { @@ -158,7 +161,7 @@ va_list ap; va_start(ap, fmt); -#if !defined(WIN32) && !defined(__CYGWIN__) +#if !defined(WIN32) /* On Unix, we just fprintf to stderr */ vfprintf(stderr, fmt, ap); #else @@ -322,7 +325,7 @@ * http://dev.remotenetworktechnology.com/cmd/cmdfaq.htm */ if (log_file != NULL) -#if !defined(WIN32) && !defined(__CYGWIN__) +#if !defined(WIN32) || defined(__CYGWIN__) snprintf(cmd, MAXPGPATH, "%s\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &%s", #else snprintf(cmd, MAXPGPATH, "%sSTART /B \"\" \"%s\" %s%s < \"%s\" >> \"%s\" 2>&1%s", @@ -330,7 +333,7 @@ SYSTEMQUOTE, postgres_path, pgdata_opt, post_opts, DEVNULL, log_file, SYSTEMQUOTE); else -#if !defined(WIN32) && !defined(__CYGWIN__) +#if !defined(WIN32) || defined(__CYGWIN__) snprintf(cmd, MAXPGPATH, "%s\"%s\" %s%s < \"%s\" 2>&1 &%s", #else snprintf(cmd, MAXPGPATH, "%sSTART /B \"\" \"%s\" %s%s < \"%s\" 2>&1%s", @@ -811,7 +814,7 @@ } } -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) static bool pgwin32_IsInstalled(SC_HANDLE hSCM) @@ -1089,14 +1092,14 @@ printf(_(" %s reload [-D DATADIR] [-s]\n"), progname); printf(_(" %s status [-D DATADIR]\n"), progname); printf(_(" %s kill SIGNALNAME PROCESSID\n"), progname); -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) printf(_(" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR] [-w] [-o \"OPTIONS\"]\n"), progname); printf(_(" %s unregister [-N SERVICENAME]\n"), progname); #endif printf(_("Common options:\n")); printf(_(" -D, --pgdata DATADIR location of the database storage area\n")); printf(_(" -s, --silent only print errors, no informational messages\n")); -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) printf(_(" -N service name with which to register PostgreSQL server\n")); printf(_(" -P password of account to register PostgreSQL server\n")); printf(_(" -U user name of account to register PostgreSQL server\n")); @@ -1205,7 +1208,7 @@ int c; pgpid_t killproc = 0; -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) setvbuf(stderr, NULL, _IONBF, 0); #endif @@ -1352,7 +1355,7 @@ set_sig(argv[++optind]); killproc = atol(argv[++optind]); } -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) else if (strcmp(argv[optind], "register") == 0) ctl_command = REGISTER_COMMAND; else if (strcmp(argv[optind], "unregister") == 0) @@ -1442,8 +1445,8 @@ case KILL_COMMAND: do_kill(killproc); break; -#if defined(WIN32) || defined(__CYGWIN__) +#if defined(WIN32) case REGISTER_COMMAND: pgwin32_doRegister(); break; --- postgresql-8.0.0cvs/contrib/spi/Makefile.orig 2004-08-20 22:13:08.000000000 +0200 +++ postgresql-8.0.0cvs/contrib/spi/Makefile 2004-10-04 12:50:55.000000000 +0200 @@ -17,4 +17,6 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif + +SHLIB_LINK += -L$(top_builddir)/src/port -lpgport --- postgresql-8.0.0cvs/src/interfaces/libpq/Makefile.orig 2004-10-15 13:35:50.000000000 +0200 +++ postgresql-8.0.0cvs/src/interfaces/libpq/Makefile 2004-10-15 13:39:05.000000000 +0200 @@ -30,6 +30,10 @@ dllist.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o \ $(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o, $(LIBOBJS)) +ifeq ($(PORTNAME), cygwin) +override shlib = cyg$(NAME)$(DLSUFFIX) +endif + ifeq ($(PORTNAME), win32) OBJS += win32.o libpqrc.o libpqrc.o : libpq.rc