Bug 1428182 - 2. Check both quota.h and quotactl(); r=glandium draft
authorJim Chen <nchen@mozilla.com>
Tue, 30 Jan 2018 14:08:22 -0500
changeset 748988 fe78c114189a362cdad3d79ce67868b045328392
parent 748987 9ded282343df64d9cc4abcf7d7c6b03ac3423ff0
child 748989 7cd9eb04532c14b1dd0dc8747448b89d16e4f118
push id97287
push userbmo:nchen@mozilla.com
push dateTue, 30 Jan 2018 19:09:20 +0000
reviewersglandium
bugs1428182
milestone60.0a1
Bug 1428182 - 2. Check both quota.h and quotactl(); r=glandium Android headers can have a <sys/quota.h> header but with its functions ifdef'ed out. Check for that by checking for the presence of quotactl(). MozReview-Commit-ID: 26ILnbP7flO
build/moz.configure/headers.configure
--- a/build/moz.configure/headers.configure
+++ b/build/moz.configure/headers.configure
@@ -35,18 +35,23 @@ 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 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);',
+                       when=non_msvc_compiler,
+                       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',