diff options
author | Tollef Fog Heen <tfheen@err.no> | 2008-03-23 20:00:00 +0100 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2008-03-23 20:00:00 +0100 |
commit | dce0339076516b4cda3427ce0398472f89b6347a (patch) | |
tree | 60321427e5d3a19210d6e9d90e8af8ba23ffe4c7 /parse.c | |
parent | 762172849c13754a5c25d425cc8c403c1e5c9409 (diff) | |
download | pkg-config-dce0339076516b4cda3427ce0398472f89b6347a.tar.gz |
2008-02-19 Tor Lillqvist <tml@novell.com>
* main.c: Remove the possibility to have a default PKG_CONFIG_PATH
in the Registry. It is much more flexible to just use environment
variables. In general the Registry is not used in the ports of
GTK+ or GNOME libraries and software to Windows.
* parse.c (parse_line): On Windows, handle also .pc files found in
a share/pkgconfig folder when automatically redefining a prefix
variable for the package.
* pkg-config.1: Corresponding changes.
2008-02-18 Tor Lillqvist <tml@novell.com>
* main.c: Fix some bitrot: On Windows, don't use the compile-time
PKG_CONFIG_PC_PATH, but deduce a default one at run-time based on
the location of the executable. This was originally what
pkg-config did on Windows, but it had bit-rotted.
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -1011,18 +1011,25 @@ parse_line (Package *pkg, const char *untrimmed, const char *path, gboolean igno gchar *prefix = pkg->pcfiledir; const int prefix_len = strlen (prefix); const char *const lib_pkgconfig = "\\lib\\pkgconfig"; + const char *const share_pkgconfig = "\\share\\pkgconfig"; const int lib_pkgconfig_len = strlen (lib_pkgconfig); + const int share_pkgconfig_len = strlen (share_pkgconfig); - if (strlen (prefix) > lib_pkgconfig_len && - pathnamecmp (prefix + prefix_len - lib_pkgconfig_len, - lib_pkgconfig) == 0) + if ((strlen (prefix) > lib_pkgconfig_len && + pathnamecmp (prefix + prefix_len - lib_pkgconfig_len, lib_pkgconfig) == 0) || + (strlen (prefix) > share_pkgconfig_len && + pathnamecmp (prefix + prefix_len - share_pkgconfig_len, share_pkgconfig) == 0)) { - /* It ends in lib\pkgconfig. Good. */ + /* It ends in lib\pkgconfig or share\pkgconfig. Good. */ gchar *p; prefix = g_strdup (prefix); - prefix[prefix_len - lib_pkgconfig_len] = '\0'; + if (strlen (prefix) > lib_pkgconfig_len && + pathnamecmp (prefix + prefix_len - lib_pkgconfig_len, lib_pkgconfig) == 0) + prefix[prefix_len - lib_pkgconfig_len] = '\0'; + else + prefix[prefix_len - share_pkgconfig_len] = '\0'; /* Turn backslashes into slashes or * poptParseArgvString() will eat them when ${prefix} |