--- valgrind-3.7.0/configure	2011-11-09 13:59:24.327865519 -0500
+++ valgrind-3.7.0/configure	2011-11-09 14:14:20.386614717 -0500
@@ -5129,11 +5129,17 @@
 # i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
 # i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
 #
+# XXX this fails with: arm-unknown-linux-gnueabi-gcc  (Foo Release2) 4.5.3
+#gcc_version=`${CC} --version \
+#             | head -n 1 \
+#             | $SED 's/i686-apple-darwin10//' \
+#             | $SED 's/i686-apple-darwin11//' \
+#             | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`
+# this splits on [compiler name] [pkg/pkg-version] [version] [vendor], extracting version
+# assuming gnu sed with extended RE support
 gcc_version=`${CC} --version \
              | head -n 1 \
-             | $SED 's/i686-apple-darwin10//' \
-             | $SED 's/i686-apple-darwin11//' \
-             | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`
+             | $SED -re 's/^[^ ]+\s+\([^\)]+\)\s+([^ ]+).*$/\1/'`
 
 is_clang="notclang"
 if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
