-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Windows prefix behavior does not match pkg-config #176
Comments
This is probably a dumb patch but it seems to have the right result: From 4c3fa563cdec835c8a84db740722304f31028025 Mon Sep 17 00:00:00 2001
From: Patrick Griffis <tingping@tingping.se>
Date: Wed, 7 Mar 2018 17:18:55 +0000
Subject: [PATCH] Always rewrite prefix on Windows
This matches the pkg-config behavior and fixes relocating files
---
libpkgconf/pkg.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c
index 0feb4d6..d301124 100644
--- a/libpkgconf/pkg.c
+++ b/libpkgconf/pkg.c
@@ -368,7 +368,11 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
pkgconf_pkg_parser_keyword_set(client, pkg, lineno, key, value);
break;
case '=':
- if (strcmp(key, client->prefix_varname) || !(client->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX))
+ if (strcmp(key, client->prefix_varname)
+#if !defined(_WIN32) && !defined(_WIN64) /* Always redefine on Windows */
+ || !(client->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX)
+#endif
+ )
pkgconf_tuple_add(client, &pkg->vars, key, value, true);
else
{
--
2.16.2.windows.1
|
I prefer to unconditionally set PKGCONF_PKG_PKGF_REDEFINE_PREFIX on
Windows, so that it could be opted out. See cli/main.c.
…On Wed, Mar 7, 2018 at 4:23 PM, TingPing ***@***.***> wrote:
This is probably a dumb patch but it seems to have the right result:
From 4c3fa563cdec835c8a84db740722304f31028025 Mon Sep 17 00:00:00 2001
From: Patrick Griffis ***@***.***>
Date: Wed, 7 Mar 2018 17:18:55 +0000
Subject: [PATCH] Always rewrite prefix on Windows
This matches the pkg-config behavior and fixes relocating files---
libpkgconf/pkg.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c
index 0feb4d6..d301124 100644--- a/libpkgconf/pkg.c+++ b/libpkgconf/pkg.c@@ -368,7 +368,11 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
pkgconf_pkg_parser_keyword_set(client, pkg, lineno, key, value);
break;
case '=':- if (strcmp(key, client->prefix_varname) || !(client->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX))+ if (strcmp(key, client->prefix_varname)+#if !defined(_WIN32) && !defined(_WIN64) /* Always redefine on Windows */+ || !(client->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX)+#endif+ )
pkgconf_tuple_add(client, &pkg->vars, key, value, true);
else
{--
2.16.2.windows.1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#176 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABc7DFaOmknExS5swaf4MxukCUUIvvzJks5tcF3VgaJpZM4ShLnD>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pkg-config
on Windows will replace theprefix
with the path to its binary which is required considering everything on Windows is assumed to be portable.The exact
pkg-config
behavior is this: https://github.com/GNOME/glib/blob/75fa8c2afbab4f414d2eb03684d9f807bd690aef/glib/gwin32.c#L219-L308It can be simplified a bit for pkgconf's usage though.
The text was updated successfully, but these errors were encountered: