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 25KB

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