* [Buildroot] [PATCH] pkgconf: fix incorrect variable-directory sysroot prefixing
@ 2015-11-02 20:03 Gustavo Zacarias
2015-11-02 21:46 ` Peter Seiderer
2015-11-02 21:49 ` Yann E. MORIN
0 siblings, 2 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2015-11-02 20:03 UTC (permalink / raw)
To: buildroot
According to the pkg-config documents ("specification") when
sysroot-prefixing is enabled via PKG_CONFIG_SYSROOT_DIR this should only
be applied to -I/-L directories (includes, library directories), and not
to all of the other variables that can specify a directory.
However xorg uses mapdir/sdkdir in a similar fashion in what could be
considered an abuse of the spec, hence needs to be prefixed as well.
This patch makes pkgconf behave in the pkg-config specified way with the
added exception for the mapdir and sdkdir variables which are still
prefixed.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
...-Fix-all-variables-sysroot-prefix-problem.patch | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
diff --git a/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch b/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
new file mode 100644
index 0000000..33a7589
--- /dev/null
+++ b/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
@@ -0,0 +1,47 @@
+From cb7638bd24f3b9a40c125338e7b315fbabeb37ed Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Mon, 2 Nov 2015 15:36:28 -0300
+Subject: [PATCH] Fix all-variables sysroot prefix problem
+
+According to the pkg-config specifications (or rather documentation)
+only the -L/-I directory entries should be sysroot-prefixed.
+But since xorg uses mapdir/sdkdir with a similar intention disable
+prefixing for all variables except these.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ main.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/main.c b/main.c
+index 6947126..77f3654 100644
+--- a/main.c
++++ b/main.c
+@@ -313,9 +313,9 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
+ memset(req->buf, 0, sizeof(req->buf));
+
+ if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
+- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
+- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
+-
++ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
++ (!strcmp(req->variable, "mapdir") || !strcmp(req->variable, "sdkdir")))
++ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
+ strlcat(req->buf, var, sizeof(req->buf));
+ return;
+ }
+@@ -323,8 +323,9 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
+ strlcat(req->buf, " ", sizeof(req->buf));
+
+ if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
+- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
+- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
++ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
++ (!strcmp(req->variable, "mapdir") || !strcmp(req->variable, "sdkdir")))
++ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
+
+ strlcat(req->buf, var, sizeof(req->buf));
+ }
+--
+2.4.10
+
--
2.4.10
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Buildroot] [PATCH] pkgconf: fix incorrect variable-directory sysroot prefixing
2015-11-02 20:03 [Buildroot] [PATCH] pkgconf: fix incorrect variable-directory sysroot prefixing Gustavo Zacarias
@ 2015-11-02 21:46 ` Peter Seiderer
2015-11-02 21:49 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Peter Seiderer @ 2015-11-02 21:46 UTC (permalink / raw)
To: buildroot
Hello Gustavo,
On Mon, 2 Nov 2015 17:03:50 -0300, Gustavo Zacarias <gustavo@zacarias.com.ar> wrote:
> According to the pkg-config documents ("specification") when
> sysroot-prefixing is enabled via PKG_CONFIG_SYSROOT_DIR this should only
> be applied to -I/-L directories (includes, library directories), and not
> to all of the other variables that can specify a directory.
>
> However xorg uses mapdir/sdkdir in a similar fashion in what could be
> considered an abuse of the spec, hence needs to be prefixed as well.
>
> This patch makes pkgconf behave in the pkg-config specified way with the
> added exception for the mapdir and sdkdir variables which are still
> prefixed.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
> ...-Fix-all-variables-sysroot-prefix-problem.patch | 47 ++++++++++++++++++++++
> 1 file changed, 47 insertions(+)
> create mode 100644 package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
>
> diff --git a/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch b/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
> new file mode 100644
> index 0000000..33a7589
> --- /dev/null
> +++ b/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
> @@ -0,0 +1,47 @@
> +From cb7638bd24f3b9a40c125338e7b315fbabeb37ed Mon Sep 17 00:00:00 2001
> +From: Gustavo Zacarias <gustavo@zacarias.com.ar>
> +Date: Mon, 2 Nov 2015 15:36:28 -0300
> +Subject: [PATCH] Fix all-variables sysroot prefix problem
> +
> +According to the pkg-config specifications (or rather documentation)
> +only the -L/-I directory entries should be sysroot-prefixed.
> +But since xorg uses mapdir/sdkdir with a similar intention disable
> +prefixing for all variables except these.
> +
> +Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> +---
> + main.c | 11 ++++++-----
> + 1 file changed, 6 insertions(+), 5 deletions(-)
> +
> +diff --git a/main.c b/main.c
> +index 6947126..77f3654 100644
> +--- a/main.c
> ++++ b/main.c
> +@@ -313,9 +313,9 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
> + memset(req->buf, 0, sizeof(req->buf));
> +
> + if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
> +- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
> +- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> +-
> ++ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
> ++ (!strcmp(req->variable, "mapdir") || !strcmp(req->variable, "sdkdir")))
> ++ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> + strlcat(req->buf, var, sizeof(req->buf));
> + return;
> + }
> +@@ -323,8 +323,9 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
> + strlcat(req->buf, " ", sizeof(req->buf));
> +
> + if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
> +- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
> +- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> ++ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
> ++ (!strcmp(req->variable, "mapdir") || !strcmp(req->variable, "sdkdir")))
> ++ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> +
> + strlcat(req->buf, var, sizeof(req->buf));
> + }
> +--
> +2.4.10
> +
Tested for the lib4vl/qt/moc case, './host/usr/bin/pkg-config --variable=moc_location QtCore'
(same for uic/rcc) now returns the correct values...
Tested-by: Peter Seiderer <ps.report@gmx.net>
Regards,
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread* [Buildroot] [PATCH] pkgconf: fix incorrect variable-directory sysroot prefixing
2015-11-02 20:03 [Buildroot] [PATCH] pkgconf: fix incorrect variable-directory sysroot prefixing Gustavo Zacarias
2015-11-02 21:46 ` Peter Seiderer
@ 2015-11-02 21:49 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2015-11-02 21:49 UTC (permalink / raw)
To: buildroot
Gustavo, All,
On 2015-11-02 17:03 -0300, Gustavo Zacarias spake thusly:
> According to the pkg-config documents ("specification") when
> sysroot-prefixing is enabled via PKG_CONFIG_SYSROOT_DIR this should only
> be applied to -I/-L directories (includes, library directories), and not
> to all of the other variables that can specify a directory.
>
> However xorg uses mapdir/sdkdir in a similar fashion in what could be
> considered an abuse of the spec, hence needs to be prefixed as well.
>
> This patch makes pkgconf behave in the pkg-config specified way with the
> added exception for the mapdir and sdkdir variables which are still
> prefixed.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
As discussed on IRC, this patch breaks the build of xlib-libX11:
checking keysym definitions... configure: error: Cannot find keysymdef.h
make[1]: *** [/home/ymorin/dev/buildroot/O/build/xlib_libX11-1.6.3/.stamp_configured] Error 1
make: *** [_all] Error 2
That's because, in its infinite wisdom^Wstupidity, the Xorg packages are
calling pkg-config to directly query variables, even those that should
be retrived with --cflags and such, like so:
KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
Yes, they are _that_ busted... ;-(
So, NAK. Sorry.
Waiting for your updated proposal, now! ;-]
Regards,
Yann E. MORIN.
> ---
> ...-Fix-all-variables-sysroot-prefix-problem.patch | 47 ++++++++++++++++++++++
> 1 file changed, 47 insertions(+)
> create mode 100644 package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
>
> diff --git a/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch b/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
> new file mode 100644
> index 0000000..33a7589
> --- /dev/null
> +++ b/package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch
> @@ -0,0 +1,47 @@
> +From cb7638bd24f3b9a40c125338e7b315fbabeb37ed Mon Sep 17 00:00:00 2001
> +From: Gustavo Zacarias <gustavo@zacarias.com.ar>
> +Date: Mon, 2 Nov 2015 15:36:28 -0300
> +Subject: [PATCH] Fix all-variables sysroot prefix problem
> +
> +According to the pkg-config specifications (or rather documentation)
> +only the -L/-I directory entries should be sysroot-prefixed.
> +But since xorg uses mapdir/sdkdir with a similar intention disable
> +prefixing for all variables except these.
> +
> +Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> +---
> + main.c | 11 ++++++-----
> + 1 file changed, 6 insertions(+), 5 deletions(-)
> +
> +diff --git a/main.c b/main.c
> +index 6947126..77f3654 100644
> +--- a/main.c
> ++++ b/main.c
> +@@ -313,9 +313,9 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
> + memset(req->buf, 0, sizeof(req->buf));
> +
> + if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
> +- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
> +- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> +-
> ++ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
> ++ (!strcmp(req->variable, "mapdir") || !strcmp(req->variable, "sdkdir")))
> ++ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> + strlcat(req->buf, var, sizeof(req->buf));
> + return;
> + }
> +@@ -323,8 +323,9 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
> + strlcat(req->buf, " ", sizeof(req->buf));
> +
> + if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
> +- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
> +- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> ++ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
> ++ (!strcmp(req->variable, "mapdir") || !strcmp(req->variable, "sdkdir")))
> ++ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
> +
> + strlcat(req->buf, var, sizeof(req->buf));
> + }
> +--
> +2.4.10
> +
> --
> 2.4.10
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-02 21:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 20:03 [Buildroot] [PATCH] pkgconf: fix incorrect variable-directory sysroot prefixing Gustavo Zacarias
2015-11-02 21:46 ` Peter Seiderer
2015-11-02 21:49 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox