From a65d5cff5fdc842b9567d56771193820ae48b7b7 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 17 Apr 2013 07:40:54 -0700 Subject: Allow Windows prefix redefinition in any pkgconfig directory The prefix redefinition feature on Windows to make packages relocatable was being confined only to locations where the .pc file was in a directory ending in lib/pkgconfig or share/pkgconfig. This is too restrictive as it's quite common for the libdir to have a different name such as lib64. This keeps the convention that the feature will only be enabled when the .pc file is in a pkgconfig directory, and it continues to define the prefix to the grandparent of the pkgconfig directory. The path handling is switched over to standard glib functions g_path_get_basename and g_path_get_dirname to avoid handrolled handling of Windows paths. --- pkg-config.1 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'pkg-config.1') diff --git a/pkg-config.1 b/pkg-config.1 index 201b473..ce123c9 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -318,15 +318,22 @@ and This can be augmented or replaced using the standard environment variables described above. -If a .pc file is found in a directory that matches the usual -conventions (i.e., ends with \\lib\\pkgconfig or \\share\\pkgconfig), +If a .pc file is found in a directory named +.IR pkgconfig , the prefix for that package is assumed to be the grandparent of the -directory where the file was found, and the \fIprefix\fP variable is -overridden for that file accordingly. +directory where the file was found, and the +.I prefix +variable is overridden for that file accordingly. If the value of a variable in a .pc file begins with the original, -non-overridden, value of the \fIprefix\fP variable, then the overridden -value of \fIprefix\fP is used instead. +non-overridden, value of the +.I prefix +variable, then the overridden value of +.I prefix +is used instead. This allows the feature to work even when the variables +have been expanded in the .pc file. + +See the \-\-dont-define-prefix option for disabling this feature. .\" .SH AUTOCONF MACROS .TP -- cgit v1.2.1