Ticket #41 (closed enhancement: noresponse)

Opened 3 years ago

Last modified 2 months ago

Windows alternative for configure script

Reported by: jtv Assigned to: jtv
Priority: low Milestone: 3.0
Component: portability Version: 2.6
Severity: normal Keywords:
Cc:

Description

It's annoying for Windows users working without a Unix-like environment that they need to edit an included file, win32/common, by hand to match their own installations. This file is under revision control and is distributed with the source code, so it is easy to lose one's changes.

Some script similar to configure ought to generate this file. The script could add some guessing logic for finding the available libpq installations, e.g. by calling pg_config if it is available or as a backup strategy, searching the system for instances of the required header and library files. It could also print instructions for obtaining and installing these files if needed.

Attachments

Change History

03/06/06 11:34:44 changed by Bart Samwel <bart@samwel.tk>

Suggestion: rename common to common-sample, or preferably to another name than "common", because it's only common between the two VC++ makefiles and it's not used by the MinGW makefiles.

Doing something configure-like is harder to do on Windows, mainly because users will probably want to use the libpq debug libraries as well, which means that they need to install the PostgreSQL source code, which counts as another postgresql install. It'll be difficult for an automated script to choose between the two. This will always remain a manual chore, whatever you do.

03/06/06 12:22:25 changed by jtv

The upcoming 2.6.5 already renames common to common-sample (see bug ticket #44), but as you say this is more of a compiler issue than a platform issue at the moment. It would be nice if common would work for MinGW as well, of course. For historical interest: the name "common" stems from the fact that its settings are shared by the two separate makefiles for libpqxx and the test suite--but both for Visual C++.

I see what you mean about the difficulty here... Maybe this should be solved by increased coordination with the main PostgreSQL project. If they recommend a particular location for their files on Windows, libpqxx should follow that. It may be helpful to coordinate examples in the documentation at least.

The main thing I had in mind, however, was to try pg_config if available. Is that available on Windows installations/builds?

03/06/06 12:28:48 changed by Bart Samwel <bart@samwel.tk>

OK, here are the issues:

1. PostgreSQL has a default install location (C:\Program Files\PostgreSQL\8.1). However, that path has spaces in it, and the libpqxx configure script won't handle that.

2. Even if libpqxx would correctly handle the spaces, this would not be the directory you'd usually want. You'd normally want to use the directory where the PostgreSQL *source* is contained, as that will contain the debug version of libpq. And for sources, there is *no* standard -- everybody is free to put this wherever they like. And it's very Windows-unlike to demand a specific location for this -- I know myself, I NEVER follow the recommended directories for things like sources. Not to mention the fact that people may have different drive letters for different things. For instance, I keep all my data / sources on D: while my binaries are all on C:. But this is a _choice_.

3. pg_config is only supplied with the normal install in the default location. But as I said, that's usually *not* the PostgreSQL dir that you want to use!

So, the problem is that the one postgresql install that has a pg_config and that has a default location is not the one that you want, and the one that you want has no standard location and no pg_config.

10/29/07 13:05:06 changed by fernando.a.gomez.f@gmail.com

Why not simply create an installer? Since it's for Windows, the installer can ask the user which compiler he'll be using, and then add the corresponding header file to the INCLUDE environment variable, etc, so that I only need to open VC, create my project, reference the libraries and that's it?

10/29/07 18:31:03 changed by jtv

If a Windows user would volunteer to write such an installer, that would be wonderful!

10/29/07 19:17:29 changed by fernando.a.gomez.f@gmail.com

I'd write it myself then. Any considerations that I should take before doing it? :)

10/29/07 19:17:36 changed by fernando.a.gomez.f@gmail.com

I'll write it myself then. Any considerations that I should take before doing it? :)

10/30/07 13:31:26 changed by jtv

Great!

The main thing is to hard-code as little as possible. The problem with the Windows environment is that there are very few standards: just about anything can be in any location. The installer should have minimal expectations about where things are.

11/02/08 01:42:11 changed by jtv

  • status changed from new to closed.
  • resolution set to noresponse.

Add/Change #41 (Windows alternative for configure script)




Change Properties
Action