blob: c2e64f1012bf636e97fb8e8ca3c1d41933724996 [file] [log] [blame]
Roland McGrath6d2b3492002-12-30 00:51:30 +00001dnl Process this file with autoconf to create configure. Use autoreconf.
2AC_PREREQ(2.57)
Dmitry V. Levindce75932013-04-30 23:52:12 +00003AC_INIT([strace],
4 m4_esyscmd([./git-version-gen .tarball-version]),
5 [strace-devel@lists.sourceforge.net])
Roland McGrath6d2b3492002-12-30 00:51:30 +00006AC_CONFIG_SRCDIR([strace.c])
Roland McGrathffda2d32009-10-11 16:25:29 -07007AC_CONFIG_AUX_DIR([.])
Mike Frysingerbb3a0f72013-04-30 22:41:11 -04008AC_CONFIG_HEADERS([config.h])
Dmitry V. Levin3cf90b62013-06-18 14:31:57 +00009AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip silent-rules parallel-tests])
Roland McGrath6d2b3492002-12-30 00:51:30 +000010AM_MAINTAINER_MODE
11AC_CANONICAL_HOST
12
H.J. Lu35be5812012-04-16 13:00:01 +020013AC_PROG_CC
H.J. Lu35be5812012-04-16 13:00:01 +020014AC_USE_SYSTEM_EXTENSIONS
15
Roland McGrath6d2b3492002-12-30 00:51:30 +000016AC_MSG_CHECKING([for supported architecture])
17case "$host_cpu" in
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +000018bfin)
19 arch=bfin
20 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
21 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000022i[[3456]]86|pentium)
23 arch=i386
24 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
25 ;;
26ia64)
27 arch=ia64
28 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
29 ;;
30m68k)
31 arch=m68k
32 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
33 ;;
Roland McGrath6d1a65c2004-07-12 07:44:08 +000034sparc64*)
35 arch=sparc64
36 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
37 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000038sparc*)
39 arch=sparc
40 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
41 ;;
James Hogan5f999a82013-02-22 14:44:10 +000042metag*)
43 arch=metag
44 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
45 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000046mips*)
47 arch=mips
48 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
49 ;;
50alpha*)
51 arch=alpha
52 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
53 ;;
Roland McGratheb285352003-01-14 09:59:00 +000054powerpc*)
Roland McGrath6d2b3492002-12-30 00:51:30 +000055 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Anton Blanchard9afc2ee2013-07-11 12:03:57 +100056 AC_TRY_COMPILE(
57[#ifndef __LP64__
58# error 32 bit
Dmitry V. Levinaf3ab5b2015-01-21 17:04:31 +000059#endif], [], arch=powerpc64, arch=powerpc)
60 if test "$arch" = "powerpc64"; then
Andreas Schwabd69fa492010-07-12 21:39:57 +020061 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
62 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000063 ;;
64arm*)
65 arch=arm
66 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
67 ;;
Steve McIntyred8d3bd32012-10-24 17:58:16 +010068aarch64*)
69 arch=aarch64
70 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
71 ;;
Denys Vlasenko5ae2b7c2009-02-27 20:32:52 +000072avr32*)
73 arch=avr32
74 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
75 ;;
Vineet Gupta7daacbb2013-08-16 12:47:06 +053076arc*)
77 arch=arc
78 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
79 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000080s390)
81 arch=s390
82 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
83 ;;
84s390x)
85 arch=s390x
86 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
87 ;;
88hppa*|parisc*)
89 arch=hppa
90 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
91 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000092sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +000093 arch=sh64
94 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +000095 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000096sh*)
97 arch=sh
98 AC_DEFINE([SH], 1, [Define for the SH architecture.])
99 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000100x86?64*)
H.J. Lu35be5812012-04-16 13:00:01 +0200101 AC_TRY_COMPILE(
102[#ifndef __ILP32__
103# error not x32
104#endif], [], arch=x32, arch=x86_64)
105 if test "$arch" = "x86_64"; then
106 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
107 else
108 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
109 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +0000110 ;;
Denys Vlasenkoea0e6e82009-02-25 17:08:40 +0000111cris|crisv10)
112 arch=crisv10
113 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
114 ;;
115crisv32)
116 arch=crisv32
117 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
118 ;;
Chris Metcalfc8c66982009-12-28 10:00:15 -0500119tile*)
120 arch=tile
121 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
122 ;;
Edgar E. Iglesias939caba2010-07-06 14:21:07 +0200123microblaze*)
124 arch=microblaze
125 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
126 ;;
Christian Svensson492f81f2013-02-14 13:26:27 +0100127or1k*)
128 arch=or1k
129 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
130 ;;
131
Chris Zankel8f636ed2013-03-25 10:22:07 -0700132xtensa*)
133 arch=xtensa
134 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
135 ;;
136
Roland McGrath6d2b3492002-12-30 00:51:30 +0000137*)
138 AC_MSG_RESULT([NO!])
139 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
140 ;;
141esac
142AC_MSG_RESULT($arch)
143
Roland McGrath6d2b3492002-12-30 00:51:30 +0000144AC_SUBST(arch)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000145
Dmitry V. Levin0160e162014-03-18 23:37:43 +0000146AC_ARG_ENABLE([arm-oabi],
147 [AS_HELP_STRING([--enable-arm-oabi],
148 [enable OABI support on ARM EABI])],
149 [], [enable_arm_oabi=no])
150case "$enable_arm_oabi" in
151 yes) enable_arm_oabi=1 ;;
152 no) enable_arm_oabi=0 ;;
153 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
154esac
155AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
156 [Define to 1 if you want OABI support on ARM EABI.])
157
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000158gl_WARN_ADD([-Wall])
Dmitry V. Levin1ed5d802010-09-09 17:42:28 +0000159gl_WARN_ADD([-Wwrite-strings])
Dmitry V. Levin3ed5d022014-09-10 13:46:04 +0000160gl_WARN_ADD([-Wsign-compare])
Dmitry V. Levind376c922012-05-15 00:50:26 +0000161AC_ARG_ENABLE([gcc-Werror],
162 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
163 [case $enableval in
164 yes) gl_WARN_ADD([-Werror]) ;;
165 no) ;;
166 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
167 esac]
168)
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000169AC_SUBST([WARN_CFLAGS])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000170
171AC_PROG_CPP
Roland McGrath6d2b3492002-12-30 00:51:30 +0000172AC_PROG_INSTALL
173AC_C_CONST
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400174AC_C_BIGENDIAN
Roland McGrath6d2b3492002-12-30 00:51:30 +0000175AC_HEADER_STDC
Roland McGrath639658b2008-08-01 01:06:31 +0000176AC_HEADER_STDBOOL
Roland McGrath6d2b3492002-12-30 00:51:30 +0000177AC_HEADER_DIRENT
178AC_HEADER_STAT
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000179AC_CHECK_MEMBERS(m4_normalize([
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000180 struct stat.st_blksize,
181 struct stat.st_blocks,
182 struct stat.st_flags,
183 struct stat.st_fstype,
184 struct stat.st_gen,
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000185 struct stat.st_rdev
186]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000187
188AC_TYPE_SIGNAL
189AC_TYPE_UID_T
190AC_TYPE_MODE_T
191AC_TYPE_GETGROUPS
192AC_HEADER_MAJOR
Roland McGrathacf06ef2003-01-10 19:57:34 +0000193AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
Roland McGrathe07cd602003-02-26 20:34:02 +0000194AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
195[#include <sys/types.h>
196#include <sys/socket.h>
197#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000198AC_LITTLE_ENDIAN_LONG_LONG
Roland McGrath6d2b3492002-12-30 00:51:30 +0000199
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000200AC_CHECK_FUNCS(m4_normalize([
Dmitry V. Levin1ea64732015-01-10 00:08:58 +0000201 fanotify_mark
Dmitry V. Levind3541302014-02-26 00:01:00 +0000202 fopen64
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000203 fork
Dmitry V. Levind3541302014-02-26 00:01:00 +0000204 fputs_unlocked
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000205 if_indextoname
206 inet_ntop
207 prctl
Mike Frysinger97ca0272014-08-11 02:52:08 -0400208 preadv
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000209 process_vm_readv
Mike Frysinger97ca0272014-08-11 02:52:08 -0400210 pwritev
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000211 sendmsg
Masatake YAMATO993198d2014-11-07 01:23:27 +0900212 sendmmsg
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000213 sigaction
214 stpcpy
215 strerror
216 strsignal
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000217]))
218AC_CHECK_HEADERS(m4_normalize([
219 asm/cachectl.h
220 asm/sysmips.h
Lubomir Rintelc400a1c2014-10-03 11:40:28 +0200221 bluetooth/bluetooth.h
Dmitry V. Levinc41808b2013-03-18 00:52:29 +0000222 elf.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000223 inttypes.h
224 ioctls.h
Dmitry V. Levin52572b62014-12-11 19:21:54 +0000225 linux/falloc.h
Ben Noordhuis88eafd82013-02-04 00:04:57 +0100226 linux/perf_event.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000227 linux/ptrace.h
228 linux/utsname.h
229 mqueue.h
230 netinet/sctp.h
231 poll.h
Dmitry V. Levinfdb896e2014-02-25 23:04:55 +0000232 scsi/sg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000233 stropts.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000234 sys/conf.h
235 sys/epoll.h
Dmitry V. Levin1ea64732015-01-10 00:08:58 +0000236 sys/fanotify.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000237 sys/filio.h
238 sys/ioctl.h
239 sys/poll.h
240 sys/ptrace.h
241 sys/reg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000242 sys/vfs.h
Masatake YAMATOf5480672014-11-22 19:03:33 +0900243 sys/xattr.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000244]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000245AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000246 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100247#include <sys/socket.h>
248#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000249AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Dmitry V. Levine2de3bd2013-11-12 15:27:38 +0000250AC_CHECK_TYPES([struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000251AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000252
Masatake YAMATOcaf6a432014-11-07 01:23:25 +0900253AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000254AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000255
Dmitry V. Levin7b9bc442015-01-08 04:06:06 +0000256AC_CHECK_TYPES([struct stat64],,, [#include <sys/types.h>
257#include <asm/stat.h>])
Roland McGrath79db8af2003-06-27 21:20:09 +0000258AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
Dmitry V. Levin9e6a7bf2015-01-08 04:12:29 +0000259AC_CHECK_TYPES([struct statfs64],,, [#include <sys/vfs.h>])
Roland McGrath79db8af2003-06-27 21:20:09 +0000260
Ali Polatel0b4060f2013-09-24 20:04:32 +0300261AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,,
Roland McGrathce9f0742004-03-01 21:29:22 +0000262 [#include <sys/ptrace.h>])
263
Dmitry V. Levinea22e972012-05-01 20:56:32 +0000264AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
265
Dmitry V. Levinae5aa472013-11-11 23:54:30 +0000266AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
Dmitry V. Levinbc091e32014-03-11 22:18:40 +0000267 struct sigevent.__pad,
Dmitry V. Levin36ab3d52015-01-13 09:24:04 +0300268 siginfo_t.si_syscall,
269 siginfo_t.si_timerid,
270 siginfo_t.si_overrun],,, [#include <signal.h>])
Dmitry V. Levinae5aa472013-11-11 23:54:30 +0000271
Dmitry V. Levin82a528d2014-09-29 23:29:56 +0000272AC_CHECK_MEMBERS([struct sysinfo.totalhigh,
273 struct sysinfo.freehigh,
274 struct sysinfo.mem_unit],,, [#include <sys/sysinfo.h>])
275
Dmitry V. Levin594eb8f2013-11-12 21:49:03 +0000276AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
277
Dmitry V. Levinb7dd5e62014-09-08 15:20:10 +0000278AC_CHECK_HEADERS([libaio.h], [
279 AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
280 AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
281])
282
Roland McGrath6d2b3492002-12-30 00:51:30 +0000283AC_CHECK_DECLS([sys_errlist])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000284AC_CHECK_DECLS(m4_normalize([
285 PTRACE_EVENT_CLONE,
286 PTRACE_EVENT_EXEC,
287 PTRACE_EVENT_EXIT,
288 PTRACE_EVENT_FORK,
289 PTRACE_EVENT_VFORK,
290 PTRACE_EVENT_VFORK_DONE,
291 PTRACE_GETEVENTMSG,
292 PTRACE_GETSIGINFO,
293 PTRACE_O_TRACECLONE,
294 PTRACE_O_TRACEEXEC,
295 PTRACE_O_TRACEEXIT,
296 PTRACE_O_TRACEFORK,
297 PTRACE_O_TRACESYSGOOD,
298 PTRACE_O_TRACEVFORK,
Dmitry V. Levin6974bd42013-11-12 21:20:50 +0000299 PTRACE_PEEKUSER,
300 PTRACE_POKEUSER,
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000301 PTRACE_SETOPTIONS
302]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000303
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000304AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levind8ad1dd2014-04-26 15:22:08 +0000305 P_PID,
306 P_PPID,
307 P_PGID,
308 P_SID,
309 P_CID,
310 P_UID,
311 P_GID,
312 P_ALL,
313 P_LWPID
314]),,, [#include <sys/wait.h>])
315
316AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levinbaf60d92014-04-26 14:12:33 +0000317 LO_FLAGS_READ_ONLY,
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000318 LO_FLAGS_AUTOCLEAR,
319 LO_FLAGS_PARTSCAN
320]),,, [#include <linux/loop.h>])
321
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000322AC_CHECK_DECLS(m4_normalize([
323 CTL_KERN,
324 CTL_VM,
325 CTL_NET,
326 CTL_PROC,
327 CTL_FS,
328 CTL_DEBUG,
329 CTL_DEV,
330 CTL_BUS,
331 CTL_ABI,
332 CTL_CPU,
333 CTL_ARLAN,
334 CTL_S390DBF,
335 CTL_SUNRPC,
336 CTL_PM,
337 CTL_FRV,
338 KERN_OSTYPE,
339 KERN_OSRELEASE,
340 KERN_OSREV,
341 KERN_VERSION,
342 KERN_SECUREMASK,
343 KERN_PROF,
344 KERN_NODENAME,
345 KERN_DOMAINNAME,
346 KERN_PANIC,
347 KERN_REALROOTDEV,
348 KERN_SPARC_REBOOT,
349 KERN_CTLALTDEL,
350 KERN_PRINTK,
351 KERN_NAMETRANS,
352 KERN_PPC_HTABRECLAIM,
353 KERN_PPC_ZEROPAGED,
354 KERN_PPC_POWERSAVE_NAP,
355 KERN_MODPROBE,
356 KERN_SG_BIG_BUFF,
357 KERN_ACCT,
358 KERN_PPC_L2CR,
359 KERN_RTSIGNR,
360 KERN_RTSIGMAX,
361 KERN_SHMMAX,
362 KERN_MSGMAX,
363 KERN_MSGMNB,
364 KERN_MSGPOOL,
365 KERN_SYSRQ,
366 KERN_MAX_THREADS,
367 KERN_RANDOM,
368 KERN_SHMALL,
369 KERN_MSGMNI,
370 KERN_SEM,
371 KERN_SPARC_STOP_A,
372 KERN_SHMMNI,
373 KERN_OVERFLOWUID,
374 KERN_OVERFLOWGID,
375 KERN_SHMPATH,
376 KERN_HOTPLUG,
377 KERN_IEEE_EMULATION_WARNINGS,
378 KERN_S390_USER_DEBUG_LOGGING,
379 KERN_CORE_USES_PID,
380 KERN_TAINTED,
381 KERN_CADPID,
382 KERN_PIDMAX,
383 KERN_CORE_PATTERN,
384 KERN_PANIC_ON_OOPS,
385 KERN_HPPA_PWRSW,
386 KERN_HPPA_UNALIGNED,
387 KERN_PRINTK_RATELIMIT,
388 KERN_PRINTK_RATELIMIT_BURST,
389 KERN_PTY,
390 KERN_NGROUPS_MAX,
391 KERN_SPARC_SCONS_PWROFF,
392 KERN_HZ_TIMER,
393 KERN_UNKNOWN_NMI_PANIC,
394 KERN_BOOTLOADER_TYPE,
395 KERN_RANDOMIZE,
396 KERN_SETUID_DUMPABLE,
397 KERN_SPIN_RETRY,
398 KERN_ACPI_VIDEO_FLAGS,
399 KERN_IA64_UNALIGNED,
400 KERN_COMPAT_LOG,
401 KERN_MAX_LOCK_DEPTH,
402 KERN_NMI_WATCHDOG,
403 KERN_PANIC_ON_NMI,
404 NET_CORE,
405 NET_ETHER,
406 NET_802,
407 NET_UNIX,
408 NET_IPV4,
409 NET_IPX,
410 NET_ATALK,
411 NET_NETROM,
412 NET_AX25,
413 NET_BRIDGE,
414 NET_ROSE,
415 NET_IPV6,
416 NET_X25,
417 NET_TR,
418 NET_DECNET,
419 NET_ECONET,
420 NET_SCTP,
421 NET_LLC,
422 NET_NETFILTER,
423 NET_DCCP,
424 NET_IRDA,
425 NET_CORE_WMEM_MAX,
426 NET_CORE_RMEM_MAX,
427 NET_CORE_WMEM_DEFAULT,
428 NET_CORE_RMEM_DEFAULT,
429 NET_CORE_DESTROY_DELAY,
430 NET_CORE_MAX_BACKLOG,
431 NET_CORE_FASTROUTE,
432 NET_CORE_MSG_COST,
433 NET_CORE_MSG_BURST,
434 NET_CORE_OPTMEM_MAX,
435 NET_CORE_HOT_LIST_LENGTH,
436 NET_CORE_DIVERT_VERSION,
437 NET_CORE_NO_CONG_THRESH,
438 NET_CORE_NO_CONG,
439 NET_CORE_LO_CONG,
440 NET_CORE_MOD_CONG,
441 NET_CORE_DEV_WEIGHT,
442 NET_CORE_SOMAXCONN,
443 NET_CORE_BUDGET,
444 NET_CORE_AEVENT_ETIME,
445 NET_CORE_AEVENT_RSEQTH,
446 NET_CORE_WARNINGS,
447 NET_IPV4_FORWARD,
448 NET_IPV4_DYNADDR,
449 NET_IPV4_CONF,
450 NET_IPV4_NEIGH,
451 NET_IPV4_ROUTE,
452 NET_IPV4_FIB_HASH,
453 NET_IPV4_NETFILTER,
454 NET_IPV4_TCP_TIMESTAMPS,
455 NET_IPV4_TCP_WINDOW_SCALING,
456 NET_IPV4_TCP_SACK,
457 NET_IPV4_TCP_RETRANS_COLLAPSE,
458 NET_IPV4_DEFAULT_TTL,
459 NET_IPV4_AUTOCONFIG,
460 NET_IPV4_NO_PMTU_DISC,
461 NET_IPV4_TCP_SYN_RETRIES,
462 NET_IPV4_IPFRAG_HIGH_THRESH,
463 NET_IPV4_IPFRAG_LOW_THRESH,
464 NET_IPV4_IPFRAG_TIME,
465 NET_IPV4_TCP_MAX_KA_PROBES,
466 NET_IPV4_TCP_KEEPALIVE_TIME,
467 NET_IPV4_TCP_KEEPALIVE_PROBES,
468 NET_IPV4_TCP_RETRIES1,
469 NET_IPV4_TCP_RETRIES2,
470 NET_IPV4_TCP_FIN_TIMEOUT,
471 NET_IPV4_IP_MASQ_DEBUG,
472 NET_TCP_SYNCOOKIES,
473 NET_TCP_STDURG,
474 NET_TCP_RFC1337,
475 NET_TCP_SYN_TAILDROP,
476 NET_TCP_MAX_SYN_BACKLOG,
477 NET_IPV4_LOCAL_PORT_RANGE,
478 NET_IPV4_ICMP_ECHO_IGNORE_ALL,
479 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
480 NET_IPV4_ICMP_SOURCEQUENCH_RATE,
481 NET_IPV4_ICMP_DESTUNREACH_RATE,
482 NET_IPV4_ICMP_TIMEEXCEED_RATE,
483 NET_IPV4_ICMP_PARAMPROB_RATE,
484 NET_IPV4_ICMP_ECHOREPLY_RATE,
485 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
486 NET_IPV4_IGMP_MAX_MEMBERSHIPS,
487 NET_TCP_TW_RECYCLE,
488 NET_IPV4_ALWAYS_DEFRAG,
489 NET_IPV4_TCP_KEEPALIVE_INTVL,
490 NET_IPV4_INET_PEER_THRESHOLD,
491 NET_IPV4_INET_PEER_MINTTL,
492 NET_IPV4_INET_PEER_MAXTTL,
493 NET_IPV4_INET_PEER_GC_MINTIME,
494 NET_IPV4_INET_PEER_GC_MAXTIME,
495 NET_TCP_ORPHAN_RETRIES,
496 NET_TCP_ABORT_ON_OVERFLOW,
497 NET_TCP_SYNACK_RETRIES,
498 NET_TCP_MAX_ORPHANS,
499 NET_TCP_MAX_TW_BUCKETS,
500 NET_TCP_FACK,
501 NET_TCP_REORDERING,
502 NET_TCP_ECN,
503 NET_TCP_DSACK,
504 NET_TCP_MEM,
505 NET_TCP_WMEM,
506 NET_TCP_RMEM,
507 NET_TCP_APP_WIN,
508 NET_TCP_ADV_WIN_SCALE,
509 NET_IPV4_NONLOCAL_BIND,
510 NET_IPV4_ICMP_RATELIMIT,
511 NET_IPV4_ICMP_RATEMASK,
512 NET_TCP_TW_REUSE,
513 NET_TCP_FRTO,
514 NET_TCP_LOW_LATENCY,
515 NET_IPV4_IPFRAG_SECRET_INTERVAL,
516 NET_IPV4_IGMP_MAX_MSF,
517 NET_TCP_NO_METRICS_SAVE,
518 NET_TCP_DEFAULT_WIN_SCALE,
519 NET_TCP_MODERATE_RCVBUF,
520 NET_TCP_TSO_WIN_DIVISOR,
521 NET_TCP_BIC_BETA,
522 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
523 NET_TCP_CONG_CONTROL,
524 NET_TCP_ABC,
525 NET_IPV4_IPFRAG_MAX_DIST,
526 NET_TCP_MTU_PROBING,
527 NET_TCP_BASE_MSS,
528 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
529 NET_TCP_DMA_COPYBREAK,
530 NET_TCP_SLOW_START_AFTER_IDLE,
531 NET_CIPSOV4_CACHE_ENABLE,
532 NET_CIPSOV4_CACHE_BUCKET_SIZE,
533 NET_CIPSOV4_RBM_OPTFMT,
534 NET_CIPSOV4_RBM_STRICTVALID,
535 NET_TCP_AVAIL_CONG_CONTROL,
536 NET_TCP_ALLOWED_CONG_CONTROL,
537 NET_TCP_MAX_SSTHRESH,
538 NET_TCP_FRTO_RESPONSE,
539 NET_IPV4_ROUTE_FLUSH,
540 NET_IPV4_ROUTE_MIN_DELAY,
541 NET_IPV4_ROUTE_MAX_DELAY,
542 NET_IPV4_ROUTE_GC_THRESH,
543 NET_IPV4_ROUTE_MAX_SIZE,
544 NET_IPV4_ROUTE_GC_MIN_INTERVAL,
545 NET_IPV4_ROUTE_GC_TIMEOUT,
546 NET_IPV4_ROUTE_GC_INTERVAL,
547 NET_IPV4_ROUTE_REDIRECT_LOAD,
548 NET_IPV4_ROUTE_REDIRECT_NUMBER,
549 NET_IPV4_ROUTE_REDIRECT_SILENCE,
550 NET_IPV4_ROUTE_ERROR_COST,
551 NET_IPV4_ROUTE_ERROR_BURST,
552 NET_IPV4_ROUTE_GC_ELASTICITY,
553 NET_IPV4_ROUTE_MTU_EXPIRES,
554 NET_IPV4_ROUTE_MIN_PMTU,
555 NET_IPV4_ROUTE_MIN_ADVMSS,
556 NET_IPV4_ROUTE_SECRET_INTERVAL,
557 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
558 NET_IPV4_CONF_FORWARDING,
559 NET_IPV4_CONF_MC_FORWARDING,
560 NET_IPV4_CONF_PROXY_ARP,
561 NET_IPV4_CONF_ACCEPT_REDIRECTS,
562 NET_IPV4_CONF_SECURE_REDIRECTS,
563 NET_IPV4_CONF_SEND_REDIRECTS,
564 NET_IPV4_CONF_SHARED_MEDIA,
565 NET_IPV4_CONF_RP_FILTER,
566 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE,
567 NET_IPV4_CONF_BOOTP_RELAY,
568 NET_IPV4_CONF_LOG_MARTIANS,
569 NET_IPV4_CONF_TAG,
570 NET_IPV4_CONF_ARPFILTER,
571 NET_IPV4_CONF_MEDIUM_ID,
572 NET_IPV4_CONF_NOXFRM,
573 NET_IPV4_CONF_NOPOLICY,
574 NET_IPV4_CONF_FORCE_IGMP_VERSION,
575 NET_IPV4_CONF_ARP_ANNOUNCE,
576 NET_IPV4_CONF_ARP_IGNORE,
577 NET_IPV4_CONF_PROMOTE_SECONDARIES,
578 NET_IPV4_CONF_ARP_ACCEPT,
579 NET_IPV4_CONF_ARP_NOTIFY,
580 NET_IPV6_CONF,
581 NET_IPV6_NEIGH,
582 NET_IPV6_ROUTE,
583 NET_IPV6_ICMP,
584 NET_IPV6_BINDV6ONLY,
585 NET_IPV6_IP6FRAG_HIGH_THRESH,
586 NET_IPV6_IP6FRAG_LOW_THRESH,
587 NET_IPV6_IP6FRAG_TIME,
588 NET_IPV6_IP6FRAG_SECRET_INTERVAL,
589 NET_IPV6_MLD_MAX_MSF,
590 NET_IPV6_ROUTE_FLUSH,
591 NET_IPV6_ROUTE_GC_THRESH,
592 NET_IPV6_ROUTE_MAX_SIZE,
593 NET_IPV6_ROUTE_GC_MIN_INTERVAL,
594 NET_IPV6_ROUTE_GC_TIMEOUT,
595 NET_IPV6_ROUTE_GC_INTERVAL,
596 NET_IPV6_ROUTE_GC_ELASTICITY,
597 NET_IPV6_ROUTE_MTU_EXPIRES,
598 NET_IPV6_ROUTE_MIN_ADVMSS,
599 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
600 NET_UNIX_DESTROY_DELAY,
601 NET_UNIX_DELETE_DELAY,
602 NET_UNIX_MAX_DGRAM_QLEN,
603 VM_OVERCOMMIT_MEMORY,
604 VM_PAGE_CLUSTER,
605 VM_DIRTY_BACKGROUND,
606 VM_DIRTY_RATIO,
607 VM_DIRTY_WB_CS,
608 VM_DIRTY_EXPIRE_CS,
609 VM_NR_PDFLUSH_THREADS,
610 VM_OVERCOMMIT_RATIO,
611 VM_PAGEBUF,
612 VM_HUGETLB_PAGES,
613 VM_SWAPPINESS,
614 VM_LOWMEM_RESERVE_RATIO,
615 VM_MIN_FREE_KBYTES,
616 VM_MAX_MAP_COUNT,
617 VM_LAPTOP_MODE,
618 VM_BLOCK_DUMP,
619 VM_HUGETLB_GROUP,
620 VM_VFS_CACHE_PRESSURE,
621 VM_LEGACY_VA_LAYOUT,
622 VM_SWAP_TOKEN_TIMEOUT
623]),,,
624[#include <sys/types.h>
625#include <linux/sysctl.h>])
626
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100627AC_CHECK_DECLS(m4_normalize([
628 V4L2_FIELD_ANY,
629 V4L2_FIELD_NONE,
630 V4L2_FIELD_TOP,
631 V4L2_FIELD_BOTTOM,
632 V4L2_FIELD_INTERLACED,
633 V4L2_FIELD_SEQ_TB,
634 V4L2_FIELD_SEQ_BT,
635 V4L2_FIELD_ALTERNATE,
636 V4L2_FIELD_INTERLACED_TB,
637 V4L2_FIELD_INTERLACED_BT,
638 V4L2_BUF_TYPE_VIDEO_CAPTURE,
639 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
640 V4L2_BUF_TYPE_VIDEO_OUTPUT,
641 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
642 V4L2_BUF_TYPE_VIDEO_OVERLAY,
643 V4L2_BUF_TYPE_VBI_CAPTURE,
644 V4L2_BUF_TYPE_VBI_OUTPUT,
645 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
646 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
647 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
648 V4L2_TUNER_RADIO,
649 V4L2_TUNER_ANALOG_TV,
650 V4L2_TUNER_DIGITAL_TV,
651 V4L2_MEMORY_MMAP,
652 V4L2_MEMORY_USERPTR,
653 V4L2_MEMORY_OVERLAY,
654 V4L2_MEMORY_DMABUF,
655 V4L2_COLORSPACE_SMPTE170M,
656 V4L2_COLORSPACE_SMPTE240M,
657 V4L2_COLORSPACE_REC709,
658 V4L2_COLORSPACE_BT878,
659 V4L2_COLORSPACE_470_SYSTEM_M,
660 V4L2_COLORSPACE_470_SYSTEM_BG,
661 V4L2_COLORSPACE_JPEG,
662 V4L2_COLORSPACE_SRGB,
663 V4L2_PRIORITY_UNSET,
664 V4L2_PRIORITY_BACKGROUND,
665 V4L2_PRIORITY_INTERACTIVE,
666 V4L2_PRIORITY_RECORD,
667 V4L2_FRMSIZE_TYPE_DISCRETE,
668 V4L2_FRMSIZE_TYPE_CONTINUOUS,
669 V4L2_FRMSIZE_TYPE_STEPWISE,
670 V4L2_FRMIVAL_TYPE_DISCRETE,
671 V4L2_FRMIVAL_TYPE_CONTINUOUS,
672 V4L2_FRMIVAL_TYPE_STEPWISE,
673 V4L2_CTRL_TYPE_INTEGER,
674 V4L2_CTRL_TYPE_BOOLEAN,
675 V4L2_CTRL_TYPE_MENU,
676 V4L2_CTRL_TYPE_BUTTON,
677 V4L2_CTRL_TYPE_INTEGER64,
678 V4L2_CTRL_TYPE_CTRL_CLASS,
679 V4L2_CTRL_TYPE_STRING,
680 V4L2_CTRL_TYPE_BITMASK,
681 V4L2_CTRL_TYPE_INTEGER_MENU
682]),,, [#include <linux/videodev2.h>])
683
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000684AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
685 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
686#include <stdlib.h>
687#include <linux/fs.h>], [return !BLKGETSIZE64;])],
688 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
689 if test $ac_cv_have_blkgetsize64 = yes; then
690 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
691 fi)
692
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000693AC_CHECK_SIZEOF([long])
Dmitry V. Levin7a498be2013-05-04 19:51:57 +0000694AC_CHECK_SIZEOF([long long])
Dmitry V. Levin54cabef2014-03-03 23:09:47 +0000695AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000696
Dmitry V. Levinab3953b2014-02-08 00:15:52 +0000697AC_CACHE_CHECK([for SA_RESTORER], [st_cv_sa_restorer],
698 [st_cv_sa_restorer="$(echo SA_RESTORER |
699 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
700 grep ^0x)"
701 test -n "$st_cv_sa_restorer" || st_cv_sa_restorer=no])
702if test "x$st_cv_sa_restorer" != xno; then
703 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_sa_restorer],
704 [SA_RESTORER defined in <asm/signal.h>])
705fi
706
Dmitry V. Levin38593e92014-02-26 16:51:28 +0000707AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
708 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
709 [st_cv_have___builtin_popcount=yes],
710 [st_cv_have___builtin_popcount=no])])
711if test "x$st_cv_have___builtin_popcount" = xyes; then
712 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
713 [Define to 1 if the system provides __builtin_popcount function])
714fi
715
Roland McGrath6d2b3492002-12-30 00:51:30 +0000716AC_PATH_PROG([PERL], [perl])
717
Luca Clementi327064b2013-07-23 00:11:35 -0700718dnl stack trace with libunwind
719libunwind_CPPFLAGS=
720libunwind_LDFLAGS=
721libunwind_LIBS=
722AC_ARG_WITH([libunwind],
723 [AS_HELP_STRING([--with-libunwind],
724 [use libunwind to implement stack tracing support])],
725 [case "${withval}" in
726 yes|no|check) ;;
727 *) with_libunwind=yes
728 libunwind_CPPFLAGS="-I${withval}/include"
729 libunwind_LDFLAGS="-L${withval}/lib" ;;
730 esac],
731 [with_libunwind=check]
732)
733
734use_libunwind=no
735AS_IF([test "x$with_libunwind" != xno],
736 [saved_CPPFLAGS="$CPPFLAGS"
737 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
738
739 AC_CHECK_HEADERS([libunwind-ptrace.h],
740 [saved_LDFLAGS="$LDFLAGS"
741 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
742
743 AC_CHECK_LIB([unwind], [backtrace],
744 [libunwind_LIBS="-lunwind $libunwind_LIBS"
745
746 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
747 saved_LIBS="$LIBS"
748 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
749
750 AC_LINK_IFELSE(
751 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
752 [[return !unw_create_addr_space(0, 0)]])
753 ],
754 [AC_MSG_RESULT([yes])
755 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
756
757 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
758 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
759 use_libunwind=yes
760 ],
761 [if test "x$with_libunwind" != xcheck; then
762 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
763 fi
764 ],
765 [$libunwind_LIBS]
766 )
767 ],
768 [AC_MSG_RESULT([no])
769 if test "x$with_libunwind" != xcheck; then
770 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
771 fi
772 ]
773 )
774
775 LIBS="$saved_LIBS"
776 ],
777 [if test "x$with_libunwind" != xcheck; then
778 AC_MSG_FAILURE([failed to find libunwind])
779 fi
780 ],
781 [$libunwind_LIBS]
782 )
783
784 LDFLAGS="$saved_LDFLAGS"
785 ],
786 [if test "x$with_libunwind" != xcheck; then
787 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
788 fi
789 ]
790 )
791
792 CPPFLAGS="$saved_CPPFLAGS"
793 ]
794)
795
796dnl enable libunwind
797AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
798if test "x$use_libunwind" = xyes; then
799 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
800 AC_SUBST(libunwind_LIBS)
801 AC_SUBST(libunwind_LDFLAGS)
802 AC_SUBST(libunwind_CPPFLAGS)
803fi
804AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
805AC_MSG_RESULT([$use_libunwind])
806
Dmitry V. Levind59287d2015-01-13 04:57:27 +0000807if test "$arch" = mips && test "$no_create" != yes; then
808 mkdir -p linux/mips
809 if $srcdir/linux/mips/genstub.sh linux/mips; then
810 AC_MSG_RESULT([Generated MIPS syscallent stubs])
811 else
812 AC_MSG_FAILURE([Failed to generate syscallent stubs])
813 fi
814fi
815
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000816AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000817AC_OUTPUT