Changeset 154007 in webkit
- Timestamp:
- Aug 13, 2013 9:56:04 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r153979 r154007 1 2013-08-13 Zan Dobersek <zdobersek@igalia.com> 2 3 [Autotools] Don't compare $CC, $CXX to exact compiler names 4 https://bugs.webkit.org/show_bug.cgi?id=119683 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Instead of comparing $CC and $CXX to exact compiler names (like 'gcc', 'clang++' etc.), 9 use the compiler version checks to also specify the broader compiler collection of which 10 the used compiler is a member of. This avoids failures in some border-line cases where 11 the user would still use either a GCC or a Clang compiler but provide it through a symbolic 12 link that was specified via the CC/CXX environment variables. 13 14 * Source/autotools/CheckSystemAndBasicDependencies.m4: Store the detected C/C++ compiler collection 15 in c_compiler/cxx_compiler. Throw an error if no supported compiler was found. 16 * Source/autotools/SetupCompilerFlags.m4: Test for a specific compiler by checking against 17 c_compiler/cxx_compiler rather than CC/CXX values. 18 1 19 2013-08-12 Zan Dobersek <zdobersek@igalia.com> 2 20 -
trunk/Source/autotools/CheckSystemAndBasicDependencies.m4
r148248 r154007 80 80 81 81 # Check that an appropriate C compiler is available. 82 c_compiler="unknown" 82 83 AC_LANG_PUSH([C]) 83 84 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ 84 #if !(defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) \ 85 && !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0) 86 #error Unsupported compiler 85 #if !(defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) 86 #error Not a supported GCC compiler 87 87 #endif 88 ],[])],[],[AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.0 is required for C compilation])]) 88 ])], [c_compiler="gcc"], []) 89 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ 90 #if !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0) 91 #error Not a supported Clang compiler 92 #endif 93 ])], [c_compiler="clang"], []) 89 94 AC_LANG_POP([C]) 90 95 96 if test "$c_compiler" = "unknown"; then 97 AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.0 is required for C compilation]) 98 fi 99 91 100 # Check that an appropriate C++ compiler is available. 101 cxx_compiler="unknown" 92 102 AC_LANG_PUSH([C++]) 93 103 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ 94 #if !(defined(__GNUG__) && defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) \ 95 && !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0) 96 #error Unsupported compiler 104 #if !(defined(__GNUG__) && defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) 105 #error Not a supported G++ compiler 97 106 #endif 98 ],[])],[],[AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.0 is required for C++ compilation])]) 107 ])], [cxx_compiler="g++"], []) 108 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ 109 #if !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0) 110 #error Not a supported Clang++ compiler 111 #endif 112 ])], [cxx_compiler="clang++"], []) 99 113 AC_LANG_POP([C++]) 114 115 if test "$cxx_compiler" = "unknown"; then 116 AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.0 is required for C++ compilation]) 117 fi 100 118 101 119 # C/C++ Language Features -
trunk/Source/autotools/SetupCompilerFlags.m4
r150445 r154007 5 5 6 6 # Clang requires suppression of unused arguments warnings. 7 if test "$ CC" = "clang"; then7 if test "$c_compiler" = "clang"; then 8 8 CFLAGS="$CFLAGS -Qunused-arguments" 9 9 fi … … 12 12 # -Wno-c++11-extensions, currently only usable with Clang, suppresses warnings of C++11 extensions in use. 13 13 # Suppress unused arguments warnings for C++ files as well. 14 if test "$ CXX" = "clang++"; then14 if test "$cxx_compiler" = "clang++"; then 15 15 CXXFLAGS="$CXXFLAGS -stdlib=libstdc++ -Wno-c++11-extensions -Qunused-arguments" 16 16 fi
Note: See TracChangeset
for help on using the changeset viewer.