summaryrefslogtreecommitdiff
path: root/package/pkgconfig/pkgconfig-filter.sh
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2007-01-14 03:48:13 +0000
committerEric Andersen <andersen@codepoet.org>2007-01-14 03:48:13 +0000
commit4ac03cc86a989c2f86b2cdb7041b854bf9609049 (patch)
treeed1fe069c952e2aac6f037bf880734fab7fe60e3 /package/pkgconfig/pkgconfig-filter.sh
parentceb285976563f6ba2c87a17ff92f1b1490df698a (diff)
filter pkgconfig output to force it do use our staging_dir and not
try to use the system libraries as it is inclined to do
Diffstat (limited to 'package/pkgconfig/pkgconfig-filter.sh')
-rwxr-xr-xpackage/pkgconfig/pkgconfig-filter.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/package/pkgconfig/pkgconfig-filter.sh b/package/pkgconfig/pkgconfig-filter.sh
new file mode 100755
index 000000000..8769bfd8a
--- /dev/null
+++ b/package/pkgconfig/pkgconfig-filter.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# filter the output from pkg-config (renamed as pkg-config.real)
+# and ensures PKG_CONFIG_SYSROOT is prepended to all paths
+
+CMD=$0
+
+if [ ! "$PKG_CONFIG_SYSROOT" ]; then
+ echo "pkg-config-filter: missing \$PKG_CONFIG_SYSROOT environment variable"
+ exit 2
+fi
+
+export PKG_CONFIG_LIBDIR
+export PKG_CONFIG_PATH
+
+if $CMD.real $* |
+ sed -e "s~\-L/*$PKG_CONFIG_SYSROOT/*~-L=/~g; s~\-I/*$PKG_CONFIG_SYSROOT/*~-I=/~g;" |
+ sed -e "s~\-L/~-L=/~g; s~\-I/~-I=/~g;" |
+ sed -e "s~\-L\=~-L$PKG_CONFIG_SYSROOT~g; s~\-I\=~-I$PKG_CONFIG_SYSROOT~g;"
+then
+ echo "PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR" >&2
+ echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >&2
+ echo "OKAY" >&2;
+ exit 0;
+else
+ echo "pkg-config failed!" >&2
+ exit 1
+fi