Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 26KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  1. # 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>
  5. # Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
  6. # Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
  7. # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
  8. # Copyright (c) 2002-2020 The strace developers.
  9. # All rights reserved.
  10. #
  11. # SPDX-License-Identifier: LGPL-2.1-or-later
  12. AC_PREREQ(2.57)
  13. AC_INIT([strace],
  14. st_esyscmd_s([./git-version-gen .tarball-version]),
  15. [strace-devel@lists.strace.io],
  16. [strace],
  17. [https://strace.io])
  18. m4_define([copyright_year], st_esyscmd_s([./copyright-year-gen .year]))
  19. m4_define([manpage_date], st_esyscmd_s([./file-date-gen strace.1.in]))
  20. AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
  21. AC_CONFIG_SRCDIR([strace.c])
  22. AC_CONFIG_AUX_DIR([.])
  23. AC_CONFIG_HEADERS([config.h])
  24. AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests subdir-objects 1.13])
  25. AM_MAINTAINER_MODE
  26. AC_CANONICAL_HOST
  27. RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')"
  28. AC_SUBST(RPM_CHANGELOGTIME)
  29. DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)"
  30. AC_SUBST(DEB_CHANGELOGTIME)
  31. AC_PROG_CC
  32. AC_PROG_CC_STDC
  33. AC_PROG_CPP
  34. AC_PROG_INSTALL
  35. AC_PROG_RANLIB
  36. AM_PROG_AR
  37. AC_USE_SYSTEM_EXTENSIONS
  38. AX_CODE_COVERAGE
  39. AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.])
  40. AC_SUBST([COPYRIGHT_YEAR], [copyright_year])
  41. AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
  42. AC_SUBST([MANPAGE_DATE], [manpage_date])
  43. AC_C_BIGENDIAN
  44. dnl arch-specific default for --enable-gcc-Werror
  45. arch_enable_Werror=yes
  46. AC_MSG_CHECKING([for supported architecture])
  47. arch_m32=
  48. arch_mx32=
  49. cc_flags_m32=-m32
  50. cc_flags_mx32=-mx32
  51. case "$host_cpu" in
  52. aarch64*)
  53. arch=aarch64
  54. arch_m32=arm
  55. cc_flags_m32=
  56. AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
  57. ;;
  58. alpha*)
  59. arch=alpha
  60. arch_enable_Werror=no
  61. AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
  62. ;;
  63. arc*)
  64. arch=arc
  65. AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
  66. ;;
  67. arm*)
  68. arch=arm
  69. AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
  70. ;;
  71. avr32*)
  72. arch=avr32
  73. AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
  74. ;;
  75. bfin)
  76. arch=bfin
  77. arch_enable_Werror=no
  78. AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
  79. ;;
  80. csky*)
  81. arch=csky
  82. AC_DEFINE([CSKY], 1, [Define for the C-SKY architecture])
  83. ;;
  84. hppa*|parisc*)
  85. arch=hppa
  86. AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  87. ;;
  88. i[[3456]]86|pentium)
  89. arch=i386
  90. AC_DEFINE([I386], 1, [Define for the i386 architecture.])
  91. ;;
  92. ia64)
  93. arch=ia64
  94. AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
  95. ;;
  96. m68k)
  97. arch=m68k
  98. AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
  99. ;;
  100. metag*)
  101. arch=metag
  102. AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
  103. ;;
  104. microblaze*)
  105. arch=microblaze
  106. arch_enable_Werror=no
  107. AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
  108. ;;
  109. mips*)
  110. arch=mips
  111. AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
  112. ;;
  113. nios2*)
  114. arch=nios2
  115. AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
  116. ;;
  117. or1k*)
  118. arch=or1k
  119. AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
  120. ;;
  121. powerpc*)
  122. AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
  123. AC_TRY_COMPILE(
  124. [#ifndef __LP64__
  125. # error 32 bit
  126. #endif], [], arch=powerpc64, arch=powerpc)
  127. if test "$arch" = "powerpc64"; then
  128. # $ac_cv_c_bigendian is defined by AC_C_BIGENDIAN
  129. case "$ac_cv_c_bigendian" in
  130. no)
  131. arch=powerpc64le
  132. AC_DEFINE([POWERPC64LE], 1,
  133. [Define for the little endian PowerPC64 architecture.])
  134. ;;
  135. *)
  136. arch_m32=powerpc
  137. AC_DEFINE([POWERPC64], 1,
  138. [Define for the big endian PowerPC64 architecture.])
  139. ;;
  140. esac
  141. fi
  142. ;;
  143. riscv64*)
  144. arch=riscv64
  145. AC_DEFINE([RISCV64], 1, [Define for the RISC-V 64-bit architecture])
  146. ;;
  147. s390)
  148. arch=s390
  149. AC_DEFINE([S390], 1, [Define for the S390 architecture.])
  150. ;;
  151. s390x)
  152. arch=s390x
  153. arch_m32=s390
  154. cc_flags_m32=-m31
  155. AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
  156. ;;
  157. sh64*)
  158. arch=sh64
  159. AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  160. ;;
  161. sh*)
  162. arch=sh
  163. AC_DEFINE([SH], 1, [Define for the SH architecture.])
  164. ;;
  165. sparc64*)
  166. arch=sparc64
  167. arch_m32=sparc
  168. AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
  169. ;;
  170. sparc*)
  171. arch=sparc
  172. AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
  173. ;;
  174. tile*)
  175. arch=tile
  176. AC_DEFINE([TILE], 1, [Define for the Tile architecture])
  177. ;;
  178. x86?64*)
  179. arch_m32=i386
  180. AC_TRY_COMPILE(
  181. [#ifndef __ILP32__
  182. # error not x32
  183. #endif], [], arch=x32, arch=x86_64)
  184. if test "$arch" = "x86_64"; then
  185. arch_mx32=x32
  186. AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
  187. else
  188. AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
  189. fi
  190. ;;
  191. xtensa*)
  192. arch=xtensa
  193. AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
  194. ;;
  195. *)
  196. AC_MSG_RESULT([NO!])
  197. AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
  198. ;;
  199. esac
  200. AC_MSG_RESULT($arch)
  201. arch_native=$arch
  202. test -n "$arch_m32" ||
  203. arch_m32=$arch
  204. test -n "$arch_mx32" ||
  205. arch_mx32=$arch
  206. AC_SUBST(arch)
  207. AC_SUBST(arch_m32)
  208. AC_SUBST(arch_mx32)
  209. AC_SUBST(cc_flags_m32)
  210. AC_SUBST(cc_flags_mx32)
  211. AC_SUBST(arch_native)
  212. MIPS_ABI=
  213. if test "$arch" = mips; then
  214. AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
  215. [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
  216. [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
  217. # requires GCC >= 3.4
  218. AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
  219. [AC_COMPILE_IFELSE(
  220. [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])],
  221. [st_cv_mips_abi=o32],
  222. [AC_COMPILE_IFELSE(
  223. [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])],
  224. [st_cv_mips_abi=n32],
  225. [AC_COMPILE_IFELSE(
  226. [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])],
  227. [st_cv_mips_abi=n64],
  228. [st_cv_mips_abi=unknown])])])])
  229. case "$st_cv_mips_abi" in
  230. o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);;
  231. n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);;
  232. n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);;
  233. *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
  234. esac
  235. MIPS_ABI="$st_cv_mips_abi"
  236. fi
  237. AC_SUBST(MIPS_ABI)
  238. AC_ARG_ENABLE([arm-oabi],
  239. [AS_HELP_STRING([--enable-arm-oabi],
  240. [enable OABI support on ARM EABI])],
  241. [], [enable_arm_oabi=no])
  242. case "$enable_arm_oabi" in
  243. yes) enable_arm_oabi=1 ;;
  244. no) enable_arm_oabi=0 ;;
  245. *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
  246. esac
  247. AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
  248. [Define to 1 if you want OABI support on ARM EABI.])
  249. st_WARN_CFLAGS
  250. AX_PROG_CC_FOR_BUILD
  251. AC_C_TYPEOF
  252. AC_TYPE_UID_T
  253. AC_CHECK_FUNCS(m4_normalize([
  254. accept4
  255. be64toh
  256. fallocate
  257. fanotify_mark
  258. fcntl64
  259. fopen64
  260. fork
  261. fputs_unlocked
  262. fstatat
  263. ftruncate
  264. futimens
  265. iconv_open
  266. if_indextoname
  267. open64
  268. open_memstream
  269. preadv
  270. process_vm_readv
  271. pwritev
  272. readahead
  273. signalfd
  274. stpcpy
  275. strerror
  276. strndup
  277. strsignal
  278. sync_file_range
  279. utimensat
  280. ]))
  281. AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
  282. AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
  283. AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
  284. [#include <asm/posix_types.h>])
  285. AC_CHECK_TYPES([struct __kernel_timespec, struct __kernel_sock_timeval],,,
  286. [#include <linux/time_types.h>])
  287. AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
  288. [#include <sys/types.h>
  289. #include <asm/stat.h>])
  290. AC_CHECK_TYPES([struct user_desc],
  291. [AC_CHECK_MEMBERS([struct user_desc.lm],,,
  292. [#include <asm/ldt.h>])],,
  293. [#include <asm/ldt.h>])
  294. AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
  295. [#include <sys/types.h>
  296. #include <asm/stat.h>])
  297. AC_CHECK_TYPES(m4_normalize([
  298. struct pt_all_user_regs,
  299. struct ia64_fpreg,
  300. struct ptrace_peeksiginfo_args,
  301. struct __ptrace_syscall_info
  302. ]),,, [#include <sys/ptrace.h>])
  303. AC_CHECK_TYPES([struct ptrace_syscall_info],,, [#include <linux/ptrace.h>])
  304. # For kernels that do not have v3.10-rc1~201^2~11
  305. AC_CHECK_TYPES([s390_compat_regs],,, [#include <asm/ptrace.h>])
  306. AC_CHECK_TYPES(m4_normalize([
  307. struct flock,
  308. struct flock64,
  309. struct __kernel_flock,
  310. struct __kernel_flock64,
  311. struct f_owner_ex,
  312. struct __kernel_f_owner_ex
  313. ]),,,
  314. [#include <sys/types.h>
  315. #include <linux/fcntl.h>])
  316. AC_CHECK_TYPES(m4_normalize([
  317. struct kcmp_epoll_slot
  318. ]),,, [#include <linux/kcmp.h>])
  319. AC_CHECK_TYPES(m4_normalize([
  320. struct keyctl_kdf_params,
  321. struct keyctl_pkey_params,
  322. struct keyctl_pkey_query
  323. ]),,, [#include <linux/keyctl.h>])
  324. AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
  325. AC_CHECK_MEMBERS(m4_normalize([
  326. siginfo_t.si_syscall,
  327. siginfo_t.si_timerid,
  328. siginfo_t.si_overrun
  329. ]),,, [#include <signal.h>])
  330. AC_CHECK_MEMBERS(m4_normalize([
  331. struct perf_event_attr.precise_ip,
  332. struct perf_event_attr.mmap_data,
  333. struct perf_event_attr.sample_id_all,
  334. struct perf_event_attr.exclude_host,
  335. struct perf_event_attr.exclude_guest,
  336. struct perf_event_attr.exclude_callchain_kernel,
  337. struct perf_event_attr.exclude_callchain_user,
  338. struct perf_event_attr.mmap2,
  339. struct perf_event_attr.comm_exec,
  340. struct perf_event_attr.use_clockid,
  341. struct perf_event_attr.context_switch,
  342. struct perf_event_attr.write_backward,
  343. struct perf_event_attr.namespaces,
  344. struct perf_event_attr.bp_type,
  345. struct perf_event_attr.config1,
  346. struct perf_event_attr.config2,
  347. struct perf_event_attr.branch_sample_type,
  348. struct perf_event_attr.sample_regs_user,
  349. struct perf_event_attr.sample_stack_user,
  350. struct perf_event_attr.sample_regs_intr,
  351. struct perf_event_attr.aux_watermark,
  352. struct perf_event_attr.sample_max_stack,
  353. struct perf_event_attr.aux_sample_size
  354. ]),,, [#include <linux/perf_event.h>])
  355. AC_CHECK_HEADERS(m4_normalize([
  356. asm/cachectl.h
  357. asm/guarded_storage.h
  358. asm/sysmips.h
  359. elf.h
  360. gcov.h
  361. iconv.h
  362. inttypes.h
  363. linux/bsg.h
  364. linux/dm-ioctl.h
  365. linux/dqblk_xfs.h
  366. linux/falloc.h
  367. linux/fib_rules.h
  368. linux/fiemap.h
  369. linux/hiddev.h
  370. linux/if_addr.h
  371. linux/if_link.h
  372. linux/ip_vs.h
  373. linux/ipc.h
  374. linux/kcmp.h
  375. linux/kvm.h
  376. linux/memfd.h
  377. linux/mmtimer.h
  378. linux/mount.h
  379. linux/neighbour.h
  380. linux/netfilter/ipset/ip_set.h
  381. linux/netfilter/nf_tables.h
  382. linux/netfilter/nf_tables_compat.h
  383. linux/netfilter/nfnetlink.h
  384. linux/netfilter/nfnetlink_acct.h
  385. linux/netfilter/nfnetlink_conntrack.h
  386. linux/netfilter/nfnetlink_cthelper.h
  387. linux/netfilter/nfnetlink_cttimeout.h
  388. linux/netfilter/nfnetlink_log.h
  389. linux/netfilter/nfnetlink_queue.h
  390. linux/nsfs.h
  391. linux/openat2.h
  392. linux/perf_event.h
  393. linux/quota.h
  394. linux/sched.h
  395. linux/seccomp.h
  396. linux/securebits.h
  397. linux/userfaultfd.h
  398. linux/utsname.h
  399. mqueue.h
  400. netinet/sctp.h
  401. netipx/ipx.h
  402. paths.h
  403. scsi/sg.h
  404. stropts.h
  405. sys/conf.h
  406. sys/eventfd.h
  407. sys/fanotify.h
  408. sys/ipc.h
  409. sys/quota.h
  410. sys/signalfd.h
  411. sys/xattr.h
  412. ustat.h
  413. ]))
  414. AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
  415. AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
  416. AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
  417. AC_CHECK_HEADERS([linux/netfilter/xt_osf.h],,, [#include <linux/ip.h>
  418. #include <linux/tcp.h>])
  419. AC_CHECK_HEADERS(m4_normalize([
  420. linux/netfilter_arp/arp_tables.h
  421. linux/netfilter_bridge/ebtables.h
  422. linux/netfilter_ipv4/ip_tables.h
  423. linux/netfilter_ipv6/ip6_tables.h
  424. ]),,, [#include <netinet/in.h>
  425. #include <net/if.h>])
  426. AC_CHECK_HEADERS([linux/bpf.h], [
  427. AC_CHECK_TYPES(m4_normalize([
  428. struct bpf_insn,
  429. struct bpf_map_info,
  430. struct bpf_prog_info
  431. ]),,, [#include <linux/bpf.h>])
  432. st_BPF_ATTR
  433. ])
  434. AC_CHECK_HEADERS([linux/io_uring.h], [
  435. AC_CHECK_MEMBERS(m4_normalize([
  436. struct io_uring_params.features,
  437. struct io_uring_params.wq_fd,
  438. struct io_uring_params.resv
  439. ]),,, [#include <linux/io_uring.h>])
  440. ])
  441. AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
  442. AC_CHECK_MEMBERS([struct sockaddr_hci.hci_channel],,,
  443. [#include <bluetooth/bluetooth.h>
  444. #include <bluetooth/hci.h>])
  445. AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
  446. [#include <bluetooth/bluetooth.h>
  447. #include <bluetooth/l2cap.h>])
  448. ])
  449. AC_CHECK_MEMBERS(m4_normalize([
  450. struct br_mdb_entry.flags,
  451. struct br_mdb_entry.vid
  452. ]),,, [#include <netinet/in.h>
  453. #include <linux/if_bridge.h>])
  454. AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
  455. AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
  456. AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
  457. AC_CHECK_TYPES(m4_normalize([
  458. struct ifla_cacheinfo
  459. ]),,, [#include <sys/socket.h>
  460. #include <linux/rtnetlink.h>])
  461. AC_CHECK_DECLS(m4_normalize([
  462. TCA_ACT_PAD,
  463. TCA_ACT_COOKIE,
  464. TCA_ACT_FLAGS
  465. ]),,, [#include <sys/socket.h>
  466. #include <linux/pkt_cls.h>])
  467. AC_CHECK_DECLS(m4_normalize([
  468. IFLA_PORT_SELF,
  469. IFLA_PROTINFO,
  470. IFLA_AF_SPEC,
  471. IFLA_XDP,
  472. IFLA_PROP_LIST,
  473. IFLA_ALT_IFNAME,
  474. IFLA_PERM_ADDRESS
  475. ]),,, [#include <sys/socket.h>
  476. #include <linux/rtnetlink.h>])
  477. AC_CHECK_TYPES(m4_normalize([
  478. struct gnet_stats_basic,
  479. struct gnet_stats_queue,
  480. struct gnet_stats_rate_est,
  481. struct gnet_stats_rate_est64
  482. ]),,, [#include <linux/gen_stats.h>])
  483. AC_CHECK_DECLS(m4_normalize([
  484. TCA_STATS_PKT64
  485. ]),,, [#include <linux/gen_stats.h>])
  486. AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/types.h>
  487. #include <linux/pkt_sched.h>])
  488. AC_CHECK_DECLS([TCA_STAB_DATA],,, [#include <linux/types.h>
  489. #include <linux/pkt_sched.h>])
  490. AC_CHECK_TYPES(m4_normalize([
  491. struct fib_rule_uid_range,
  492. struct fib_rule_port_range
  493. ]),,, [#include <linux/fib_rules.h>])
  494. AC_CHECK_TYPES([struct statfs], [
  495. AC_CHECK_MEMBERS(m4_normalize([
  496. struct statfs.f_frsize,
  497. struct statfs.f_flags,
  498. struct statfs.f_fsid.val,
  499. struct statfs.f_fsid.__val
  500. ]),,, [#include <linux/types.h>
  501. #include <asm/statfs.h>])
  502. ],, [#include <linux/types.h>
  503. #include <asm/statfs.h>])
  504. AC_CHECK_TYPES([struct statfs64], [
  505. AC_CHECK_MEMBERS(m4_normalize([
  506. struct statfs64.f_frsize,
  507. struct statfs64.f_flags,
  508. struct statfs64.f_fsid.val,
  509. struct statfs64.f_fsid.__val
  510. ]),,, [#include <linux/types.h>
  511. #include <asm/statfs.h>])
  512. ],, [#include <linux/types.h>
  513. #include <asm/statfs.h>])
  514. AC_CHECK_TYPES([struct statx],,, [#include <linux/types.h>
  515. #include <linux/stat.h>])
  516. AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
  517. AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
  518. AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
  519. AC_CHECK_TYPES(m4_normalize([
  520. struct ptp_sys_offset
  521. ]),,, [#include <linux/ptp_clock.h>])
  522. AC_CHECK_TYPES(m4_normalize([
  523. struct kvm_cpuid2,
  524. struct kvm_regs,
  525. struct kvm_sregs,
  526. struct kvm_userspace_memory_region
  527. ]),,, [#include <linux/kvm.h>])
  528. saved_CPPFLAGS="$CPPFLAGS"
  529. AC_CACHE_CHECK([whether <linux/signal.h> can be used along with <signal.h>],
  530. [st_cv_linux_signal],
  531. [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  532. #include <signal.h>
  533. #include <linux/signal.h>]],[])],
  534. [st_cv_linux_signal=yes],
  535. [st_cv_linux_signal=no])])
  536. if test "x$st_cv_linux_signal" = xno; then
  537. mkdir -p linux/linux
  538. cp $srcdir/linux/signal.h.in linux/linux/signal.h
  539. CPPFLAGS="$CPPFLAGS -Ilinux"
  540. fi
  541. AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
  542. AC_CHECK_MEMBERS(m4_normalize([
  543. struct iocb.aio_flags,
  544. struct iocb.aio_rw_flags
  545. ]),,, [#include <linux/aio_abi.h>])
  546. AC_CHECK_MEMBERS([struct clone_args.set_tid_size],,, [#include <linux/sched.h>])
  547. CPPFLAGS="$saved_CPPFLAGS"
  548. AC_CHECK_HEADERS([linux/btrfs.h], [
  549. AC_CHECK_MEMBERS(m4_normalize([
  550. struct btrfs_ioctl_feature_flags.compat_flags,
  551. struct btrfs_ioctl_fs_info_args.nodesize,
  552. struct btrfs_ioctl_defrag_range_args.start,
  553. struct btrfs_ioctl_search_args_v2.buf_size,
  554. struct btrfs_ioctl_logical_ino_args.flags
  555. ]),,, [ #include <stdio.h>
  556. #include <linux/btrfs.h>])
  557. AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
  558. BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
  559. #include <linux/btrfs.h>])])
  560. st_CHECK_TYPES
  561. AC_CHECK_DECLS([sys_errlist])
  562. AC_CHECK_DECLS(m4_normalize([
  563. PTRACE_PEEKUSER,
  564. PTRACE_POKEUSER
  565. ]),,, [#include <sys/ptrace.h>])
  566. AC_CHECK_DECLS(m4_normalize([
  567. P_PID,
  568. P_PPID,
  569. P_PGID,
  570. P_SID,
  571. P_CID,
  572. P_UID,
  573. P_GID,
  574. P_ALL,
  575. P_LWPID
  576. ]),,, [#include <sys/wait.h>])
  577. AC_CHECK_DECLS(m4_normalize([
  578. LO_FLAGS_READ_ONLY,
  579. LO_FLAGS_USE_AOPS,
  580. LO_FLAGS_AUTOCLEAR,
  581. LO_FLAGS_PARTSCAN,
  582. LO_FLAGS_DIRECT_IO
  583. ]),,, [#include <linux/loop.h>])
  584. AC_CHECK_DECLS(m4_normalize([
  585. CTL_PROC,
  586. CTL_ARLAN,
  587. CTL_S390DBF,
  588. CTL_SUNRPC,
  589. CTL_PM,
  590. CTL_FRV,
  591. KERN_PRINTK_RATELIMIT,
  592. KERN_PRINTK_RATELIMIT_BURST,
  593. KERN_PTY,
  594. KERN_NGROUPS_MAX,
  595. KERN_SPARC_SCONS_PWROFF,
  596. KERN_HZ_TIMER,
  597. KERN_UNKNOWN_NMI_PANIC,
  598. KERN_BOOTLOADER_TYPE,
  599. KERN_RANDOMIZE,
  600. KERN_SETUID_DUMPABLE,
  601. KERN_SPIN_RETRY,
  602. KERN_ACPI_VIDEO_FLAGS,
  603. KERN_IA64_UNALIGNED,
  604. KERN_COMPAT_LOG,
  605. KERN_MAX_LOCK_DEPTH,
  606. KERN_NMI_WATCHDOG,
  607. KERN_PANIC_ON_NMI,
  608. KERN_PANIC_ON_WARN,
  609. KERN_PANIC_PRINT,
  610. NET_LLC,
  611. NET_NETFILTER,
  612. NET_DCCP,
  613. NET_IRDA,
  614. NET_CORE_DESTROY_DELAY,
  615. NET_CORE_BUDGET,
  616. NET_CORE_AEVENT_ETIME,
  617. NET_CORE_AEVENT_RSEQTH,
  618. NET_CORE_WARNINGS,
  619. NET_IPV4_IGMP_MAX_MSF,
  620. NET_TCP_NO_METRICS_SAVE,
  621. NET_TCP_DEFAULT_WIN_SCALE,
  622. NET_TCP_MODERATE_RCVBUF,
  623. NET_TCP_TSO_WIN_DIVISOR,
  624. NET_TCP_BIC_BETA,
  625. NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
  626. NET_TCP_CONG_CONTROL,
  627. NET_TCP_ABC,
  628. NET_IPV4_IPFRAG_MAX_DIST,
  629. NET_TCP_MTU_PROBING,
  630. NET_TCP_BASE_MSS,
  631. NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
  632. NET_TCP_DMA_COPYBREAK,
  633. NET_TCP_SLOW_START_AFTER_IDLE,
  634. NET_CIPSOV4_CACHE_ENABLE,
  635. NET_CIPSOV4_CACHE_BUCKET_SIZE,
  636. NET_CIPSOV4_RBM_OPTFMT,
  637. NET_CIPSOV4_RBM_STRICTVALID,
  638. NET_TCP_AVAIL_CONG_CONTROL,
  639. NET_TCP_ALLOWED_CONG_CONTROL,
  640. NET_TCP_MAX_SSTHRESH,
  641. NET_TCP_FRTO_RESPONSE,
  642. NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
  643. NET_IPV4_CONF_FORCE_IGMP_VERSION,
  644. NET_IPV4_CONF_ARP_ANNOUNCE,
  645. NET_IPV4_CONF_ARP_IGNORE,
  646. NET_IPV4_CONF_PROMOTE_SECONDARIES,
  647. NET_IPV4_CONF_ARP_ACCEPT,
  648. NET_IPV4_CONF_ARP_NOTIFY,
  649. NET_IPV6_MLD_MAX_MSF,
  650. NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
  651. VM_MAX_MAP_COUNT,
  652. VM_LAPTOP_MODE,
  653. VM_BLOCK_DUMP,
  654. VM_HUGETLB_GROUP,
  655. VM_VFS_CACHE_PRESSURE,
  656. VM_LEGACY_VA_LAYOUT,
  657. VM_SWAP_TOKEN_TIMEOUT
  658. ]),,,
  659. [#include <sys/types.h>
  660. #include <linux/sysctl.h>])
  661. AC_CHECK_DECLS(m4_normalize([
  662. V4L2_FIELD_ANY,
  663. V4L2_FIELD_NONE,
  664. V4L2_FIELD_TOP,
  665. V4L2_FIELD_BOTTOM,
  666. V4L2_FIELD_INTERLACED,
  667. V4L2_FIELD_SEQ_TB,
  668. V4L2_FIELD_SEQ_BT,
  669. V4L2_FIELD_ALTERNATE,
  670. V4L2_FIELD_INTERLACED_TB,
  671. V4L2_FIELD_INTERLACED_BT,
  672. V4L2_BUF_TYPE_VIDEO_CAPTURE,
  673. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
  674. V4L2_BUF_TYPE_VIDEO_OUTPUT,
  675. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
  676. V4L2_BUF_TYPE_VIDEO_OVERLAY,
  677. V4L2_BUF_TYPE_VBI_CAPTURE,
  678. V4L2_BUF_TYPE_VBI_OUTPUT,
  679. V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
  680. V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
  681. V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
  682. V4L2_BUF_TYPE_SDR_CAPTURE,
  683. V4L2_BUF_TYPE_SDR_OUTPUT,
  684. V4L2_TUNER_RADIO,
  685. V4L2_TUNER_ANALOG_TV,
  686. V4L2_TUNER_DIGITAL_TV,
  687. V4L2_MEMORY_MMAP,
  688. V4L2_MEMORY_USERPTR,
  689. V4L2_MEMORY_OVERLAY,
  690. V4L2_MEMORY_DMABUF,
  691. V4L2_COLORSPACE_SMPTE170M,
  692. V4L2_COLORSPACE_SMPTE240M,
  693. V4L2_COLORSPACE_REC709,
  694. V4L2_COLORSPACE_BT878,
  695. V4L2_COLORSPACE_470_SYSTEM_M,
  696. V4L2_COLORSPACE_470_SYSTEM_BG,
  697. V4L2_COLORSPACE_JPEG,
  698. V4L2_COLORSPACE_SRGB,
  699. V4L2_PRIORITY_UNSET,
  700. V4L2_PRIORITY_BACKGROUND,
  701. V4L2_PRIORITY_INTERACTIVE,
  702. V4L2_PRIORITY_RECORD,
  703. V4L2_FRMSIZE_TYPE_DISCRETE,
  704. V4L2_FRMSIZE_TYPE_CONTINUOUS,
  705. V4L2_FRMSIZE_TYPE_STEPWISE,
  706. V4L2_FRMIVAL_TYPE_DISCRETE,
  707. V4L2_FRMIVAL_TYPE_CONTINUOUS,
  708. V4L2_FRMIVAL_TYPE_STEPWISE,
  709. V4L2_CTRL_TYPE_INTEGER,
  710. V4L2_CTRL_TYPE_BOOLEAN,
  711. V4L2_CTRL_TYPE_MENU,
  712. V4L2_CTRL_TYPE_BUTTON,
  713. V4L2_CTRL_TYPE_INTEGER64,
  714. V4L2_CTRL_TYPE_CTRL_CLASS,
  715. V4L2_CTRL_TYPE_STRING,
  716. V4L2_CTRL_TYPE_BITMASK,
  717. V4L2_CTRL_TYPE_INTEGER_MENU,
  718. V4L2_CTRL_TYPE_U8,
  719. V4L2_CTRL_TYPE_U16,
  720. V4L2_CTRL_TYPE_U32,
  721. V4L2_CTRL_TYPE_AREA
  722. ]),,, [#include <sys/time.h>
  723. #include <linux/ioctl.h>
  724. #include <linux/types.h>
  725. #include <linux/videodev2.h>])
  726. AC_CHECK_TYPES(m4_normalize([
  727. struct v4l2_create_buffers,
  728. struct v4l2_frmsizeenum,
  729. struct v4l2_frmivalenum,
  730. struct v4l2_meta_format,
  731. struct v4l2_pix_format_mplane,
  732. struct v4l2_plane_pix_format,
  733. struct v4l2_sdr_format
  734. ]),,, [#include <sys/time.h>
  735. #include <linux/ioctl.h>
  736. #include <linux/types.h>
  737. #include <linux/videodev2.h>])
  738. AC_CHECK_MEMBERS(m4_normalize([
  739. struct v4l2_capability.device_caps,
  740. struct v4l2_ext_control.string,
  741. struct v4l2_format.fmt.pix_mp,
  742. struct v4l2_format.fmt.sdr,
  743. struct v4l2_format.fmt.sliced,
  744. struct v4l2_window.global_alpha,
  745. struct v4l2_sdr_format.buffersize
  746. ]),,, [#include <sys/time.h>
  747. #include <linux/ioctl.h>
  748. #include <linux/types.h>
  749. #include <linux/videodev2.h>])
  750. AC_CHECK_SIZEOF([long])
  751. SIZEOF_LONG="$ac_cv_sizeof_long"
  752. AC_SUBST(SIZEOF_LONG)
  753. AC_CHECK_SIZEOF([long long])
  754. AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
  755. AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
  756. SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
  757. AC_SUBST(SIZEOF_KERNEL_LONG_T)
  758. AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
  759. AC_CHECK_SIZEOF([struct msqid64_ds],,[#include <linux/msg.h>])
  760. AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
  761. [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
  762. $CPP $CPPFLAGS -P -imacros asm/signal.h - |
  763. grep '^[0-9]')"
  764. test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
  765. if test "x$st_cv_SIGRTMIN" != xno; then
  766. AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
  767. [SIGRTMIN defined in <asm/signal.h>])
  768. fi
  769. AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
  770. [st_cv_SA_RESTORER="$(echo SA_RESTORER |
  771. $CPP $CPPFLAGS -P -imacros asm/signal.h - |
  772. grep ^0x)"
  773. test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
  774. if test "x$st_cv_SA_RESTORER" != xno; then
  775. AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
  776. [SA_RESTORER defined in <asm/signal.h>])
  777. fi
  778. AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
  779. [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
  780. [st_cv_have___builtin_popcount=yes],
  781. [st_cv_have___builtin_popcount=no])])
  782. if test "x$st_cv_have___builtin_popcount" = xyes; then
  783. AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
  784. [Define to 1 if the system provides __builtin_popcount function])
  785. fi
  786. AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
  787. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
  788. [[return !*program_invocation_name]])],
  789. [st_cv_have_program_invocation_name=yes],
  790. [st_cv_have_program_invocation_name=no])])
  791. if test "x$st_cv_have_program_invocation_name" = xyes; then
  792. AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
  793. [Define to 1 if the system provides program_invocation_name variable])
  794. fi
  795. AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert],
  796. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]],
  797. [[static_assert(1,"")]]
  798. )
  799. ],
  800. [st_cv_have_static_assert=yes],
  801. [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
  802. [[_Static_assert(1,"")]]
  803. )
  804. ],
  805. [st_cv_have_static_assert=_Static_assert],
  806. [st_cv_have_static_assert=no]
  807. )
  808. ]
  809. )
  810. ]
  811. )
  812. case "x$st_cv_have_static_assert" in
  813. xyes)
  814. AC_DEFINE([HAVE_STATIC_ASSERT], [1],
  815. [Define to 1 if the system provides static_assert])
  816. ;;
  817. x_Static_assert)
  818. AC_DEFINE([HAVE__STATIC_ASSERT], [1],
  819. [Define to 1 if the system provides _Static_assert])
  820. ;;
  821. esac
  822. saved_LIBS="$LIBS"
  823. AC_SEARCH_LIBS([dladdr], [dl])
  824. LIBS="$saved_LIBS"
  825. dl_LIBS=""
  826. if test "$ac_cv_search_dladdr" != no; then
  827. AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
  828. case "$ac_cv_search_dladdr" in
  829. -l*) dl_LIBS="$ac_cv_search_dladdr" ;;
  830. esac
  831. fi
  832. AC_SUBST(dl_LIBS)
  833. saved_LIBS="$LIBS"
  834. AC_SEARCH_LIBS([timer_create], [rt])
  835. LIBS="$saved_LIBS"
  836. case "$ac_cv_search_timer_create" in
  837. no) AC_MSG_FAILURE([failed to find timer_create]) ;;
  838. -l*) timer_LIBS="$ac_cv_search_timer_create" ;;
  839. *) timer_LIBS= ;;
  840. esac
  841. AC_SUBST(timer_LIBS)
  842. saved_LIBS="$LIBS"
  843. AC_SEARCH_LIBS([clock_gettime], [rt])
  844. LIBS="$saved_LIBS"
  845. case "$ac_cv_search_clock_gettime" in
  846. no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
  847. -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
  848. *) clock_LIBS= ;;
  849. esac
  850. AC_SUBST(clock_LIBS)
  851. saved_LIBS="$LIBS"
  852. AC_SEARCH_LIBS([mq_open], [rt])
  853. LIBS="$saved_LIBS"
  854. case "$ac_cv_search_mq_open" in
  855. -l*) mq_LIBS="$ac_cv_search_mq_open" ;;
  856. *) mq_LIBS= ;;
  857. esac
  858. AC_SUBST(mq_LIBS)
  859. AC_CHECK_TOOL([READELF], [readelf])
  860. st_STACKTRACE
  861. if test "$arch" = mips && test "$no_create" != yes; then
  862. mkdir -p linux/mips
  863. if $srcdir/linux/mips/genstub.sh \
  864. $srcdir/linux/mips linux/mips n32 n64 o32 &&
  865. $srcdir/linux/mips/genstub.sh \
  866. $srcdir/linux linux/mips common common-32; then
  867. AC_MSG_RESULT([Generated MIPS syscallent stubs])
  868. else
  869. AC_MSG_ERROR([Failed to generate syscallent stubs])
  870. fi
  871. fi
  872. AC_ARG_ENABLE([mpers],
  873. [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
  874. [whether to enable multiple personalities support required
  875. for proper decoding of structures used by tracees with
  876. personalities that differ from the personality of strace,
  877. default is yes.])],
  878. [case "$enableval" in
  879. yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
  880. *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
  881. Valid options are: yes, no, check, m32, mx32.])
  882. ;;
  883. esac],
  884. [enable_mpers=yes])
  885. AS_IF([test x$arch = xaarch64],
  886. [# So far, only aarch64 needs a separate compiler for its compat
  887. # personality (which is AArch32, that is more or less ARMv7 EABI)
  888. #
  889. # Some heuristics regarding possible compiler name:
  890. # Debian: arm-linux-gnueabi{,hf}-gcc
  891. # SuSE: arm7{,hl}-linux-gnueabi-gcc
  892. # Red Hat: arm-redhat-linux-gnu-gcc
  893. # Fedora: arm-linux-gnu-gcc
  894. # ALT: armh-alt-linux-gnueabi-gcc
  895. m4_foreach([triplet1], [arm, arm7, arm7hl, armh], dnl
  896. [m4_foreach([triplet2], [, $host_vendor-], dnl
  897. [m4_foreach([triplet3], [gnu, gnueabi, gnueabihf], dnl
  898. [m4_foreach([triplet_cc], [gcc, cc], dnl
  899. [m4_append([arm_compat_compilers], dnl
  900. triplet1[-]triplet2[linux-]triplet3[-]triplet_cc)])])])])
  901. AC_CHECK_PROGS(CC_FOR_M32, arm_compat_compilers)
  902. AS_IF([test -n "$CC_FOR_M32"],
  903. [: ${CPP_FOR_M32=$CC_FOR_M32 -E}
  904. : ${CFLAGS_FOR_M32=-std=gnu99}
  905. : ${CPPFLAGS_FOR_M32=}
  906. ])
  907. ])
  908. # Set default compiler variables for personalities.
  909. m4_foreach([pers], [M32, MX32], dnl
  910. [m4_foreach([var], [CC, CPP, CPPFLAGS], dnl
  911. [[: ${]var[_FOR_]pers[=$]var[}]
  912. AC_SUBST(var[_FOR_]pers)]) dnl
  913. m4_foreach([var], [CFLAGS], dnl
  914. [[: ${]var[_FOR_]pers[=][}]
  915. AC_SUBST(var[_FOR_]pers)])])
  916. st_MPERS([m32], [aarch64|powerpc64|s390x|sparc64|tile|x32|x86_64])
  917. st_MPERS([mx32], [x86_64])
  918. AX_VALGRIND_DFLT([sgcheck], [off])
  919. AX_VALGRIND_CHECK
  920. AC_CONFIG_FILES([Makefile
  921. tests/Makefile
  922. tests-m32/Makefile
  923. tests-mx32/Makefile
  924. strace.1
  925. strace-log-merge.1
  926. strace.spec
  927. debian/changelog])
  928. AC_OUTPUT