Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Chuck McDevitt
Actually, the more I look at it, I realize it was correct before

We want to link against readline.lib and history.lib, but the ones in
the GnuWin32 distribution are broken.
The .lib files are made from the .def files, which are supposed to list
the exports, but don't.

They can be made from commands like this:

lib /machine:i386 /def:readline.def
lib /machine:i386 /def:history.def

But that only works if the .def files list the routines you want
exported.

It's easy enough to add the few we use by hand, but I'm not sure why
they aren't there.
Adding them, running those lib commands, allowed me to link with no
errors or warnings.

Maybe I need to do some research on readline... this seems more
complicated than I expected.
Does no one else use readline on Windows?  Is the Gnuwin32 readline a
fraud?  I just don't know.






 -Original Message-
 From: Chuck McDevitt
 Sent: Monday, September 24, 2007 2:17 PM
 To: Magnus Hagander
 Cc: pgsql-hackers@postgresql.org
 Subject: RE: [HACKERS] Suggestion for MSVC build
 
 The right lib files to link readline are the .a ones...
 
 Like this:
 
 if ($solution-{options}-{readline})
 {
   $psql-AddIncludeDir($solution-{options}-{readline} .
 '\include');
   $psql-AddLibrary($solution-{options}-{readline} .
 '\lib\libreadline.dll.a');
   $psql-AddLibrary($solution-{options}-{readline} .
 '\lib\libhistory.dll.a');
 }
 
\


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Chuck McDevitt
The .def files can be generated from cygwin or mingw's dlltool command:

erase readline.def 
erase history.def
dlltool --export-all-symbols -z readline.def libreadline.a
dlltool --export-all-symbols -z history.def libhistory.a
lib /machine:i386 /def:readline.def
lib /machine:i386 /def:history.def

