Bug 1262155 - Add some generic compiler-based conditions to moz.configure. draft
authorChris Manchester <cmanchester@mozilla.com>
Thu, 15 Sep 2016 17:46:48 -0700
changeset 414238 6d7e796c1472772a6b0f9136d696fdcded1c58c9
parent 414237 ee10c3ebe282415995fedc4a9a63ca1d5bd5cb5b
child 414239 bbe2e26de38168eea44bae254e404102ffdafbe4
child 414240 e0d7a3aa9b86e775c71f12f3bb4b97dedf0e21d1
push id29629
push userbmo:cmanchester@mozilla.com
push dateFri, 16 Sep 2016 00:47:17 +0000
bugs1262155
milestone51.0a1
Bug 1262155 - Add some generic compiler-based conditions to moz.configure. MozReview-Commit-ID: CaN70tb7Voe
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
@@ -776,16 +776,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 '