]> granicus.if.org Git - shadow/commitdiff
Check size of uid_t and gid_t using AC_CHECK_SIZEOF
authorJames Le Cuirot <chewi@aura-online.co.uk>
Sat, 23 Aug 2014 08:46:39 +0000 (09:46 +0100)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 4 Sep 2014 22:29:27 +0000 (17:29 -0500)
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>
configure.in

index 1a3f84185150338914748d61fe7e5575a9d01561..4a4d6d08585409459e6c08a55b3722233d37bbc6 100644 (file)
@@ -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