(note: dlltool won't overwrite a def file if it exists).

But why would this be necessary?  It looks like the readline
distribution is broken.



 -Original Message-
 From: Chuck McDevitt
 Sent: Monday, September 24, 2007 11:59 PM
 To: 'Magnus Hagander'
 Cc: 'pgsql-hackers@postgresql.org'
 Subject: RE: [HACKERS] Suggestion for MSVC build
 
 Actually, the more I look at it, I realize it was correct before
 
 We want to link against readline.lib and history.lib, but the ones in
 the GnuWin32 distribution are broken.
 The .lib files are made from the .def files, which are supposed to
list
 the exports, but don't.
 
 They can be made from commands like this:
 
 lib /machine:i386 /def:readline.def
 lib /machine:i386 /def:history.def
 
 But that only works if the .def files list the routines you want
 exported.
 
 It's easy enough to add the few we use by hand, but I'm not sure why
 they aren't there.
 Adding them, running those lib commands, allowed me to link with no
 errors or warnings.
 
 Maybe I need to do some research on readline... this seems more
 complicated than I expected.
 Does no one else use readline on Windows?  Is the Gnuwin32 readline a
 fraud?  I just don't know.
 


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Dave Page

Chuck McDevitt wrote:

Maybe I need to do some research on readline... this seems more
complicated than I expected.
Does no one else use readline on Windows?  Is the Gnuwin32 readline a
fraud?  I just don't know.


readline has never worked well on Windows which is why we don't use it 
with the official builds. Even if you can get it to build, it'll only 
work in US locales iirc. From what you've posted of your experience, it 
doesn't sound like things have improved.


The other option is libedit, but last I tried that didn't even build on 
Windows. That was some time ago though.


Regards, Dave

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Magnus Hagander
On Mon, Sep 24, 2007 at 01:33:33PM -0400, Chuck McDevitt wrote:
 Sorry, completion_matches hasn't existed in readline for a long time.
 
 You need to define:
 
 #define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
 #define HAVE_RL_COMPLETION_MATCHES 1
 #define HAVE_RL_FILENAME_COMPLETION_FUNCTION 1
 
 Just like we do on Linux.

That wasn't in your orginal suggestion :-) 

Adding those it certainly works fine. (back to the lib issue, but that's a
different thing)

//Magnus

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Magnus Hagander
On Tue, Sep 25, 2007 at 02:58:54AM -0400, Chuck McDevitt wrote:
 Actually, the more I look at it, I realize it was correct before
 
 We want to link against readline.lib and history.lib, but the ones in
 the GnuWin32 distribution are broken.
 The .lib files are made from the .def files, which are supposed to list
 the exports, but don't.
 
 They can be made from commands like this:
 
 lib /machine:i386 /def:readline.def
 lib /machine:i386 /def:history.def
 
 But that only works if the .def files list the routines you want
 exported.
 
 It's easy enough to add the few we use by hand, but I'm not sure why
 they aren't there.
 Adding them, running those lib commands, allowed me to link with no
 errors or warnings.
 
 Maybe I need to do some research on readline... this seems more
 complicated than I expected.
 Does no one else use readline on Windows?  Is the Gnuwin32 readline a
 fraud?  I just don't know.

The libs for MSVC are certainly broken. I've filed a bug with the gnuwin32
project, though I'm unsure if they'll fix it (the other bug filed against
readilne has been open since march 2006 with no comment).
(http://sourceforge.net/tracker/index.php?func=detailaid=1801880group_id=23617atid=379173)

Can you check if your manually linked version works in non-US locales? If
you can't check, can you email me (offlist) with the binary (and the DLLs)
and I can run a test here. If they *have* fixed the issue so it works in
non-US locales, it's certainly worth expending some time making it work...

//Magnus

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Andrew Dunstan



Magnus Hagander wrote:

Can you check if your manually linked version works in non-US locales? If
you can't check, can you email me (offlist) with the binary (and the DLLs)
and I can run a test here. If they *have* fixed the issue so it works in
non-US locales, it's certainly worth expending some time making it work...


  


Many of us would like to see libedit ported to Windows too ;-)

Meanwhile, as I observed to Magnus the other day, while the Cygwin 
server has issues that make it unsuitable for production use, the Cygwin 
psql client is still probably the best one for working on Windows. I 
know people who install Cygwin just so they can use its psql. (And yes, 
I'll repeat Magnus' caveat: don't ever put Cygwin in your Windows path).


cheers

andrew

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Magnus Hagander
On Tue, Sep 25, 2007 at 06:09:36AM -0400, Andrew Dunstan wrote:
 
 
 Magnus Hagander wrote:
 Can you check if your manually linked version works in non-US locales? If
 you can't check, can you email me (offlist) with the binary (and the DLLs)
 and I can run a test here. If they *have* fixed the issue so it works in
 non-US locales, it's certainly worth expending some time making it work...
 
 
   
 
 Many of us would like to see libedit ported to Windows too ;-)

Yeah, it's on my (insanely long) TODO to look at sometime :-)

//Magnus

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Chuck McDevitt
 
  Many of us would like to see libedit ported to Windows too ;-)
 
 Yeah, it's on my (insanely long) TODO to look at sometime :-)
 
 //Magnus

I've thought about working on a libedit port myself, but I don't see how
that would help PostgreSQL unless the PostgreSQL community would be
willing to include the libedit code into our source tree
(pgsql/src/port/? ).

Otherwise it would just be downloadable from some obscure place that
most people won't find or trust.





---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Andrew Dunstan



Chuck McDevitt wrote:

Many of us would like to see libedit ported to Windows too ;-)
  

Yeah, it's on my (insanely long) TODO to look at sometime :-)

//Magnus



I've thought about working on a libedit port myself, but I don't see how
that would help PostgreSQL unless the PostgreSQL community would be
willing to include the libedit code into our source tree
(pgsql/src/port/? ).

Otherwise it would just be downloadable from some obscure place that
most people won't find or trust.
  



It would mean that the distributed Windows binaries would be free of 
GPLed code.


