Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Tue, 26 Sep 2000 15:21:46 -0400 From: Jason Tishler To: Cygwin , pgsql-ports AT postgresql DOT org Cc: J DOT Kraaijeveld AT Askesis DOT nl Subject: [PATCH]: Building PostgreSQL 7.0.2 on Cygwin 1.1.4 (Take 2) Message-ID: <20000926152146.D1016@KOSH> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yvTN2TtaGp7iPZ1q" Content-Disposition: inline User-Agent: Mutt/1.2.4i Organization: Dot Hill Systems Corp. --yvTN2TtaGp7iPZ1q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Please ignore my previous post... On Tue, Sep 26, 2000 at 07:08:53PM +0200, Joost Kraaijeveld wrote: > I read you patch etc. but I do not agree with the linking of msvcrt.lib. > I think that it should be solved with an #ifdef (see below). That way we > do not need any Microsoft libraries. As Joost was kind enough to point out, there was a deficiency with my previous patch. Please ignore the previous patch and use this one instead. Sorry for the confusion. Jason -- Jason Tishler Director, Software Engineering Phone: +1 (732) 264-8770 x235 Dot Hill Systems Corporation Fax: +1 (732) 264-8798 82 Bethany Road, Suite 7 Email: Jason DOT Tishler AT dothill DOT com Hazlet, NJ 07730 USA WWW: http://www.dothill.com --yvTN2TtaGp7iPZ1q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=ChangeLog Tue Sep 26 11:15:38 2000 Jason Tishler * src/backend/utils/Gen_fmgrtab.sh.in: Add conditional compilation to appropriately import/export fmgr_pl_finfo with __declspec(dllimport)/ __declspec(dllexport), respectively. Note that these declarations manifest themselves in fmgr.h since it is generated by Gen_fmgrtab.sh. * src/backend/utils/error/elog.c: Add conditional compilation to deal with sys_nerr/_sys_nerr inconsistencies. * src/backend/utils/error/exc.c (ExcPrint): Ditto. * src/bin/psql/help.c (usage): Change #ifdef to include check for Cygwin to prevent free-ing of memory obtained from getpwuid(). * src/makefiles/Makefile.win: Add filtering out of -lm and -lc from LIBS to prevent the linking with multiple instances of libcygwin.a crash problems. * src/utils/dllinit.c: Update to be consistent with Cygwin Net Release. * src/win32/README: Change wording to indicate that un.h is no longer needed when building against the Cygwin Net Release. --yvTN2TtaGp7iPZ1q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Instructions 1. Replace /usr/include/cygwin/cygwin_dll.h with a post 1.1.4 version from Cygwin's CVS repository or a development snapshot. The following is a known good version: http://sources.redhat.com/cygwin/snapshots/cygwin-src-20000918.tar.bz2/winsup/cygwin/include/cygwin/cygwin_dll.h 2. Apply patch: $ cd postgresql-7.0.2 $ patch -p1 ."); puts("Report bugs to ."); -#ifndef WIN32 +#if !defined(WIN32) && !defined(__CYGWIN__) if (pw) free(pw); #endif diff -upr postgresql-7.0.2.orig/src/makefiles/Makefile.win postgresql-7.0.2/src/makefiles/Makefile.win --- postgresql-7.0.2.orig/src/makefiles/Makefile.win Tue Mar 9 08:39:15 1999 +++ postgresql-7.0.2/src/makefiles/Makefile.win Tue Sep 26 10:07:23 2000 @@ -9,6 +9,9 @@ MAKE_DLL=true #MAKE_DLL=false SHLIB_LINK=$(DLLLIBS) +CYGWIN_LIBS = -lm -lc +LIBS:=$(filter-out $(CYGWIN_LIBS), $(LIBS)) + %.dll: %.o $(DLLTOOL) --export-all --output-def $*.def $< $(DLLWRAP) -o $@ --def $*.def $< $(SRCDIR)/utils/dllinit.o $(DLLLIBS) diff -upr postgresql-7.0.2.orig/src/utils/dllinit.c postgresql-7.0.2/src/utils/dllinit.c --- postgresql-7.0.2.orig/src/utils/dllinit.c Tue May 25 12:15:32 1999 +++ postgresql-7.0.2/src/utils/dllinit.c Mon Sep 25 12:18:01 2000 @@ -40,21 +40,19 @@ #undef WIN32_LEAN_AND_MEAN #include -BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, - LPVOID reserved /* Not used. */ ); #ifdef __CYGWIN32__ #include DECLARE_CYGWIN_DLL(DllMain); /* save hInstance from DllMain */ -HINSTANCE __hDllInstance_base; +HANDLE __hDllInstance_base; #endif /* __CYGWIN32__ */ struct _reent *_impure_ptr; -extern struct _reent *__imp_reent_data; +extern __declspec(dllimport) struct _reent reent_data; /* *---------------------------------------------------------------------- @@ -84,7 +82,7 @@ DllMain( __hDllInstance_base = hInst; #endif /* __CYGWIN32__ */ - _impure_ptr = __imp_reent_data; + _impure_ptr = &reent_data; switch (reason) { diff -upr postgresql-7.0.2.orig/src/win32/README postgresql-7.0.2/src/win32/README --- postgresql-7.0.2.orig/src/win32/README Sun Jan 17 01:27:05 1999 +++ postgresql-7.0.2/src/win32/README Tue Sep 26 10:45:12 2000 @@ -1,3 +1,7 @@ -Add the included headers endian.h into Cygwin's include/, tcp.h into -include/netinet, and un.h into include/sys. +Copy the following headers to Cygwin's include directories: + $ cp endian.h /usr/include + $ cp tcp.h /usr/include/netinet + +Note that un.h is already included in Cygwin's Net Release so it no longer +needs to be manually copied and can be removed from this directory. --yvTN2TtaGp7iPZ1q Content-Type: text/plain; charset=us-ascii -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com --yvTN2TtaGp7iPZ1q--