Thread: Building PostgreSQL from Source using MinGW

Building PostgreSQL from Source using MinGW

From
"Lee, Patricia S."
Date:

I’m trying to build postgreSQL 8.0.3 from source using MinGW (the suggested emulator), and I don’t see any step-by-step instructions on how to do this.  I’ve seen the INSTALL and FAQ_MINGW docs, but it still doesn’t make sense to me.  After I’m finished and get this to compile, I would love to create such a document if one does not already exist.

 

First, I installed MinGW.

  1. Install MinGW
    1. Go to URL:  http://www.mingw.org/download.shtml
    2. Download:  MinGW-4.1.1.exe

                                                               i.      Install full set of packages

    1. Download:  MSYS-1.0.10.exe

                                                               i.      Answer y/n questions (installed MinGW on “c:/mingw”.  Make sure this is entered because you will not be able to mount the directory otherwise.)

 

Then, I did a configure using the following…

(I received the following errors when I then tried to do a make.  Any suggestions would be welcome.)

 

LEEP ~/sources/PostgreSQL/postgresql-8.0.3

$ configure --prefix=/c/PostgreSQL/8.0.3

checking build system type... i686-pc-mingw32

checking host system type... i686-pc-mingw32

checking which template to use... win32

checking whether to build with 64-bit integer date/time support... no

checking whether NLS is wanted... no

checking for default port number... 5432

checking for gcc... gcc

checking for C compiler default output... a.exe

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables... .exe

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking if gcc supports -Wdeclaration-after-statement... yes

checking if gcc supports -Wold-style-definition... yes

checking if gcc supports -Wendif-labels... yes

checking if gcc supports -fno-strict-aliasing... yes

configure: using CFLAGS=-O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wold-style-definition -Wendif-labels -fno-strict-aliasing

checking whether the C compiler still works... yes

checking how to run the C preprocessor... gcc -E

checking allow thread-safe client libraries... no

checking whether to build with Tcl... no

checking whether to build Perl modules... no

checking whether to build Python modules... no

checking whether to build with Kerberos 4 support... no

checking whether to build with Kerberos 5 support... no

checking whether to build with PAM support... no

checking whether to build with Rendezvous support... no

checking whether to build with OpenSSL support... no

configure: WARNING: *** Readline does not work on MinGW --- disabling

configure: using CPPFLAGS= -I./src/include/port/win32 -DEXEC_BACKEND

configure: using LDFLAGS=-Wl,--allow-multiple-definition

checking for gawk... gawk

checking for flex... no

configure: WARNING:

*** Without Flex you will not be able to build PostgreSQL from CVS or

*** change any of the scanner definition files.  You can obtain Flex from

*** a GNU mirror site.  (If you are using the official distribution of

*** PostgreSQL then you do not need to worry about this because the Flex

*** output is pre-generated.)

checking whether ln -s works... yes

checking for ld used by GCC... c:/mingw/mingw32/bin/ld.exe

checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes

checking for ranlib... ranlib

checking for lorder... no

checking for tar... /bin/tar

checking for strip... strip

checking whether it is possible to strip libraries... yes

checking for bison... no

configure: WARNING:

*** Without Bison you will not be able to build PostgreSQL from CVS or

*** change any of the parser definition files.  You can obtain Bison from

*** a GNU mirror site.  (If you are using the official distribution of

*** PostgreSQL then you do not need to worry about this because the Bison

*** output is pre-generated.)  To use a different yacc program (possible,

*** but not recommended), set the environment variable YACC before running

*** 'configure'.

checking for perl... no

checking for main in -lbsd... no

checking for setproctitle in -lutil... no

checking for main in -lm... yes

checking for main in -ldl... no

checking for main in -lnsl... no

checking for main in -lsocket... no

checking for main in -lipc... no

checking for main in -lIPC... no

checking for main in -llc... no

checking for main in -ldld... no

