2001-10-19 Tor Lillqvist <tml@iki.fi>

Author: tml
Date: 2001-10-18 22:39:22 GMT
2001-10-19  Tor Lillqvist  <tml@iki.fi>

	* main.c: (Win32): Add option --dont-define-prefix on Windows. The
	option prevents pkg-config from automatically defining an
	overriding value for the "prefix" variable.

	Unless this option is used, set "prefix" to pkg-config's
	installation directory, i.e. assume that the packages whose
	configuration files are found in the same tree where
	pkg-config.exe itself is, also have been configured to use the
	same prefix. This means that a typical "developer package"
	containg a subtree of headers, libraries, etc, including .pc
	files, can be installed in any random location. As long as
	pkg-config.exe is installed the same tree, things just should
	work.

	* pkg-config.1: Document it.
This commit is contained in:
Arch Librarian 2005-07-14 13:04:31 +00:00
parent 1aaee14cab
commit 1aa1db96e5
3 changed files with 51 additions and 0 deletions

View file

@ -1,3 +1,21 @@
2001-10-19 Tor Lillqvist <tml@iki.fi>
* main.c: (Win32): Add option --dont-define-prefix on Windows. The
option prevents pkg-config from automatically defining an
overriding value for the "prefix" variable.
Unless this option is used, set "prefix" to pkg-config's
installation directory, i.e. assume that the packages whose
configuration files are found in the same tree where
pkg-config.exe itself is, also have been configured to use the
same prefix. This means that a typical "developer package"
containg a subtree of headers, libraries, etc, including .pc
files, can be installed in any random location. As long as
pkg-config.exe is installed the same tree, things just should
work.
* pkg-config.1: Document it.
2001-09-30 Tor Lillqvist <tml@iki.fi>
Changes for "pure" Win32 (without Cygwin or similar) support. The

24
main.c
View file

@ -14,6 +14,7 @@
static int want_debug_spew = 0;
static int want_verbose_errors = 0;
static int want_stdout_errors = 0;
static int dont_define_prefix = 0;
void
debug_spew (const char *format, ...)
@ -204,6 +205,10 @@ main (int argc, char **argv)
"show verbose information about missing or conflicting packages" },
{ "errors-to-stdout", 0, POPT_ARG_NONE, &want_stdout_errors, 0,
"print errors from --print-errors to stdout not stderr" },
#ifdef G_OS_WIN32
{ "dont-define-prefix", 0, POPT_ARG_NONE, &dont_define_prefix, 0,
"don't set the value of prefix based on where pkg-config.exe is installed" },
#endif
POPT_AUTOHELP
{ NULL, 0, 0, NULL, 0 }
};
@ -321,6 +326,25 @@ main (int argc, char **argv)
return 1;
}
#ifdef G_OS_WIN32
if (!dont_define_prefix)
{
gchar *prefix = g_win32_get_package_installation_directory (PACKAGE " " VERSION, NULL);
gchar *p = prefix;
/* Turn backslashes into slashes or poptParseArgvString() will eat
* them when ${prefix} has been expanded in parse_libs().
*/
while (*p)
{
if (*p == '\\')
*p = '/';
p++;
}
define_global_variable ("prefix", prefix);
}
#endif
package_init ();
if (want_list)

View file

@ -167,6 +167,15 @@ constraint after each package name, for example:
.fi
Remember to use \-\-print-errors if you want error messages.
.TP
.I "--dont-define-prefix"
This option is available only on Windows and prevents \fIpkg-config\fP
from automatically setting the variable "prefix" as the same directory
where \fIpkg-config\fP was installed. (This directory is determined by
asking the system where \fIpkg-config.exe\fP is located, and if that
directory is called \fIbin\fP or \fIlib\fP, using its parent
directory, otherwise itself.)
.SH ENVIRONMENT VARIABLES
.TP