7 DIR
="$(cd "$DIR"; pwd)"
9 echo "Usage: $0 toolchain-dir"
13 echo -n "Locating cpp ... "
14 for bin
in bin usr
/bin usr
/local
/bin
; do
15 for cmd
in "$DIR/$bin/"*-cpp; do
16 if [ -x "$cmd" ]; then
24 if [ ! -x "$CPP" ]; then
25 echo "Can't locate a cpp executable in '$DIR' !"
29 for lib
in $
(STAGING_DIR
="$dir" "$CPP" -x c
-v /dev
/null
2>&1 |
sed -ne 's#:# #g; s#^LIBRARY_PATH=##p'); do
30 if [ -d "$lib" ]; then
31 grep -qs "STAGING_DIR" "$lib/specs" && rm -f "$lib/specs"
32 if [ $FOUND -lt 1 ]; then
33 echo -n "Patching specs ... "
34 STAGING_DIR
="$dir" "$CPP" -dumpspecs |
awk '
36 sub("%{L.}", "%{L*} -L %:getenv(STAGING_DIR /usr/lib) -rpath-link %:getenv(STAGING_DIR /usr/lib)")
39 $0 = $0 " -idirafter %:getenv(STAGING_DIR /usr/include)"
58 if [ $FOUND -lt 1 ]; then
59 echo "Failed to locate library directory!"
62 echo "Toolchain successfully patched."
This page took 0.047666 seconds and 5 git commands to generate.