]> granicus.if.org Git - strace/blobdiff - configure.ac
io.c: move sendfile parsers to a separate file
[strace] / configure.ac
index bb8bf46f79b491fdf39831c211aae5c4c0b4839f..0819f8390cba4ae279c1dfa6bcef60cb76bf7118 100644 (file)
@@ -150,21 +150,27 @@ AC_MSG_RESULT($arch)
 AC_SUBST(arch)
 
 if test "$arch" = mips; then
-       AC_CACHE_CHECK([for MIPS ABI], [ac_cv_mips_abi],
+       AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
+                      [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM],
+                                      [#include <sgidefs.h>],
+                                      [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
+
+       AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
                [AC_COMPILE_IFELSE(
                        [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
                                         [[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
-                       [ac_cv_mips_abi=o32],
+                       [st_cv_mips_abi=o32],
                [AC_COMPILE_IFELSE(
                        [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
                                         [[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
-                       [ac_cv_mips_abi=n32],
+                       [st_cv_mips_abi=n32],
                [AC_COMPILE_IFELSE(
                        [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
                                         [[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
-                       [ac_cv_mips_abi=n64],
-                       [ac_cv_mips_abi=unknown])])])])
-       case "$ac_cv_mips_abi" in
+                       [st_cv_mips_abi=n64],
+                       [st_cv_mips_abi=unknown])])])])
+
+       case "$st_cv_mips_abi" in
                o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _MIPS_SIM_ABI32.]);;
                n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _MIPS_SIM_NABI32.]);;
                n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _MIPS_SIM_ABI64.]);;
@@ -206,11 +212,14 @@ AC_HEADER_STDBOOL
 AC_HEADER_DIRENT
 AC_HEADER_STAT
 AC_CHECK_MEMBERS(m4_normalize([
+       struct stat.st_atim.tv_nsec,
        struct stat.st_blksize,
        struct stat.st_blocks,
+       struct stat.st_ctim.tv_nsec,
        struct stat.st_flags,
        struct stat.st_fstype,
        struct stat.st_gen,
+       struct stat.st_mtim.tv_nsec,
        struct stat.st_rdev
 ]))
 
@@ -242,6 +251,7 @@ AC_CHECK_FUNCS(m4_normalize([
        sendmsg
        sendmmsg
        sigaction
+       signalfd
        stpcpy
        strerror
        strsignal
@@ -264,16 +274,15 @@ AC_CHECK_HEADERS(m4_normalize([
        linux/utsname.h
        mqueue.h
        netinet/sctp.h
-       poll.h
        scsi/sg.h
        stropts.h
        sys/conf.h
        sys/epoll.h
+       sys/eventfd.h
        sys/fanotify.h
-       sys/filio.h
        sys/ioctl.h
-       sys/poll.h
        sys/reg.h
+       sys/signalfd.h
        sys/vfs.h
        sys/xattr.h
 ]))
@@ -288,6 +297,13 @@ AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
 AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
 AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
 
+AC_CHECK_MEMBERS(m4_normalize([
+       struct stat.st_atime_nsec,
+       struct stat.st_ctime_nsec,
+       struct stat.st_mtime_nsec
+]),,, [#include <sys/types.h>
+#include <asm/stat.h>])
+
 AC_CHECK_TYPES([struct stat64],,, [#include <sys/types.h>
 #include <asm/stat.h>])
 AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
@@ -304,10 +320,6 @@ AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
                  siginfo_t.si_timerid,
                  siginfo_t.si_overrun],,, [#include <signal.h>])
 
-AC_CHECK_MEMBERS([struct sysinfo.totalhigh,
-                 struct sysinfo.freehigh,
-                 struct sysinfo.mem_unit],,, [#include <sys/sysinfo.h>])
-
 AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
 
 AC_CHECK_HEADERS([libaio.h], [
@@ -319,6 +331,20 @@ AC_CHECK_HEADERS([linux/input.h], [
        AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
 ])
 
+AC_CHECK_HEADERS([linux/bpf.h], [
+       AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works],
+                      [st_cv_have_union_bpf_attr_log_buf],
+               [AC_COMPILE_IFELSE(
+                       [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
+                                        [[union bpf_attr a = { .log_buf = 0 };]])],
+                       [st_cv_have_union_bpf_attr_log_buf=yes],
+                       [st_cv_have_union_bpf_attr_log_buf=no])])
+       if test $st_cv_have_union_bpf_attr_log_buf = yes; then
+               AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1],
+                         [Define to 1 if union bpf_attr.log_buf initialization works])
+       fi
+])
+
 AC_CHECK_DECLS([sys_errlist])
 AC_CHECK_DECLS(m4_normalize([
        PTRACE_PEEKUSER,
@@ -853,33 +879,8 @@ if test "$arch" = mips && test "$no_create" != yes; then
        fi
 fi
 
-have_m32=no
-case "$arch" in
-       aarch64|powerpc64|sparc64|tile|x32|x86_64)
-       AC_MSG_CHECKING([for -m32 runtime support])
-       saved_CFLAGS="$CFLAGS"
-       CFLAGS="$CFLAGS -m32"
-       AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return 0;}]])],
-               [have_m32=yes],[have_m32=no],[have_m32=no])
-       CFLAGS="$saved_CFLAGS"
-       AC_MSG_RESULT($have_m32)
-       ;;
-esac
-AM_CONDITIONAL([HAVE_M32_RUNTIME], [test "$have_m32" = yes])
-
-have_mx32=no
-case "$arch" in
-       x86_64)
-       AC_MSG_CHECKING([for -mx32 runtime support])
-       saved_CFLAGS="$CFLAGS"
-       CFLAGS="$CFLAGS -mx32"
-       AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return 0;}]])],
-               [have_mx32=yes],[have_mx32=no],[have_mx32=no])
-       CFLAGS="$saved_CFLAGS"
-       AC_MSG_RESULT($have_mx32)
-       ;;
-esac
-AM_CONDITIONAL([HAVE_MX32_RUNTIME], [test "$have_mx32" = yes])
+st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
+st_MPERS([mx32], [x86_64])
 
 AC_CONFIG_FILES([Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile])
 AC_OUTPUT