Re: Also cannot build the postgresql server under Mingw using 8.0 beta 2

Started by Dann Corbitover 21 years ago5 messages
#1Dann Corbit
DCorbit@connx.com

Adding this to the c.h file solved most of the problems for the libpq
DLL:

#if defined(HAVE_STRINGS_H) && !defined(_MSC_VER)
#include <strings.h>
#endif
...
#if defined(WIN32) && defined(_MSC_VER)
#include <winsock2.h>
#define snprintf _snprintf
#endif

Since I ran configure for MINGW (which has strings.h) it creates a
header file which is partly invalid for MS VC++

-----Original Message-----
From: Dann Corbit
Sent: Wednesday, September 01, 2004 12:00 PM
To: PostgreSQL-development
Subject: Also cannot build the postgresql server under Mingw
using 8.0 beta 2

Also cannot build the PostgreSQL server under Mingw

dlltool --dllname postgres.exe --output-exp postgres.exp --def
postgres.def
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations -L../../src/port -o postgres.exe
-Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o
bootstrap/SUBSYS.o catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o
executor/SUBSYS.o lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o
nodes/SUBSYS.o optimizer/SUBSYS.o port/SUBSYS.o postmaster/SUBSYS.o
regex/SUBSYS.o rewrite/SUBSYS.o storage/SUBSYS.o tcop/SUBSYS.o
utils/SUBSYS.o ../../src/timezone/SUBSYS.o -lpgport -lz -lwsock32
-lcrypt -lm -lws2_32
commands/SUBSYS.o(.text+0x2802b):tablespace.c: undefined
reference to `slat'
collect2: ld returned 1 exit status
make[2]: *** [postgres] Error 1
make[2]: Leaving directory
`/u/postgresql-8.0.0beta2/src/backend'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/u/postgresql-8.0.0beta2/src'
make: *** [all] Error 2

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Dann Corbit
Sent: Wednesday, September 01, 2004 11:30 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] can't build libpq with beta 2

U:\postgresql-8.0.0beta2\src\interfaces\libpq>nmake /f
win32.mak

Microsoft (R) Program Maintenance Utility Version
8.00.40607.16
Copyright (C) Microsoft Corporation. All rights
reserved.

Building the Win32 static library...

