echo -n "Patching specs ... "
STAGING_DIR="$DIR" "$CPP" -dumpspecs | awk '
mode ~ "link" {
- sub("%{L.}", "%{L*} -L %:getenv(STAGING_DIR /usr/lib) -rpath-link %:getenv(STAGING_DIR /usr/lib)")
+ sub(/(%@?\{L.\})/, "& -L %:getenv(STAGING_DIR /usr/lib) -rpath-link %:getenv(STAGING_DIR /usr/lib)")
}
mode ~ "cpp" {
$0 = $0 " -idirafter %:getenv(STAGING_DIR /usr/include)"
}
-VERSION="$(STAGING_DIR="$DIR" "$CPP" --version | head -n1)"
+VERSION="$(STAGING_DIR="$DIR" "$CPP" --version | sed -ne 's/^.* (.*) //; s/ .*$//; 1p')"
VERSION="${VERSION:-unknown}"
case "${VERSION##* }" in