checking for main in -lld... no

checking for main in -lcompat... no

checking for main in -lBSD... no

checking for main in -lgen... no

checking for main in -lPW... no

checking for main in -lresolv... no

checking for library containing getopt_long... none required

checking for main in -lunix... no

checking for library containing crypt... no

checking for library containing fdatasync... no

checking for shmget in -lcygipc... no

checking for main in -lwsock32... yes

checking for inflate in -lz... no

configure: error: zlib library not found

If you have zlib already installed, see config.log for details on the

failure.  It is possible the compiler isn't looking in the proper directory.

Use --without-zlib to disable zlib support.

 

LEEP ~/sources/PostgreSQL/postgresql-8.0.3

$ make

You need to run the 'configure' program first. See the file

'INSTALL' for installation instructions.

make: *** [all] Error 1

LEEP ~/sources/PostgreSQL/postgresql-8.0.3

$ gmake

sh: gmake: command not found

 

Re: Building PostgreSQL from Source using MinGW

From
Tom Lane
Date:
"Lee, Patricia S." <Patricia.Lee@unisys.com> writes:
> I'm trying to build postgreSQL 8.0.3 from source using MinGW

The people who know how to do that probably don't hang out in
pgsql-novice ;-).  Try asking for help in pgsql-hackers-win32.

However, your immediate problem is simply failure to read configure's
error message:

> configure: error: zlib library not found
> If you have zlib already installed, see config.log for details on the
> failure.  It is possible the compiler isn't looking in the proper
> directory.
> Use --without-zlib to disable zlib support.

            regards, tom lane

Re: Building PostgreSQL from Source using MinGW

From
Bruce Momjian
Date:
Ah, so you read FAQ_MINGW.  Don't you see the line --without-zlib below.
That is what you need to use to build it, and this is mentioned in
FAQ_MINGW.

---------------------------------------------------------------------------

