2007-01-14 04:48:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# filter the output from pkg-config (renamed as pkg-config.real)
|
|
|
|
# and ensures PKG_CONFIG_SYSROOT is prepended to all paths
|
|
|
|
|
2008-04-01 17:29:03 +02:00
|
|
|
set -o pipefail
|
|
|
|
|
2007-01-14 04:48:13 +01:00
|
|
|
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
|
2007-01-14 05:20:57 +01:00
|
|
|
#echo "PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR" >&2
|
|
|
|
#echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >&2
|
|
|
|
#echo "OKAY" >&2;
|
2007-01-14 04:48:13 +01:00
|
|
|
exit 0;
|
|
|
|
else
|
2007-01-14 05:20:57 +01:00
|
|
|
exit $?
|
2007-01-14 04:48:13 +01:00
|
|
|
fi
|