diff options
author | James Le Cuirot <chewi@aura-online.co.uk> | 2014-08-23 09:46:39 +0100 |
---|---|---|
committer | Serge Hallyn <serge.hallyn@ubuntu.com> | 2014-09-04 17:29:27 -0500 |
commit | 2cb54158b80cdbd97ca3b36df83f9255e923ae3f (patch) | |
tree | a7e02ec9b0b6416ccebe7a6f0bf969a72fb5f74f | |
parent | 420943657cde8b9f0586c20119c91d9a8f9850bf (diff) |
Check size of uid_t and gid_t using AC_CHECK_SIZEOF
This built-in check is simpler than the previous method and, most
importantly, works when cross-compiling.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
-rw-r--r-- | configure.in | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/configure.in b/configure.in index 1a3f8418..4a4d6d08 100644 --- a/configure.in +++ b/configure.in @@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then dnl dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc dnl - AC_RUN_IFELSE([AC_LANG_SOURCE([ -#include <sys/types.h> -int main(void) { - uid_t u; - gid_t g; - return (sizeof u < 4) || (sizeof g < 4); -} - ])], [id32bit="yes"], [id32bit="no"]) - - if test "x$id32bit" = "xyes"; then + AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"]) + AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"]) + + if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.]) enable_subids="yes" else |