aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2010-02-11 13:46:38 -0800
committerNed Ludd <solar@gentoo.org>2010-02-11 13:46:38 -0800
commitd63e9fd2b1025c235627bdaf7392a5f7185d3c9d (patch)
treea73a4c9b14ff2ba95af998c23693c52936b6d03f
parentcross-pkg-config: switch to PKG_CONFIG_SYSROOT_DIR (kind of) (diff)
downloadcrossdev-d63e9fd2b1025c235627bdaf7392a5f7185d3c9d.tar.gz
crossdev-d63e9fd2b1025c235627bdaf7392a5f7185d3c9d.tar.bz2
crossdev-d63e9fd2b1025c235627bdaf7392a5f7185d3c9d.zip
- take pkg-config update from (awong) Albert J. Wong @ google for the chromium/gentoo build env -> http://codereview.appspot.com/206075
Signed-off-by: Ned Ludd <solar@gentoo.org>
-rwxr-xr-xwrappers/cross-pkg-config36
1 files changed, 17 insertions, 19 deletions
diff --git a/wrappers/cross-pkg-config b/wrappers/cross-pkg-config
index d81266f..9c12899 100755
--- a/wrappers/cross-pkg-config
+++ b/wrappers/cross-pkg-config
@@ -100,24 +100,22 @@ ret=$?
#
output=$(echo "${output}" | sed -e 's:\(-[IL][[:space:]]*\)\(/usr\):\1'"${SYSROOT}"'\2:g')
-case " ${output} " in
- *" -L/usr/lib "*|*" -L/usr/local/lib "*|\
- *" -L /usr/lib "*|*" -L /usr/local/lib "*|\
- *" -L/usr/lib64 "*|*" -L/usr/local/lib64 "*|\
- *" -L /usr/lib64 "*|*" -L /usr/local/lib64 "*)
- warn "### falling down so here is a dump state ######"
- export PKG_CONFIG_DEBUG_SPEW="yes"
- pkg-config --debug "$@" 1>&2
- warn "### end of dump ###############################"
- error "host -L paths detected: ${output}"
- ;;
- *" -I/usr/include"*|*" -I/usr/local/include"*)
- warn "### falling down so here is a dump state ######"
- export PKG_CONFIG_DEBUG_SPEW="yes"
- pkg-config --debug "$@" 1>&2
- warn "### end of dump ###############################"
- error "host -I paths detected: ${output}"
- ;;
-esac
+# We turn the output into a newline separate string of options, then use grep
+# to look for bad -Is and -Ls. Bad -Is and -Ls are ones that point to things
+# outside the ${SYSROOT}.
+bad_lines=$(echo "$output" | # Get the pkg-config output.
+ tr -s ' ' | tr ' ' '\n' | # Put each flags on its own line.
+ grep -E '^(-L|-I)' | # Find all -I and -L lines.
+ grep -v -E "..:?${SYSROOT}" # Find all things outside the SYSROOT.
+ )
+if [ -n "$bad_lines" ]; then
+ warn "### falling down so here is a dump state ######"
+ pkg-config --debug "$@" 1>&2
+ warn "### end of dump ###############################"
+ warn "### suspicious compile flags dumped here ######"
+ echo "$bad_lines"
+ warn "### end of flag dump ##########################"
+ error "host -I or -L paths detected: ${output}"
+fi
[ -n "${output}" ] && echo "${output}"
exit ${ret}