Bug 1262155 - Add some generic compiler-based conditions to moz.configure.
MozReview-Commit-ID: CaN70tb7Voe
--- 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 '