2
1

valgrind-3.7.0-compiler-check.patch 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Fix the compiler version check so that it doesn't misdetect the
  2. version when the compiler version contains parenthesis.
  3. Taken from upstream r12274.
  4. Index: valgrind-3.7.0/configure.in
  5. ===================================================================
  6. --- valgrind-3.7.0.orig/configure.in 2011-12-22 15:21:22.269669307 +0100
  7. +++ valgrind-3.7.0/configure.in 2011-12-22 15:21:54.029135051 +0100
  8. @@ -98,18 +98,21 @@
  9. # We don't want gcc < 3.0
  10. AC_MSG_CHECKING([for a supported version of gcc])
  11. -# Try to get the gcc version, sed-ing out some unexpected stuff
  12. -# that appears with the default gcc on OSX 10.6 and 10.7 respectively.
  13. -# Without this, the version number comes out as 686, 10 or 11 :-(
  14. +# Obtain the compiler version.
  15. #
  16. -# i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
  17. -# i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
  18. +# A few examples of how the ${CC} --version output looks like:
  19. +#
  20. +# Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
  21. +# Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
  22. +# openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
  23. +# Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
  24. +# OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
  25. +# OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
  26. +# Clang: clang version 2.9 (tags/RELEASE_29/final)
  27. #
  28. [gcc_version=`${CC} --version \
  29. - | head -n 1 \
  30. - | $SED 's/i686-apple-darwin10//' \
  31. - | $SED 's/i686-apple-darwin11//' \
  32. - | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
  33. + | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p' \
  34. + -e 's/[^ ]*clang version \([0-9.]*\).*$/\1/p'`]
  35. is_clang="notclang"
  36. if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
  37. Index: valgrind-3.7.0/configure
  38. ===================================================================
  39. --- valgrind-3.7.0.orig/configure 2011-12-22 15:22:05.138948143 +0100
  40. +++ valgrind-3.7.0/configure 2011-12-22 15:23:34.807439246 +0100
  41. @@ -5122,18 +5122,22 @@
  42. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a supported version of gcc" >&5
  43. $as_echo_n "checking for a supported version of gcc... " >&6; }
  44. -# Try to get the gcc version, sed-ing out some unexpected stuff
  45. -# that appears with the default gcc on OSX 10.6 and 10.7 respectively.
  46. -# Without this, the version number comes out as 686, 10 or 11 :-(
  47. +# Obtain the compiler version.
  48. +#
  49. +# A few examples of how the ${CC} --version output looks like:
  50. #
  51. -# i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
  52. -# i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
  53. +# Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
  54. +# Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
  55. +# openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
  56. +# Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
  57. +# OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
  58. +# OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
  59. +# Clang: clang version 2.9 (tags/RELEASE_29/final)
  60. #
  61. gcc_version=`${CC} --version \
  62. - | head -n 1 \
  63. - | $SED 's/i686-apple-darwin10//' \
  64. - | $SED 's/i686-apple-darwin11//' \
  65. - | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`
  66. + | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p' \
  67. + -e 's/[^ ]*clang version \([0-9.]*\).*$/\1/p'`
  68. +
  69. is_clang="notclang"
  70. if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then