summaryrefslogtreecommitdiffstats
path: root/scripts/pkg-config-wrapper
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2005-11-28 14:09:40 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2005-11-28 14:09:40 +0000
commitd6a5d6ff08e79815c140584cfb6a9f1a69df5a89 (patch)
treeffe38a1f580bfbffa046200927acb6dde3f95aad /scripts/pkg-config-wrapper
parent5dba5217ce529b157e317f63cfceba95b3da363d (diff)
downloadptxdist-d6a5d6ff08e79815c140584cfb6a9f1a69df5a89.tar.gz
ptxdist-d6a5d6ff08e79815c140584cfb6a9f1a69df5a89.tar.xz
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-0.7-trunk@3438 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'scripts/pkg-config-wrapper')
-rwxr-xr-xscripts/pkg-config-wrapper29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/pkg-config-wrapper b/scripts/pkg-config-wrapper
new file mode 100755
index 000000000..ff0fba7a1
--- /dev/null
+++ b/scripts/pkg-config-wrapper
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+CMD=/usr/bin/pkg-config
+
+if [ ! "$SYSROOT" ]; then
+ echo "pkg-config-filter: missing \$SYSROOT environment variable"
+ exit 2
+fi
+
+#if [ ! "$PKG_CONFIG_LIBDIR" ]; then
+# export PKG_CONFIG_LIBDIR=$SYSROOT/usr/pkgconfig/
+#fi
+
+export PKG_CONFIG_LIBDIR
+export PKG_CONFIG_PATH
+
+if $CMD $* |
+ sed -e "s~\-L/*$SYSROOT/*~-L=/~g; s~\-I/*$SYSROOT/*~-I=/~g;" | # protect already given sysroot
+ sed -e "s~\-L/~-L=/~g; s~\-I/~-I=/~g;" | # add sysroot symbol to all absolute pathes
+ sed -e "s~\-L\=~-L$SYSROOT~g; s~\-I\=~-I$SYSROOT~g;" # replace sysroot sign to sysroot path
+ 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 \ No newline at end of file