Skip site navigation (1) Skip section navigation (2)

Re: bug in config

From: Jason Tishler <jason(at)tishler(dot)net>
To: Scott <scott(dot)ellis(at)aetas(dot)com(dot)au>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: bug in config
Date: 2002-08-23 13:17:32
Message-ID: 20020823131732.GD1356@tishler.net (view raw or flat)
Thread:
Lists: pgsql-cygwin
Scott,

On Sun, Aug 18, 2002 at 10:14:07PM +1000, Scott wrote:
> Anyway, I built the
> libpq++ libs using the win32.mak files and NMAKE for use in my vc++
> progs, then I ran the configure script for cygwin and built
> postgresql...I found afterward that the "pg_config_os.h" (in
> postgresql-7.2.1/src/include) contained a line that said " #include
> <cygwin/version.h>", but this line occurs just before an "#ifdef
> __CYGWIN__" statement. This stopped my vc++ programs from compiling. I
> found that putting the include after the ifdef allows me to use the
> same headers under both environments...

I don't believe that the above is the right solution.  If it works then,
you are lucky.  It's also a very fragile solution that is subject to
break in the future.

> I'm supposing that this include statement is written into the code by the
> configure scripts, and that moving it down a line or two would be a simple
> thing for someone in the know :)

Under Cygwin (and the other Unixes), pg_config.h is created by
configure.  pg_config.h #includes pg_config_os.h which is a symlink to
the OS specific header file -- port/win.h is this case.  Under Windows,
pg_config.h is a copy of pg_config.h.win32 which is *only* created
during nmake if pg_config.h did not previously exist.

So, you were "lucky" that building with VC++ after configuring for
Cygwin almost worked.  My WAG is if you configure for a different Unix
such as Solaris you would have more than one line to "fix."

IMO, the best solution is to add an install target to win32.mak.  In
this way, one could do a nmake install and then point VC++ to this
installation directory.  Now your VC++ builds are independent of the
source tree -- freeing it up for other platform builds.

Since you have the VC++ itch, please submit a patch to pgsql-patches to
rectify this situation.  Please include a patch to the documentation
too:

    doc/src/sgml/install-win32.sgml

Thanks,
Jason

In response to

pgsql-cygwin by date

Next:From: E.BoydDate: 2002-08-23 13:32:19
Subject: Problems installing DBI
Previous:From: Yared MengistuDate: 2002-08-23 02:10:24
Subject: A newbie question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group