headers.configure (1978B)
1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- 2 # vim: set filetype=python: 3 # This Source Code Form is subject to the terms of the Mozilla Public 4 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 7 # Check for headers defining standard int types. 8 check_header("stdint.h") 9 have_inttypes = check_header("inttypes.h") 10 11 12 # Assume we have ansi C header files available. 13 set_define("STDC_HEADERS", True) 14 15 set_config("HAVE_INTTYPES_H", have_inttypes) 16 17 building_linux = depends(target)(lambda target: target.kernel == "Linux") 18 19 20 check_header("alloca.h") 21 22 check_headers( 23 "sys/byteorder.h", 24 "getopt.h", 25 "unistd.h", 26 "nl_types.h", 27 "cpuid.h", 28 "fts.h", 29 ) 30 31 # These are all the places some variant of statfs can be hiding. 32 check_headers( 33 "sys/statvfs.h", 34 "sys/statfs.h", 35 "sys/vfs.h", 36 "sys/mount.h", 37 ) 38 39 # Quota support 40 # Check for both the header and quotactl() because Android headers can have the 41 # header but not quotactl(). 42 set_define( 43 "HAVE_SYS_QUOTA_H", 44 try_compile( 45 includes=["sys/quota.h"], 46 body="quotactl(0, nullptr, 0, (caddr_t)nullptr);", 47 check_msg="for sys/quota.h", 48 ), 49 ) 50 check_header("linux/quota.h", includes=["sys/socket.h"], when=building_linux) 51 52 # SCTP support - needs various network include headers 53 check_headers( 54 "linux/if_addr.h", 55 "linux/rtnetlink.h", 56 includes=["sys/socket.h"], 57 when=building_linux, 58 ) 59 60 check_header("sys/queue.h") 61 62 check_headers( 63 "sys/types.h", 64 "netinet/in.h", 65 "byteswap.h", 66 ) 67 68 # memfd_create(2) -- Note that older versions of the Linux man-pages 69 # project incorrectly cite <sys/memfd.h>, which doesn't exist; this 70 # was fixed in the man-pages-5.00 release. 71 set_define( 72 "HAVE_MEMFD_CREATE", 73 try_compile( 74 includes=["sys/mman.h"], 75 body='memfd_create("", 0);', 76 check_msg="for memfd_create in sys/mman.h", 77 ), 78 )