diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2005-12-27 11:46:41 +0000 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2005-12-27 11:46:41 +0000 |
commit | 2703f338564540709ed09d798fcab0b071222c9b (patch) | |
tree | c9498a44e4a9e58e3d35adde5081bab6707e6ee9 /scripts/pkg-config-wrapper | |
parent | cf7502a4f62fe22c2d3a821c2e1ac2a28881317a (diff) | |
download | ptxdist-2703f338564540709ed09d798fcab0b071222c9b.tar.gz ptxdist-2703f338564540709ed09d798fcab0b071222c9b.tar.xz |
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/branches/ptxdist-0.7-destdir-r3569@3574 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'scripts/pkg-config-wrapper')
-rwxr-xr-x | scripts/pkg-config-wrapper | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/scripts/pkg-config-wrapper b/scripts/pkg-config-wrapper index ff0fba7a1..f0895a8fb 100755 --- a/scripts/pkg-config-wrapper +++ b/scripts/pkg-config-wrapper @@ -1,10 +1,10 @@ #!/bin/bash -CMD=/usr/bin/pkg-config +PKGCONFIG=/usr/bin/pkg-config if [ ! "$SYSROOT" ]; then - echo "pkg-config-filter: missing \$SYSROOT environment variable" - exit 2 + echo "pkg-config-filter: missing \$SYSROOT environment variable" + exit 2 fi #if [ ! "$PKG_CONFIG_LIBDIR" ]; then @@ -14,16 +14,33 @@ 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; +[ "$PTXDIST_DEBUG" = "1" ] && echo "$PKGCONFIG $*" >&2 + +# +# 1) protect already given sysroot +# 2) add sysroot symbol to all absolute paths +# 3) replace sysroot sign to sysroot path +# 4) libtool isn't correctly DESTDIR/SYSROOT aware, it replaces -lfoo by +# paths leading to host libraries; using -Wl,-lfoo seems to work. +# + +$PKGCONFIG $* | + sed -e "s~\-L/*$SYSROOT/*~-L=/~g; s~\-I/*$SYSROOT/*~-I=/~g;" | # 1) + sed -e "s~\-L/~-L=/~g; s~\-I/~-I=/~g;" | # 2) + sed -e "s~\-L\=~-L$SYSROOT~g; s~\-I\=~-I$SYSROOT~g;" | # 3) + sed -e "s~[\t ]\-l~ -Wl,-l~g;" # 4) + +if [ "$?" = "0" ]; then + + echo "-----pkg-config-wrapper-----" >&2 + #echo "PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR" >&2 + echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >&2 + echo "----------------------------" >&2 + exit 0; + else - echo "pkg-config failed!" >&2 - exit 1 -fi
\ No newline at end of file + + echo "pkg-config failed!" >&2 + exit 1 + +fi |