blob: 4732778776e17800e85326d06bceae52580e0115 [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 arch=powerpc
56 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Anton Blanchard9afc2ee2013-07-11 12:03:57 +100057 AC_TRY_COMPILE(
58[#ifndef __LP64__
59# error 32 bit
60#endif], [], ppc_bits=64, ppc_bits=32)
61 if test "$ppc_bits" = "64"; then
Andreas Schwabd69fa492010-07-12 21:39:57 +020062 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
63 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000064 ;;
65arm*)
66 arch=arm
67 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
68 ;;
Steve McIntyred8d3bd32012-10-24 17:58:16 +010069aarch64*)
70 arch=aarch64
71 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
72 ;;
Denys Vlasenko5ae2b7c2009-02-27 20:32:52 +000073avr32*)
74 arch=avr32
75 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
76 ;;
Vineet Gupta7daacbb2013-08-16 12:47:06 +053077arc*)
78 arch=arc
79 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
80 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000081s390)
82 arch=s390
83 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
84 ;;
85s390x)
86 arch=s390x
87 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
88 ;;
89hppa*|parisc*)
90 arch=hppa
91 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
92 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000093sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +000094 arch=sh64
95 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +000096 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000097sh*)
98 arch=sh
99 AC_DEFINE([SH], 1, [Define for the SH architecture.])
100 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000101x86?64*)
H.J. Lu35be5812012-04-16 13:00:01 +0200102 AC_TRY_COMPILE(
103[#ifndef __ILP32__
104# error not x32
105#endif], [], arch=x32, arch=x86_64)
106 if test "$arch" = "x86_64"; then
107 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
108 else
109 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
110 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +0000111 ;;
Denys Vlasenkoea0e6e82009-02-25 17:08:40 +0000112cris|crisv10)
113 arch=crisv10
114 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
115 ;;
116crisv32)
117 arch=crisv32
118 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
119 ;;
Chris Metcalfc8c66982009-12-28 10:00:15 -0500120tile*)
121 arch=tile
122 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
123 ;;
Edgar E. Iglesias939caba2010-07-06 14:21:07 +0200124microblaze*)
125 arch=microblaze
126 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
127 ;;
Christian Svensson492f81f2013-02-14 13:26:27 +0100128or1k*)
129 arch=or1k
130 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
131 ;;
132
Chris Zankel8f636ed2013-03-25 10:22:07 -0700133xtensa*)
134 arch=xtensa
135 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
136 ;;
137
Roland McGrath6d2b3492002-12-30 00:51:30 +0000138*)
139 AC_MSG_RESULT([NO!])
140 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
141 ;;
142esac
143AC_MSG_RESULT($arch)
144
Roland McGrath6d2b3492002-12-30 00:51:30 +0000145AC_SUBST(arch)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000146
Roland McGrathbc44e402004-07-12 05:45:08 +0000147AM_CONDITIONAL([I386], [test x$arch = xi386])
Roland McGrath2746edd2002-12-30 09:13:08 +0000148AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
H.J. Lu35be5812012-04-16 13:00:01 +0200149AM_CONDITIONAL([X32], [test x$arch = xx32])
Roland McGrath45aeb6e2003-01-10 10:44:59 +0000150
Roland McGrath6d2b3492002-12-30 00:51:30 +0000151AC_INCLUDEDIR
152
Dmitry V. Levin0160e162014-03-18 23:37:43 +0000153AC_ARG_ENABLE([arm-oabi],
154 [AS_HELP_STRING([--enable-arm-oabi],
155 [enable OABI support on ARM EABI])],
156 [], [enable_arm_oabi=no])
157case "$enable_arm_oabi" in
158 yes) enable_arm_oabi=1 ;;
159 no) enable_arm_oabi=0 ;;
160 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
161esac
162AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
163 [Define to 1 if you want OABI support on ARM EABI.])
164
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000165gl_WARN_ADD([-Wall])
Dmitry V. Levin1ed5d802010-09-09 17:42:28 +0000166gl_WARN_ADD([-Wwrite-strings])
Dmitry V. Levin3ed5d022014-09-10 13:46:04 +0000167gl_WARN_ADD([-Wsign-compare])
Dmitry V. Levind376c922012-05-15 00:50:26 +0000168AC_ARG_ENABLE([gcc-Werror],
169 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
170 [case $enableval in
171 yes) gl_WARN_ADD([-Werror]) ;;
172 no) ;;
173 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
174 esac]
175)
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000176AC_SUBST([WARN_CFLAGS])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000177
178AC_PROG_CPP
Roland McGrath6d2b3492002-12-30 00:51:30 +0000179AC_PROG_INSTALL
180AC_C_CONST
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400181AC_C_BIGENDIAN
Roland McGrath6d2b3492002-12-30 00:51:30 +0000182AC_HEADER_STDC
Roland McGrath639658b2008-08-01 01:06:31 +0000183AC_HEADER_STDBOOL
Roland McGrath6d2b3492002-12-30 00:51:30 +0000184AC_HEADER_DIRENT
185AC_HEADER_STAT
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000186AC_CHECK_MEMBERS(m4_normalize([
187 struct stat.st_aclcnt,
188 struct stat.st_blksize,
189 struct stat.st_blocks,
190 struct stat.st_flags,
191 struct stat.st_fstype,
192 struct stat.st_gen,
193 struct stat.st_level,
194 struct stat.st_rdev
195]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000196AC_STAT64
Bernhard Reutner-Fischer9906e6d2009-10-14 16:33:58 +0200197AC_STATFS64
Roland McGrath6d2b3492002-12-30 00:51:30 +0000198
199AC_TYPE_SIGNAL
200AC_TYPE_UID_T
201AC_TYPE_MODE_T
202AC_TYPE_GETGROUPS
203AC_HEADER_MAJOR
Roland McGrathacf06ef2003-01-10 19:57:34 +0000204AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
Roland McGrathe07cd602003-02-26 20:34:02 +0000205AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
206[#include <sys/types.h>
207#include <sys/socket.h>
208#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000209AC_LITTLE_ENDIAN_LONG_LONG
Roland McGrath6d2b3492002-12-30 00:51:30 +0000210
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000211AC_CHECK_FUNCS(m4_normalize([
Dmitry V. Levind3541302014-02-26 00:01:00 +0000212 fopen64
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000213 fork
Dmitry V. Levind3541302014-02-26 00:01:00 +0000214 fputs_unlocked
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000215 if_indextoname
216 inet_ntop
217 prctl
Mike Frysinger97ca0272014-08-11 02:52:08 -0400218 preadv
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000219 process_vm_readv
Mike Frysinger97ca0272014-08-11 02:52:08 -0400220 pwritev
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000221 sendmsg
Masatake YAMATO993198d2014-11-07 01:23:27 +0900222 sendmmsg
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000223 sigaction
224 stpcpy
225 strerror
226 strsignal
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000227]))
228AC_CHECK_HEADERS(m4_normalize([
229 asm/cachectl.h
230 asm/sysmips.h
Lubomir Rintelc400a1c2014-10-03 11:40:28 +0200231 bluetooth/bluetooth.h
Dmitry V. Levinc41808b2013-03-18 00:52:29 +0000232 elf.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000233 inttypes.h
234 ioctls.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000235 linux/capability.h
Ben Noordhuis88eafd82013-02-04 00:04:57 +0100236 linux/perf_event.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000237 linux/ptrace.h
238 linux/utsname.h
239 mqueue.h
240 netinet/sctp.h
241 poll.h
Dmitry V. Levinfdb896e2014-02-25 23:04:55 +0000242 scsi/sg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000243 stropts.h
244 sys/acl.h
245 sys/asynch.h
246 sys/conf.h
247 sys/epoll.h
248 sys/filio.h
249 sys/ioctl.h
250 sys/poll.h
251 sys/ptrace.h
252 sys/reg.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000253 sys/vfs.h
Masatake YAMATOf5480672014-11-22 19:03:33 +0900254 sys/xattr.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000255]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000256AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000257 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100258#include <sys/socket.h>
259#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000260AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Dmitry V. Levine2de3bd2013-11-12 15:27:38 +0000261AC_CHECK_TYPES([struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000262AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000263
Masatake YAMATOcaf6a432014-11-07 01:23:25 +0900264AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000265AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000266
Roland McGrath79db8af2003-06-27 21:20:09 +0000267AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
268
Ali Polatel0b4060f2013-09-24 20:04:32 +0300269AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,,
Roland McGrathce9f0742004-03-01 21:29:22 +0000270 [#include <sys/ptrace.h>])
271
Dmitry V. Levinea22e972012-05-01 20:56:32 +0000272AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
273
Dmitry V. Levinae5aa472013-11-11 23:54:30 +0000274AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
Dmitry V. Levinbc091e32014-03-11 22:18:40 +0000275 struct sigevent.__pad,
276 siginfo_t.si_syscall],,, [#include <signal.h>])
Dmitry V. Levinae5aa472013-11-11 23:54:30 +0000277
Dmitry V. Levin82a528d2014-09-29 23:29:56 +0000278AC_CHECK_MEMBERS([struct sysinfo.totalhigh,
279 struct sysinfo.freehigh,
280 struct sysinfo.mem_unit],,, [#include <sys/sysinfo.h>])
281
Dmitry V. Levin594eb8f2013-11-12 21:49:03 +0000282AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
283
Dmitry V. Levinb7dd5e62014-09-08 15:20:10 +0000284AC_CHECK_HEADERS([libaio.h], [
285 AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
286 AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
287])
288
Roland McGrath6d2b3492002-12-30 00:51:30 +0000289AC_CHECK_DECLS([sys_errlist])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000290AC_CHECK_DECLS(m4_normalize([
291 PTRACE_EVENT_CLONE,
292 PTRACE_EVENT_EXEC,
293 PTRACE_EVENT_EXIT,
294 PTRACE_EVENT_FORK,
295 PTRACE_EVENT_VFORK,
296 PTRACE_EVENT_VFORK_DONE,
297 PTRACE_GETEVENTMSG,
298 PTRACE_GETSIGINFO,
299 PTRACE_O_TRACECLONE,
300 PTRACE_O_TRACEEXEC,
301 PTRACE_O_TRACEEXIT,
302 PTRACE_O_TRACEFORK,
303 PTRACE_O_TRACESYSGOOD,
304 PTRACE_O_TRACEVFORK,
Dmitry V. Levin6974bd42013-11-12 21:20:50 +0000305 PTRACE_PEEKUSER,
306 PTRACE_POKEUSER,
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000307 PTRACE_SETOPTIONS
308]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000309
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000310AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levind8ad1dd2014-04-26 15:22:08 +0000311 P_PID,
312 P_PPID,
313 P_PGID,
314 P_SID,
315 P_CID,
316 P_UID,
317 P_GID,
318 P_ALL,
319 P_LWPID
320]),,, [#include <sys/wait.h>])
321
322AC_CHECK_DECLS(m4_normalize([
Dmitry V. Levinbaf60d92014-04-26 14:12:33 +0000323 LO_FLAGS_READ_ONLY,
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000324 LO_FLAGS_AUTOCLEAR,
325 LO_FLAGS_PARTSCAN
326]),,, [#include <linux/loop.h>])
327
Dmitry V. Levin6dbbe072014-04-26 13:54:12 +0000328AC_CHECK_DECLS(m4_normalize([
329 CTL_KERN,
330 CTL_VM,
331 CTL_NET,
332 CTL_PROC,
333 CTL_FS,
334 CTL_DEBUG,
335 CTL_DEV,
336 CTL_BUS,
337 CTL_ABI,
338 CTL_CPU,
339 CTL_ARLAN,
340 CTL_S390DBF,
341 CTL_SUNRPC,
342 CTL_PM,
343 CTL_FRV,
344 KERN_OSTYPE,
345 KERN_OSRELEASE,
346 KERN_OSREV,
347 KERN_VERSION,
348 KERN_SECUREMASK,
349 KERN_PROF,
350 KERN_NODENAME,
351 KERN_DOMAINNAME,
352 KERN_PANIC,
353 KERN_REALROOTDEV,
354 KERN_SPARC_REBOOT,
355 KERN_CTLALTDEL,
356 KERN_PRINTK,
357 KERN_NAMETRANS,
358 KERN_PPC_HTABRECLAIM,
359 KERN_PPC_ZEROPAGED,
360 KERN_PPC_POWERSAVE_NAP,
361 KERN_MODPROBE,
362 KERN_SG_BIG_BUFF,
363 KERN_ACCT,
364 KERN_PPC_L2CR,
365 KERN_RTSIGNR,
366 KERN_RTSIGMAX,
367 KERN_SHMMAX,
368 KERN_MSGMAX,
369 KERN_MSGMNB,
370 KERN_MSGPOOL,
371 KERN_SYSRQ,
372 KERN_MAX_THREADS,
373 KERN_RANDOM,
374 KERN_SHMALL,
375 KERN_MSGMNI,
376 KERN_SEM,
377 KERN_SPARC_STOP_A,
378 KERN_SHMMNI,
379 KERN_OVERFLOWUID,
380 KERN_OVERFLOWGID,
381 KERN_SHMPATH,
382 KERN_HOTPLUG,
383 KERN_IEEE_EMULATION_WARNINGS,
384 KERN_S390_USER_DEBUG_LOGGING,
385 KERN_CORE_USES_PID,
386 KERN_TAINTED,
387 KERN_CADPID,
388 KERN_PIDMAX,
389 KERN_CORE_PATTERN,
390 KERN_PANIC_ON_OOPS,
391 KERN_HPPA_PWRSW,
392 KERN_HPPA_UNALIGNED,
393 KERN_PRINTK_RATELIMIT,
394 KERN_PRINTK_RATELIMIT_BURST,
395 KERN_PTY,
396 KERN_NGROUPS_MAX,
397 KERN_SPARC_SCONS_PWROFF,
398 KERN_HZ_TIMER,
399 KERN_UNKNOWN_NMI_PANIC,
400 KERN_BOOTLOADER_TYPE,
401 KERN_RANDOMIZE,
402 KERN_SETUID_DUMPABLE,
403 KERN_SPIN_RETRY,
404 KERN_ACPI_VIDEO_FLAGS,
405 KERN_IA64_UNALIGNED,
406 KERN_COMPAT_LOG,
407 KERN_MAX_LOCK_DEPTH,
408 KERN_NMI_WATCHDOG,
409 KERN_PANIC_ON_NMI,
410 NET_CORE,
411 NET_ETHER,
412 NET_802,
413 NET_UNIX,
414 NET_IPV4,
415 NET_IPX,
416 NET_ATALK,
417 NET_NETROM,
418 NET_AX25,
419 NET_BRIDGE,
420 NET_ROSE,
421 NET_IPV6,
422 NET_X25,
423 NET_TR,
424 NET_DECNET,
425 NET_ECONET,
426 NET_SCTP,
427 NET_LLC,
428 NET_NETFILTER,
429 NET_DCCP,
430 NET_IRDA,
431 NET_CORE_WMEM_MAX,
432 NET_CORE_RMEM_MAX,
433 NET_CORE_WMEM_DEFAULT,
434 NET_CORE_RMEM_DEFAULT,
435 NET_CORE_DESTROY_DELAY,
436 NET_CORE_MAX_BACKLOG,
437 NET_CORE_FASTROUTE,
438 NET_CORE_MSG_COST,
439 NET_CORE_MSG_BURST,
440 NET_CORE_OPTMEM_MAX,
441 NET_CORE_HOT_LIST_LENGTH,
442 NET_CORE_DIVERT_VERSION,
443 NET_CORE_NO_CONG_THRESH,
444 NET_CORE_NO_CONG,
445 NET_CORE_LO_CONG,
446 NET_CORE_MOD_CONG,
447 NET_CORE_DEV_WEIGHT,
448 NET_CORE_SOMAXCONN,
449 NET_CORE_BUDGET,
450 NET_CORE_AEVENT_ETIME,
451 NET_CORE_AEVENT_RSEQTH,
452 NET_CORE_WARNINGS,
453 NET_IPV4_FORWARD,
454 NET_IPV4_DYNADDR,
455 NET_IPV4_CONF,
456 NET_IPV4_NEIGH,
457 NET_IPV4_ROUTE,
458 NET_IPV4_FIB_HASH,
459 NET_IPV4_NETFILTER,
460 NET_IPV4_TCP_TIMESTAMPS,
461 NET_IPV4_TCP_WINDOW_SCALING,
462 NET_IPV4_TCP_SACK,
463 NET_IPV4_TCP_RETRANS_COLLAPSE,
464 NET_IPV4_DEFAULT_TTL,
465 NET_IPV4_AUTOCONFIG,
466 NET_IPV4_NO_PMTU_DISC,
467 NET_IPV4_TCP_SYN_RETRIES,
468 NET_IPV4_IPFRAG_HIGH_THRESH,
469 NET_IPV4_IPFRAG_LOW_THRESH,
470 NET_IPV4_IPFRAG_TIME,
471 NET_IPV4_TCP_MAX_KA_PROBES,
472 NET_IPV4_TCP_KEEPALIVE_TIME,
473 NET_IPV4_TCP_KEEPALIVE_PROBES,
474 NET_IPV4_TCP_RETRIES1,
475 NET_IPV4_TCP_RETRIES2,
476 NET_IPV4_TCP_FIN_TIMEOUT,
477 NET_IPV4_IP_MASQ_DEBUG,
478 NET_TCP_SYNCOOKIES,
479 NET_TCP_STDURG,
480 NET_TCP_RFC1337,
481 NET_TCP_SYN_TAILDROP,
482 NET_TCP_MAX_SYN_BACKLOG,
483 NET_IPV4_LOCAL_PORT_RANGE,
484 NET_IPV4_ICMP_ECHO_IGNORE_ALL,
485 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
486 NET_IPV4_ICMP_SOURCEQUENCH_RATE,
487 NET_IPV4_ICMP_DESTUNREACH_RATE,
488 NET_IPV4_ICMP_TIMEEXCEED_RATE,
489 NET_IPV4_ICMP_PARAMPROB_RATE,
490 NET_IPV4_ICMP_ECHOREPLY_RATE,
491 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
492 NET_IPV4_IGMP_MAX_MEMBERSHIPS,
493 NET_TCP_TW_RECYCLE,
494 NET_IPV4_ALWAYS_DEFRAG,
495 NET_IPV4_TCP_KEEPALIVE_INTVL,
496 NET_IPV4_INET_PEER_THRESHOLD,
497 NET_IPV4_INET_PEER_MINTTL,
498 NET_IPV4_INET_PEER_MAXTTL,
499 NET_IPV4_INET_PEER_GC_MINTIME,
500 NET_IPV4_INET_PEER_GC_MAXTIME,
501 NET_TCP_ORPHAN_RETRIES,
502 NET_TCP_ABORT_ON_OVERFLOW,
503 NET_TCP_SYNACK_RETRIES,
504 NET_TCP_MAX_ORPHANS,
505 NET_TCP_MAX_TW_BUCKETS,
506 NET_TCP_FACK,
507 NET_TCP_REORDERING,
508 NET_TCP_ECN,
509 NET_TCP_DSACK,
510 NET_TCP_MEM,
511 NET_TCP_WMEM,
512 NET_TCP_RMEM,
513 NET_TCP_APP_WIN,
514 NET_TCP_ADV_WIN_SCALE,
515 NET_IPV4_NONLOCAL_BIND,
516 NET_IPV4_ICMP_RATELIMIT,
517 NET_IPV4_ICMP_RATEMASK,
518 NET_TCP_TW_REUSE,
519 NET_TCP_FRTO,
520 NET_TCP_LOW_LATENCY,
521 NET_IPV4_IPFRAG_SECRET_INTERVAL,
522 NET_IPV4_IGMP_MAX_MSF,
523 NET_TCP_NO_METRICS_SAVE,
524 NET_TCP_DEFAULT_WIN_SCALE,
525 NET_TCP_MODERATE_RCVBUF,
526 NET_TCP_TSO_WIN_DIVISOR,
527 NET_TCP_BIC_BETA,
528 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
529 NET_TCP_CONG_CONTROL,
530 NET_TCP_ABC,
531 NET_IPV4_IPFRAG_MAX_DIST,
532 NET_TCP_MTU_PROBING,
533 NET_TCP_BASE_MSS,
534 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
535 NET_TCP_DMA_COPYBREAK,
536 NET_TCP_SLOW_START_AFTER_IDLE,
537 NET_CIPSOV4_CACHE_ENABLE,
538 NET_CIPSOV4_CACHE_BUCKET_SIZE,
539 NET_CIPSOV4_RBM_OPTFMT,
540 NET_CIPSOV4_RBM_STRICTVALID,
541 NET_TCP_AVAIL_CONG_CONTROL,
542 NET_TCP_ALLOWED_CONG_CONTROL,
543 NET_TCP_MAX_SSTHRESH,
544 NET_TCP_FRTO_RESPONSE,
545 NET_IPV4_ROUTE_FLUSH,
546 NET_IPV4_ROUTE_MIN_DELAY,
547 NET_IPV4_ROUTE_MAX_DELAY,
548 NET_IPV4_ROUTE_GC_THRESH,
549 NET_IPV4_ROUTE_MAX_SIZE,
550 NET_IPV4_ROUTE_GC_MIN_INTERVAL,
551 NET_IPV4_ROUTE_GC_TIMEOUT,
552 NET_IPV4_ROUTE_GC_INTERVAL,
553 NET_IPV4_ROUTE_REDIRECT_LOAD,
554 NET_IPV4_ROUTE_REDIRECT_NUMBER,
555 NET_IPV4_ROUTE_REDIRECT_SILENCE,
556 NET_IPV4_ROUTE_ERROR_COST,
557 NET_IPV4_ROUTE_ERROR_BURST,
558 NET_IPV4_ROUTE_GC_ELASTICITY,
559 NET_IPV4_ROUTE_MTU_EXPIRES,
560 NET_IPV4_ROUTE_MIN_PMTU,
561 NET_IPV4_ROUTE_MIN_ADVMSS,
562 NET_IPV4_ROUTE_SECRET_INTERVAL,
563 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
564 NET_IPV4_CONF_FORWARDING,
565 NET_IPV4_CONF_MC_FORWARDING,
566 NET_IPV4_CONF_PROXY_ARP,
567 NET_IPV4_CONF_ACCEPT_REDIRECTS,
568 NET_IPV4_CONF_SECURE_REDIRECTS,
569 NET_IPV4_CONF_SEND_REDIRECTS,
570 NET_IPV4_CONF_SHARED_MEDIA,
571 NET_IPV4_CONF_RP_FILTER,
572 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE,
573 NET_IPV4_CONF_BOOTP_RELAY,
574 NET_IPV4_CONF_LOG_MARTIANS,
575 NET_IPV4_CONF_TAG,
576 NET_IPV4_CONF_ARPFILTER,
577 NET_IPV4_CONF_MEDIUM_ID,
578 NET_IPV4_CONF_NOXFRM,
579 NET_IPV4_CONF_NOPOLICY,
580 NET_IPV4_CONF_FORCE_IGMP_VERSION,
581 NET_IPV4_CONF_ARP_ANNOUNCE,
582 NET_IPV4_CONF_ARP_IGNORE,
583 NET_IPV4_CONF_PROMOTE_SECONDARIES,
584 NET_IPV4_CONF_ARP_ACCEPT,
585 NET_IPV4_CONF_ARP_NOTIFY,
586 NET_IPV6_CONF,
587 NET_IPV6_NEIGH,
588 NET_IPV6_ROUTE,
589 NET_IPV6_ICMP,
590 NET_IPV6_BINDV6ONLY,
591 NET_IPV6_IP6FRAG_HIGH_THRESH,
592 NET_IPV6_IP6FRAG_LOW_THRESH,
593 NET_IPV6_IP6FRAG_TIME,
594 NET_IPV6_IP6FRAG_SECRET_INTERVAL,
595 NET_IPV6_MLD_MAX_MSF,
596 NET_IPV6_ROUTE_FLUSH,
597 NET_IPV6_ROUTE_GC_THRESH,
598 NET_IPV6_ROUTE_MAX_SIZE,
599 NET_IPV6_ROUTE_GC_MIN_INTERVAL,
600 NET_IPV6_ROUTE_GC_TIMEOUT,
601 NET_IPV6_ROUTE_GC_INTERVAL,
602 NET_IPV6_ROUTE_GC_ELASTICITY,
603 NET_IPV6_ROUTE_MTU_EXPIRES,
604 NET_IPV6_ROUTE_MIN_ADVMSS,
605 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
606 NET_UNIX_DESTROY_DELAY,
607 NET_UNIX_DELETE_DELAY,
608 NET_UNIX_MAX_DGRAM_QLEN,
609 VM_OVERCOMMIT_MEMORY,
610 VM_PAGE_CLUSTER,
611 VM_DIRTY_BACKGROUND,
612 VM_DIRTY_RATIO,
613 VM_DIRTY_WB_CS,
614 VM_DIRTY_EXPIRE_CS,
615 VM_NR_PDFLUSH_THREADS,
616 VM_OVERCOMMIT_RATIO,
617 VM_PAGEBUF,
618 VM_HUGETLB_PAGES,
619 VM_SWAPPINESS,
620 VM_LOWMEM_RESERVE_RATIO,
621 VM_MIN_FREE_KBYTES,
622 VM_MAX_MAP_COUNT,
623 VM_LAPTOP_MODE,
624 VM_BLOCK_DUMP,
625 VM_HUGETLB_GROUP,
626 VM_VFS_CACHE_PRESSURE,
627 VM_LEGACY_VA_LAYOUT,
628 VM_SWAP_TOKEN_TIMEOUT
629]),,,
630[#include <sys/types.h>
631#include <linux/sysctl.h>])
632
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100633AC_CHECK_DECLS(m4_normalize([
634 V4L2_FIELD_ANY,
635 V4L2_FIELD_NONE,
636 V4L2_FIELD_TOP,
637 V4L2_FIELD_BOTTOM,
638 V4L2_FIELD_INTERLACED,
639 V4L2_FIELD_SEQ_TB,
640 V4L2_FIELD_SEQ_BT,
641 V4L2_FIELD_ALTERNATE,
642 V4L2_FIELD_INTERLACED_TB,
643 V4L2_FIELD_INTERLACED_BT,
644 V4L2_BUF_TYPE_VIDEO_CAPTURE,
645 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
646 V4L2_BUF_TYPE_VIDEO_OUTPUT,
647 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
648 V4L2_BUF_TYPE_VIDEO_OVERLAY,
649 V4L2_BUF_TYPE_VBI_CAPTURE,
650 V4L2_BUF_TYPE_VBI_OUTPUT,
651 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
652 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
653 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
654 V4L2_TUNER_RADIO,
655 V4L2_TUNER_ANALOG_TV,
656 V4L2_TUNER_DIGITAL_TV,
657 V4L2_MEMORY_MMAP,
658 V4L2_MEMORY_USERPTR,
659 V4L2_MEMORY_OVERLAY,
660 V4L2_MEMORY_DMABUF,
661 V4L2_COLORSPACE_SMPTE170M,
662 V4L2_COLORSPACE_SMPTE240M,
663 V4L2_COLORSPACE_REC709,
664 V4L2_COLORSPACE_BT878,
665 V4L2_COLORSPACE_470_SYSTEM_M,
666 V4L2_COLORSPACE_470_SYSTEM_BG,
667 V4L2_COLORSPACE_JPEG,
668 V4L2_COLORSPACE_SRGB,
669 V4L2_PRIORITY_UNSET,
670 V4L2_PRIORITY_BACKGROUND,
671 V4L2_PRIORITY_INTERACTIVE,
672 V4L2_PRIORITY_RECORD,
673 V4L2_FRMSIZE_TYPE_DISCRETE,
674 V4L2_FRMSIZE_TYPE_CONTINUOUS,
675 V4L2_FRMSIZE_TYPE_STEPWISE,
676 V4L2_FRMIVAL_TYPE_DISCRETE,
677 V4L2_FRMIVAL_TYPE_CONTINUOUS,
678 V4L2_FRMIVAL_TYPE_STEPWISE,
679 V4L2_CTRL_TYPE_INTEGER,
680 V4L2_CTRL_TYPE_BOOLEAN,
681 V4L2_CTRL_TYPE_MENU,
682 V4L2_CTRL_TYPE_BUTTON,
683 V4L2_CTRL_TYPE_INTEGER64,
684 V4L2_CTRL_TYPE_CTRL_CLASS,
685 V4L2_CTRL_TYPE_STRING,
686 V4L2_CTRL_TYPE_BITMASK,
687 V4L2_CTRL_TYPE_INTEGER_MENU
688]),,, [#include <linux/videodev2.h>])
689
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000690AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
691 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
692#include <stdlib.h>
693#include <linux/fs.h>], [return !BLKGETSIZE64;])],
694 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
695 if test $ac_cv_have_blkgetsize64 = yes; then
696 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
697 fi)
698
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000699AC_CHECK_SIZEOF([long])
Dmitry V. Levin7a498be2013-05-04 19:51:57 +0000700AC_CHECK_SIZEOF([long long])
Dmitry V. Levin54cabef2014-03-03 23:09:47 +0000701AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000702
Dmitry V. Levinab3953b2014-02-08 00:15:52 +0000703AC_CACHE_CHECK([for SA_RESTORER], [st_cv_sa_restorer],
704 [st_cv_sa_restorer="$(echo SA_RESTORER |
705 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
706 grep ^0x)"
707 test -n "$st_cv_sa_restorer" || st_cv_sa_restorer=no])
708if test "x$st_cv_sa_restorer" != xno; then
709 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_sa_restorer],
710 [SA_RESTORER defined in <asm/signal.h>])
711fi
712
Dmitry V. Levin38593e92014-02-26 16:51:28 +0000713AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
714 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
715 [st_cv_have___builtin_popcount=yes],
716 [st_cv_have___builtin_popcount=no])])
717if test "x$st_cv_have___builtin_popcount" = xyes; then
718 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
719 [Define to 1 if the system provides __builtin_popcount function])
720fi
721
Roland McGrath6d2b3492002-12-30 00:51:30 +0000722AC_PATH_PROG([PERL], [perl])
723
Luca Clementi327064b2013-07-23 00:11:35 -0700724dnl stack trace with libunwind
725libunwind_CPPFLAGS=
726libunwind_LDFLAGS=
727libunwind_LIBS=
728AC_ARG_WITH([libunwind],
729 [AS_HELP_STRING([--with-libunwind],
730 [use libunwind to implement stack tracing support])],
731 [case "${withval}" in
732 yes|no|check) ;;
733 *) with_libunwind=yes
734 libunwind_CPPFLAGS="-I${withval}/include"
735 libunwind_LDFLAGS="-L${withval}/lib" ;;
736 esac],
737 [with_libunwind=check]
738)
739
740use_libunwind=no
741AS_IF([test "x$with_libunwind" != xno],
742 [saved_CPPFLAGS="$CPPFLAGS"
743 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
744
745 AC_CHECK_HEADERS([libunwind-ptrace.h],
746 [saved_LDFLAGS="$LDFLAGS"
747 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
748
749 AC_CHECK_LIB([unwind], [backtrace],
750 [libunwind_LIBS="-lunwind $libunwind_LIBS"
751
752 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
753 saved_LIBS="$LIBS"
754 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
755
756 AC_LINK_IFELSE(
757 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
758 [[return !unw_create_addr_space(0, 0)]])
759 ],
760 [AC_MSG_RESULT([yes])
761 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
762
763 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
764 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
765 use_libunwind=yes
766 ],
767 [if test "x$with_libunwind" != xcheck; then
768 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
769 fi
770 ],
771 [$libunwind_LIBS]
772 )
773 ],
774 [AC_MSG_RESULT([no])
775 if test "x$with_libunwind" != xcheck; then
776 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
777 fi
778 ]
779 )
780
781 LIBS="$saved_LIBS"
782 ],
783 [if test "x$with_libunwind" != xcheck; then
784 AC_MSG_FAILURE([failed to find libunwind])
785 fi
786 ],
787 [$libunwind_LIBS]
788 )
789
790 LDFLAGS="$saved_LDFLAGS"
791 ],
792 [if test "x$with_libunwind" != xcheck; then
793 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
794 fi
795 ]
796 )
797
798 CPPFLAGS="$saved_CPPFLAGS"
799 ]
800)
801
802dnl enable libunwind
803AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
804if test "x$use_libunwind" = xyes; then
805 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
806 AC_SUBST(libunwind_LIBS)
807 AC_SUBST(libunwind_LDFLAGS)
808 AC_SUBST(libunwind_CPPFLAGS)
809fi
810AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
811AC_MSG_RESULT([$use_libunwind])
812
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000813AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000814AC_OUTPUT