blob: c982ced10fdb9c7433a7bf3ca3b3224bc2b182c7 [file] [log] [blame]
Dmitry V. Levin38a34c92015-12-17 17:56:48 +00001# Configure template for strace.
2#
3# Copyright (c) 1999-2001 Wichert Akkerman <wichert@deephackmode.org>
4# Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
Dmitry V. Levin2165a352016-01-12 00:02:56 +00005# Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin38a34c92015-12-17 17:56:48 +00006# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
7# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
Elliott Hughesb7556142018-02-20 17:03:16 -08008# Copyright (c) 2002-2018 The strace developers.
Dmitry V. Levin38a34c92015-12-17 17:56:48 +00009# All rights reserved.
10#
11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions
13# are met:
14# 1. Redistributions of source code must retain the above copyright
15# notice, this list of conditions and the following disclaimer.
16# 2. Redistributions in binary form must reproduce the above copyright
17# notice, this list of conditions and the following disclaimer in the
18# documentation and/or other materials provided with the distribution.
19# 3. The name of the author may not be used to endorse or promote products
20# derived from this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
Roland McGrath6d2b3492002-12-30 00:51:30 +000033AC_PREREQ(2.57)
Dmitry V. Levindce75932013-04-30 23:52:12 +000034AC_INIT([strace],
35 m4_esyscmd([./git-version-gen .tarball-version]),
Elliott Hughes28e98bc2018-06-14 16:59:04 -070036 [strace-devel@lists.strace.io],
Elliott Hughesd35df492017-02-15 15:19:05 -080037 [strace],
38 [https://strace.io])
Elliott Hughes39bac052017-05-25 16:56:11 -070039m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year]))
Elliott Hughes77c3ff82017-09-08 17:11:00 -070040m4_define([manpage_date], m4_esyscmd([./file-date-gen strace.1.in]))
Elliott Hughesdc75b012017-07-05 13:54:44 -070041AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
Roland McGrath6d2b3492002-12-30 00:51:30 +000042AC_CONFIG_SRCDIR([strace.c])
Roland McGrathffda2d32009-10-11 16:25:29 -070043AC_CONFIG_AUX_DIR([.])
Mike Frysingerbb3a0f72013-04-30 22:41:11 -040044AC_CONFIG_HEADERS([config.h])
Elliott Hughes77c3ff82017-09-08 17:11:00 -070045AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13])
Roland McGrath6d2b3492002-12-30 00:51:30 +000046AM_MAINTAINER_MODE
47AC_CANONICAL_HOST
48
Elliott Hughes03a418e2018-06-15 13:11:40 -070049RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')"
Dmitry V. Levin669efd82016-06-08 00:32:09 +000050AC_SUBST(RPM_CHANGELOGTIME)
Elliott Hughes03a418e2018-06-15 13:11:40 -070051DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)"
Dmitry V. Levin669efd82016-06-08 00:32:09 +000052AC_SUBST(DEB_CHANGELOGTIME)
Dmitry V. Levine2b3df22016-06-07 18:04:53 +000053
H.J. Lu35be5812012-04-16 13:00:01 +020054AC_PROG_CC
Elliott Hughesb7556142018-02-20 17:03:16 -080055AC_PROG_CC_STDC
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000056AC_PROG_CPP
Elliott Hughesd35df492017-02-15 15:19:05 -080057st_WARN_CFLAGS
Mike Frysinger58c7fe92015-02-26 22:22:36 -050058AX_PROG_CC_FOR_BUILD
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000059AC_PROG_INSTALL
Elvira Khabirova09294222015-08-04 01:47:02 +030060AC_PROG_RANLIB
H.J. Lu35be5812012-04-16 13:00:01 +020061
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000062AC_USE_SYSTEM_EXTENSIONS
Gabriel Laskarcba67102016-02-01 18:15:39 +010063AX_CODE_COVERAGE
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000064
Elliott Hughes39bac052017-05-25 16:56:11 -070065AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.])
66AC_SUBST([COPYRIGHT_YEAR], [copyright_year])
67
Elliott Hughes77c3ff82017-09-08 17:11:00 -070068AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
69AC_SUBST([MANPAGE_DATE], [manpage_date])
70
Roland McGrath6d2b3492002-12-30 00:51:30 +000071AC_MSG_CHECKING([for supported architecture])
Dmitry V. Levin1e04e572015-12-08 00:13:38 +000072arch_m32=
73arch_mx32=
Elliott Hughesb7556142018-02-20 17:03:16 -080074cc_flags_m32=-m32
75cc_flags_mx32=-mx32
Roland McGrath6d2b3492002-12-30 00:51:30 +000076case "$host_cpu" in
Elliott Hughesb7556142018-02-20 17:03:16 -080077aarch64*)
78 arch=aarch64
79 arch_m32=arm
80 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
81 ;;
82alpha*)
83 arch=alpha
84 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
85 ;;
86arc*)
87 arch=arc
88 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
89 ;;
90arm*)
91 arch=arm
92 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
93 ;;
94avr32*)
95 arch=avr32
96 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
97 ;;
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +000098bfin)
99 arch=bfin
100 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
101 ;;
Elliott Hughesb7556142018-02-20 17:03:16 -0800102hppa*|parisc*)
103 arch=hppa
104 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
105 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000106i[[3456]]86|pentium)
107 arch=i386
108 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
109 ;;
110ia64)
111 arch=ia64
112 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
113 ;;
114m68k)
115 arch=m68k
116 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
117 ;;
James Hogan5f999a82013-02-22 14:44:10 +0000118metag*)
119 arch=metag
120 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
121 ;;
Elliott Hughesb7556142018-02-20 17:03:16 -0800122microblaze*)
123 arch=microblaze
124 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
125 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000126mips*)
127 arch=mips
128 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
129 ;;
Elliott Hughesb7556142018-02-20 17:03:16 -0800130nios2*)
131 arch=nios2
132 AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
133 ;;
134or1k*)
135 arch=or1k
136 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000137 ;;
Roland McGratheb285352003-01-14 09:59:00 +0000138powerpc*)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000139 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Anton Blanchard9afc2ee2013-07-11 12:03:57 +1000140 AC_TRY_COMPILE(
141[#ifndef __LP64__
142# error 32 bit
Dmitry V. Levinaf3ab5b2015-01-21 17:04:31 +0000143#endif], [], arch=powerpc64, arch=powerpc)
144 if test "$arch" = "powerpc64"; then
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000145 arch_m32=powerpc
Andreas Schwabd69fa492010-07-12 21:39:57 +0200146 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
147 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +0000148 ;;
Elliott Hughesb7556142018-02-20 17:03:16 -0800149riscv*)
150 arch=riscv
151 AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
Vineet Gupta7daacbb2013-08-16 12:47:06 +0530152 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000153s390)
154 arch=s390
155 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
156 ;;
157s390x)
158 arch=s390x
Elliott Hughesb7556142018-02-20 17:03:16 -0800159 arch_m32=s390
160 cc_flags_m32=-m31
Roland McGrath6d2b3492002-12-30 00:51:30 +0000161 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
162 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +0000163sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +0000164 arch=sh64
165 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +0000166 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +0000167sh*)
168 arch=sh
169 AC_DEFINE([SH], 1, [Define for the SH architecture.])
170 ;;
Elliott Hughesb7556142018-02-20 17:03:16 -0800171sparc64*)
172 arch=sparc64
173 arch_m32=sparc
174 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
175 ;;
176sparc*)
177 arch=sparc
178 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
179 ;;
180tile*)
181 arch=tile
182 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
183 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000184x86?64*)
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000185 arch_m32=i386
H.J. Lu35be5812012-04-16 13:00:01 +0200186 AC_TRY_COMPILE(
187[#ifndef __ILP32__
188# error not x32
189#endif], [], arch=x32, arch=x86_64)
190 if test "$arch" = "x86_64"; then
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000191 arch_mx32=x32
H.J. Lu35be5812012-04-16 13:00:01 +0200192 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
193 else
194 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
195 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +0000196 ;;
Chris Zankel8f636ed2013-03-25 10:22:07 -0700197xtensa*)
198 arch=xtensa
199 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
200 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000201*)
202 AC_MSG_RESULT([NO!])
203 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
204 ;;
205esac
206AC_MSG_RESULT($arch)
207
Elliott Hughesb7556142018-02-20 17:03:16 -0800208arch_native=$arch
209
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000210test -n "$arch_m32" ||
211 arch_m32=$arch
212test -n "$arch_mx32" ||
213 arch_mx32=$arch
Roland McGrath6d2b3492002-12-30 00:51:30 +0000214AC_SUBST(arch)
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000215AC_SUBST(arch_m32)
216AC_SUBST(arch_mx32)
Elliott Hughesb7556142018-02-20 17:03:16 -0800217AC_SUBST(cc_flags_m32)
218AC_SUBST(cc_flags_mx32)
219AC_SUBST(arch_native)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000220
James Cowgill468dccf2016-08-11 16:33:02 +0000221MIPS_ABI=
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000222if test "$arch" = mips; then
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000223 AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
Elliott Hughesd35df492017-02-15 15:19:05 -0800224 [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
Elliott Hughesb7556142018-02-20 17:03:16 -0800225 [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000226
Elliott Hughesd35df492017-02-15 15:19:05 -0800227 # requires GCC >= 3.4
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000228 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000229 [AC_COMPILE_IFELSE(
Elliott Hughesd35df492017-02-15 15:19:05 -0800230 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])],
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000231 [st_cv_mips_abi=o32],
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000232 [AC_COMPILE_IFELSE(
Elliott Hughesd35df492017-02-15 15:19:05 -0800233 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])],
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000234 [st_cv_mips_abi=n32],
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000235 [AC_COMPILE_IFELSE(
Elliott Hughesd35df492017-02-15 15:19:05 -0800236 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])],
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000237 [st_cv_mips_abi=n64],
238 [st_cv_mips_abi=unknown])])])])
239
240 case "$st_cv_mips_abi" in
Elliott Hughesd35df492017-02-15 15:19:05 -0800241 o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);;
242 n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);;
243 n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);;
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000244 *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
245 esac
James Cowgill468dccf2016-08-11 16:33:02 +0000246 MIPS_ABI="$st_cv_mips_abi"
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000247fi
James Cowgill468dccf2016-08-11 16:33:02 +0000248AC_SUBST(MIPS_ABI)
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000249
Dmitry V. Levin0160e162014-03-18 23:37:43 +0000250AC_ARG_ENABLE([arm-oabi],
251 [AS_HELP_STRING([--enable-arm-oabi],
252 [enable OABI support on ARM EABI])],
253 [], [enable_arm_oabi=no])
254case "$enable_arm_oabi" in
255 yes) enable_arm_oabi=1 ;;
256 no) enable_arm_oabi=0 ;;
257 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
258esac
259AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
260 [Define to 1 if you want OABI support on ARM EABI.])
261
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400262AC_C_BIGENDIAN
Dmitry V. Levin2165a352016-01-12 00:02:56 +0000263AC_C_TYPEOF
Roland McGrath6d2b3492002-12-30 00:51:30 +0000264
Roland McGrath6d2b3492002-12-30 00:51:30 +0000265AC_TYPE_UID_T
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000266
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000267AC_CHECK_FUNCS(m4_normalize([
Dmitry V. Levin891855e2016-07-11 17:21:22 +0000268 accept4
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700269 be64toh
Eugene Syromyatnikovdbb76602016-09-22 00:21:50 +0300270 fallocate
Dmitry V. Levin1ea64732015-01-10 00:08:58 +0000271 fanotify_mark
Dmitry V. Levind3541302014-02-26 00:01:00 +0000272 fopen64
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000273 fork
Dmitry V. Levind3541302014-02-26 00:01:00 +0000274 fputs_unlocked
Dmitry V. Levinb0e61152015-12-02 01:02:39 +0000275 fstatat
276 ftruncate
277 futimens
Elliott Hughesb7556142018-02-20 17:03:16 -0800278 iconv_open
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000279 if_indextoname
Dmitry V. Levinbf2698a2016-07-03 22:15:45 +0000280 open64
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000281 prctl
Mike Frysinger97ca0272014-08-11 02:52:08 -0400282 preadv
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000283 process_vm_readv
Mike Frysinger97ca0272014-08-11 02:52:08 -0400284 pwritev
Eugene Syromyatnikov0c766332016-09-02 18:28:24 +0300285 readahead
Dmitry V. Levin30ac0622015-08-03 09:47:25 +0000286 signalfd
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000287 stpcpy
288 strerror
Elliott Hughesdc75b012017-07-05 13:54:44 -0700289 strndup
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000290 strsignal
Dmitry V. Levin5b2d2572016-04-06 00:02:08 +0000291 sync_file_range
Dmitry V. Levin78e48eb2015-07-15 15:34:59 +0000292 utimensat
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000293]))
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000294
295AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
296
297AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
298
299AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
300[#include <asm/posix_types.h>])
301
302AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
303[#include <sys/types.h>
304#include <asm/stat.h>])
305
Elliott Hughesb7556142018-02-20 17:03:16 -0800306AC_CHECK_TYPES([struct user_desc],
307 [AC_CHECK_MEMBERS([struct user_desc.lm],,,
308 [#include <asm/ldt.h>])],,
309 [#include <asm/ldt.h>])
Elliott Hughesd35df492017-02-15 15:19:05 -0800310
Dmitry V. Levina7c4ee42016-08-24 00:29:40 +0000311AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
Dmitry V. Levin788939b2016-08-23 14:27:45 +0000312[#include <sys/types.h>
313#include <asm/stat.h>])
314
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000315AC_CHECK_TYPES(m4_normalize([
316 struct pt_all_user_regs,
317 struct ia64_fpreg,
318 struct ptrace_peeksiginfo_args
319]),,, [#include <sys/ptrace.h>])
320
Elliott Hughesc1873762018-12-19 15:13:36 -0800321# For kernels that do not have v3.10-rc1~201^2~11
322AC_CHECK_TYPES([s390_compat_regs],,, [#include <asm/ptrace.h>])
323
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000324AC_CHECK_TYPES(m4_normalize([
325 struct flock,
326 struct flock64,
327 struct __kernel_flock,
Elliott Hughes03a418e2018-06-15 13:11:40 -0700328 struct __kernel_flock64,
329 struct f_owner_ex,
330 struct __kernel_f_owner_ex
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000331]),,,
332[#include <sys/types.h>
333#include <linux/fcntl.h>])
334
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700335AC_CHECK_TYPES(m4_normalize([
336 struct crypto_report_aead,
337 struct crypto_report_blkcipher,
338 struct crypto_report_cipher,
339 struct crypto_report_hash,
340 struct crypto_report_rng
341]),,, [#include <linux/cryptouser.h>])
342
343AC_CHECK_TYPES(m4_normalize([
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800344 struct kcmp_epoll_slot
345]),,, [#include <linux/kcmp.h>])
346
347AC_CHECK_TYPES(m4_normalize([
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700348 struct keyctl_kdf_params
349]),,, [#include <linux/keyctl.h>])
350
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000351AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
352
353AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
354
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000355AC_CHECK_MEMBERS(m4_normalize([
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000356 siginfo_t.si_syscall,
357 siginfo_t.si_timerid,
358 siginfo_t.si_overrun
359]),,, [#include <signal.h>])
360
Elliott Hughesd35df492017-02-15 15:19:05 -0800361AC_CHECK_MEMBERS(m4_normalize([
362 struct perf_event_attr.precise_ip,
363 struct perf_event_attr.mmap_data,
364 struct perf_event_attr.sample_id_all,
365 struct perf_event_attr.exclude_host,
366 struct perf_event_attr.exclude_guest,
367 struct perf_event_attr.exclude_callchain_kernel,
368 struct perf_event_attr.exclude_callchain_user,
369 struct perf_event_attr.mmap2,
370 struct perf_event_attr.comm_exec,
371 struct perf_event_attr.use_clockid,
372 struct perf_event_attr.context_switch,
373 struct perf_event_attr.write_backward,
Elliott Hughesb7556142018-02-20 17:03:16 -0800374 struct perf_event_attr.namespaces,
Elliott Hughesd35df492017-02-15 15:19:05 -0800375 struct perf_event_attr.bp_type,
376 struct perf_event_attr.config1,
377 struct perf_event_attr.config2,
378 struct perf_event_attr.branch_sample_type,
379 struct perf_event_attr.sample_regs_user,
380 struct perf_event_attr.sample_stack_user,
381 struct perf_event_attr.sample_regs_intr,
382 struct perf_event_attr.aux_watermark,
383 struct perf_event_attr.sample_max_stack
384]),,, [#include <linux/perf_event.h>])
385
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000386AC_CHECK_HEADERS(m4_normalize([
387 asm/cachectl.h
Elliott Hughesb7556142018-02-20 17:03:16 -0800388 asm/guarded_storage.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000389 asm/sysmips.h
Dmitry V. Levinc41808b2013-03-18 00:52:29 +0000390 elf.h
Elliott Hughesb7556142018-02-20 17:03:16 -0800391 iconv.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000392 inttypes.h
Bart Van Assche67d0a8e2015-02-06 13:37:03 +0100393 linux/bsg.h
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700394 linux/cryptouser.h
Elliott Hughesd35df492017-02-15 15:19:05 -0800395 linux/dm-ioctl.h
Eugene Syromyatnikov81b63832016-09-21 06:12:37 +0300396 linux/dqblk_xfs.h
Dmitry V. Levin52572b62014-12-11 19:21:54 +0000397 linux/falloc.h
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700398 linux/fib_rules.h
Dmitry V. Levinc5253072016-05-24 00:19:17 +0000399 linux/fiemap.h
Elliott Hughesdc75b012017-07-05 13:54:44 -0700400 linux/genetlink.h
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +0000401 linux/hiddev.h
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700402 linux/if_addr.h
403 linux/if_link.h
Mike Frysinger54646b82015-08-19 13:29:27 -0400404 linux/ip_vs.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400405 linux/ipc.h
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800406 linux/kcmp.h
Elliott Hughesb7556142018-02-20 17:03:16 -0800407 linux/kvm.h
408 linux/memfd.h
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +0000409 linux/mmtimer.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400410 linux/msg.h
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700411 linux/neighbour.h
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800412 linux/netfilter/ipset/ip_set.h
413 linux/netfilter/nf_tables.h
414 linux/netfilter/nf_tables_compat.h
Elliott Hughesdc75b012017-07-05 13:54:44 -0700415 linux/netfilter/nfnetlink.h
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800416 linux/netfilter/nfnetlink_acct.h
417 linux/netfilter/nfnetlink_conntrack.h
418 linux/netfilter/nfnetlink_cthelper.h
419 linux/netfilter/nfnetlink_cttimeout.h
420 linux/netfilter/nfnetlink_log.h
421 linux/netfilter/nfnetlink_queue.h
Elliott Hughes39bac052017-05-25 16:56:11 -0700422 linux/nsfs.h
Ben Noordhuis88eafd82013-02-04 00:04:57 +0100423 linux/perf_event.h
Eugene Syromyatnikov81b63832016-09-21 06:12:37 +0300424 linux/quota.h
Dmitry V. Levin2af69032015-02-04 23:50:50 +0000425 linux/seccomp.h
Dmitry V. Levin1e880732015-02-14 01:51:03 +0000426 linux/securebits.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400427 linux/sem.h
428 linux/shm.h
Dr. David Alan Gilbert5d1216a2016-05-10 11:49:02 +0100429 linux/userfaultfd.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000430 linux/utsname.h
431 mqueue.h
432 netinet/sctp.h
Dmitry V. Levinebda41a2016-06-19 22:02:45 +0000433 netipx/ipx.h
Elliott Hughesb7556142018-02-20 17:03:16 -0800434 paths.h
Dmitry V. Levinfdb896e2014-02-25 23:04:55 +0000435 scsi/sg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000436 stropts.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000437 sys/conf.h
Dmitry V. Levinc8cba992015-08-01 21:08:13 +0000438 sys/eventfd.h
Dmitry V. Levin1ea64732015-01-10 00:08:58 +0000439 sys/fanotify.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400440 sys/ipc.h
441 sys/msg.h
Eugene Syromyatnikov81b63832016-09-21 06:12:37 +0300442 sys/quota.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400443 sys/sem.h
444 sys/shm.h
Dmitry V. Levin30ac0622015-08-03 09:47:25 +0000445 sys/signalfd.h
Masatake YAMATOf5480672014-11-22 19:03:33 +0900446 sys/xattr.h
Elliott Hughesd35df492017-02-15 15:19:05 -0800447 ustat.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000448]))
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000449
450AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
451
452AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
453
Mike Frysingerba10a422015-10-31 00:47:53 -0400454AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000455
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800456AC_CHECK_HEADERS([linux/netfilter/xt_osf.h],,, [#include <linux/ip.h>
457#include <linux/tcp.h>])
458
Mike Frysinger54646b82015-08-19 13:29:27 -0400459AC_CHECK_HEADERS(m4_normalize([
460 linux/netfilter_arp/arp_tables.h
461 linux/netfilter_bridge/ebtables.h
462 linux/netfilter_ipv4/ip_tables.h
463 linux/netfilter_ipv6/ip6_tables.h
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000464]),,, [#include <netinet/in.h>
Mike Frysinger54646b82015-08-19 13:29:27 -0400465#include <net/if.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000466
Dmitry V. Levin19dadf92015-02-22 02:50:33 +0300467AC_CHECK_HEADERS([linux/input.h], [
468 AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
469])
470
Dmitry V. Levin4e3ded32015-07-29 16:27:16 +0000471AC_CHECK_HEADERS([linux/bpf.h], [
Elliott Hughes03a418e2018-06-15 13:11:40 -0700472 AC_CHECK_TYPES(m4_normalize([
473 struct bpf_insn,
474 struct bpf_map_info,
475 struct bpf_prog_info
476 ]),,, [#include <linux/bpf.h>])
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700477 st_BPF_ATTR
Dmitry V. Levin4e3ded32015-07-29 16:27:16 +0000478])
479
Elliott Hughes03a418e2018-06-15 13:11:40 -0700480AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
481 AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
482 [#include <bluetooth/bluetooth.h>
483 #include <bluetooth/l2cap.h>])
484])
485
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800486AC_CHECK_TYPES(m4_normalize([
487 struct br_mdb_entry,
488 struct br_port_msg
489]),,, [#include <linux/if_bridge.h>])
490AC_CHECK_MEMBERS(m4_normalize([
491 struct br_mdb_entry.flags,
492 struct br_mdb_entry.vid
493]),,, [#include <linux/if_bridge.h>])
494
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700495AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
496AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
497AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
498
499AC_CHECK_TYPES(m4_normalize([
500 struct rta_mfc_stats,
501 struct rtvia
Elliott Hughes03a418e2018-06-15 13:11:40 -0700502]),,, [#include <sys/socket.h>
503#include <linux/rtnetlink.h>])
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700504
505AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
506AC_CHECK_TYPES(m4_normalize([
507 struct ndt_config,
508 struct ndt_stats
509]),,, [#include <linux/neighbour.h>])
510
511AC_CHECK_TYPES(m4_normalize([
512 struct ifla_bridge_id,
Elliott Hughes03a418e2018-06-15 13:11:40 -0700513 struct ifla_cacheinfo,
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700514 struct ifla_port_vsi,
515 struct rtnl_link_stats64
Elliott Hughes03a418e2018-06-15 13:11:40 -0700516]),,, [#include <sys/socket.h>
517#include <linux/rtnetlink.h>])
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700518AC_CHECK_MEMBERS(m4_normalize([
519 struct rtnl_link_stats.rx_nohandler,
520 struct rtnl_link_stats64.rx_nohandler
Elliott Hughes03a418e2018-06-15 13:11:40 -0700521]),,, [#include <sys/socket.h>
522#include <linux/rtnetlink.h>])
523AC_CHECK_DECLS(m4_normalize([
524 IFLA_PORT_SELF,
525 IFLA_PROTINFO,
526 IFLA_AF_SPEC,
527 IFLA_XDP
528]),,, [#include <sys/socket.h>
529#include <linux/rtnetlink.h>])
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700530
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800531AC_CHECK_TYPES(m4_normalize([
532 struct gnet_stats_basic,
533 struct gnet_stats_queue,
534 struct gnet_stats_rate_est,
535 struct gnet_stats_rate_est64
536]),,, [#include <linux/gen_stats.h>])
537
Elliott Hughes03a418e2018-06-15 13:11:40 -0700538AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/types.h>
539#include <linux/pkt_sched.h>])
540AC_CHECK_DECLS([TCA_STAB_DATA],,, [#include <linux/types.h>
541#include <linux/pkt_sched.h>])
Elliott Hughesbbf97dc2017-11-15 16:45:52 -0800542
Elliott Hughes03a418e2018-06-15 13:11:40 -0700543AC_CHECK_TYPES(m4_normalize([
544 struct fib_rule_uid_range,
545 struct fib_rule_port_range
546]),,, [#include <linux/fib_rules.h>])
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700547
Dmitry V. Levin67c2f672016-04-26 00:21:26 +0000548AC_CHECK_TYPES([struct statfs], [
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700549 AC_CHECK_MEMBERS(m4_normalize([
550 struct statfs.f_frsize,
551 struct statfs.f_flags,
552 struct statfs.f_fsid.val,
553 struct statfs.f_fsid.__val
554 ]),,, [#include <linux/types.h>
Dmitry V. Levin67c2f672016-04-26 00:21:26 +0000555#include <asm/statfs.h>])
556],, [#include <linux/types.h>
557#include <asm/statfs.h>])
558
559AC_CHECK_TYPES([struct statfs64], [
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700560 AC_CHECK_MEMBERS(m4_normalize([
561 struct statfs64.f_frsize,
562 struct statfs64.f_flags,
563 struct statfs64.f_fsid.val,
564 struct statfs64.f_fsid.__val
565 ]),,, [#include <linux/types.h>
Dmitry V. Levin67c2f672016-04-26 00:21:26 +0000566#include <asm/statfs.h>])
567],, [#include <linux/types.h>
568#include <asm/statfs.h>])
569
Dmitry V. Levin799b22a2016-05-26 12:55:41 +0000570AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
571
Elliott Hughesb7556142018-02-20 17:03:16 -0800572AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
573
574AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
575
576AC_CHECK_TYPES(m4_normalize([
577 struct ptp_sys_offset
578]),,, [#include <linux/ptp_clock.h>])
579
580AC_CHECK_TYPES(m4_normalize([
Elliott Hughesc1873762018-12-19 15:13:36 -0800581 struct kvm_cpuid2,
Elliott Hughesb7556142018-02-20 17:03:16 -0800582 struct kvm_regs,
583 struct kvm_sregs,
584 struct kvm_userspace_memory_region
585]),,, [#include <linux/kvm.h>])
586
Elliott Hughes03a418e2018-06-15 13:11:40 -0700587saved_CPPFLAGS="$CPPFLAGS"
Elliott Hughesc1873762018-12-19 15:13:36 -0800588
589AC_CACHE_CHECK([whether <linux/signal.h> can be used along with <signal.h>],
590 [st_cv_linux_signal],
591 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
592#include <signal.h>
593#include <linux/signal.h>]],[])],
594 [st_cv_linux_signal=yes],
595 [st_cv_linux_signal=no])])
596if test "x$st_cv_linux_signal" = xno; then
597 mkdir -p linux/linux
598 cp $srcdir/linux/signal.h.in linux/linux/signal.h
599 CPPFLAGS="$CPPFLAGS -Ilinux"
600fi
601
Elliott Hughes03a418e2018-06-15 13:11:40 -0700602AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
Elliott Hughesc1873762018-12-19 15:13:36 -0800603
Elliott Hughes03a418e2018-06-15 13:11:40 -0700604CPPFLAGS="$saved_CPPFLAGS"
605
Jeff Mahoney8cc69622016-05-18 18:09:39 -0400606AC_CHECK_HEADERS([linux/btrfs.h], [
607 AC_CHECK_MEMBERS(m4_normalize([
608 struct btrfs_ioctl_feature_flags.compat_flags,
609 struct btrfs_ioctl_fs_info_args.nodesize,
Dmitry V. Levin7c0e8872016-06-16 23:21:57 +0000610 struct btrfs_ioctl_defrag_range_args.start,
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700611 struct btrfs_ioctl_search_args_v2.buf_size,
612 struct btrfs_ioctl_logical_ino_args.flags
Jeff Mahoney8cc69622016-05-18 18:09:39 -0400613 ]),,, [ #include <stdio.h>
614#include <linux/btrfs.h>])
Elliott Hughesdc75b012017-07-05 13:54:44 -0700615 AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
616 BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
Jeff Mahoney8cc69622016-05-18 18:09:39 -0400617#include <linux/btrfs.h>])])
618
Roland McGrath6d2b3492002-12-30 00:51:30 +0000619AC_CHECK_DECLS([sys_errlist])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000620AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levin6974bd42013-11-12 21:20:50 +0000621 PTRACE_PEEKUSER,
Dmitry V. Levinfadf3792015-02-13 00:26:38 +0000622 PTRACE_POKEUSER
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000623]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000624
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000625AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levind8ad1dd2014-04-26 15:22:08 +0000626 P_PID,
627 P_PPID,
628 P_PGID,
629 P_SID,
630 P_CID,
631 P_UID,
632 P_GID,
633 P_ALL,
634 P_LWPID
635]),,, [#include <sys/wait.h>])
636
637AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levinbaf60d92014-04-26 14:12:33 +0000638 LO_FLAGS_READ_ONLY,
Elliott Hughesd35df492017-02-15 15:19:05 -0800639 LO_FLAGS_USE_AOPS,
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000640 LO_FLAGS_AUTOCLEAR,
Elliott Hughesd35df492017-02-15 15:19:05 -0800641 LO_FLAGS_PARTSCAN,
642 LO_FLAGS_DIRECT_IO
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000643]),,, [#include <linux/loop.h>])
644
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000645AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000646 CTL_PROC,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000647 CTL_ARLAN,
648 CTL_S390DBF,
649 CTL_SUNRPC,
650 CTL_PM,
651 CTL_FRV,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000652 KERN_PRINTK_RATELIMIT,
653 KERN_PRINTK_RATELIMIT_BURST,
654 KERN_PTY,
655 KERN_NGROUPS_MAX,
656 KERN_SPARC_SCONS_PWROFF,
657 KERN_HZ_TIMER,
658 KERN_UNKNOWN_NMI_PANIC,
659 KERN_BOOTLOADER_TYPE,
660 KERN_RANDOMIZE,
661 KERN_SETUID_DUMPABLE,
662 KERN_SPIN_RETRY,
663 KERN_ACPI_VIDEO_FLAGS,
664 KERN_IA64_UNALIGNED,
665 KERN_COMPAT_LOG,
666 KERN_MAX_LOCK_DEPTH,
667 KERN_NMI_WATCHDOG,
668 KERN_PANIC_ON_NMI,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000669 NET_LLC,
670 NET_NETFILTER,
671 NET_DCCP,
672 NET_IRDA,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000673 NET_CORE_DESTROY_DELAY,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000674 NET_CORE_BUDGET,
675 NET_CORE_AEVENT_ETIME,
676 NET_CORE_AEVENT_RSEQTH,
677 NET_CORE_WARNINGS,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000678 NET_IPV4_IGMP_MAX_MSF,
679 NET_TCP_NO_METRICS_SAVE,
680 NET_TCP_DEFAULT_WIN_SCALE,
681 NET_TCP_MODERATE_RCVBUF,
682 NET_TCP_TSO_WIN_DIVISOR,
683 NET_TCP_BIC_BETA,
684 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
685 NET_TCP_CONG_CONTROL,
686 NET_TCP_ABC,
687 NET_IPV4_IPFRAG_MAX_DIST,
688 NET_TCP_MTU_PROBING,
689 NET_TCP_BASE_MSS,
690 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
691 NET_TCP_DMA_COPYBREAK,
692 NET_TCP_SLOW_START_AFTER_IDLE,
693 NET_CIPSOV4_CACHE_ENABLE,
694 NET_CIPSOV4_CACHE_BUCKET_SIZE,
695 NET_CIPSOV4_RBM_OPTFMT,
696 NET_CIPSOV4_RBM_STRICTVALID,
697 NET_TCP_AVAIL_CONG_CONTROL,
698 NET_TCP_ALLOWED_CONG_CONTROL,
699 NET_TCP_MAX_SSTHRESH,
700 NET_TCP_FRTO_RESPONSE,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000701 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000702 NET_IPV4_CONF_FORCE_IGMP_VERSION,
703 NET_IPV4_CONF_ARP_ANNOUNCE,
704 NET_IPV4_CONF_ARP_IGNORE,
705 NET_IPV4_CONF_PROMOTE_SECONDARIES,
706 NET_IPV4_CONF_ARP_ACCEPT,
707 NET_IPV4_CONF_ARP_NOTIFY,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000708 NET_IPV6_MLD_MAX_MSF,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000709 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000710 VM_MAX_MAP_COUNT,
711 VM_LAPTOP_MODE,
712 VM_BLOCK_DUMP,
713 VM_HUGETLB_GROUP,
714 VM_VFS_CACHE_PRESSURE,
715 VM_LEGACY_VA_LAYOUT,
716 VM_SWAP_TOKEN_TIMEOUT
717]),,,
718[#include <sys/types.h>
719#include <linux/sysctl.h>])
720
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100721AC_CHECK_DECLS(m4_normalize([
722 V4L2_FIELD_ANY,
723 V4L2_FIELD_NONE,
724 V4L2_FIELD_TOP,
725 V4L2_FIELD_BOTTOM,
726 V4L2_FIELD_INTERLACED,
727 V4L2_FIELD_SEQ_TB,
728 V4L2_FIELD_SEQ_BT,
729 V4L2_FIELD_ALTERNATE,
730 V4L2_FIELD_INTERLACED_TB,
731 V4L2_FIELD_INTERLACED_BT,
732 V4L2_BUF_TYPE_VIDEO_CAPTURE,
733 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
734 V4L2_BUF_TYPE_VIDEO_OUTPUT,
735 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
736 V4L2_BUF_TYPE_VIDEO_OVERLAY,
737 V4L2_BUF_TYPE_VBI_CAPTURE,
738 V4L2_BUF_TYPE_VBI_OUTPUT,
739 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
740 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
741 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
Elliott Hughes39bac052017-05-25 16:56:11 -0700742 V4L2_BUF_TYPE_SDR_CAPTURE,
743 V4L2_BUF_TYPE_SDR_OUTPUT,
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100744 V4L2_TUNER_RADIO,
745 V4L2_TUNER_ANALOG_TV,
746 V4L2_TUNER_DIGITAL_TV,
747 V4L2_MEMORY_MMAP,
748 V4L2_MEMORY_USERPTR,
749 V4L2_MEMORY_OVERLAY,
750 V4L2_MEMORY_DMABUF,
751 V4L2_COLORSPACE_SMPTE170M,
752 V4L2_COLORSPACE_SMPTE240M,
753 V4L2_COLORSPACE_REC709,
754 V4L2_COLORSPACE_BT878,
755 V4L2_COLORSPACE_470_SYSTEM_M,
756 V4L2_COLORSPACE_470_SYSTEM_BG,
757 V4L2_COLORSPACE_JPEG,
758 V4L2_COLORSPACE_SRGB,
759 V4L2_PRIORITY_UNSET,
760 V4L2_PRIORITY_BACKGROUND,
761 V4L2_PRIORITY_INTERACTIVE,
762 V4L2_PRIORITY_RECORD,
763 V4L2_FRMSIZE_TYPE_DISCRETE,
764 V4L2_FRMSIZE_TYPE_CONTINUOUS,
765 V4L2_FRMSIZE_TYPE_STEPWISE,
766 V4L2_FRMIVAL_TYPE_DISCRETE,
767 V4L2_FRMIVAL_TYPE_CONTINUOUS,
768 V4L2_FRMIVAL_TYPE_STEPWISE,
769 V4L2_CTRL_TYPE_INTEGER,
770 V4L2_CTRL_TYPE_BOOLEAN,
771 V4L2_CTRL_TYPE_MENU,
772 V4L2_CTRL_TYPE_BUTTON,
773 V4L2_CTRL_TYPE_INTEGER64,
774 V4L2_CTRL_TYPE_CTRL_CLASS,
775 V4L2_CTRL_TYPE_STRING,
776 V4L2_CTRL_TYPE_BITMASK,
777 V4L2_CTRL_TYPE_INTEGER_MENU
Dmitry V. Levina8443f82016-05-14 00:36:27 +0000778]),,, [#include <sys/time.h>
779#include <linux/ioctl.h>
780#include <linux/types.h>
781#include <linux/videodev2.h>])
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100782
Elliott Hughes39bac052017-05-25 16:56:11 -0700783AC_CHECK_MEMBERS(m4_normalize([
784 struct v4l2_window.global_alpha,
785 struct v4l2_sdr_format.buffersize
786]),,, [#include <sys/time.h>
787#include <linux/ioctl.h>
788#include <linux/types.h>
789#include <linux/videodev2.h>])
790
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000791AC_CHECK_SIZEOF([long])
Elliott Hughesb7556142018-02-20 17:03:16 -0800792SIZEOF_LONG="$ac_cv_sizeof_long"
793AC_SUBST(SIZEOF_LONG)
Dmitry V. Levin7a498be2013-05-04 19:51:57 +0000794AC_CHECK_SIZEOF([long long])
Dmitry V. Levin54cabef2014-03-03 23:09:47 +0000795AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
Elliott Hughesd35df492017-02-15 15:19:05 -0800796AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
Elliott Hughesb7556142018-02-20 17:03:16 -0800797SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
798AC_SUBST(SIZEOF_KERNEL_LONG_T)
Dmitry V. Levin8c20d892015-05-21 16:19:40 +0000799AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000800
Elliott Hughesb7556142018-02-20 17:03:16 -0800801
Dmitry V. Levin59f63d32015-03-05 05:03:41 +0000802AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
803 [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
804 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
805 grep '^[0-9]')"
Elliott Hughesdc75b012017-07-05 13:54:44 -0700806 test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
Dmitry V. Levin59f63d32015-03-05 05:03:41 +0000807if test "x$st_cv_SIGRTMIN" != xno; then
808 AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
809 [SIGRTMIN defined in <asm/signal.h>])
810fi
811AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
812 [st_cv_SA_RESTORER="$(echo SA_RESTORER |
Dmitry V. Levinab3953b2014-02-08 00:15:52 +0000813 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
814 grep ^0x)"
Elliott Hughesdc75b012017-07-05 13:54:44 -0700815 test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
Dmitry V. Levin59f63d32015-03-05 05:03:41 +0000816if test "x$st_cv_SA_RESTORER" != xno; then
817 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
Dmitry V. Levinab3953b2014-02-08 00:15:52 +0000818 [SA_RESTORER defined in <asm/signal.h>])
819fi
820
Dmitry V. Levin38593e92014-02-26 16:51:28 +0000821AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
822 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
823 [st_cv_have___builtin_popcount=yes],
824 [st_cv_have___builtin_popcount=no])])
825if test "x$st_cv_have___builtin_popcount" = xyes; then
826 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
827 [Define to 1 if the system provides __builtin_popcount function])
828fi
829
Elliott Hughesdc75b012017-07-05 13:54:44 -0700830AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
831 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
832 [[return !*program_invocation_name]])],
833 [st_cv_have_program_invocation_name=yes],
834 [st_cv_have_program_invocation_name=no])])
835if test "x$st_cv_have_program_invocation_name" = xyes; then
836 AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
837 [Define to 1 if the system provides program_invocation_name variable])
838fi
839
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700840AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert],
841 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]],
Elliott Hughes03a418e2018-06-15 13:11:40 -0700842 [[static_assert(1,"")]]
843 )
844 ],
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700845 [st_cv_have_static_assert=yes],
Elliott Hughes03a418e2018-06-15 13:11:40 -0700846 [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
847 [[_Static_assert(1,"")]]
848 )
849 ],
850 [st_cv_have_static_assert=_Static_assert],
851 [st_cv_have_static_assert=no]
852 )
853 ]
854 )
855 ]
856 )
857case "x$st_cv_have_static_assert" in
858 xyes)
859 AC_DEFINE([HAVE_STATIC_ASSERT], [1],
860 [Define to 1 if the system provides static_assert])
861 ;;
862 x_Static_assert)
863 AC_DEFINE([HAVE__STATIC_ASSERT], [1],
864 [Define to 1 if the system provides _Static_assert])
865 ;;
866esac
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700867
Dmitry V. Levin856b7592015-02-27 05:01:25 +0000868AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
Dmitry V. Levin977550d2015-02-27 04:09:56 +0000869if test "x$ac_cv_lib_dl_dladdr" = xyes; then
870 AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
Dmitry V. Levin977550d2015-02-27 04:09:56 +0000871fi
872AC_SUBST(dl_LIBS)
873
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700874saved_LIBS="$LIBS"
875AC_SEARCH_LIBS([timer_create], [rt])
876LIBS="$saved_LIBS"
877case "$ac_cv_search_timer_create" in
878 no) AC_MSG_FAILURE([failed to find timer_create]) ;;
879 -l*) timer_LIBS="$ac_cv_search_timer_create" ;;
880 *) timer_LIBS= ;;
881esac
882AC_SUBST(timer_LIBS)
883
884saved_LIBS="$LIBS"
885AC_SEARCH_LIBS([clock_gettime], [rt])
886LIBS="$saved_LIBS"
887case "$ac_cv_search_clock_gettime" in
888 no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
889 -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
890 *) clock_LIBS= ;;
891esac
892AC_SUBST(clock_LIBS)
893
894saved_LIBS="$LIBS"
895AC_SEARCH_LIBS([mq_open], [rt])
896LIBS="$saved_LIBS"
897case "$ac_cv_search_mq_open" in
898 -l*) mq_LIBS="$ac_cv_search_mq_open" ;;
899 *) mq_LIBS= ;;
900esac
901AC_SUBST(mq_LIBS)
902
Roland McGrath6d2b3492002-12-30 00:51:30 +0000903AC_PATH_PROG([PERL], [perl])
904
Elliott Hughesb7556142018-02-20 17:03:16 -0800905AC_CHECK_TOOL([READELF], [readelf])
906
Elliott Hughes03a418e2018-06-15 13:11:40 -0700907st_STACKTRACE
Elliott Hughesb7556142018-02-20 17:03:16 -0800908
Dmitry V. Levind59287d2015-01-13 04:57:27 +0000909if test "$arch" = mips && test "$no_create" != yes; then
910 mkdir -p linux/mips
911 if $srcdir/linux/mips/genstub.sh linux/mips; then
912 AC_MSG_RESULT([Generated MIPS syscallent stubs])
913 else
Elliott Hughesb7556142018-02-20 17:03:16 -0800914 AC_MSG_ERROR([Failed to generate syscallent stubs])
Dmitry V. Levind59287d2015-01-13 04:57:27 +0000915 fi
916fi
917
Elliott Hughesb7556142018-02-20 17:03:16 -0800918AC_ARG_ENABLE([mpers],
919 [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
920 [whether to enable multiple personalities support required
921 for proper decoding of structures used by tracees with
922 personalities that differ from the personality of strace,
923 default is yes.])],
924 [case "$enableval" in
925 yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
926 *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
927 Valid options are: yes, no, check, m32, mx32.])
928 ;;
929 esac],
930 [enable_mpers=yes])
931
932st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
Dmitry V. Levinf8b49132015-07-23 11:19:47 +0000933st_MPERS([mx32], [x86_64])
Dmitry V. Levin679c47c2015-01-23 22:45:02 +0000934
Elliott Hughesd35df492017-02-15 15:19:05 -0800935AX_VALGRIND_DFLT([sgcheck], [off])
936AX_VALGRIND_CHECK
937
Dmitry V. Levine2b3df22016-06-07 18:04:53 +0000938AC_CONFIG_FILES([Makefile
939 tests/Makefile
940 tests-m32/Makefile
941 tests-mx32/Makefile
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700942 strace.1
Elliott Hughesb7556142018-02-20 17:03:16 -0800943 strace-log-merge.1
Dmitry V. Levin669efd82016-06-08 00:32:09 +0000944 strace.spec
945 debian/changelog])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000946AC_OUTPUT