Lee, Patricia S. wrote:
> I'm trying to build postgreSQL 8.0.3 from source using MinGW (the
> suggested emulator), and I don't see any step-by-step instructions on
> how to do this.  I've seen the INSTALL and FAQ_MINGW docs, but it still
> doesn't make sense to me.  After I'm finished and get this to compile, I
> would love to create such a document if one does not already exist.
>
>
>
> First, I installed MinGW.
>
> 1.    Install MinGW
>
>     a.    Go to URL:  http://www.mingw.org/download.shtml
>     b.    Download:  MinGW-4.1.1.exe
> <http://prdownloads.sourceforge.net/mingw/MinGW-4.1.1.exe?download>
>
>                                                                i.
> Install full set of packages
>
>     c.    Download:  MSYS-1.0.10.exe
> <http://prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe?download>
>
>                                                                i.
> Answer y/n questions (installed MinGW on "c:/mingw".  Make sure this is
> entered because you will not be able to mount the directory otherwise.)
>
>
>
> Then, I did a configure using the following...
>
> (I received the following errors when I then tried to do a make.  Any
> suggestions would be welcome.)
>
>
>
> LEEP ~/sources/PostgreSQL/postgresql-8.0.3
>
> $ configure --prefix=/c/PostgreSQL/8.0.3
>
> checking build system type... i686-pc-mingw32
>
> checking host system type... i686-pc-mingw32
>
> checking which template to use... win32
>
> checking whether to build with 64-bit integer date/time support... no
>
> checking whether NLS is wanted... no
>
> checking for default port number... 5432
>
> checking for gcc... gcc
>
> checking for C compiler default output... a.exe
>
> checking whether the C compiler works... yes
>
> checking whether we are cross compiling... no
>
> checking for suffix of executables... .exe
>
> checking for suffix of object files... o
>
> checking whether we are using the GNU C compiler... yes
>
> checking whether gcc accepts -g... yes
>
> checking if gcc supports -Wdeclaration-after-statement... yes
>
> checking if gcc supports -Wold-style-definition... yes
>
> checking if gcc supports -Wendif-labels... yes
>
> checking if gcc supports -fno-strict-aliasing... yes
>
> configure: using CFLAGS=-O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wold-style-definition -Wendif-labels
> -fno-strict-aliasing
>
> checking whether the C compiler still works... yes
>
> checking how to run the C preprocessor... gcc -E
>
> checking allow thread-safe client libraries... no
>
> checking whether to build with Tcl... no
>
> checking whether to build Perl modules... no
>
> checking whether to build Python modules... no
>
> checking whether to build with Kerberos 4 support... no
>
> checking whether to build with Kerberos 5 support... no
>
> checking whether to build with PAM support... no
>
> checking whether to build with Rendezvous support... no
>
> checking whether to build with OpenSSL support... no
>
> configure: WARNING: *** Readline does not work on MinGW --- disabling
>
> configure: using CPPFLAGS= -I./src/include/port/win32 -DEXEC_BACKEND
>
> configure: using LDFLAGS=-Wl,--allow-multiple-definition
>
> checking for gawk... gawk
>
> checking for flex... no
>
> configure: WARNING:
>
> *** Without Flex you will not be able to build PostgreSQL from CVS or
>
> *** change any of the scanner definition files.  You can obtain Flex
> from
>
> *** a GNU mirror site.  (If you are using the official distribution of
>
> *** PostgreSQL then you do not need to worry about this because the Flex
>
> *** output is pre-generated.)
>
> checking whether ln -s works... yes
>
> checking for ld used by GCC... c:/mingw/mingw32/bin/ld.exe
>
> checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
>
> checking for ranlib... ranlib
>
> checking for lorder... no
>
> checking for tar... /bin/tar
>
> checking for strip... strip
>
> checking whether it is possible to strip libraries... yes
>
> checking for bison... no
>
> configure: WARNING:
>
> *** Without Bison you will not be able to build PostgreSQL from CVS or
>
> *** change any of the parser definition files.  You can obtain Bison
> from
>
> *** a GNU mirror site.  (If you are using the official distribution of
>
> *** PostgreSQL then you do not need to worry about this because the
> Bison
>
> *** output is pre-generated.)  To use a different yacc program
> (possible,
>
> *** but not recommended), set the environment variable YACC before
> running
>
> *** 'configure'.
>
> checking for perl... no
>
> checking for main in -lbsd... no
>
> checking for setproctitle in -lutil... no
>
> checking for main in -lm... yes
>
> checking for main in -ldl... no
>
> checking for main in -lnsl... no
>
> checking for main in -lsocket... no
>
> checking for main in -lipc... no
>
> checking for main in -lIPC... no
>
> checking for main in -llc... no
>
> checking for main in -ldld... no
>
> checking for main in -lld... no
>
> checking for main in -lcompat... no
>
> checking for main in -lBSD... no
>
> checking for main in -lgen... no
>
> checking for main in -lPW... no
>
> checking for main in -lresolv... no
>
> checking for library containing getopt_long... none required
>
> checking for main in -lunix... no
>
> checking for library containing crypt... no
>
> checking for library containing fdatasync... no
>
> checking for shmget in -lcygipc... no
>
> checking for main in -lwsock32... yes
>
> checking for inflate in -lz... no
>
> configure: error: zlib library not found
>
> If you have zlib already installed, see config.log for details on the
>
> failure.  It is possible the compiler isn't looking in the proper
> directory.
>
> Use --without-zlib to disable zlib support.
>
>
>
> LEEP ~/sources/PostgreSQL/postgresql-8.0.3
>
> $ make
>
> You need to run the 'configure' program first. See the file
>
> 'INSTALL' for installation instructions.
>
> make: *** [all] Error 1
>
> LEEP ~/sources/PostgreSQL/postgresql-8.0.3
>
> $ gmake
>
> sh: gmake: command not found
>
>
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073