diff --git a/configure.ac b/configure.ac index 6c19eedef..c4dde3a8b 100644 --- a/configure.ac +++ b/configure.ac @@ -36,13 +36,6 @@ LT_LIB_DLLOAD dnl Checks for libraries. -dnl Checks for header files. -AC_CHECK_HEADERS(crypt.h utmp.h \ - termio.h sgtty.h sys/ioctl.h paths.h \ - sys/capability.h sys/random.h \ - gshadow.h lastlog.h rpc/key_prot.h acl/libacl.h \ - attr/libattr.h attr/error_context.h) - dnl shadow now uses the libc's shadow implementation AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])]) diff --git a/lib/csrand.c b/lib/csrand.c index 1914a3036..def32be2e 100644 --- a/lib/csrand.c +++ b/lib/csrand.c @@ -10,8 +10,8 @@ #include #include #include -#if HAVE_SYS_RANDOM_H -#include +#if __has_include() +# include #endif #include "bit.h" diff --git a/lib/defines.h b/lib/defines.h index 5f9ed4d1c..89300c93c 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -41,7 +41,7 @@ * crypt(3), crypt_gensalt(3), and their * feature test macros may be defined in here. */ -#if HAVE_CRYPT_H +#if __has_include() # include #endif diff --git a/lib/gshadow.c b/lib/gshadow.c index d1ca70706..2725e09eb 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -9,7 +9,7 @@ #include -#if defined(SHADOWGRP) && !defined(HAVE_GSHADOW_H) +#if defined(SHADOWGRP) && !__has_include() #ident "$Id$" diff --git a/lib/gshadow_.h b/lib/gshadow_.h index be1f0f1c2..2b38cb338 100644 --- a/lib/gshadow_.h +++ b/lib/gshadow_.h @@ -9,7 +9,7 @@ #define SHADOW_INCLUDE_LIB_GSHADOW__H_ -#if defined(HAVE_GSHADOW_H) +#if __has_include() # include #else @@ -41,5 +41,5 @@ int putsgent (const struct sgrp *, FILE *); #define GSHADOW "/etc/gshadow" -#endif // !HAVE_GSHADOW_H +#endif // !__has_include() #endif // include guard diff --git a/lib/idmapping.c b/lib/idmapping.c index 89c03b101..ef685f326 100644 --- a/lib/idmapping.c +++ b/lib/idmapping.c @@ -12,9 +12,9 @@ #include #include #include -#if HAVE_SYS_CAPABILITY_H #include -#include +#if __has_include() +# include #endif #include "alloc/calloc.h" @@ -86,7 +86,7 @@ get_map_ranges(int ranges, int argc, char **argv) */ #define ULONG_DIGITS (((WIDTHOF(unsigned long) + 9)/10)*3) -#if HAVE_SYS_CAPABILITY_H +#if __has_include() static inline bool maps_lower_root(int cap, int ranges, const struct map_range *mappings) { int idx; @@ -129,7 +129,7 @@ void write_mapping(int proc_dir_fd, int ranges, const struct map_range *mappings char *buf, *pos, *end; int fd; -#if HAVE_SYS_CAPABILITY_H +#if __has_include() int cap; struct __user_cap_header_struct hdr = {_LINUX_CAPABILITY_VERSION_3, 0}; struct __user_cap_data_struct data[2] = {{0}}; diff --git a/lib/pam_defs.h b/lib/pam_defs.h index dd016e5cc..f12e7d4d8 100644 --- a/lib/pam_defs.h +++ b/lib/pam_defs.h @@ -6,11 +6,12 @@ */ #include + #include -#ifdef HAVE_SECURITY_PAM_MISC_H +#if __has_include() # include #endif -#ifdef HAVE_SECURITY_OPENPAM_H +#if __has_include() # include #endif