diff options
author | Tollef Fog Heen <tfheen@qurzaw> | 2009-06-30 05:05:52 +0200 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2009-08-15 21:45:10 +0200 |
commit | c3ddc0344e02b77c3ebe74273be90b500e2448a4 (patch) | |
tree | f54d0d6571d793c7dd4a6a46312b0f66b00c5b89 | |
parent | 9b49307caed60772474f54eb6b2cc8af22132293 (diff) | |
parent | 1bcb18ca35c02f8f3a5a3744ed226b1afa4ec5cc (diff) | |
download | pkg-config-c3ddc0344e02b77c3ebe74273be90b500e2448a4.tar.gz |
Merge
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | check/common | 2 | ||||
-rw-r--r-- | main.c | 11 | ||||
-rw-r--r-- | parse.c | 26 | ||||
-rw-r--r-- | pkg-config.1 | 4 | ||||
-rw-r--r-- | pkg.h | 11 | ||||
-rw-r--r-- | pkg.m4 | 3 |
7 files changed, 57 insertions, 19 deletions
@@ -1,3 +1,22 @@ +2009-06-30 Tollef Fog Heen <tfheen@err.no> + + * pkg.m4: Add patch from Peter Rosin for somewhat nicer output if + you use the four-clause form of PKG_CHECK_MODULES. + +2009-06-12 Tor Lillqvist <tml@iki.fi> + + * parse.c: On Win32, if the value of a a variable other than the + "prefix" one starts with the non-overridden value of "prefix", + then replace that prefix, too, with the run-time one. + + To avoid shadowing warnings, rename a 'p' variable to 'q'. + + * pkg-config.1: Corresponding update. + + * main.c + * pkg.h: Move the Win32 redefinition of PKG_CONFIG_PC_PATH from + main.c to pkg.h as it now is needed in pkg.c, too. + 2009-03-30 Tollef Fog Heen <tfheen@err.no> * autogen.sh: Allow not running configure, wanted by cygwin. diff --git a/check/common b/check/common index 5cf772d..b61d529 100644 --- a/check/common +++ b/check/common @@ -6,7 +6,7 @@ pkgconfig=../pkg-config -. config.sh +. ./config.sh PKG_CONFIG_PATH=$srcdir export PKG_CONFIG_PATH @@ -36,17 +36,6 @@ #undef STRICT #endif -#ifdef G_OS_WIN32 -/* No hardcoded paths in the binary, thanks */ -/* It's OK to leak this */ -#undef PKG_CONFIG_PC_PATH -#define PKG_CONFIG_PC_PATH \ - g_strconcat (g_win32_get_package_installation_subdirectory (NULL, NULL, "lib/pkgconfig"), \ - ";", \ - g_win32_get_package_installation_subdirectory (NULL, NULL, "share/pkgconfig"), \ - NULL) -#endif - static int want_debug_spew = 0; static int want_verbose_errors = 0; static int want_stdout_errors = 0; @@ -901,6 +901,8 @@ parse_url (Package *pkg, const char *str, const char *path) } #ifdef G_OS_WIN32 +static char *orig_prefix = NULL; + static int pathnamecmp (const char *a, const char *b) @@ -1031,8 +1033,10 @@ parse_line (Package *pkg, const char *untrimmed, const char *path, { /* It ends in lib\pkgconfig or share\pkgconfig. Good. */ - gchar *p; + gchar *q; + orig_prefix = g_strdup (p); + prefix = g_strdup (prefix); if (strlen (prefix) > lib_pkgconfig_len && pathnamecmp (prefix + prefix_len - lib_pkgconfig_len, lib_pkgconfig) == 0) @@ -1044,12 +1048,12 @@ parse_line (Package *pkg, const char *untrimmed, const char *path, * poptParseArgvString() will eat them when ${prefix} * has been expanded in parse_libs(). */ - p = prefix; - while (*p) + q = prefix; + while (*q) { - if (*p == '\\') - *p = '/'; - p++; + if (*q == '\\') + *q = '/'; + q++; } varname = g_strdup (tag); debug_spew (" Variable declaration, '%s' overridden with '%s'\n", @@ -1058,6 +1062,16 @@ parse_line (Package *pkg, const char *untrimmed, const char *path, goto cleanup; } } + else if (!dont_define_prefix && + orig_prefix != NULL && + strncmp (p, orig_prefix, strlen (orig_prefix)) == 0 && + G_IS_DIR_SEPARATOR (p[strlen (orig_prefix)])) + { + char *oldstr = str; + + p = str = g_strconcat (g_hash_table_lookup (pkg->vars, prefix_variable), p + strlen (orig_prefix), NULL); + g_free (oldstr); + } #endif if (g_hash_table_lookup (pkg->vars, tag)) diff --git a/pkg-config.1 b/pkg-config.1 index 375db76..83041db 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -261,6 +261,10 @@ conventions (i.e., ends with \\lib\\pkgconfig or \\share\\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. + +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. .\" .SH AUTOCONF MACROS .TP @@ -26,6 +26,17 @@ #include "glib-1.2.10/glib.h" #endif +#ifdef G_OS_WIN32 +/* No hardcoded paths in the binary, thanks */ +/* It's OK to leak this */ +#undef PKG_CONFIG_PC_PATH +#define PKG_CONFIG_PC_PATH \ + g_strconcat (g_win32_get_package_installation_subdirectory (NULL, NULL, "lib/pkgconfig"), \ + ";", \ + g_win32_get_package_installation_subdirectory (NULL, NULL, "share/pkgconfig"), \ + NULL) +#endif + typedef enum { LESS_THAN, @@ -148,7 +148,8 @@ path to pkg-config. _PKG_TEXT To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], - [$4]) + [AC_MSG_RESULT([no]) + $4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS |