From 7d8aceeb9313cafa0b99f7f8413d8e72d66cf9a0 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 7 Jan 2025 21:30:03 +0100 Subject: [PATCH] btrfs-progs: build: add detection for more headers, types and functions Add missing checks reported by autoscan. Reorder the sections, headers, types and functions. Some of the reported issues are not fixed as they're not critical. Signed-off-by: David Sterba --- configure.ac | 92 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index f52154056..58da69de6 100644 --- a/configure.ac +++ b/configure.ac @@ -74,14 +74,6 @@ AC_CHECK_TOOL([AR], [ar]) AC_PATH_PROG([RM], [rm], [rm]) AC_PATH_PROG([RMDIR], [rmdir], [rmdir]) - -AC_CHECK_FUNCS([openat], [], - [AC_MSG_ERROR([cannot find openat() function])]) - -AC_CHECK_FUNCS([reallocarray]) - -AC_CHECK_FUNCS([clock_gettime]) - AX_CHECK_DEFINE([features.h],[__GLIBC__],[HAVE_GLIBC=1],[HAVE_GLIBC=0]) AC_SUBST([HAVE_GLIBC]) @@ -90,15 +82,97 @@ AX_GCC_BUILTIN([__builtin_sub_overflow]) AX_GCC_BUILTIN([__builtin_mul_overflow]) AX_GCC_BUILTIN([__builtin_cpu_supports__pclmul]) +AC_CHECK_HEADERS([fcntl.h]) +AC_CHECK_HEADERS([inttypes.h]) +AC_CHECK_HEADERS([malloc.h]) +AC_CHECK_HEADERS([mntent.h]) +AC_CHECK_HEADERS([stdint.h]) +AC_CHECK_HEADERS([strings.h]) +AC_CHECK_HEADERS([sys/file.h]) +AC_CHECK_HEADERS([sys/ioctl.h]) +AC_CHECK_HEADERS([sys/param.h]) +AC_CHECK_HEADERS([sys/socket.h]) +AC_CHECK_HEADERS([sys/statfs.h]) +AC_CHECK_HEADERS([sys/statvfs.h]) +AC_CHECK_HEADERS([sys/time.h]) +AC_CHECK_HEADERS([unistd.h]) +AC_CHECK_HEADER_STDBOOL + AC_CHECK_HEADERS([linux/perf_event.h]) AC_CHECK_HEADERS([linux/hw_breakpoint.h]) AC_CHECK_HEADERS([linux/fsverity.h]) -AC_CHECK_HEADERS([printf.h]) + +AC_CHECK_MEMBERS([struct stat.st_blksize]) +AC_CHECK_MEMBERS([struct stat.st_rdev]) + +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INT8_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +dnl Required functions +AC_FUNC_CHOWN +AC_FUNC_ERROR_AT_LINE +AC_FUNC_FORK +AC_FUNC_GETMNTENT +AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_FUNC_REALLOC + +AC_CHECK_FUNCS([openat + fchdir + fdatasync + ftruncate + getcwd + getmntent + getpagesize + gettimeofday + lchown + localtime_r + memchr + memmove + memset + mkdir + mkfifo + munmap + realpath + regcomp + rmdir + select + socket + strcasecmp + strchr + strdup + strerror + strncasecmp + strndup + strrchr + strstr + strtol + strtoul + strtoull + sysinfo + uname + ], [], [AC_MSG_ERROR([cannot find required function])]) dnl Check for printf.h functions. +AC_CHECK_HEADERS([printf.h]) AC_CHECK_FUNCS([register_printf_specifier]) AC_CHECK_FUNCS([register_printf_modifier]) +dnl Optional (tests) +AC_CHECK_FUNCS([clock_gettime]) + if grep -q 'HAVE_LINUX_FSVERITY_H.*1' confdefs.h; then have_fsverity='yes' else