[OE-core] [PATCH] pkgconfig: add -native script that uses the native sysroot instead of target
Enrico Scholz
enrico.scholz at sigma-chemnitz.de
Tue Jan 8 16:06:31 UTC 2013
Ross Burton <ross.burton-ral2JQCrhuEAvxtiuMwx3w at public.gmane.org>
writes:
> 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.
how will you call this wrapper when e.g. makefile contains:
| foo_CFLAGS = $(shell pkg-config --cflags foo)
?
A more powerful approach might be to install it as 'pkg-config' under
${STAGING_BINDIR_NATIVE}/pkg-config-native/ and prepend this dir to
$PATH when executing the makefile above.
> --- /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 "$@"
1. last 'pkg-config' should be called with 'exec'
2. it depends on too much assumptions (e.g. that PKG_CONFIG_PATH and
_LIBDIR are already exported.
I would write it:
| #! /bin/sh
| exec env -u PKG_CONFIG_SYSROOT_DIR \
| PKG_CONFIG_PATH="@PATH_NATIVE@" \
| PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@" \
| pkg-config "$@"
Enrico
More information about the Openembedded-core
mailing list