Source code
Revision control
Copy as Markdown
Other Tools
# -*- 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
# Check for headers defining standard int types.
check_header("stdint.h")
have_inttypes = check_header("inttypes.h")
# Assume we have ansi C header files available.
set_define("STDC_HEADERS", True)
set_config("HAVE_INTTYPES_H", have_inttypes)
building_linux = depends(target)(lambda target: target.kernel == "Linux")
check_header("alloca.h")
check_headers(
"sys/byteorder.h",
"getopt.h",
"unistd.h",
"nl_types.h",
"cpuid.h",
"fts.h",
)
# 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",
)
# Quota support
# Check for both the header and quotactl() because Android headers can have the
# header but not quotactl().
set_define(
"HAVE_SYS_QUOTA_H",
try_compile(
includes=["sys/quota.h"],
body="quotactl(0, nullptr, 0, (caddr_t)nullptr);",
check_msg="for sys/quota.h",
),
)
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")
check_headers(
"sys/types.h",
"netinet/in.h",
"byteswap.h",
)
# memfd_create(2) -- Note that older versions of the Linux man-pages
# project incorrectly cite <sys/memfd.h>, which doesn't exist; this
# was fixed in the man-pages-5.00 release.
set_define(
"HAVE_MEMFD_CREATE",
try_compile(
includes=["sys/mman.h"],
body='memfd_create("", 0);',
check_msg="for memfd_create in sys/mman.h",
),
)