gl_WARN_ADD([-Wall])
gl_WARN_ADD([-Wwrite-strings])
+gl_WARN_ADD([-Wsign-compare])
AC_ARG_ENABLE([gcc-Werror],
[AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
[case $enableval in
if_indextoname
inet_ntop
prctl
+ preadv
process_vm_readv
+ pwritev
sendmsg
+ sendmmsg
sigaction
stpcpy
strerror
AC_CHECK_HEADERS(m4_normalize([
asm/cachectl.h
asm/sysmips.h
+ bluetooth/bluetooth.h
elf.h
inttypes.h
ioctls.h
- linux/capability.h
linux/perf_event.h
linux/ptrace.h
linux/utsname.h
poll.h
scsi/sg.h
stropts.h
- sys/acl.h
- sys/asynch.h
sys/conf.h
sys/epoll.h
sys/filio.h
sys/poll.h
sys/ptrace.h
sys/reg.h
- sys/uio.h
sys/vfs.h
+ sys/xattr.h
]))
AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
[], [], [#include <stddef.h>
AC_CHECK_TYPES([struct sigcontext],,, [#include <signal.h>])
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_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
struct sigevent.__pad,
siginfo_t.si_syscall],,, [#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], [
+ AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
+ AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
+])
+
AC_CHECK_DECLS([sys_errlist])
AC_CHECK_DECLS(m4_normalize([
PTRACE_EVENT_CLONE,
[#include <sys/types.h>
#include <linux/sysctl.h>])
+AC_CHECK_DECLS(m4_normalize([
+ V4L2_FIELD_ANY,
+ V4L2_FIELD_NONE,
+ V4L2_FIELD_TOP,
+ V4L2_FIELD_BOTTOM,
+ V4L2_FIELD_INTERLACED,
+ V4L2_FIELD_SEQ_TB,
+ V4L2_FIELD_SEQ_BT,
+ V4L2_FIELD_ALTERNATE,
+ V4L2_FIELD_INTERLACED_TB,
+ V4L2_FIELD_INTERLACED_BT,
+ V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY,
+ V4L2_BUF_TYPE_VBI_CAPTURE,
+ V4L2_BUF_TYPE_VBI_OUTPUT,
+ V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
+ V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
+ V4L2_TUNER_RADIO,
+ V4L2_TUNER_ANALOG_TV,
+ V4L2_TUNER_DIGITAL_TV,
+ V4L2_MEMORY_MMAP,
+ V4L2_MEMORY_USERPTR,
+ V4L2_MEMORY_OVERLAY,
+ V4L2_MEMORY_DMABUF,
+ V4L2_COLORSPACE_SMPTE170M,
+ V4L2_COLORSPACE_SMPTE240M,
+ V4L2_COLORSPACE_REC709,
+ V4L2_COLORSPACE_BT878,
+ V4L2_COLORSPACE_470_SYSTEM_M,
+ V4L2_COLORSPACE_470_SYSTEM_BG,
+ V4L2_COLORSPACE_JPEG,
+ V4L2_COLORSPACE_SRGB,
+ V4L2_PRIORITY_UNSET,
+ V4L2_PRIORITY_BACKGROUND,
+ V4L2_PRIORITY_INTERACTIVE,
+ V4L2_PRIORITY_RECORD,
+ V4L2_FRMSIZE_TYPE_DISCRETE,
+ V4L2_FRMSIZE_TYPE_CONTINUOUS,
+ V4L2_FRMSIZE_TYPE_STEPWISE,
+ V4L2_FRMIVAL_TYPE_DISCRETE,
+ V4L2_FRMIVAL_TYPE_CONTINUOUS,
+ V4L2_FRMIVAL_TYPE_STEPWISE,
+ V4L2_CTRL_TYPE_INTEGER,
+ V4L2_CTRL_TYPE_BOOLEAN,
+ V4L2_CTRL_TYPE_MENU,
+ V4L2_CTRL_TYPE_BUTTON,
+ V4L2_CTRL_TYPE_INTEGER64,
+ V4L2_CTRL_TYPE_CTRL_CLASS,
+ V4L2_CTRL_TYPE_STRING,
+ V4L2_CTRL_TYPE_BITMASK,
+ V4L2_CTRL_TYPE_INTEGER_MENU
+]),,, [#include <linux/videodev2.h>])
+
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <stdlib.h>
AC_PATH_PROG([PERL], [perl])
+dnl stack trace with libunwind
+libunwind_CPPFLAGS=
+libunwind_LDFLAGS=
+libunwind_LIBS=
+AC_ARG_WITH([libunwind],
+ [AS_HELP_STRING([--with-libunwind],
+ [use libunwind to implement stack tracing support])],
+ [case "${withval}" in
+ yes|no|check) ;;
+ *) with_libunwind=yes
+ libunwind_CPPFLAGS="-I${withval}/include"
+ libunwind_LDFLAGS="-L${withval}/lib" ;;
+ esac],
+ [with_libunwind=check]
+)
+
+use_libunwind=no
+AS_IF([test "x$with_libunwind" != xno],
+ [saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
+
+ AC_CHECK_HEADERS([libunwind-ptrace.h],
+ [saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
+
+ AC_CHECK_LIB([unwind], [backtrace],
+ [libunwind_LIBS="-lunwind $libunwind_LIBS"
+
+ AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
+ saved_LIBS="$LIBS"
+ LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
+
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
+ [[return !unw_create_addr_space(0, 0)]])
+ ],
+ [AC_MSG_RESULT([yes])
+ libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
+
+ AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
+ [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
+ use_libunwind=yes
+ ],
+ [if test "x$with_libunwind" != xcheck; then
+ AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
+ fi
+ ],
+ [$libunwind_LIBS]
+ )
+ ],
+ [AC_MSG_RESULT([no])
+ if test "x$with_libunwind" != xcheck; then
+ AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
+ fi
+ ]
+ )
+
+ LIBS="$saved_LIBS"
+ ],
+ [if test "x$with_libunwind" != xcheck; then
+ AC_MSG_FAILURE([failed to find libunwind])
+ fi
+ ],
+ [$libunwind_LIBS]
+ )
+
+ LDFLAGS="$saved_LDFLAGS"
+ ],
+ [if test "x$with_libunwind" != xcheck; then
+ AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
+ fi
+ ]
+ )
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ ]
+)
+
+dnl enable libunwind
+AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
+if test "x$use_libunwind" = xyes; then
+ AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
+ AC_SUBST(libunwind_LIBS)
+ AC_SUBST(libunwind_LDFLAGS)
+ AC_SUBST(libunwind_CPPFLAGS)
+fi
+AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
+AC_MSG_RESULT([$use_libunwind])
+
AC_CONFIG_FILES([Makefile tests/Makefile])
AC_OUTPUT