Bug 1262155 - Add some generic compiler-based conditions to moz.configure. draft
authorChris Manchester <cmanchester@mozilla.com>
Wed, 24 Aug 2016 14:43:16 -0700
changeset 405142 2289fdf8067f9201a02f70728a7e4a85edbc6698
parent 405141 bde9d90477d0818254cdd0664f767db74a888403
child 405143 7530b6c23256b9fcb5f1130368d4e241eebf3bce
push id27409
push usercmanchester@mozilla.com
push dateWed, 24 Aug 2016 22:28:07 +0000
bugs1262155
milestone51.0a1
Bug 1262155 - Add some generic compiler-based conditions to moz.configure. MozReview-Commit-ID: 5Kv4dZ3IhA
build/moz.configure/headers.configure
build/moz.configure/toolchain.configure
--- a/build/moz.configure/headers.configure
+++ b/build/moz.configure/headers.configure
@@ -5,19 +5,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # Check for headers defining standard int types.
 check_header('stdint.h')
 have_inttypes = check_header('inttypes.h')
 
 set_config('HAVE_INTTYPES_H', have_inttypes)
 
-# Checks for headers relevant to non-windows systems.
-non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
-
 building_linux = depends(target)(lambda target: target.kernel == 'Linux')
 
 have_malloc = check_header('malloc.h')
 
 add_old_configure_assignment('HAVE_MALLOC_H', have_malloc)
 
 check_headers(
     'sys/byteorder.h',
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -759,16 +759,20 @@ def compiler(language, host_or_target, c
 
 c_compiler = compiler('C', target)
 cxx_compiler = compiler('C++', target, c_compiler=c_compiler)
 host_c_compiler = compiler('C', host, other_compiler=c_compiler)
 host_cxx_compiler = compiler('C++', host, c_compiler=host_c_compiler,
                              other_compiler=cxx_compiler,
                              other_c_compiler=c_compiler)
 
+# Generic compiler-based conditions.
+non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
+building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
+
 include('compile-checks.configure')
 
 @depends(have_64_bit,
          try_compile(body='static_assert(sizeof(void *) == 8, "")',
                      check_msg='for 64-bit OS'))
 def check_have_64_bit(have_64_bit, compiler_have_64_bit):
     if have_64_bit != compiler_have_64_bit:
         configure_error('The target compiler does not agree with configure '