glibc: install libmvec.so when available
[buildroot-gz.git] / package / pkgconf / 0001-Fix-all-variables-sysroot-prefix-problem.patch
blobbac9f6208bfcecea7d9270921274fc4540c4cccc
1 From abc7a780f2a52a1aa3ee288e17140b817b545cc3 Mon Sep 17 00:00:00 2001
2 From: Gustavo Zacarias <gustavo@zacarias.com.ar>
3 Date: Mon, 2 Nov 2015 18:38:00 -0300
4 Subject: [PATCH] Fix all-variables sysroot prefix problem
6 According to the pkg-config specifications (or rather documentation)
7 only the -L/-I directory entries should be sysroot-prefixed.
9 We also need to prefix the mapdir/sdkdir variables since they're used by
10 xorg and expected that way.
12 Also allow prefixing for includedir and libdir since in some silly cases
13 the directories may be requested barebones via pkg-config
14 --variable=includedir libfool for example.
16 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
17 ---
18 main.c | 17 ++++++++++++-----
19 1 file changed, 12 insertions(+), 5 deletions(-)
21 diff --git a/main.c b/main.c
22 index 6947126..52d16c2 100644
23 --- a/main.c
24 +++ b/main.c
25 @@ -313,9 +313,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
26 memset(req->buf, 0, sizeof(req->buf));
28 if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
29 - (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
30 - strlcat(req->buf, sysroot_dir, sizeof(req->buf));
32 + (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
33 + (!strcmp(req->variable, "includedir") || \
34 + !strcmp(req->variable, "libdir") || \
35 + !strcmp(req->variable, "mapdir") || \
36 + !strcmp(req->variable, "sdkdir")))
37 + strlcat(req->buf, sysroot_dir, sizeof(req->buf));
38 strlcat(req->buf, var, sizeof(req->buf));
39 return;
41 @@ -323,8 +326,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
42 strlcat(req->buf, " ", sizeof(req->buf));
44 if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
45 - (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
46 - strlcat(req->buf, sysroot_dir, sizeof(req->buf));
47 + (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
48 + (!strcmp(req->variable, "includedir") || \
49 + !strcmp(req->variable, "libdir") || \
50 + !strcmp(req->variable, "mapdir") || \
51 + !strcmp(req->variable, "sdkdir")))
52 + strlcat(req->buf, sysroot_dir, sizeof(req->buf));
54 strlcat(req->buf, var, sizeof(req->buf));
56 --
57 2.4.10