Most people don't actually build from source. I especially suspect that 
very few people build on Windows.


cheers

andrew

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Alvaro Herrera
Chuck McDevitt wrote:
  
   Many of us would like to see libedit ported to Windows too ;-)
  
  Yeah, it's on my (insanely long) TODO to look at sometime :-)
  
  //Magnus
 
 I've thought about working on a libedit port myself, but I don't see how
 that would help PostgreSQL unless the PostgreSQL community would be
 willing to include the libedit code into our source tree
 (pgsql/src/port/? ).
 
 Otherwise it would just be downloadable from some obscure place that
 most people won't find or trust.

Windows people only download the installer anyway, so that's not a
problem.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [HACKERS] Suggestion for MSVC build

2007-09-25 Thread Magnus Hagander
Chuck McDevitt wrote:
 Many of us would like to see libedit ported to Windows too ;-)
 Yeah, it's on my (insanely long) TODO to look at sometime :-)

 //Magnus
 
 I've thought about working on a libedit port myself, but I don't see how
 that would help PostgreSQL unless the PostgreSQL community would be
 willing to include the libedit code into our source tree
 (pgsql/src/port/? ).
 
 Otherwise it would just be downloadable from some obscure place that
 most people won't find or trust.

Others have already pointed out the gain for users who download binary
distributions. Heck, worst case, we can just stick a port on pgFoundry.

So - let me know if you actively start looking at this, and if so let's
cooperate.

//Magnus

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Suggestion for MSVC build

2007-09-24 Thread Magnus Hagander
What version readline are you using?

I tried with the latest download, and I get about 200 warnings like:
1.\src\bin\psql\tab-complete.c(600) : warning C4013: 'completion_matches'
undef
ined; assuming extern returning int
1.\src\bin\psql\tab-complete.c(600) : warning C4047: '=' : 'char **'
differs in
 levels of indirection from 'int'


And also, 12 linker errors - pretty much all the readline stuff. A quick
look at the files seem to show that the readline.lib and history.lib files
that ship with gnuwin32 are empty of symbols. The .def files are also
empty. Are yours different?


Also, do you know if this version of readline actually works on non-US
locales, or if it's still broken there? (I'd test it myself if I could just
build it :-P)

//Magnus

On Sun, Sep 23, 2007 at 10:03:09PM -0400, Chuck McDevitt wrote:
 It seems like there isn't any good reason the perl scripts for the MSVC
 build don't support readline
 
  
 
 Readline for windows is available as part of the GnuWin32 project. 
 
  
 
 http://gnuwin32.sourceforge.net/packages/readline.htm
 
  
 
 It normally installs to c:\Program Files\GnuWin32
 
  
 
 I'd update the scripts myself, but I'm not a PERL programmer.
 
 From what I can see, you'd add another line to config.pl for readline,
 and then add some stuff to  mkvcbuild.pm for psql  to do something like:
 
  
 
 if ($solution-{options}-{readline})
 
 {
 
  
 $psql-AddIncludeDir($solution-{options}-{readline} . '\include');
 
  
 $psql-AddLibrary($solution-{options}-{readline} .
 '\lib\readline.lib');
 
  
 $psql-AddLibrary($solution-{options}-{readline} .
 '\lib\history.lib');
 
 }
 
  
 
 And something to solution.pm in the part that builds pg_config.h that
 looks something like:
 
  
 
 if ($self-{options}-{readline})
 
 {
 
 print O #define
 HAVE_LIBREADLINE 1\n;
 
 print O #define
 HAVE_READLINE_READLINE_H 1\n;
 
 print O #define
 HAVE_READLINE_HISTORY_H 1\n;
 
 print O #define
 USE_READLINE 1\n;
 
 print O #define
 USE_READLINE_STATIC 1\n;
 
 }
 
 (Not sure about the last line).
 
  
 
 I don't know if this is a good idea, but I would think this would make
 psql more user-friendly on windows.
 
  
 
 Perhaps someone who understands readline and perl better than me might
 want to take this on?
 
  
 

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Suggestion for MSVC build

2007-09-24 Thread Chuck McDevitt
Sorry, completion_matches hasn't existed in readline for a long time.

You need to define:

#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
#define HAVE_RL_COMPLETION_MATCHES 1
#define HAVE_RL_FILENAME_COMPLETION_FUNCTION 1

Just like we do on Linux.


 -Original Message-
 From: Magnus Hagander [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 24, 2007 1:30 AM
 To: Chuck McDevitt
 Cc: pgsql-hackers@postgresql.org
 Subject: Re: [HACKERS] Suggestion for MSVC build
 
 What version readline are you using?
 
 I tried with the latest download, and I get about 200 warnings like:
 1.\src\bin\psql\tab-complete.c(600) : warning C4013:
 'completion_matches'
 undef
 ined; assuming extern returning int
 1.\src\bin\psql\tab-complete.c(600) : warning C4047: '=' : 'char **'
 differs in
  levels of indirection from 'int'
 
 
 And also, 12 linker errors - pretty much all the readline stuff. A
 quick
 look at the files seem to show that the readline.lib and history.lib
 files
 that ship with gnuwin32 are empty of symbols. The .def files are also
 empty. Are yours different?
 
 
 Also, do you know if this version of readline actually works on non-US
 locales, or if it's still broken there? (I'd test it myself if I could
 just
 build it :-P)
 
 //Magnus
 
 On Sun, Sep 23, 2007 at 10:03:09PM -0400, Chuck McDevitt wrote:
  It seems like there isn't any good reason the perl scripts for the
 MSVC
  build don't support readline
 
 
 
  Readline for windows is available as part of the GnuWin32 project.
 
 
 
  http://gnuwin32.sourceforge.net/packages/readline.htm
 
 
 
  It normally installs to c:\Program Files\GnuWin32
 
 
 
  I'd update the scripts myself, but I'm not a PERL programmer.
 
  From what I can see, you'd add another line to config.pl for
 readline,
  and then add some stuff to  mkvcbuild.pm for psql  to do something
 like:
 
 
 
  if ($solution-{options}-{readline})
 
  {
 
 
  $psql-AddIncludeDir($solution-{options}-{readline} . '\include');
 
 
  $psql-AddLibrary($solution-{options}-{readline} .
  '\lib\readline.lib');
 
 
  $psql-AddLibrary($solution-{options}-{readline} .
  '\lib\history.lib');
 
  }
 
 
 
  And something to solution.pm in the part that builds pg_config.h
that
  looks something like:
 
 
 
  if ($self-{options}-{readline})
 
  {
 
  print O #define
  HAVE_LIBREADLINE 1\n;
 
  print O #define
  HAVE_READLINE_READLINE_H 1\n;
 
  print O #define
  HAVE_READLINE_HISTORY_H 1\n;
 
  print O #define
  USE_READLINE 1\n;
 
  print O #define
  USE_READLINE_STATIC 1\n;
 
  }
 
  (Not sure about the last line).
 
 
 
  I don't know if this is a good idea, but I would think this would
 make
  psql more user-friendly on windows.
 
 
 
  Perhaps someone who understands readline and perl better than me
 might
  want to take this on?
 
 
 


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Suggestion for MSVC build

2007-09-24 Thread Chuck McDevitt
Also, I think I told you the wrong file to link to.  I think it is the
.a files, not the .lib files.
Let me check on that.

 -Original Message-
 From: Chuck McDevitt
 Sent: Monday, September 24, 2007 10:34 AM
 To: 'Magnus Hagander'
 Cc: pgsql-hackers@postgresql.org
 Subject: RE: [HACKERS] Suggestion for MSVC build
 
 Sorry, completion_matches hasn't existed in readline for a long time.
 
 You need to define:
 
 #define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
 #define HAVE_RL_COMPLETION_MATCHES 1
 #define HAVE_RL_FILENAME_COMPLETION_FUNCTION 1
 
 Just like we do on Linux.
 
 
  -Original Message-
  From: Magnus Hagander [mailto:[EMAIL PROTECTED]
  Sent: Monday, September 24, 2007 1:30 AM
  To: Chuck McDevitt
  Cc: pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Suggestion for MSVC build
 
  What version readline are you using?
 
  I tried with the latest download, and I get about 200 warnings like:
  1.\src\bin\psql\tab-complete.c(600) : warning C4013:
  'completion_matches'
  undef
  ined; assuming extern returning int
  1.\src\bin\psql\tab-complete.c(600) : warning C4047: '=' : 'char
**'
  differs in
   levels of indirection from 'int'
 
 
  And also, 12 linker errors - pretty much all the readline stuff. A
  quick
  look at the files seem to show that the readline.lib and history.lib
  files
  that ship with gnuwin32 are empty of symbols. The .def files are
also
  empty. Are yours different?
 
 
  Also, do you know if this version of readline actually works on non-
 US
  locales, or if it's still broken there? (I'd test it myself if I
 could
  just
  build it :-P)
 
  //Magnus
 
  On Sun, Sep 23, 2007 at 10:03:09PM -0400, Chuck McDevitt wrote:
   It seems like there isn't any good reason the perl scripts for the
  MSVC
   build don't support readline
  
  
  
   Readline for windows is available as part of the GnuWin32 project.
  
  
  
   http://gnuwin32.sourceforge.net/packages/readline.htm
  
  
  
   It normally installs to c:\Program Files\GnuWin32
  
  
  
   I'd update the scripts myself, but I'm not a PERL programmer.
  
   From what I can see, you'd add another line to config.pl for
  readline,
   and then add some stuff to  mkvcbuild.pm for psql  to do something
  like:
  
  
  
   if ($solution-{options}-{readline})
  
   {
  
  
   $psql-AddIncludeDir($solution-{options}-{readline} .
 '\include');
  
  
   $psql-AddLibrary($solution-{options}-{readline} .
   '\lib\readline.lib');
  
  
   $psql-AddLibrary($solution-{options}-{readline} .
   '\lib\history.lib');
  
   }
  
  
  
   And something to solution.pm in the part that builds pg_config.h
 that
   looks something like:
  
  
  
   if ($self-{options}-{readline})
  
   {
  
   print O #define
   HAVE_LIBREADLINE 1\n;
  
   print O #define
   HAVE_READLINE_READLINE_H 1\n;
  
   print O #define
   HAVE_READLINE_HISTORY_H 1\n;
  
   print O #define
   USE_READLINE 1\n;
  
   print O #define
   USE_READLINE_STATIC 1\n;
  
   }
  
   (Not sure about the last line).
  
  
  
   I don't know if this is a good idea, but I would think this would
  make
   psql more user-friendly on windows.
  
  
  
   Perhaps someone who understands readline and perl better than me
  might
   want to take this on?
  
  
  


---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Suggestion for MSVC build

2007-09-24 Thread Chuck McDevitt
The right lib files to link readline are the .a ones... 

Like this:

if ($solution-{options}-{readline})
{
$psql-AddIncludeDir($solution-{options}-{readline} .
'\include');
$psql-AddLibrary($solution-{options}-{readline} .
'\lib\libreadline.dll.a');
$psql-AddLibrary($solution-{options}-{readline} .
'\lib\libhistory.dll.a');
}