cl.exe @u:\tmp\nm33D2.tmp
cl : Command line warning D9002 : ignoring unknown
option '/YX'
cl : Command line warning D9035 : option 'GX' has been
deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of
'GX'
getaddrinfo.c
..\..\include\c.h(66) : fatal error C1083: Cannot open
include file: 'strings.h': No such file or directory
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Dann Corbit (#1)
Re: Also cannot build the postgresql server under Mingw

Dann Corbit wrote:

Adding this to the c.h file solved most of the problems for the libpq DLL:

#if defined(HAVE_STRINGS_H) && !defined(_MSC_VER)
#include <strings.h>
#endif
...
#if defined(WIN32) && defined(_MSC_VER)
#include <winsock2.h>
#define snprintf _snprintf
#endif
Since I ran configure for MINGW (which has strings.h) it creates a
header file which is partly invalid for MS VC++

We do not expect configure to create a setup for any use on Windows
other than building under MinGW.

cheers

andrew

#3Dann Corbit
DCorbit@connx.com
In reply to: Dann Corbit (#1)

-----Original Message-----
From: Andrew Dunstan [mailto:andrew@dunslane.net]
Sent: Wednesday, September 01, 2004 12:31 PM
To: Dann Corbit
Cc: PostgreSQL-development
Subject: Re: [HACKERS] Also cannot build the postgresql
server under Mingw using 8.0 beta 2

Dann Corbit wrote:

Adding this to the c.h file solved most of the problems for

the libpq

DLL:

#if defined(HAVE_STRINGS_H) && !defined(_MSC_VER)
#include <strings.h>
#endif
...
#if defined(WIN32) && defined(_MSC_VER)
#include <winsock2.h>
#define snprintf _snprintf
#endif
Since I ran configure for MINGW (which has strings.h) it creates a
header file which is partly invalid for MS VC++

We do not expect configure to create a setup for any use on Windows
other than building under MinGW.

Then why does the file \postgresql-8.0.0beta2\src\interfaces\libpq say
the following:
U:\postgresql-8.0.0beta2\src\interfaces\libpq>type win32.mak
# Makefile for Microsoft Visual C++ 5.0 (or compat)

If you really do build the interface under only one compiler that is a
titanic step down from before.

BTW, the missing symbol slat problem under Mingw has been isolated as
the following lines from pg_os_config.h:

/*
* Supplement to <sys/stat.h>.
*/
#define lstat slat

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Dann Corbit (#3)
Re: Also cannot build the postgresql server under Mingw

Dann Corbit wrote:

-----Original Message-----
From: Andrew Dunstan [mailto:andrew@dunslane.net]
Sent: Wednesday, September 01, 2004 12:31 PM
To: Dann Corbit
Cc: PostgreSQL-development
Subject: Re: [HACKERS] Also cannot build the postgresql
server under Mingw using 8.0 beta 2

Dann Corbit wrote:

Adding this to the c.h file solved most of the problems for

the libpq

DLL:

#if defined(HAVE_STRINGS_H) && !defined(_MSC_VER)
#include <strings.h>
#endif
...
#if defined(WIN32) && defined(_MSC_VER)
#include <winsock2.h>
#define snprintf _snprintf
#endif
Since I ran configure for MINGW (which has strings.h) it creates a
header file which is partly invalid for MS VC++

We do not expect configure to create a setup for any use on Windows
other than building under MinGW.

Then why does the file \postgresql-8.0.0beta2\src\interfaces\libpq say
the following:
U:\postgresql-8.0.0beta2\src\interfaces\libpq>type win32.mak
# Makefile for Microsoft Visual C++ 5.0 (or compat)

If you really do build the interface under only one compiler that is a
titanic step down from before.

You have missed the point. You should be able to build using that
makefile *without* having run configure. After all, you can't run
configure on Windows at all without MinGW or Cygwin. If you use it, it
not unreasonably assumes that that will be your build environment too.

cheers

andrew

#5Magnus Hagander
mha@sollentuna.net
In reply to: Dann Corbit (#3)

Known issue, and the patch is in cvs already. You need to change
include/port/win32.h, it has a spelling mistake for stat.

There was talk of re-wrapping beta-2 with this included, but I guess it
wasn't done. That leaves beta-2 unusable on win32 without manually
applying that patch. Might want to put that on the download page.

//Magnus

_____

From: Dann Corbit [mailto:DCorbit@connx.com]
Sent: Wednesday, September 01, 2004 9:00 PM
To: PostgreSQL-development
Subject: [HACKERS] Also cannot build the postgresql server under
Mingw using 8.0 beta 2

Also cannot build the PostgreSQL server under Mingw

dlltool --dllname postgres.exe --output-exp postgres.exp --def
postgres.def
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations -L../../src/port -o postgres.exe
-Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o
bootstrap/SUBSYS.o catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o
executor/SUBSYS.o lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o
nodes/SUBSYS.o optimizer/SUBSYS.o port/SUBSYS.o postmaster/SUBSYS.o
regex/SUBSYS.o rewrite/SUBSYS.o storage/SUBSYS.o tcop/SUBSYS.o
utils/SUBSYS.o ../../src/timezone/SUBSYS.o -lpgport -lz -lwsock32
-lcrypt -lm -lws2_32
commands/SUBSYS.o(.text+0x2802b):tablespace.c: undefined
reference to `slat'
collect2: ld returned 1 exit status
make[2]: *** [postgres] Error 1
make[2]: Leaving directory
`/u/postgresql-8.0.0beta2/src/backend'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/u/postgresql-8.0.0beta2/src'
make: *** [all] Error 2

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Dann Corbit
Sent: Wednesday, September 01, 2004 11:30 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] can't build libpq with beta 2

U:\postgresql-8.0.0beta2\src\interfaces\libpq>nmake /f
win32.mak

Microsoft (R) Program Maintenance Utility Version
8.00.40607.16
Copyright (C) Microsoft Corporation. All rights
reserved.

Building the Win32 static library...

cl.exe @u:\tmp\nm33D2.tmp
cl : Command line warning D9002 : ignoring unknown
option '/YX'
cl : Command line warning D9035 : option 'GX' has been
deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of
'GX'
getaddrinfo.c
..\..\include\c.h(66) : fatal error C1083: Cannot open
include file: 'strings.h': No such file or directory
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.