blob: e50390e74451b8af231b97e36776200166c88a86 [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>
8# All rights reserved.
9#
10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions
12# are met:
13# 1. Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16# notice, this list of conditions and the following disclaimer in the
17# documentation and/or other materials provided with the distribution.
18# 3. The name of the author may not be used to endorse or promote products
19# derived from this software without specific prior written permission.
20#
21# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
Roland McGrath6d2b3492002-12-30 00:51:30 +000032AC_PREREQ(2.57)
Dmitry V. Levindce75932013-04-30 23:52:12 +000033AC_INIT([strace],
34 m4_esyscmd([./git-version-gen .tarball-version]),
35 [strace-devel@lists.sourceforge.net])
Roland McGrath6d2b3492002-12-30 00:51:30 +000036AC_CONFIG_SRCDIR([strace.c])
Roland McGrathffda2d32009-10-11 16:25:29 -070037AC_CONFIG_AUX_DIR([.])
Mike Frysingerbb3a0f72013-04-30 22:41:11 -040038AC_CONFIG_HEADERS([config.h])
Dmitry V. Levincf3ecbd2015-08-26 22:50:58 +000039AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules parallel-tests])
Roland McGrath6d2b3492002-12-30 00:51:30 +000040AM_MAINTAINER_MODE
41AC_CANONICAL_HOST
42
H.J. Lu35be5812012-04-16 13:00:01 +020043AC_PROG_CC
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000044AC_PROG_CPP
Mike Frysinger58c7fe92015-02-26 22:22:36 -050045AX_PROG_CC_FOR_BUILD
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000046AC_PROG_INSTALL
Elvira Khabirova09294222015-08-04 01:47:02 +030047AC_PROG_RANLIB
H.J. Lu35be5812012-04-16 13:00:01 +020048
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000049AC_USE_SYSTEM_EXTENSIONS
Gabriel Laskarcba67102016-02-01 18:15:39 +010050AX_CODE_COVERAGE
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +000051
Roland McGrath6d2b3492002-12-30 00:51:30 +000052AC_MSG_CHECKING([for supported architecture])
Dmitry V. Levin1e04e572015-12-08 00:13:38 +000053arch_m32=
54arch_mx32=
Roland McGrath6d2b3492002-12-30 00:51:30 +000055case "$host_cpu" in
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +000056bfin)
57 arch=bfin
58 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
59 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000060i[[3456]]86|pentium)
61 arch=i386
62 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
63 ;;
64ia64)
65 arch=ia64
66 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
67 ;;
68m68k)
69 arch=m68k
70 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
71 ;;
Roland McGrath6d1a65c2004-07-12 07:44:08 +000072sparc64*)
73 arch=sparc64
Dmitry V. Levin1e04e572015-12-08 00:13:38 +000074 arch_m32=sparc
Roland McGrath6d1a65c2004-07-12 07:44:08 +000075 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
76 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000077sparc*)
78 arch=sparc
79 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
80 ;;
James Hogan5f999a82013-02-22 14:44:10 +000081metag*)
82 arch=metag
83 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
84 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000085mips*)
86 arch=mips
87 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
88 ;;
89alpha*)
90 arch=alpha
91 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
92 ;;
Roland McGratheb285352003-01-14 09:59:00 +000093powerpc*)
Roland McGrath6d2b3492002-12-30 00:51:30 +000094 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Anton Blanchard9afc2ee2013-07-11 12:03:57 +100095 AC_TRY_COMPILE(
96[#ifndef __LP64__
97# error 32 bit
Dmitry V. Levinaf3ab5b2015-01-21 17:04:31 +000098#endif], [], arch=powerpc64, arch=powerpc)
99 if test "$arch" = "powerpc64"; then
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000100 arch_m32=powerpc
Andreas Schwabd69fa492010-07-12 21:39:57 +0200101 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
102 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +0000103 ;;
104arm*)
105 arch=arm
106 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
107 ;;
Steve McIntyred8d3bd32012-10-24 17:58:16 +0100108aarch64*)
109 arch=aarch64
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000110 arch_m32=arm
Steve McIntyred8d3bd32012-10-24 17:58:16 +0100111 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
112 ;;
Denys Vlasenko5ae2b7c2009-02-27 20:32:52 +0000113avr32*)
114 arch=avr32
115 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
116 ;;
Vineet Gupta7daacbb2013-08-16 12:47:06 +0530117arc*)
118 arch=arc
119 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
120 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000121s390)
122 arch=s390
123 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
124 ;;
125s390x)
126 arch=s390x
127 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
128 ;;
129hppa*|parisc*)
130 arch=hppa
131 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
132 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +0000133sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +0000134 arch=sh64
135 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +0000136 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +0000137sh*)
138 arch=sh
139 AC_DEFINE([SH], 1, [Define for the SH architecture.])
140 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000141x86?64*)
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000142 arch_m32=i386
H.J. Lu35be5812012-04-16 13:00:01 +0200143 AC_TRY_COMPILE(
144[#ifndef __ILP32__
145# error not x32
146#endif], [], arch=x32, arch=x86_64)
147 if test "$arch" = "x86_64"; then
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000148 arch_mx32=x32
H.J. Lu35be5812012-04-16 13:00:01 +0200149 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
150 else
151 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
152 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +0000153 ;;
Denys Vlasenkoea0e6e82009-02-25 17:08:40 +0000154cris|crisv10)
155 arch=crisv10
156 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
157 ;;
158crisv32)
159 arch=crisv32
160 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
161 ;;
Chris Metcalfc8c66982009-12-28 10:00:15 -0500162tile*)
163 arch=tile
164 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
165 ;;
Edgar E. Iglesias939caba2010-07-06 14:21:07 +0200166microblaze*)
167 arch=microblaze
168 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
169 ;;
Ezequiel Garciabd8dd772015-04-18 17:33:27 -0300170nios2*)
171 arch=nios2
172 AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
173 ;;
174
Christian Svensson492f81f2013-02-14 13:26:27 +0100175or1k*)
176 arch=or1k
177 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
178 ;;
179
Chris Zankel8f636ed2013-03-25 10:22:07 -0700180xtensa*)
181 arch=xtensa
182 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
183 ;;
184
Roland McGrath6d2b3492002-12-30 00:51:30 +0000185*)
186 AC_MSG_RESULT([NO!])
187 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
188 ;;
189esac
190AC_MSG_RESULT($arch)
191
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000192test -n "$arch_m32" ||
193 arch_m32=$arch
194test -n "$arch_mx32" ||
195 arch_mx32=$arch
Roland McGrath6d2b3492002-12-30 00:51:30 +0000196AC_SUBST(arch)
Dmitry V. Levin1e04e572015-12-08 00:13:38 +0000197AC_SUBST(arch_m32)
198AC_SUBST(arch_mx32)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000199
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000200if test "$arch" = mips; then
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000201 AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
202 [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM],
203 [#include <sgidefs.h>],
204 [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
205
206 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000207 [AC_COMPILE_IFELSE(
208 [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
209 [[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000210 [st_cv_mips_abi=o32],
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000211 [AC_COMPILE_IFELSE(
212 [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
213 [[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000214 [st_cv_mips_abi=n32],
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000215 [AC_COMPILE_IFELSE(
216 [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
217 [[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
Dmitry V. Levin6684b682015-08-18 22:53:22 +0000218 [st_cv_mips_abi=n64],
219 [st_cv_mips_abi=unknown])])])])
220
221 case "$st_cv_mips_abi" in
Dmitry V. Levin047365e2015-02-15 01:08:48 +0000222 o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _MIPS_SIM_ABI32.]);;
223 n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _MIPS_SIM_NABI32.]);;
224 n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _MIPS_SIM_ABI64.]);;
225 *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
226 esac
227fi
228
Dmitry V. Levin0160e162014-03-18 23:37:43 +0000229AC_ARG_ENABLE([arm-oabi],
230 [AS_HELP_STRING([--enable-arm-oabi],
231 [enable OABI support on ARM EABI])],
232 [], [enable_arm_oabi=no])
233case "$enable_arm_oabi" in
234 yes) enable_arm_oabi=1 ;;
235 no) enable_arm_oabi=0 ;;
236 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
237esac
238AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
239 [Define to 1 if you want OABI support on ARM EABI.])
240
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000241gl_WARN_ADD([-Wall])
Dmitry V. Levin1ed5d802010-09-09 17:42:28 +0000242gl_WARN_ADD([-Wwrite-strings])
Dmitry V. Levin3ed5d022014-09-10 13:46:04 +0000243gl_WARN_ADD([-Wsign-compare])
Dmitry V. Levind376c922012-05-15 00:50:26 +0000244AC_ARG_ENABLE([gcc-Werror],
245 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
246 [case $enableval in
247 yes) gl_WARN_ADD([-Werror]) ;;
248 no) ;;
249 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
250 esac]
251)
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000252AC_SUBST([WARN_CFLAGS])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000253
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400254AC_C_BIGENDIAN
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000255AC_C_CONST
Dmitry V. Levin2165a352016-01-12 00:02:56 +0000256AC_C_TYPEOF
Roland McGrath6d2b3492002-12-30 00:51:30 +0000257
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000258AC_TYPE_GETGROUPS
259AC_TYPE_MODE_T
Roland McGrath6d2b3492002-12-30 00:51:30 +0000260AC_TYPE_SIGNAL
261AC_TYPE_UID_T
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000262
263AC_HEADER_DIRENT
Roland McGrath6d2b3492002-12-30 00:51:30 +0000264AC_HEADER_MAJOR
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000265AC_HEADER_STAT
266AC_HEADER_STDBOOL
267AC_HEADER_STDC
Roland McGrath6d2b3492002-12-30 00:51:30 +0000268
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000269AC_CHECK_FUNCS(m4_normalize([
Dmitry V. Levin1ea64732015-01-10 00:08:58 +0000270 fanotify_mark
Dmitry V. Levind3541302014-02-26 00:01:00 +0000271 fopen64
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000272 fork
Dmitry V. Levind3541302014-02-26 00:01:00 +0000273 fputs_unlocked
Dmitry V. Levinb0e61152015-12-02 01:02:39 +0000274 fstatat
275 ftruncate
276 futimens
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000277 if_indextoname
278 inet_ntop
Dmitry V. Levin7bee4622015-06-08 14:19:46 +0000279 inet_pton
Dmitry V. Levin78ed3f32015-03-23 00:04:27 +0000280 pipe2
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
Dmitry V. Levineb4649a2016-01-12 04:37:06 +0000285 recvmmsg
Masatake YAMATO993198d2014-11-07 01:23:27 +0900286 sendmmsg
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000287 sigaction
Dmitry V. Levin30ac0622015-08-03 09:47:25 +0000288 signalfd
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000289 stpcpy
290 strerror
291 strsignal
Dmitry V. Levin5b2d2572016-04-06 00:02:08 +0000292 sync_file_range
Dmitry V. Levin78e48eb2015-07-15 15:34:59 +0000293 utimensat
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000294]))
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000295
296AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
297
298AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
299
300AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
301[#include <asm/posix_types.h>])
302
303AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
304[#include <sys/types.h>
305#include <asm/stat.h>])
306
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000307AC_CHECK_TYPES(m4_normalize([
308 struct pt_all_user_regs,
309 struct ia64_fpreg,
310 struct ptrace_peeksiginfo_args
311]),,, [#include <sys/ptrace.h>])
312
313AC_CHECK_TYPES(m4_normalize([
314 struct flock,
315 struct flock64,
316 struct __kernel_flock,
317 struct __kernel_flock64
318]),,,
319[#include <sys/types.h>
320#include <linux/fcntl.h>])
321
322AC_CHECK_MEMBERS(m4_normalize([
323 struct stat.st_atim.tv_nsec,
324 struct stat.st_blksize,
325 struct stat.st_blocks,
326 struct stat.st_ctim.tv_nsec,
327 struct stat.st_flags,
328 struct stat.st_fstype,
329 struct stat.st_gen,
330 struct stat.st_mtim.tv_nsec,
331 struct stat.st_rdev
332]))
333
334AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
335
336AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
337
338AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
339
340AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
341[#include <sys/types.h>
342#include <sys/socket.h>
343#include <netinet/in.h>])
344
345AC_CHECK_MEMBERS(m4_normalize([
346 struct stat.st_atime_nsec,
347 struct stat.st_ctime_nsec,
348 struct stat.st_mtime_nsec
349]),,, [#include <sys/types.h>
350#include <asm/stat.h>])
351
352AC_CHECK_MEMBERS(m4_normalize([
353 siginfo_t.si_syscall,
354 siginfo_t.si_timerid,
355 siginfo_t.si_overrun
356]),,, [#include <signal.h>])
357
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000358AC_CHECK_HEADERS(m4_normalize([
359 asm/cachectl.h
360 asm/sysmips.h
Lubomir Rintelc400a1c2014-10-03 11:40:28 +0200361 bluetooth/bluetooth.h
Dmitry V. Levinc41808b2013-03-18 00:52:29 +0000362 elf.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000363 inttypes.h
Bart Van Assche67d0a8e2015-02-06 13:37:03 +0100364 linux/bsg.h
Dmitry V. Levin52572b62014-12-11 19:21:54 +0000365 linux/falloc.h
Dmitry V. Levin2af69032015-02-04 23:50:50 +0000366 linux/filter.h
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +0000367 linux/hiddev.h
Mike Frysinger54646b82015-08-19 13:29:27 -0400368 linux/ip_vs.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400369 linux/ipc.h
Dmitry V. Levindf7aa2b2015-01-19 17:02:16 +0000370 linux/mmtimer.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400371 linux/msg.h
Ben Noordhuis88eafd82013-02-04 00:04:57 +0100372 linux/perf_event.h
Dmitry V. Levin2af69032015-02-04 23:50:50 +0000373 linux/seccomp.h
Dmitry V. Levin1e880732015-02-14 01:51:03 +0000374 linux/securebits.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400375 linux/sem.h
376 linux/shm.h
Dr. David Alan Gilbert5d1216a2016-05-10 11:49:02 +0100377 linux/userfaultfd.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000378 linux/utsname.h
379 mqueue.h
380 netinet/sctp.h
Dmitry V. Levinfdb896e2014-02-25 23:04:55 +0000381 scsi/sg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000382 stropts.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000383 sys/conf.h
Dmitry V. Levinc8cba992015-08-01 21:08:13 +0000384 sys/eventfd.h
Dmitry V. Levin1ea64732015-01-10 00:08:58 +0000385 sys/fanotify.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400386 sys/ipc.h
387 sys/msg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000388 sys/reg.h
Mike Frysingerba10a422015-10-31 00:47:53 -0400389 sys/sem.h
390 sys/shm.h
Dmitry V. Levin30ac0622015-08-03 09:47:25 +0000391 sys/signalfd.h
Masatake YAMATOf5480672014-11-22 19:03:33 +0900392 sys/xattr.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000393]))
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000394
395AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
396
397AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
398
Mike Frysingerba10a422015-10-31 00:47:53 -0400399AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000400
401AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],,,
402[#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100403#include <sys/socket.h>
404#include <asm/types.h>])
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000405
Mike Frysinger54646b82015-08-19 13:29:27 -0400406AC_CHECK_HEADERS(m4_normalize([
407 linux/netfilter_arp/arp_tables.h
408 linux/netfilter_bridge/ebtables.h
409 linux/netfilter_ipv4/ip_tables.h
410 linux/netfilter_ipv6/ip6_tables.h
Dmitry V. Levin1ef7aa62016-01-12 21:27:36 +0000411]),,, [#include <netinet/in.h>
Mike Frysinger54646b82015-08-19 13:29:27 -0400412#include <net/if.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000413
Dmitry V. Levin19dadf92015-02-22 02:50:33 +0300414AC_CHECK_HEADERS([linux/input.h], [
415 AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
416])
417
Dmitry V. Levin4e3ded32015-07-29 16:27:16 +0000418AC_CHECK_HEADERS([linux/bpf.h], [
419 AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works],
420 [st_cv_have_union_bpf_attr_log_buf],
421 [AC_COMPILE_IFELSE(
422 [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
423 [[union bpf_attr a = { .log_buf = 0 };]])],
424 [st_cv_have_union_bpf_attr_log_buf=yes],
425 [st_cv_have_union_bpf_attr_log_buf=no])])
426 if test $st_cv_have_union_bpf_attr_log_buf = yes; then
427 AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1],
428 [Define to 1 if union bpf_attr.log_buf initialization works])
429 fi
430])
431
Dmitry V. Levin67c2f672016-04-26 00:21:26 +0000432AC_CHECK_TYPES([struct statfs], [
433 AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include <linux/types.h>
434#include <asm/statfs.h>])
435 AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include <linux/types.h>
436#include <asm/statfs.h>])
437 AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include <linux/types.h>
438#include <asm/statfs.h>])
439 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include <linux/types.h>
440#include <asm/statfs.h>])
441],, [#include <linux/types.h>
442#include <asm/statfs.h>])
443
444AC_CHECK_TYPES([struct statfs64], [
445 AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include <linux/types.h>
446#include <asm/statfs.h>])
447 AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include <linux/types.h>
448#include <asm/statfs.h>])
449 AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include <linux/types.h>
450#include <asm/statfs.h>])
451 AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include <linux/types.h>
452#include <asm/statfs.h>])
453],, [#include <linux/types.h>
454#include <asm/statfs.h>])
455
Roland McGrath6d2b3492002-12-30 00:51:30 +0000456AC_CHECK_DECLS([sys_errlist])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000457AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levin6974bd42013-11-12 21:20:50 +0000458 PTRACE_PEEKUSER,
Dmitry V. Levinfadf3792015-02-13 00:26:38 +0000459 PTRACE_POKEUSER
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000460]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000461
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000462AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levind8ad1dd2014-04-26 15:22:08 +0000463 P_PID,
464 P_PPID,
465 P_PGID,
466 P_SID,
467 P_CID,
468 P_UID,
469 P_GID,
470 P_ALL,
471 P_LWPID
472]),,, [#include <sys/wait.h>])
473
474AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levinbaf60d92014-04-26 14:12:33 +0000475 LO_FLAGS_READ_ONLY,
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000476 LO_FLAGS_AUTOCLEAR,
477 LO_FLAGS_PARTSCAN
478]),,, [#include <linux/loop.h>])
479
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000480AC_CHECK_DECLS(m4_normalize([
481 CTL_KERN,
482 CTL_VM,
483 CTL_NET,
484 CTL_PROC,
485 CTL_FS,
486 CTL_DEBUG,
487 CTL_DEV,
488 CTL_BUS,
489 CTL_ABI,
490 CTL_CPU,
491 CTL_ARLAN,
492 CTL_S390DBF,
493 CTL_SUNRPC,
494 CTL_PM,
495 CTL_FRV,
496 KERN_OSTYPE,
497 KERN_OSRELEASE,
498 KERN_OSREV,
499 KERN_VERSION,
500 KERN_SECUREMASK,
501 KERN_PROF,
502 KERN_NODENAME,
503 KERN_DOMAINNAME,
504 KERN_PANIC,
505 KERN_REALROOTDEV,
506 KERN_SPARC_REBOOT,
507 KERN_CTLALTDEL,
508 KERN_PRINTK,
509 KERN_NAMETRANS,
510 KERN_PPC_HTABRECLAIM,
511 KERN_PPC_ZEROPAGED,
512 KERN_PPC_POWERSAVE_NAP,
513 KERN_MODPROBE,
514 KERN_SG_BIG_BUFF,
515 KERN_ACCT,
516 KERN_PPC_L2CR,
517 KERN_RTSIGNR,
518 KERN_RTSIGMAX,
519 KERN_SHMMAX,
520 KERN_MSGMAX,
521 KERN_MSGMNB,
522 KERN_MSGPOOL,
523 KERN_SYSRQ,
524 KERN_MAX_THREADS,
525 KERN_RANDOM,
526 KERN_SHMALL,
527 KERN_MSGMNI,
528 KERN_SEM,
529 KERN_SPARC_STOP_A,
530 KERN_SHMMNI,
531 KERN_OVERFLOWUID,
532 KERN_OVERFLOWGID,
533 KERN_SHMPATH,
534 KERN_HOTPLUG,
535 KERN_IEEE_EMULATION_WARNINGS,
536 KERN_S390_USER_DEBUG_LOGGING,
537 KERN_CORE_USES_PID,
538 KERN_TAINTED,
539 KERN_CADPID,
540 KERN_PIDMAX,
541 KERN_CORE_PATTERN,
542 KERN_PANIC_ON_OOPS,
543 KERN_HPPA_PWRSW,
544 KERN_HPPA_UNALIGNED,
545 KERN_PRINTK_RATELIMIT,
546 KERN_PRINTK_RATELIMIT_BURST,
547 KERN_PTY,
548 KERN_NGROUPS_MAX,
549 KERN_SPARC_SCONS_PWROFF,
550 KERN_HZ_TIMER,
551 KERN_UNKNOWN_NMI_PANIC,
552 KERN_BOOTLOADER_TYPE,
553 KERN_RANDOMIZE,
554 KERN_SETUID_DUMPABLE,
555 KERN_SPIN_RETRY,
556 KERN_ACPI_VIDEO_FLAGS,
557 KERN_IA64_UNALIGNED,
558 KERN_COMPAT_LOG,
559 KERN_MAX_LOCK_DEPTH,
560 KERN_NMI_WATCHDOG,
561 KERN_PANIC_ON_NMI,
562 NET_CORE,
563 NET_ETHER,
564 NET_802,
565 NET_UNIX,
566 NET_IPV4,
567 NET_IPX,
568 NET_ATALK,
569 NET_NETROM,
570 NET_AX25,
571 NET_BRIDGE,
572 NET_ROSE,
573 NET_IPV6,
574 NET_X25,
575 NET_TR,
576 NET_DECNET,
577 NET_ECONET,
578 NET_SCTP,
579 NET_LLC,
580 NET_NETFILTER,
581 NET_DCCP,
582 NET_IRDA,
583 NET_CORE_WMEM_MAX,
584 NET_CORE_RMEM_MAX,
585 NET_CORE_WMEM_DEFAULT,
586 NET_CORE_RMEM_DEFAULT,
587 NET_CORE_DESTROY_DELAY,
588 NET_CORE_MAX_BACKLOG,
589 NET_CORE_FASTROUTE,
590 NET_CORE_MSG_COST,
591 NET_CORE_MSG_BURST,
592 NET_CORE_OPTMEM_MAX,
593 NET_CORE_HOT_LIST_LENGTH,
594 NET_CORE_DIVERT_VERSION,
595 NET_CORE_NO_CONG_THRESH,
596 NET_CORE_NO_CONG,
597 NET_CORE_LO_CONG,
598 NET_CORE_MOD_CONG,
599 NET_CORE_DEV_WEIGHT,
600 NET_CORE_SOMAXCONN,
601 NET_CORE_BUDGET,
602 NET_CORE_AEVENT_ETIME,
603 NET_CORE_AEVENT_RSEQTH,
604 NET_CORE_WARNINGS,
605 NET_IPV4_FORWARD,
606 NET_IPV4_DYNADDR,
607 NET_IPV4_CONF,
608 NET_IPV4_NEIGH,
609 NET_IPV4_ROUTE,
610 NET_IPV4_FIB_HASH,
611 NET_IPV4_NETFILTER,
612 NET_IPV4_TCP_TIMESTAMPS,
613 NET_IPV4_TCP_WINDOW_SCALING,
614 NET_IPV4_TCP_SACK,
615 NET_IPV4_TCP_RETRANS_COLLAPSE,
616 NET_IPV4_DEFAULT_TTL,
617 NET_IPV4_AUTOCONFIG,
618 NET_IPV4_NO_PMTU_DISC,
619 NET_IPV4_TCP_SYN_RETRIES,
620 NET_IPV4_IPFRAG_HIGH_THRESH,
621 NET_IPV4_IPFRAG_LOW_THRESH,
622 NET_IPV4_IPFRAG_TIME,
623 NET_IPV4_TCP_MAX_KA_PROBES,
624 NET_IPV4_TCP_KEEPALIVE_TIME,
625 NET_IPV4_TCP_KEEPALIVE_PROBES,
626 NET_IPV4_TCP_RETRIES1,
627 NET_IPV4_TCP_RETRIES2,
628 NET_IPV4_TCP_FIN_TIMEOUT,
629 NET_IPV4_IP_MASQ_DEBUG,
630 NET_TCP_SYNCOOKIES,
631 NET_TCP_STDURG,
632 NET_TCP_RFC1337,
633 NET_TCP_SYN_TAILDROP,
634 NET_TCP_MAX_SYN_BACKLOG,
635 NET_IPV4_LOCAL_PORT_RANGE,
636 NET_IPV4_ICMP_ECHO_IGNORE_ALL,
637 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
638 NET_IPV4_ICMP_SOURCEQUENCH_RATE,
639 NET_IPV4_ICMP_DESTUNREACH_RATE,
640 NET_IPV4_ICMP_TIMEEXCEED_RATE,
641 NET_IPV4_ICMP_PARAMPROB_RATE,
642 NET_IPV4_ICMP_ECHOREPLY_RATE,
643 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
644 NET_IPV4_IGMP_MAX_MEMBERSHIPS,
645 NET_TCP_TW_RECYCLE,
646 NET_IPV4_ALWAYS_DEFRAG,
647 NET_IPV4_TCP_KEEPALIVE_INTVL,
648 NET_IPV4_INET_PEER_THRESHOLD,
649 NET_IPV4_INET_PEER_MINTTL,
650 NET_IPV4_INET_PEER_MAXTTL,
651 NET_IPV4_INET_PEER_GC_MINTIME,
652 NET_IPV4_INET_PEER_GC_MAXTIME,
653 NET_TCP_ORPHAN_RETRIES,
654 NET_TCP_ABORT_ON_OVERFLOW,
655 NET_TCP_SYNACK_RETRIES,
656 NET_TCP_MAX_ORPHANS,
657 NET_TCP_MAX_TW_BUCKETS,
658 NET_TCP_FACK,
659 NET_TCP_REORDERING,
660 NET_TCP_ECN,
661 NET_TCP_DSACK,
662 NET_TCP_MEM,
663 NET_TCP_WMEM,
664 NET_TCP_RMEM,
665 NET_TCP_APP_WIN,
666 NET_TCP_ADV_WIN_SCALE,
667 NET_IPV4_NONLOCAL_BIND,
668 NET_IPV4_ICMP_RATELIMIT,
669 NET_IPV4_ICMP_RATEMASK,
670 NET_TCP_TW_REUSE,
671 NET_TCP_FRTO,
672 NET_TCP_LOW_LATENCY,
673 NET_IPV4_IPFRAG_SECRET_INTERVAL,
674 NET_IPV4_IGMP_MAX_MSF,
675 NET_TCP_NO_METRICS_SAVE,
676 NET_TCP_DEFAULT_WIN_SCALE,
677 NET_TCP_MODERATE_RCVBUF,
678 NET_TCP_TSO_WIN_DIVISOR,
679 NET_TCP_BIC_BETA,
680 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
681 NET_TCP_CONG_CONTROL,
682 NET_TCP_ABC,
683 NET_IPV4_IPFRAG_MAX_DIST,
684 NET_TCP_MTU_PROBING,
685 NET_TCP_BASE_MSS,
686 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
687 NET_TCP_DMA_COPYBREAK,
688 NET_TCP_SLOW_START_AFTER_IDLE,
689 NET_CIPSOV4_CACHE_ENABLE,
690 NET_CIPSOV4_CACHE_BUCKET_SIZE,
691 NET_CIPSOV4_RBM_OPTFMT,
692 NET_CIPSOV4_RBM_STRICTVALID,
693 NET_TCP_AVAIL_CONG_CONTROL,
694 NET_TCP_ALLOWED_CONG_CONTROL,
695 NET_TCP_MAX_SSTHRESH,
696 NET_TCP_FRTO_RESPONSE,
697 NET_IPV4_ROUTE_FLUSH,
698 NET_IPV4_ROUTE_MIN_DELAY,
699 NET_IPV4_ROUTE_MAX_DELAY,
700 NET_IPV4_ROUTE_GC_THRESH,
701 NET_IPV4_ROUTE_MAX_SIZE,
702 NET_IPV4_ROUTE_GC_MIN_INTERVAL,
703 NET_IPV4_ROUTE_GC_TIMEOUT,
704 NET_IPV4_ROUTE_GC_INTERVAL,
705 NET_IPV4_ROUTE_REDIRECT_LOAD,
706 NET_IPV4_ROUTE_REDIRECT_NUMBER,
707 NET_IPV4_ROUTE_REDIRECT_SILENCE,
708 NET_IPV4_ROUTE_ERROR_COST,
709 NET_IPV4_ROUTE_ERROR_BURST,
710 NET_IPV4_ROUTE_GC_ELASTICITY,
711 NET_IPV4_ROUTE_MTU_EXPIRES,
712 NET_IPV4_ROUTE_MIN_PMTU,
713 NET_IPV4_ROUTE_MIN_ADVMSS,
714 NET_IPV4_ROUTE_SECRET_INTERVAL,
715 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
716 NET_IPV4_CONF_FORWARDING,
717 NET_IPV4_CONF_MC_FORWARDING,
718 NET_IPV4_CONF_PROXY_ARP,
719 NET_IPV4_CONF_ACCEPT_REDIRECTS,
720 NET_IPV4_CONF_SECURE_REDIRECTS,
721 NET_IPV4_CONF_SEND_REDIRECTS,
722 NET_IPV4_CONF_SHARED_MEDIA,
723 NET_IPV4_CONF_RP_FILTER,
724 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE,
725 NET_IPV4_CONF_BOOTP_RELAY,
726 NET_IPV4_CONF_LOG_MARTIANS,
727 NET_IPV4_CONF_TAG,
728 NET_IPV4_CONF_ARPFILTER,
729 NET_IPV4_CONF_MEDIUM_ID,
730 NET_IPV4_CONF_NOXFRM,
731 NET_IPV4_CONF_NOPOLICY,
732 NET_IPV4_CONF_FORCE_IGMP_VERSION,
733 NET_IPV4_CONF_ARP_ANNOUNCE,
734 NET_IPV4_CONF_ARP_IGNORE,
735 NET_IPV4_CONF_PROMOTE_SECONDARIES,
736 NET_IPV4_CONF_ARP_ACCEPT,
737 NET_IPV4_CONF_ARP_NOTIFY,
738 NET_IPV6_CONF,
739 NET_IPV6_NEIGH,
740 NET_IPV6_ROUTE,
741 NET_IPV6_ICMP,
742 NET_IPV6_BINDV6ONLY,
743 NET_IPV6_IP6FRAG_HIGH_THRESH,
744 NET_IPV6_IP6FRAG_LOW_THRESH,
745 NET_IPV6_IP6FRAG_TIME,
746 NET_IPV6_IP6FRAG_SECRET_INTERVAL,
747 NET_IPV6_MLD_MAX_MSF,
748 NET_IPV6_ROUTE_FLUSH,
749 NET_IPV6_ROUTE_GC_THRESH,
750 NET_IPV6_ROUTE_MAX_SIZE,
751 NET_IPV6_ROUTE_GC_MIN_INTERVAL,
752 NET_IPV6_ROUTE_GC_TIMEOUT,
753 NET_IPV6_ROUTE_GC_INTERVAL,
754 NET_IPV6_ROUTE_GC_ELASTICITY,
755 NET_IPV6_ROUTE_MTU_EXPIRES,
756 NET_IPV6_ROUTE_MIN_ADVMSS,
757 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
758 NET_UNIX_DESTROY_DELAY,
759 NET_UNIX_DELETE_DELAY,
760 NET_UNIX_MAX_DGRAM_QLEN,
761 VM_OVERCOMMIT_MEMORY,
762 VM_PAGE_CLUSTER,
763 VM_DIRTY_BACKGROUND,
764 VM_DIRTY_RATIO,
765 VM_DIRTY_WB_CS,
766 VM_DIRTY_EXPIRE_CS,
767 VM_NR_PDFLUSH_THREADS,
768 VM_OVERCOMMIT_RATIO,
769 VM_PAGEBUF,
770 VM_HUGETLB_PAGES,
771 VM_SWAPPINESS,
772 VM_LOWMEM_RESERVE_RATIO,
773 VM_MIN_FREE_KBYTES,
774 VM_MAX_MAP_COUNT,
775 VM_LAPTOP_MODE,
776 VM_BLOCK_DUMP,
777 VM_HUGETLB_GROUP,
778 VM_VFS_CACHE_PRESSURE,
779 VM_LEGACY_VA_LAYOUT,
780 VM_SWAP_TOKEN_TIMEOUT
781]),,,
782[#include <sys/types.h>
783#include <linux/sysctl.h>])
784
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100785AC_CHECK_DECLS(m4_normalize([
786 V4L2_FIELD_ANY,
787 V4L2_FIELD_NONE,
788 V4L2_FIELD_TOP,
789 V4L2_FIELD_BOTTOM,
790 V4L2_FIELD_INTERLACED,
791 V4L2_FIELD_SEQ_TB,
792 V4L2_FIELD_SEQ_BT,
793 V4L2_FIELD_ALTERNATE,
794 V4L2_FIELD_INTERLACED_TB,
795 V4L2_FIELD_INTERLACED_BT,
796 V4L2_BUF_TYPE_VIDEO_CAPTURE,
797 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
798 V4L2_BUF_TYPE_VIDEO_OUTPUT,
799 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
800 V4L2_BUF_TYPE_VIDEO_OVERLAY,
801 V4L2_BUF_TYPE_VBI_CAPTURE,
802 V4L2_BUF_TYPE_VBI_OUTPUT,
803 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
804 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
805 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
806 V4L2_TUNER_RADIO,
807 V4L2_TUNER_ANALOG_TV,
808 V4L2_TUNER_DIGITAL_TV,
809 V4L2_MEMORY_MMAP,
810 V4L2_MEMORY_USERPTR,
811 V4L2_MEMORY_OVERLAY,
812 V4L2_MEMORY_DMABUF,
813 V4L2_COLORSPACE_SMPTE170M,
814 V4L2_COLORSPACE_SMPTE240M,
815 V4L2_COLORSPACE_REC709,
816 V4L2_COLORSPACE_BT878,
817 V4L2_COLORSPACE_470_SYSTEM_M,
818 V4L2_COLORSPACE_470_SYSTEM_BG,
819 V4L2_COLORSPACE_JPEG,
820 V4L2_COLORSPACE_SRGB,
821 V4L2_PRIORITY_UNSET,
822 V4L2_PRIORITY_BACKGROUND,
823 V4L2_PRIORITY_INTERACTIVE,
824 V4L2_PRIORITY_RECORD,
825 V4L2_FRMSIZE_TYPE_DISCRETE,
826 V4L2_FRMSIZE_TYPE_CONTINUOUS,
827 V4L2_FRMSIZE_TYPE_STEPWISE,
828 V4L2_FRMIVAL_TYPE_DISCRETE,
829 V4L2_FRMIVAL_TYPE_CONTINUOUS,
830 V4L2_FRMIVAL_TYPE_STEPWISE,
831 V4L2_CTRL_TYPE_INTEGER,
832 V4L2_CTRL_TYPE_BOOLEAN,
833 V4L2_CTRL_TYPE_MENU,
834 V4L2_CTRL_TYPE_BUTTON,
835 V4L2_CTRL_TYPE_INTEGER64,
836 V4L2_CTRL_TYPE_CTRL_CLASS,
837 V4L2_CTRL_TYPE_STRING,
838 V4L2_CTRL_TYPE_BITMASK,
839 V4L2_CTRL_TYPE_INTEGER_MENU
Dmitry V. Levina8443f82016-05-14 00:36:27 +0000840]),,, [#include <sys/time.h>
841#include <linux/ioctl.h>
842#include <linux/types.h>
843#include <linux/videodev2.h>])
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100844
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000845AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
846 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
847#include <stdlib.h>
848#include <linux/fs.h>], [return !BLKGETSIZE64;])],
849 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
850 if test $ac_cv_have_blkgetsize64 = yes; then
851 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
852 fi)
853
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000854AC_CHECK_SIZEOF([long])
Dmitry V. Levin7a498be2013-05-04 19:51:57 +0000855AC_CHECK_SIZEOF([long long])
Dmitry V. Levin54cabef2014-03-03 23:09:47 +0000856AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
Dmitry V. Levin8c20d892015-05-21 16:19:40 +0000857AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000858
Dmitry V. Levin59f63d32015-03-05 05:03:41 +0000859AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
860 [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
861 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
862 grep '^[0-9]')"
863 test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
864if test "x$st_cv_SIGRTMIN" != xno; then
865 AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
866 [SIGRTMIN defined in <asm/signal.h>])
867fi
868AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
869 [st_cv_SA_RESTORER="$(echo SA_RESTORER |
Dmitry V. Levinab3953b2014-02-08 00:15:52 +0000870 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
871 grep ^0x)"
Dmitry V. Levin59f63d32015-03-05 05:03:41 +0000872 test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
873if test "x$st_cv_SA_RESTORER" != xno; then
874 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
Dmitry V. Levinab3953b2014-02-08 00:15:52 +0000875 [SA_RESTORER defined in <asm/signal.h>])
876fi
877
Dmitry V. Levin38593e92014-02-26 16:51:28 +0000878AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
879 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
880 [st_cv_have___builtin_popcount=yes],
881 [st_cv_have___builtin_popcount=no])])
882if test "x$st_cv_have___builtin_popcount" = xyes; then
883 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
884 [Define to 1 if the system provides __builtin_popcount function])
885fi
886
Dmitry V. Levin856b7592015-02-27 05:01:25 +0000887AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
Dmitry V. Levin977550d2015-02-27 04:09:56 +0000888if test "x$ac_cv_lib_dl_dladdr" = xyes; then
889 AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
Dmitry V. Levin977550d2015-02-27 04:09:56 +0000890fi
891AC_SUBST(dl_LIBS)
892
Roland McGrath6d2b3492002-12-30 00:51:30 +0000893AC_PATH_PROG([PERL], [perl])
894
Luca Clementi327064b2013-07-23 00:11:35 -0700895dnl stack trace with libunwind
896libunwind_CPPFLAGS=
897libunwind_LDFLAGS=
898libunwind_LIBS=
899AC_ARG_WITH([libunwind],
900 [AS_HELP_STRING([--with-libunwind],
901 [use libunwind to implement stack tracing support])],
902 [case "${withval}" in
903 yes|no|check) ;;
904 *) with_libunwind=yes
905 libunwind_CPPFLAGS="-I${withval}/include"
906 libunwind_LDFLAGS="-L${withval}/lib" ;;
907 esac],
908 [with_libunwind=check]
909)
910
911use_libunwind=no
912AS_IF([test "x$with_libunwind" != xno],
913 [saved_CPPFLAGS="$CPPFLAGS"
914 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
915
916 AC_CHECK_HEADERS([libunwind-ptrace.h],
917 [saved_LDFLAGS="$LDFLAGS"
918 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
919
920 AC_CHECK_LIB([unwind], [backtrace],
921 [libunwind_LIBS="-lunwind $libunwind_LIBS"
922
923 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
924 saved_LIBS="$LIBS"
925 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
926
927 AC_LINK_IFELSE(
928 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
929 [[return !unw_create_addr_space(0, 0)]])
930 ],
931 [AC_MSG_RESULT([yes])
932 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
933
934 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
935 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
936 use_libunwind=yes
937 ],
938 [if test "x$with_libunwind" != xcheck; then
939 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
940 fi
941 ],
942 [$libunwind_LIBS]
943 )
944 ],
945 [AC_MSG_RESULT([no])
946 if test "x$with_libunwind" != xcheck; then
947 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
948 fi
949 ]
950 )
951
952 LIBS="$saved_LIBS"
953 ],
954 [if test "x$with_libunwind" != xcheck; then
955 AC_MSG_FAILURE([failed to find libunwind])
956 fi
957 ],
958 [$libunwind_LIBS]
959 )
960
961 LDFLAGS="$saved_LDFLAGS"
962 ],
963 [if test "x$with_libunwind" != xcheck; then
964 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
965 fi
966 ]
967 )
968
969 CPPFLAGS="$saved_CPPFLAGS"
970 ]
971)
972
973dnl enable libunwind
974AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
975if test "x$use_libunwind" = xyes; then
976 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
977 AC_SUBST(libunwind_LIBS)
978 AC_SUBST(libunwind_LDFLAGS)
979 AC_SUBST(libunwind_CPPFLAGS)
980fi
981AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
982AC_MSG_RESULT([$use_libunwind])
983
Dmitry V. Levind59287d2015-01-13 04:57:27 +0000984if test "$arch" = mips && test "$no_create" != yes; then
985 mkdir -p linux/mips
986 if $srcdir/linux/mips/genstub.sh linux/mips; then
987 AC_MSG_RESULT([Generated MIPS syscallent stubs])
988 else
989 AC_MSG_FAILURE([Failed to generate syscallent stubs])
990 fi
991fi
992
Dmitry V. Levinf8b49132015-07-23 11:19:47 +0000993st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
994st_MPERS([mx32], [x86_64])
Dmitry V. Levin679c47c2015-01-23 22:45:02 +0000995
996AC_CONFIG_FILES([Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000997AC_OUTPUT