For using readline out of the dll.  I assume libreadline.a and
libhistory.a instead for static linking.

 -Original Message-
 From: Magnus Hagander [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 24, 2007 1:30 AM
 To: Chuck McDevitt
 Cc: pgsql-hackers@postgresql.org
 Subject: Re: [HACKERS] Suggestion for MSVC build
 
 What version readline are you using?
 
 I tried with the latest download, and I get about 200 warnings like:
 1.\src\bin\psql\tab-complete.c(600) : warning C4013:
 'completion_matches'
 undef
 ined; assuming extern returning int
 1.\src\bin\psql\tab-complete.c(600) : warning C4047: '=' : 'char **'
 differs in
  levels of indirection from 'int'
 
 
 And also, 12 linker errors - pretty much all the readline stuff. A
 quick
 look at the files seem to show that the readline.lib and history.lib
 files
 that ship with gnuwin32 are empty of symbols. The .def files are also
 empty. Are yours different?
 
 
 Also, do you know if this version of readline actually works on non-US
 locales, or if it's still broken there? (I'd test it myself if I could
 just
 build it :-P)
 
 //Magnus
 
 On Sun, Sep 23, 2007 at 10:03:09PM -0400, Chuck McDevitt wrote:
  It seems like there isn't any good reason the perl scripts for the
 MSVC
  build don't support readline
 
 
 
  Readline for windows is available as part of the GnuWin32 project.
 
 
 
  http://gnuwin32.sourceforge.net/packages/readline.htm
 
 
 
  It normally installs to c:\Program Files\GnuWin32
 
 
 
  I'd update the scripts myself, but I'm not a PERL programmer.
 
  From what I can see, you'd add another line to config.pl for
 readline,
  and then add some stuff to  mkvcbuild.pm for psql  to do something
 like:
 
 
 
  if ($solution-{options}-{readline})
 
  {
 
 
  $psql-AddIncludeDir($solution-{options}-{readline} . '\include');
 
 
  $psql-AddLibrary($solution-{options}-{readline} .
  '\lib\readline.lib');
 
 
  $psql-AddLibrary($solution-{options}-{readline} .
  '\lib\history.lib');
 
  }
 
 
 
  And something to solution.pm in the part that builds pg_config.h
that
  looks something like:
 
 
 
  if ($self-{options}-{readline})
 
  {
 
  print O #define
  HAVE_LIBREADLINE 1\n;
 
  print O #define
  HAVE_READLINE_READLINE_H 1\n;
 
  print O #define
  HAVE_READLINE_HISTORY_H 1\n;
 
  print O #define
  USE_READLINE 1\n;
 
  print O #define
  USE_READLINE_STATIC 1\n;
 
  }
 
  (Not sure about the last line).
 
 
 
  I don't know if this is a good idea, but I would think this would
 make
  psql more user-friendly on windows.
 
 
 
  Perhaps someone who understands readline and perl better than me
 might
  want to take this on?
 
 
 


---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


[HACKERS] Suggestion for MSVC build

2007-09-23 Thread Chuck McDevitt
It seems like there isn't any good reason the perl scripts for the MSVC
build don't support readline

 

Readline for windows is available as part of the GnuWin32 project. 

 

http://gnuwin32.sourceforge.net/packages/readline.htm

 

It normally installs to c:\Program Files\GnuWin32

 

I'd update the scripts myself, but I'm not a PERL programmer.

From what I can see, you'd add another line to config.pl for readline,
and then add some stuff to  mkvcbuild.pm for psql  to do something like:

 

if ($solution-{options}-{readline})

{

 
$psql-AddIncludeDir($solution-{options}-{readline} . '\include');

 
$psql-AddLibrary($solution-{options}-{readline} .
'\lib\readline.lib');

 
$psql-AddLibrary($solution-{options}-{readline} .
'\lib\history.lib');

}

 

And something to solution.pm in the part that builds pg_config.h that
looks something like:

 

if ($self-{options}-{readline})

{

print O #define
HAVE_LIBREADLINE 1\n;

print O #define
HAVE_READLINE_READLINE_H 1\n;

print O #define
HAVE_READLINE_HISTORY_H 1\n;

print O #define
USE_READLINE 1\n;

print O #define
USE_READLINE_STATIC 1\n;

}

(Not sure about the last line).

 

I don't know if this is a good idea, but I would think this would make
psql more user-friendly on windows.

 

Perhaps someone who understands readline and perl better than me might
want to take this on?