build/moz.configure/headers.configure
author Chris Manchester <cmanchester@mozilla.com>
Tue, 26 Jul 2016 15:27:19 -0700
changeset 306807 550fc29355f102a40f897b958fee7c2776a99fb3
child 312335 3f398fa60de08dc4c6c0076105c38135afac9ebd
permissions -rw-r--r--
Bug 1269517 - Move various header checks to Python configure. r=glandium MozReview-Commit-ID: CLn3PQUh4gG

# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# 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',
    'getopt.h',
    'unistd.h',
    'nl_types.h',
    'cpuid.h',
    when=non_msvc_compiler,
)

# These are all the places some variant of statfs can be hiding.
check_headers(
    'sys/statvfs.h',
    'sys/statfs.h',
    'sys/vfs.h',
    'sys/mount.h',
    when=non_msvc_compiler,
)

# Quota support
check_header('sys/quota.h',
             when=non_msvc_compiler)
check_header('linux/quota.h',
             includes=['sys/socket.h'],
             when=building_linux)

# SCTP support - needs various network include headers
check_headers(
    'linux/if_addr.h',
    'linux/rtnetlink.h',
    includes=['sys/socket.h'],
    when=building_linux,
)

check_header('sys/queue.h',
             when=non_msvc_compiler)

check_headers(
    'sys/types.h',
    'netinet/in.h',
    'byteswap.h',
    when=non_msvc_compiler,
)