Mail Archives: cygwin/2000/11/03/21:23:04
------_=_NextPart_000_01C04605.F04C0AB0
Content-Type: text/plain;
charset="iso-8859-1"
This is the same problem I posted to this list. I received the attached
e-mail from Jason Tishler and it works great!
> -----Original Message-----
> From: lbottorff AT harveycounty DOT com [mailto:lbottorff AT harveycounty DOT com]
> Sent: Friday, November 03, 2000 2:26 PM
> To: cygwin AT sourceware DOT cygnus DOT com; pgsql-ports AT postgresql DOT org
> Subject: [PORTS] Errors building Postgres on NT
>
>
>
>
> This is what I get when I try the configure of postgres
> 7.0.2 on my NT 4.0
> Workstation running cygwin dll 1.1.14
>
> linking ./include/port/win.h to include/os.h
> linking ./makefiles/Makefile.win to Makefile.port
> linking ./backend/port/tas/dummy.s to backend/port/tas.s
> configure: error: ./backend/port/tas/dummy.s: File not found
>
> This is a section of the make where it bombs:
>
> gcc -I../include -I../backend -I/usr/local/include -O2
> -I/usr/local/include
> -Wall -Wmissing-prototypes -Wmissing-declarations -c -o
> dllinit.o dllinit.c
> dllinit.c:49: conflicting types for `DllMain'
> dllinit.c:44: previous declaration of `DllMain'
> dllinit.c:49: conflicting types for `_cygwin_dll_entry'
> dllinit.c:49: previous declaration of `_cygwin_dll_entry'
> dllinit.c:81: conflicting types for `DllMain'
> dllinit.c:49: previous declaration of `DllMain'
> make[2]: *** [dllinit.o] Error 1
> make[2]: Leaving directory `/cygdrive/e/postgresql-7.0.2/src/utils'
> make[1]: *** [../utils/dllinit.o] Error 2
> make[1]: Leaving directory `/cygdrive/e/postgresql-7.0.2/src/backend'
> make: *** [all] Error 2
>
> Any ideas? (Besides get Linux--they won't let me!) Has
> anybody seen this before?
>
> Larry Bottorff
>
>
------_=_NextPart_000_01C04605.F04C0AB0
Content-Type: message/rfc822
Content-Description: Re: [PORTS] Compiling postgresql on WinNT
Message-ID: <20001102171609 DOT B1109 AT dothill DOT com>
From: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
To: Bob Love <blove AT allaire DOT com>
Cc: "'pgsql-ports AT postgresql DOT org'" <pgsql-ports AT postgresql DOT org>
Subject: Re: [PORTS] Compiling postgresql on WinNT
Date: Thu, 2 Nov 2000 17:16:10 -0500
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: multipart/mixed;
boundary="----_=_NextPart_002_01C04605.F04C0AB0"
------_=_NextPart_002_01C04605.F04C0AB0
Content-Type: text/plain;
charset="iso-8859-1"
Bob,
On Thu, Nov 02, 2000 at 04:15:12PM -0500, Bob Love wrote:
> Any help would be appreciated.
Please see the following:
http://people.freebsd.org/~kevlo/postgres/portNT.html
but use the attached patch instead.
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
------_=_NextPart_002_01C04605.F04C0AB0
Content-Type: text/plain;
name="Cygwin-1.1.4-PostgreSQL-7.0.2.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Cygwin-1.1.4-PostgreSQL-7.0.2.patch"
diff -upr postgresql-7.0.2.orig/src/backend/utils/Gen_fmgrtab.sh.in =
postgresql-7.0.2/src/backend/utils/Gen_fmgrtab.sh.in
--- postgresql-7.0.2.orig/src/backend/utils/Gen_fmgrtab.sh.in Sun May =
21 22:34:21 2000
+++ postgresql-7.0.2/src/backend/utils/Gen_fmgrtab.sh.in Thu Nov 2 =
12:57:25 2000
@@ -136,7 +136,12 @@ extern void load_file(char *filename);
*/
=20
/* We don't make this static so fmgr_faddr() macros can access it */
-extern FmgrInfo *fmgr_pl_finfo;
+#ifdef BUILDING_DLL
+#define DLL_INTERFACE __declspec(dllexport)
+#else
+#define DLL_INTERFACE __declspec(dllimport)
+#endif
+extern DLL_INTERFACE FmgrInfo *fmgr_pl_finfo;
=20
#define fmgr_faddr(finfo) \
( \
diff -upr postgresql-7.0.2.orig/src/backend/utils/error/elog.c =
postgresql-7.0.2/src/backend/utils/error/elog.c
--- postgresql-7.0.2.orig/src/backend/utils/error/elog.c Sat Apr 15 =
15:13:08 2000
+++ postgresql-7.0.2/src/backend/utils/error/elog.c Thu Nov 2 12:58:04 =
2000
@@ -37,9 +37,6 @@
#include "utils/trace.h"
#include "commands/copy.h"
=20
-extern int errno;
-extern int sys_nerr;
-
extern CommandDest whereToSendOutput;
=20
#ifdef USE_SYSLOG
@@ -105,6 +102,7 @@ elog(int lev, const char *fmt,...)
char *bp;
int indent =3D 0;
int space_needed;
+ int errno_copy =3D errno;
=20
#ifdef USE_SYSLOG
int log_level;
@@ -154,12 +152,22 @@ elog(int lev, const char *fmt,...)
break;
}
=20
- /* get errno string for %m */
- if (errno < sys_nerr && errno >=3D 0)
- errorstr =3D strerror(errno);
- else
+ /*
+ * get errno string for %m
+ * Standard UNIX (XPG4v2/UNIX95 and later) says that errno will be =
set
+ * (to EINVAL) if the argument to strerror() is out of range.
+ * IRIX and Solaris actually return NULL without setting errno.
+ * Others such as AIX, Cygwin and Linux return a string for all =
values.
+ * This string contains a number for out of range values.
+ * HPUX and QNX return the same string for all out of range values.
+ * Those will not be well served by this code. However it is =
highly
+ * unlikely that this code will be called with an out of range =
errno.
+ */
+ errno =3D 0;
+ errorstr =3D strerror(errno_copy);
+ if (errno !=3D 0 || errorstr =3D=3D NULL)
{
- sprintf(errorstr_buf, "error %d", errno);
+ sprintf(errorstr_buf, "error %d", errno_copy);
errorstr =3D errorstr_buf;
}
=20
diff -upr postgresql-7.0.2.orig/src/backend/utils/error/exc.c =
postgresql-7.0.2/src/backend/utils/error/exc.c
--- postgresql-7.0.2.orig/src/backend/utils/error/exc.c Wed Jan 26 =
00:57:20 2000
+++ postgresql-7.0.2/src/backend/utils/error/exc.c Thu Nov 2 12:58:04 =
2000
@@ -100,9 +100,9 @@ ExcPrint(Exception *excP,
ExcData data,
ExcMessage message)
{
- extern int errno;
- extern int sys_nerr;
-
+ int errno_copy =3D errno;
+ const char *errorstr;
+ =20
#ifdef lint
data =3D data;
#endif
@@ -127,10 +127,14 @@ ExcPrint(Exception *excP,
=20
fprintf(stderr, " (%ld)", detail);
=20
- if (errno > 0 && errno < sys_nerr)
- fprintf(stderr, " [%s]", strerror(errno));
- else if (errno !=3D 0)
- fprintf(stderr, " [Error %d]", errno);
+ if (errno_copy !=3D 0) {
+ errno =3D 0;
+ errorstr =3D strerror(errno_copy);
+ if (errno =3D=3D 0 && errorstr !=3D NULL)
+ fprintf(stderr, " [Error %d: %s]", errno_copy, errorstr);
+ else if (errno_copy !=3D 0)
+ fprintf(stderr, " [Error %d]", errno_copy);
+ }
=20
fprintf(stderr, "\n");
=20
diff -upr postgresql-7.0.2.orig/src/bin/psql/help.c =
postgresql-7.0.2/src/bin/psql/help.c
--- postgresql-7.0.2.orig/src/bin/psql/help.c Fri May 26 11:47:18 2000
+++ postgresql-7.0.2/src/bin/psql/help.c Thu Nov 2 12:57:25 2000
@@ -138,7 +138,7 @@ usage(void)
puts("available at <http://www.postgresql.org>.");
puts("Report bugs to <pgsql-bugs AT postgresql DOT org>.");
=20
-#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 Thu Nov 2 12:57:25 =
2000
@@ -9,6 +9,9 @@ MAKE_DLL=3Dtrue
#MAKE_DLL=3Dfalse
SHLIB_LINK=3D$(DLLLIBS)
=20
+CYGWIN_LIBS =3D -lm -lc
+LIBS:=3D$(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 Thu Nov 2 12:57:25 2000
@@ -40,21 +40,19 @@
#undef WIN32_LEAN_AND_MEAN
#include <stdio.h>
=20
-BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason,
- LPVOID reserved /* Not used. */ );
=20
#ifdef __CYGWIN32__
=20
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
/* save hInstance from DllMain */
-HINSTANCE __hDllInstance_base;
+HANDLE __hDllInstance_base;
=20
#endif /* __CYGWIN32__ */
=20
struct _reent *_impure_ptr;
=20
-extern struct _reent *__imp_reent_data;
+extern __declspec(dllimport) struct _reent reent_data;
=20
/*
=
*----------------------------------------------------------------------
@@ -84,7 +82,7 @@ DllMain(
__hDllInstance_base =3D hInst;
#endif /* __CYGWIN32__ */
=20
- _impure_ptr =3D __imp_reent_data;
+ _impure_ptr =3D &reent_data;
=20
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 Thu Nov 2 12:57:25 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:
=20
+ $ 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.
------_=_NextPart_002_01C04605.F04C0AB0--
------_=_NextPart_000_01C04605.F04C0AB0
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
------_=_NextPart_000_01C04605.F04C0AB0--
- Raw text -