Thread: Finding zlib on MinGW

Finding zlib on MinGW

From
"Tony and Bryn Reina"
Date:
Perhaps this is well known to gurus, but I had some trouble with configuring a snapshot in MSys/MinGW because zlib couldn't be found. After some digging, I managed to find that gcc-mingw doesn't look for /usr/local/include and /usr/local/lib, which are the directories that a mingw-compiled version of zlib resides. In any case, I thought that maybe a little FAQ or note could be added to the install documentation to mention this.
 
Basically, if configure complains about not finding zlib, then confirm that it exists in /usr/local/lib and /usr/local/include (from your MSys shell). If not, then create these directories (as necessary) and build zlib using gcc-MinGW from the MSys shell (http://www.zlib.org). Once you have a good copy of zlib, then run configure in the Postgres installation with the options: --with-includes=/usr/local/include --with-libs=/usr/local/lib
 
Hopefully, those few lines should save a novice like me a little headache during a future win32 build from scratch.
 
-Tony
 

Re: Finding zlib on MinGW

From
Andrew Dunstan
Date:

Tony and Bryn Reina wrote:

> Perhaps this is well known to gurus, but I had some trouble with
> configuring a snapshot in MSys/MinGW because zlib couldn't be found.
> After some digging, I managed to find that gcc-mingw doesn't look for
> /usr/local/include and /usr/local/lib, which are the directories that
> a mingw-compiled version of zlib resides. In any case, I thought that
> maybe a little FAQ or note could be added to the install documentation
> to mention this.
>
> Basically, if configure complains about not finding zlib, then confirm
> that it exists in /usr/local/lib and /usr/local/include (from your
> MSys shell). If not, then create these directories (as necessary) and
> build zlib using gcc-MinGW from the MSys shell (http://www.zlib.org).
> Once you have a good copy of zlib, then run configure in the Postgres
> installation with the options: --with-includes=/usr/local/include
> --with-libs=/usr/local/lib
>
> Hopefully, those few lines should save a novice like me a little
> headache during a future win32 build from scratch.
>
>

or you could simply add --without-zlib to your postgresql configure flags

or you could configure the zlib install to use /usr instead of /usr/local

:-)

cheers

andrew


Re: Finding zlib on MinGW

From
"Tony and Bryn Reina"
Date:
> >
>
> or you could simply add --without-zlib to your postgresql configure flags
>
> or you could configure the zlib install to use /usr instead of /usr/local
>
> :-)
>

Sure, but we're talking about the first-time user. Particularily on Windows,
first-timers get extremely frustrated when things don't work right out of
the box. The more idiot proof the installation, the more likely that the
naive user will catch on.

-Tony

Re: Finding zlib on MinGW

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-hackers-win32-owner@postgresql.org
> [mailto:pgsql-hackers-win32-owner@postgresql.org] On Behalf
> Of Tony and Bryn Reina
> Sent: 08 July 2004 14:46
> To: Andrew Dunstan
> Cc: pgsql-hackers-win32@postgresql.org
> Subject: Re: [pgsql-hackers-win32] Finding zlib on MinGW
>
>
> Sure, but we're talking about the first-time user.
> Particularily on Windows, first-timers get extremely
> frustrated when things don't work right out of the box. The
> more idiot proof the installation, the more likely that the
> naive user will catch on.

Most users will not build from source, but will use the installer which
is nearing completion.

Regards, Dave.

Re: Finding zlib on MinGW

From
"Tony and Bryn Reina"
Date:
> Most users will not build from source, but will use the installer which
> is nearing completion.

> Regards, Dave.


Seems I'm just howling at the moon here. However, if the win32 source code
build is specifically for mingw/msys and zlib installs on msys into a
directory that isn't looked for by default by the PostgreSQL configure, then
I'd expect a lot of "problem" e-mails from users who complain about zlib
during installation. A simple fix (liking adding those directories to
PostgreSQL configure) could be done to prevent a little headache in the
future.

-Tony




Re: Finding zlib on MinGW

From
Bruce Momjian
Date:
Tony and Bryn Reina wrote:
> > Most users will not build from source, but will use the installer which
> > is nearing completion.
>
> > Regards, Dave.
>
>
> Seems I'm just howling at the moon here. However, if the win32 source code
> build is specifically for mingw/msys and zlib installs on msys into a
> directory that isn't looked for by default by the PostgreSQL configure, then
> I'd expect a lot of "problem" e-mails from users who complain about zlib
> during installation. A simple fix (liking adding those directories to
> PostgreSQL configure) could be done to prevent a little headache in the
> future.

If zlib was installed as part of mingw automatically, then we should
look in there by default, but if folks are installing mingw, I think
they would then know to point to that directory to find it.  If we
automatically look, we might find other stuff we shouldn't, no?

Let's see if others have this issue and if they do we can add such a
search path for Win32.

--
  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

Re: Finding zlib on MinGW

From
"Merlin Moncure"
Date:
> >
> > Seems I'm just howling at the moon here. However, if the win32
source
> code
> > build is specifically for mingw/msys and zlib installs on msys into
a
> > directory that isn't looked for by default by the PostgreSQL
configure,
> then
> > I'd expect a lot of "problem" e-mails from users who complain about
zlib
> > during installation. A simple fix (liking adding those directories
to
> > PostgreSQL configure) could be done to prevent a little headache in
the
> > future.
>
> If zlib was installed as part of mingw automatically, then we should
> look in there by default, but if folks are installing mingw, I think
> they would then know to point to that directory to find it.  If we
> automatically look, we might find other stuff we shouldn't, no?
>
> Let's see if others have this issue and if they do we can add such a
> search path for Win32.

The mingw environment is a little quriky.  It by default drops all user
compiled libraries in /local/lib, where all the standard libs are in
/mingw/lib, where postgresql currently looks.

I find it easier just to configure the libraries like zlib to put their
stuff in the mingw folder.  In lieu of making changes, I'd be happy to
write a compiling guide for win32 users who are unfamiliar with the
win32 environment.

Merlin

Re: Finding zlib on MinGW

From
Bruce Momjian
Date:
Merlin Moncure wrote:
> > If zlib was installed as part of mingw automatically, then we should
> > look in there by default, but if folks are installing mingw, I think
> > they would then know to point to that directory to find it.  If we
> > automatically look, we might find other stuff we shouldn't, no?
> >
> > Let's see if others have this issue and if they do we can add such a
> > search path for Win32.
>
> The mingw environment is a little quriky.  It by default drops all user
> compiled libraries in /local/lib, where all the standard libs are in
> /mingw/lib, where postgresql currently looks.
>
> I find it easier just to configure the libraries like zlib to put their
> stuff in the mingw folder.  In lieu of making changes, I'd be happy to
> write a compiling guide for win32 users who are unfamiliar with the
> win32 environment.

Is there any downside to adding /usr/local/lib and /usr/local/include
for mingw?  Those paths are searches by default on unix gcc.  Why isn't
that happening with mingw gcc?

--
  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

Re: Finding zlib on MinGW

From
"Merlin Moncure"
Date:
> Is there any downside to adding /usr/local/lib and /usr/local/include
> for mingw?  Those paths are searches by default on unix gcc.  Why
isn't
> that happening with mingw gcc?

No, there wouldn't be.  Good question.  The mingw system seems custom
set up to cause headaches.

Merlin