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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  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. gcov.h
  358. iconv.h
  359. inttypes.h
  360. linux/bsg.h
  361. linux/cryptouser.h
  362. linux/dm-ioctl.h
  363. linux/dqblk_xfs.h
  364. linux/falloc.h
  365. linux/fib_rules.h
  366. linux/fiemap.h
  367. linux/hiddev.h
  368. linux/if_addr.h
  369. linux/if_link.h
  370. linux/io_uring.h
  371. linux/ip_vs.h
  372. linux/ipc.h
  373. linux/kcmp.h
  374. linux/kvm.h
  375. linux/memfd.h
  376. linux/mmtimer.h
  377. linux/mount.h
  378. linux/msg.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/perf_event.h
  392. linux/quota.h
  393. linux/sched.h
  394. linux/seccomp.h
  395. linux/securebits.h
  396. linux/sem.h
  397. linux/shm.h
  398. linux/userfaultfd.h
  399. linux/utsname.h
  400. mqueue.h
  401. netinet/sctp.h
  402. netipx/ipx.h
  403. paths.h
  404. scsi/sg.h
  405. stropts.h
  406. sys/conf.h
  407. sys/eventfd.h
  408. sys/fanotify.h
  409. sys/ipc.h
  410. sys/msg.h
  411. sys/quota.h
  412. sys/sem.h
  413. sys/shm.h
  414. sys/signalfd.h
  415. sys/xattr.h
  416. ustat.h
  417. ]))
  418. AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
  419. AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
  420. AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
  421. AC_CHECK_HEADERS([linux/netfilter/xt_osf.h],,, [#include <linux/ip.h>
  422. #include <linux/tcp.h>])
  423. AC_CHECK_HEADERS(m4_normalize([
  424. linux/netfilter_arp/arp_tables.h
  425. linux/netfilter_bridge/ebtables.h
  426. linux/netfilter_ipv4/ip_tables.h
  427. linux/netfilter_ipv6/ip6_tables.h
  428. ]),,, [#include <netinet/in.h>
  429. #include <net/if.h>])
  430. AC_CHECK_HEADERS([linux/input.h], [
  431. AC_CHECK_TYPES(m4_normalize([
  432. struct input_keymap_entry,
  433. struct input_mask
  434. ]),,, [#include <linux/input.h>])
  435. AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
  436. ])
  437. AC_CHECK_HEADERS([linux/bpf.h], [
  438. AC_CHECK_TYPES(m4_normalize([
  439. struct bpf_insn,
  440. struct bpf_map_info,
  441. struct bpf_prog_info
  442. ]),,, [#include <linux/bpf.h>])
  443. st_BPF_ATTR
  444. ])
  445. AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
  446. AC_CHECK_MEMBERS([struct sockaddr_hci.hci_channel],,,
  447. [#include <bluetooth/bluetooth.h>
  448. #include <bluetooth/hci.h>])
  449. AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
  450. [#include <bluetooth/bluetooth.h>
  451. #include <bluetooth/l2cap.h>])
  452. ])
  453. AC_CHECK_TYPES(m4_normalize([
  454. struct br_mdb_entry,
  455. struct br_port_msg
  456. ]),,, [#include <linux/if_bridge.h>])
  457. AC_CHECK_MEMBERS(m4_normalize([
  458. struct br_mdb_entry.flags,
  459. struct br_mdb_entry.vid
  460. ]),,, [#include <linux/if_bridge.h>])
  461. AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
  462. AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
  463. AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
  464. AC_CHECK_TYPES(m4_normalize([
  465. struct rta_mfc_stats,
  466. struct rtvia
  467. ]),,, [#include <sys/socket.h>
  468. #include <linux/rtnetlink.h>])
  469. AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
  470. AC_CHECK_TYPES(m4_normalize([
  471. struct ndt_config,
  472. struct ndt_stats
  473. ]),,, [#include <linux/neighbour.h>])
  474. AC_CHECK_TYPES(m4_normalize([
  475. struct ifla_bridge_id,
  476. struct ifla_cacheinfo,
  477. struct ifla_port_vsi,
  478. struct rtnl_link_stats64
  479. ]),,, [#include <sys/socket.h>
  480. #include <linux/rtnetlink.h>])
  481. AC_CHECK_MEMBERS(m4_normalize([
  482. struct rtnl_link_stats.rx_nohandler,
  483. struct rtnl_link_stats64.rx_nohandler
  484. ]),,, [#include <sys/socket.h>
  485. #include <linux/rtnetlink.h>])
  486. AC_CHECK_DECLS(m4_normalize([
  487. IFLA_PORT_SELF,
  488. IFLA_PROTINFO,
  489. IFLA_AF_SPEC,
  490. IFLA_XDP
  491. ]),,, [#include <sys/socket.h>
  492. #include <linux/rtnetlink.h>])
  493. AC_CHECK_TYPES(m4_normalize([
  494. struct gnet_stats_basic,
  495. struct gnet_stats_queue,
  496. struct gnet_stats_rate_est,
  497. struct gnet_stats_rate_est64
  498. ]),,, [#include <linux/gen_stats.h>])
  499. AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/types.h>
  500. #include <linux/pkt_sched.h>])
  501. AC_CHECK_DECLS([TCA_STAB_DATA],,, [#include <linux/types.h>
  502. #include <linux/pkt_sched.h>])
  503. AC_CHECK_TYPES(m4_normalize([
  504. struct fib_rule_uid_range,
  505. struct fib_rule_port_range
  506. ]),,, [#include <linux/fib_rules.h>])
  507. AC_CHECK_TYPES([struct statfs], [
  508. AC_CHECK_MEMBERS(m4_normalize([
  509. struct statfs.f_frsize,
  510. struct statfs.f_flags,
  511. struct statfs.f_fsid.val,
  512. struct statfs.f_fsid.__val
  513. ]),,, [#include <linux/types.h>
  514. #include <asm/statfs.h>])
  515. ],, [#include <linux/types.h>
  516. #include <asm/statfs.h>])
  517. AC_CHECK_TYPES([struct statfs64], [
  518. AC_CHECK_MEMBERS(m4_normalize([
  519. struct statfs64.f_frsize,
  520. struct statfs64.f_flags,
  521. struct statfs64.f_fsid.val,
  522. struct statfs64.f_fsid.__val
  523. ]),,, [#include <linux/types.h>
  524. #include <asm/statfs.h>])
  525. ],, [#include <linux/types.h>
  526. #include <asm/statfs.h>])
  527. AC_CHECK_TYPES([struct statx],,, [#include <linux/types.h>
  528. #include <linux/stat.h>])
  529. AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
  530. AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
  531. AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
  532. AC_CHECK_TYPES(m4_normalize([
  533. struct ptp_sys_offset
  534. ]),,, [#include <linux/ptp_clock.h>])
  535. AC_CHECK_TYPES(m4_normalize([
  536. struct kvm_cpuid2,
  537. struct kvm_regs,
  538. struct kvm_sregs,
  539. struct kvm_userspace_memory_region
  540. ]),,, [#include <linux/kvm.h>])
  541. saved_CPPFLAGS="$CPPFLAGS"
  542. AC_CACHE_CHECK([whether <linux/signal.h> can be used along with <signal.h>],
  543. [st_cv_linux_signal],
  544. [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  545. #include <signal.h>
  546. #include <linux/signal.h>]],[])],
  547. [st_cv_linux_signal=yes],
  548. [st_cv_linux_signal=no])])
  549. if test "x$st_cv_linux_signal" = xno; then
  550. mkdir -p linux/linux
  551. cp $srcdir/linux/signal.h.in linux/linux/signal.h
  552. CPPFLAGS="$CPPFLAGS -Ilinux"
  553. fi
  554. AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
  555. AC_CHECK_MEMBERS(m4_normalize([
  556. struct iocb.aio_flags,
  557. struct iocb.aio_rw_flags
  558. ]),,, [#include <linux/aio_abi.h>])
  559. AC_CHECK_TYPES([struct clone_args],,, [#include <linux/sched.h>])
  560. CPPFLAGS="$saved_CPPFLAGS"
  561. AC_CHECK_HEADERS([linux/btrfs.h], [
  562. AC_CHECK_MEMBERS(m4_normalize([
  563. struct btrfs_ioctl_feature_flags.compat_flags,
  564. struct btrfs_ioctl_fs_info_args.nodesize,
  565. struct btrfs_ioctl_defrag_range_args.start,
  566. struct btrfs_ioctl_search_args_v2.buf_size,
  567. struct btrfs_ioctl_logical_ino_args.flags
  568. ]),,, [ #include <stdio.h>
  569. #include <linux/btrfs.h>])
  570. AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
  571. BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
  572. #include <linux/btrfs.h>])])
  573. AC_CHECK_DECLS([sys_errlist])
  574. AC_CHECK_DECLS(m4_normalize([
  575. PTRACE_PEEKUSER,
  576. PTRACE_POKEUSER
  577. ]),,, [#include <sys/ptrace.h>])
  578. AC_CHECK_DECLS(m4_normalize([
  579. P_PID,
  580. P_PPID,
  581. P_PGID,
  582. P_SID,
  583. P_CID,
  584. P_UID,
  585. P_GID,
  586. P_ALL,
  587. P_LWPID
  588. ]),,, [#include <sys/wait.h>])
  589. AC_CHECK_DECLS(m4_normalize([
  590. LO_FLAGS_READ_ONLY,
  591. LO_FLAGS_USE_AOPS,
  592. LO_FLAGS_AUTOCLEAR,
  593. LO_FLAGS_PARTSCAN,
  594. LO_FLAGS_DIRECT_IO
  595. ]),,, [#include <linux/loop.h>])
  596. AC_CHECK_DECLS(m4_normalize([
  597. CTL_PROC,
  598. CTL_ARLAN,
  599. CTL_S390DBF,
  600. CTL_SUNRPC,
  601. CTL_PM,
  602. CTL_FRV,
  603. KERN_PRINTK_RATELIMIT,
  604. KERN_PRINTK_RATELIMIT_BURST,
  605. KERN_PTY,
  606. KERN_NGROUPS_MAX,
  607. KERN_SPARC_SCONS_PWROFF,
  608. KERN_HZ_TIMER,
  609. KERN_UNKNOWN_NMI_PANIC,
  610. KERN_BOOTLOADER_TYPE,
  611. KERN_RANDOMIZE,
  612. KERN_SETUID_DUMPABLE,
  613. KERN_SPIN_RETRY,
  614. KERN_ACPI_VIDEO_FLAGS,
  615. KERN_IA64_UNALIGNED,
  616. KERN_COMPAT_LOG,
  617. KERN_MAX_LOCK_DEPTH,
  618. KERN_NMI_WATCHDOG,
  619. KERN_PANIC_ON_NMI,
  620. KERN_PANIC_ON_WARN,
  621. KERN_PANIC_PRINT,
  622. NET_LLC,
  623. NET_NETFILTER,
  624. NET_DCCP,
  625. NET_IRDA,
  626. NET_CORE_DESTROY_DELAY,
  627. NET_CORE_BUDGET,
  628. NET_CORE_AEVENT_ETIME,
  629. NET_CORE_AEVENT_RSEQTH,
  630. NET_CORE_WARNINGS,
  631. NET_IPV4_IGMP_MAX_MSF,
  632. NET_TCP_NO_METRICS_SAVE,
  633. NET_TCP_DEFAULT_WIN_SCALE,
  634. NET_TCP_MODERATE_RCVBUF,
  635. NET_TCP_TSO_WIN_DIVISOR,
  636. NET_TCP_BIC_BETA,
  637. NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
  638. NET_TCP_CONG_CONTROL,
  639. NET_TCP_ABC,
  640. NET_IPV4_IPFRAG_MAX_DIST,
  641. NET_TCP_MTU_PROBING,
  642. NET_TCP_BASE_MSS,
  643. NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
  644. NET_TCP_DMA_COPYBREAK,
  645. NET_TCP_SLOW_START_AFTER_IDLE,
  646. NET_CIPSOV4_CACHE_ENABLE,
  647. NET_CIPSOV4_CACHE_BUCKET_SIZE,
  648. NET_CIPSOV4_RBM_OPTFMT,
  649. NET_CIPSOV4_RBM_STRICTVALID,
  650. NET_TCP_AVAIL_CONG_CONTROL,
  651. NET_TCP_ALLOWED_CONG_CONTROL,
  652. NET_TCP_MAX_SSTHRESH,
  653. NET_TCP_FRTO_RESPONSE,
  654. NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
  655. NET_IPV4_CONF_FORCE_IGMP_VERSION,
  656. NET_IPV4_CONF_ARP_ANNOUNCE,
  657. NET_IPV4_CONF_ARP_IGNORE,
  658. NET_IPV4_CONF_PROMOTE_SECONDARIES,
  659. NET_IPV4_CONF_ARP_ACCEPT,
  660. NET_IPV4_CONF_ARP_NOTIFY,
  661. NET_IPV6_MLD_MAX_MSF,
  662. NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
  663. VM_MAX_MAP_COUNT,
  664. VM_LAPTOP_MODE,
  665. VM_BLOCK_DUMP,
  666. VM_HUGETLB_GROUP,
  667. VM_VFS_CACHE_PRESSURE,
  668. VM_LEGACY_VA_LAYOUT,
  669. VM_SWAP_TOKEN_TIMEOUT
  670. ]),,,
  671. [#include <sys/types.h>
  672. #include <linux/sysctl.h>])
  673. AC_CHECK_DECLS(m4_normalize([
  674. V4L2_FIELD_ANY,
  675. V4L2_FIELD_NONE,
  676. V4L2_FIELD_TOP,
  677. V4L2_FIELD_BOTTOM,
  678. V4L2_FIELD_INTERLACED,
  679. V4L2_FIELD_SEQ_TB,
  680. V4L2_FIELD_SEQ_BT,
  681. V4L2_FIELD_ALTERNATE,
  682. V4L2_FIELD_INTERLACED_TB,
  683. V4L2_FIELD_INTERLACED_BT,
  684. V4L2_BUF_TYPE_VIDEO_CAPTURE,
  685. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
  686. V4L2_BUF_TYPE_VIDEO_OUTPUT,
  687. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
  688. V4L2_BUF_TYPE_VIDEO_OVERLAY,
  689. V4L2_BUF_TYPE_VBI_CAPTURE,
  690. V4L2_BUF_TYPE_VBI_OUTPUT,
  691. V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
  692. V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
  693. V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
  694. V4L2_BUF_TYPE_SDR_CAPTURE,
  695. V4L2_BUF_TYPE_SDR_OUTPUT,
  696. V4L2_TUNER_RADIO,
  697. V4L2_TUNER_ANALOG_TV,
  698. V4L2_TUNER_DIGITAL_TV,
  699. V4L2_MEMORY_MMAP,
  700. V4L2_MEMORY_USERPTR,
  701. V4L2_MEMORY_OVERLAY,
  702. V4L2_MEMORY_DMABUF,
  703. V4L2_COLORSPACE_SMPTE170M,
  704. V4L2_COLORSPACE_SMPTE240M,
  705. V4L2_COLORSPACE_REC709,
  706. V4L2_COLORSPACE_BT878,
  707. V4L2_COLORSPACE_470_SYSTEM_M,
  708. V4L2_COLORSPACE_470_SYSTEM_BG,
  709. V4L2_COLORSPACE_JPEG,
  710. V4L2_COLORSPACE_SRGB,
  711. V4L2_PRIORITY_UNSET,
  712. V4L2_PRIORITY_BACKGROUND,
  713. V4L2_PRIORITY_INTERACTIVE,
  714. V4L2_PRIORITY_RECORD,
  715. V4L2_FRMSIZE_TYPE_DISCRETE,
  716. V4L2_FRMSIZE_TYPE_CONTINUOUS,
  717. V4L2_FRMSIZE_TYPE_STEPWISE,
  718. V4L2_FRMIVAL_TYPE_DISCRETE,
  719. V4L2_FRMIVAL_TYPE_CONTINUOUS,
  720. V4L2_FRMIVAL_TYPE_STEPWISE,
  721. V4L2_CTRL_TYPE_INTEGER,
  722. V4L2_CTRL_TYPE_BOOLEAN,
  723. V4L2_CTRL_TYPE_MENU,
  724. V4L2_CTRL_TYPE_BUTTON,
  725. V4L2_CTRL_TYPE_INTEGER64,
  726. V4L2_CTRL_TYPE_CTRL_CLASS,
  727. V4L2_CTRL_TYPE_STRING,
  728. V4L2_CTRL_TYPE_BITMASK,
  729. V4L2_CTRL_TYPE_INTEGER_MENU
  730. ]),,, [#include <sys/time.h>
  731. #include <linux/ioctl.h>
  732. #include <linux/types.h>
  733. #include <linux/videodev2.h>])
  734. AC_CHECK_MEMBERS(m4_normalize([
  735. struct v4l2_capability.device_caps,
  736. struct v4l2_ext_control.string,
  737. struct v4l2_format.fmt.pix_mp,
  738. struct v4l2_format.fmt.sdr,
  739. struct v4l2_format.fmt.sliced,
  740. struct v4l2_window.global_alpha,
  741. struct v4l2_sdr_format.buffersize
  742. ]),,, [#include <sys/time.h>
  743. #include <linux/ioctl.h>
  744. #include <linux/types.h>
  745. #include <linux/videodev2.h>])
  746. AC_CHECK_SIZEOF([long])
  747. SIZEOF_LONG="$ac_cv_sizeof_long"
  748. AC_SUBST(SIZEOF_LONG)
  749. AC_CHECK_SIZEOF([long long])
  750. AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
  751. AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
  752. SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
  753. AC_SUBST(SIZEOF_KERNEL_LONG_T)
  754. AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
  755. AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
  756. [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
  757. $CPP $CPPFLAGS -P -imacros asm/signal.h - |
  758. grep '^[0-9]')"
  759. test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
  760. if test "x$st_cv_SIGRTMIN" != xno; then
  761. AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
  762. [SIGRTMIN defined in <asm/signal.h>])
  763. fi
  764. AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
  765. [st_cv_SA_RESTORER="$(echo SA_RESTORER |
  766. $CPP $CPPFLAGS -P -imacros asm/signal.h - |
  767. grep ^0x)"
  768. test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
  769. if test "x$st_cv_SA_RESTORER" != xno; then
  770. AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
  771. [SA_RESTORER defined in <asm/signal.h>])
  772. fi
  773. AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
  774. [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
  775. [st_cv_have___builtin_popcount=yes],
  776. [st_cv_have___builtin_popcount=no])])
  777. if test "x$st_cv_have___builtin_popcount" = xyes; then
  778. AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
  779. [Define to 1 if the system provides __builtin_popcount function])
  780. fi
  781. AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
  782. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
  783. [[return !*program_invocation_name]])],
  784. [st_cv_have_program_invocation_name=yes],
  785. [st_cv_have_program_invocation_name=no])])
  786. if test "x$st_cv_have_program_invocation_name" = xyes; then
  787. AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
  788. [Define to 1 if the system provides program_invocation_name variable])
  789. fi
  790. AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert],
  791. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]],
  792. [[static_assert(1,"")]]
  793. )
  794. ],
  795. [st_cv_have_static_assert=yes],
  796. [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
  797. [[_Static_assert(1,"")]]
  798. )
  799. ],
  800. [st_cv_have_static_assert=_Static_assert],
  801. [st_cv_have_static_assert=no]
  802. )
  803. ]
  804. )
  805. ]
  806. )
  807. case "x$st_cv_have_static_assert" in
  808. xyes)
  809. AC_DEFINE([HAVE_STATIC_ASSERT], [1],
  810. [Define to 1 if the system provides static_assert])
  811. ;;
  812. x_Static_assert)
  813. AC_DEFINE([HAVE__STATIC_ASSERT], [1],
  814. [Define to 1 if the system provides _Static_assert])
  815. ;;
  816. esac
  817. AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
  818. if test "x$ac_cv_lib_dl_dladdr" = xyes; then
  819. AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
  820. fi
  821. AC_SUBST(dl_LIBS)
  822. saved_LIBS="$LIBS"
  823. AC_SEARCH_LIBS([timer_create], [rt])
  824. LIBS="$saved_LIBS"
  825. case "$ac_cv_search_timer_create" in
  826. no) AC_MSG_FAILURE([failed to find timer_create]) ;;
  827. -l*) timer_LIBS="$ac_cv_search_timer_create" ;;
  828. *) timer_LIBS= ;;
  829. esac
  830. AC_SUBST(timer_LIBS)
  831. saved_LIBS="$LIBS"
  832. AC_SEARCH_LIBS([clock_gettime], [rt])
  833. LIBS="$saved_LIBS"
  834. case "$ac_cv_search_clock_gettime" in
  835. no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
  836. -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
  837. *) clock_LIBS= ;;
  838. esac
  839. AC_SUBST(clock_LIBS)
  840. saved_LIBS="$LIBS"
  841. AC_SEARCH_LIBS([mq_open], [rt])
  842. LIBS="$saved_LIBS"
  843. case "$ac_cv_search_mq_open" in
  844. -l*) mq_LIBS="$ac_cv_search_mq_open" ;;
  845. *) mq_LIBS= ;;
  846. esac
  847. AC_SUBST(mq_LIBS)
  848. AC_PATH_PROG([PERL], [perl])
  849. AC_CHECK_TOOL([READELF], [readelf])
  850. st_STACKTRACE
  851. if test "$arch" = mips && test "$no_create" != yes; then
  852. mkdir -p linux/mips
  853. if $srcdir/linux/mips/genstub.sh \
  854. $srcdir/linux/mips linux/mips n32 n64 o32 &&
  855. $srcdir/linux/mips/genstub.sh \
  856. $srcdir/linux linux/mips common common-32; then
  857. AC_MSG_RESULT([Generated MIPS syscallent stubs])
  858. else
  859. AC_MSG_ERROR([Failed to generate syscallent stubs])
  860. fi
  861. fi
  862. AC_ARG_ENABLE([mpers],
  863. [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
  864. [whether to enable multiple personalities support required
  865. for proper decoding of structures used by tracees with
  866. personalities that differ from the personality of strace,
  867. default is yes.])],
  868. [case "$enableval" in
  869. yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
  870. *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
  871. Valid options are: yes, no, check, m32, mx32.])
  872. ;;
  873. esac],
  874. [enable_mpers=yes])
  875. st_MPERS([m32], [aarch64|powerpc64|s390x|sparc64|tile|x32|x86_64])
  876. st_MPERS([mx32], [x86_64])
  877. AX_VALGRIND_DFLT([sgcheck], [off])
  878. AX_VALGRIND_CHECK
  879. AC_CONFIG_FILES([Makefile
  880. tests/Makefile
  881. tests-m32/Makefile
  882. tests-mx32/Makefile
  883. strace.1
  884. strace-log-merge.1
  885. strace.spec
  886. debian/changelog])
  887. AC_OUTPUT