[oe-commits] Ross Burton : pkgconfig: add -native script that uses the native sysroot instead of target

git at git.openembedded.org git at git.openembedded.org
Thu Jan 10 23:52:29 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: b15e22beed948f79b6ae953df7b889f3e70588b9
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=b15e22beed948f79b6ae953df7b889f3e70588b9

Author: Ross Burton <ross.burton at intel.com>
Date:   Tue Jan  8 15:23:47 2013 +0000

pkgconfig: add -native script that uses the native sysroot instead of target

pkg-config-native is useful when building a package for the target that needs to
compile a build-time tool, to avoid having to hard-code many paths.

Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/recipes-devtools/pkgconfig/pkgconfig.inc      |   10 ++++++++++
 .../pkgconfig/pkgconfig/pkg-config-native.in       |    7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig.inc b/meta/recipes-devtools/pkgconfig/pkgconfig.inc
index c54e325..c4fa456 100644
--- a/meta/recipes-devtools/pkgconfig/pkgconfig.inc
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig.inc
@@ -15,6 +15,7 @@ DEPENDS_class-nativesdk = ""
 SRC_URI = "http://pkgconfig.freedesktop.org/releases/pkg-config-${PV}.tar.gz \
            file://autofoo.patch \
            file://glibconfig-sysdefs.h \
+           file://pkg-config-native.in \
            file://disable-legacy.patch"
 
 S = "${WORKDIR}/pkg-config-${PV}/"
@@ -43,3 +44,12 @@ FILES_${PN} += "${datadir}/aclocal/pkg.m4"
 # will end up requiring 'pkgconfig(pkg-config)'.  Allow this behavior by
 # specifying an appropriate provide.
 RPROVIDES_${PN} += "pkgconfig(pkg-config) (= ${PV})"
+
+# Install a pkg-config-native wrapper that will use the native sysroot instead
+# of the MACHINE sysroot, for using pkg-config when building native tools.
+do_install_append_class-native () {
+    sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+        -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
+        < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native
+    install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
+}
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in b/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
new file mode 100644
index 0000000..5e44bb4
--- /dev/null
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+PKG_CONFIG_PATH="@PATH_NATIVE@"
+PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+unset PKG_CONFIG_SYSROOT_DIR
+
+pkg-config "$@"





More information about the Openembedded-commits mailing list