summaryrefslogtreecommitdiffstats
path: root/meta/packages/pkgconfig
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/pkgconfig')
-rw-r--r--meta/packages/pkgconfig/pkgconfig-0.22/sysroot-support.patch102
-rw-r--r--meta/packages/pkgconfig/pkgconfig.inc3
2 files changed, 104 insertions, 1 deletions
diff --git a/meta/packages/pkgconfig/pkgconfig-0.22/sysroot-support.patch b/meta/packages/pkgconfig/pkgconfig-0.22/sysroot-support.patch
new file mode 100644
index 0000000000..2e4f796cc9
--- /dev/null
+++ b/meta/packages/pkgconfig/pkgconfig-0.22/sysroot-support.patch
@@ -0,0 +1,102 @@
1Add support for PKG_CONFIG_SYSROOT_DIR to pkgconfig
2
3---
4 main.c | 5 ++++-
5 pkg-config.1 | 9 +++++++++
6 pkg.c | 14 +++++++++++++-
7 pkg.h | 3 +++
8 4 files changed, 29 insertions(+), 2 deletions(-)
9
10Index: pkg-config-0.22/main.c
11===================================================================
12--- pkg-config-0.22.orig/main.c 2007-09-14 10:20:15.000000000 +0100
13+++ pkg-config-0.22/main.c 2007-09-14 10:22:41.000000000 +0100
14@@ -46,6 +46,8 @@
15 static int want_debug_spew = 0;
16 static int want_verbose_errors = 0;
17 static int want_stdout_errors = 0;
18+char *pcsysrootdir = NULL;
19+
20
21 void
22 debug_spew (const char *format, ...)
23@@ -196,7 +198,7 @@ main (int argc, char **argv)
24 GString *str;
25 GSList *packages = NULL;
26 char *search_path;
27- char *pcbuilddir;
28+ char *pcbuilddir;
29 const char *pkglibdir;
30 char **search_dirs;
31 char **iter;
32@@ -345,6 +347,7 @@ main (int argc, char **argv)
33 }
34 }
35 #endif
36+ pcsysrootdir = getenv ("PKG_CONFIG_SYSROOT_DIR");
37
38 pcbuilddir = getenv ("PKG_CONFIG_TOP_BUILD_DIR");
39 if (pcbuilddir)
40Index: pkg-config-0.22/pkg.c
41===================================================================
42--- pkg-config-0.22.orig/pkg.c 2007-09-14 10:20:15.000000000 +0100
43+++ pkg-config-0.22/pkg.c 2007-09-14 10:22:41.000000000 +0100
44@@ -479,11 +479,23 @@ string_list_to_string (GSList *list)
45 GSList *tmp;
46 GString *str = g_string_new ("");
47 char *retval;
48+ int offset=0;
49
50 tmp = list;
51 while (tmp != NULL)
52 {
53- g_string_append (str, tmp->data);
54+ if (pcsysrootdir != NULL)
55+ {
56+ if (!strncmp(tmp->data,"-I",2) ||
57+ !strncmp(tmp->data,"-L",2))
58+ {
59+ offset=2;
60+ g_string_append_c (str,((char*)tmp->data)[0]);
61+ g_string_append_c (str,((char*)tmp->data)[1]);
62+ g_string_append (str,pcsysrootdir);
63+ }
64+ }
65+ g_string_append (str, tmp->data+offset);
66 g_string_append_c (str, ' ');
67
68 tmp = g_slist_next (tmp);
69Index: pkg-config-0.22/pkg-config.1
70===================================================================
71--- pkg-config-0.22.orig/pkg-config.1 2007-09-14 10:20:15.000000000 +0100
72+++ pkg-config-0.22/pkg-config.1 2007-09-14 10:23:08.000000000 +0100
73@@ -260,6 +260,15 @@ Don't strip -I/usr/include out of cflags
74 Don't strip -L/usr/lib out of libs
75
76 .TP
77+.I "PKG_CONFIG_SYSROOT_DIR"
78+Modify -I and -L to use the directories located in target sysroot.
79+this option is usefull when crosscompiling package that use pkg-config
80+to determine CFLAGS anf LDFLAGS. -I and -L are modified to point to
81+the new system root. this means that a -I/usr/include/libfoo will
82+become -I/var/target/usr/include/libfoo with a PKG_CONFIG_SYSROOT_DIR
83+equal to /var/target (same rule apply to -L)
84+
85+.TP
86 .I "PKG_CONFIG_LIBDIR"
87 Replaces the default \fIpkg-config\fP search directory.
88
89Index: pkg-config-0.22/pkg.h
90===================================================================
91--- pkg-config-0.22.orig/pkg.h 2007-09-14 10:20:15.000000000 +0100
92+++ pkg-config-0.22/pkg.h 2007-09-14 10:22:41.000000000 +0100
93@@ -123,6 +123,9 @@ void disable_private_libs(void);
94 /* If TRUE, do not automatically prefer uninstalled versions */
95 extern gboolean disable_uninstalled;
96
97+/* string that contain environment */
98+extern char* pcsysrootdir;
99+
100 #ifdef G_OS_WIN32
101 /* If TRUE, do not automatically define "prefix" while
102 * parsing each .pc file */
diff --git a/meta/packages/pkgconfig/pkgconfig.inc b/meta/packages/pkgconfig/pkgconfig.inc
index 47c077a8d3..ed9e7e69af 100644
--- a/meta/packages/pkgconfig/pkgconfig.inc
+++ b/meta/packages/pkgconfig/pkgconfig.inc
@@ -5,9 +5,10 @@ It replaces the ubiquitous *-config scripts you may have \
5seen with a single tool." 5seen with a single tool."
6HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/" 6HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/"
7LICENSE = "GPL" 7LICENSE = "GPL"
8PR = "r1" 8PR = "r2"
9 9
10SRC_URI = "http://pkgconfig.freedesktop.org/releases/pkg-config-${PV}.tar.gz \ 10SRC_URI = "http://pkgconfig.freedesktop.org/releases/pkg-config-${PV}.tar.gz \
11 file://sysroot-support.patch;patch=1 \
11 file://glibconfig-sysdefs.h" 12 file://glibconfig-sysdefs.h"
12 13
13S = "${WORKDIR}/pkg-config-${PV}/" 14S = "${WORKDIR}/pkg-config-${PV}/"