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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  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-2018 The strace developers.
  9. # All rights reserved.
  10. #
  11. # Redistribution and use in source and binary forms, with or without
  12. # modification, are permitted provided that the following conditions
  13. # are met:
  14. # 1. Redistributions of source code must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. # 2. Redistributions in binary form must reproduce the above copyright
  17. # notice, this list of conditions and the following disclaimer in the
  18. # documentation and/or other materials provided with the distribution.
  19. # 3. The name of the author may not be used to endorse or promote products
  20. # derived from this software without specific prior written permission.
  21. #
  22. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  23. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  24. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  25. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  27. # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  31. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. AC_PREREQ(2.57)
  33. AC_INIT([strace],
  34. m4_esyscmd([./git-version-gen .tarball-version]),
  35. [strace-devel@lists.strace.io],
  36. [strace],
  37. [https://strace.io])
  38. m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year]))
  39. m4_define([manpage_date], m4_esyscmd([./file-date-gen strace.1.in]))
  40. AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
  41. AC_CONFIG_SRCDIR([strace.c])
  42. AC_CONFIG_AUX_DIR([.])
  43. AC_CONFIG_HEADERS([config.h])
  44. AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13])
  45. AM_MAINTAINER_MODE
  46. AC_CANONICAL_HOST
  47. RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')"
  48. AC_SUBST(RPM_CHANGELOGTIME)
  49. DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)"
  50. AC_SUBST(DEB_CHANGELOGTIME)
  51. AC_PROG_CC
  52. AC_PROG_CC_STDC
  53. AC_PROG_CPP
  54. st_WARN_CFLAGS
  55. AX_PROG_CC_FOR_BUILD
  56. AC_PROG_INSTALL
  57. AC_PROG_RANLIB
  58. AC_USE_SYSTEM_EXTENSIONS
  59. AX_CODE_COVERAGE
  60. AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.])
  61. AC_SUBST([COPYRIGHT_YEAR], [copyright_year])
  62. AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
  63. AC_SUBST([MANPAGE_DATE], [manpage_date])
  64. AC_MSG_CHECKING([for supported architecture])
  65. arch_m32=
  66. arch_mx32=
  67. cc_flags_m32=-m32
  68. cc_flags_mx32=-mx32
  69. case "$host_cpu" in
  70. aarch64*)
  71. arch=aarch64
  72. arch_m32=arm
  73. AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
  74. ;;
  75. alpha*)
  76. arch=alpha
  77. AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
  78. ;;
  79. arc*)
  80. arch=arc
  81. AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
  82. ;;
  83. arm*)
  84. arch=arm
  85. AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
  86. ;;
  87. avr32*)
  88. arch=avr32
  89. AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
  90. ;;
  91. bfin)
  92. arch=bfin
  93. AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
  94. ;;
  95. hppa*|parisc*)
  96. arch=hppa
  97. AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  98. ;;
  99. i[[3456]]86|pentium)
  100. arch=i386
  101. AC_DEFINE([I386], 1, [Define for the i386 architecture.])
  102. ;;
  103. ia64)
  104. arch=ia64
  105. AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
  106. ;;
  107. m68k)
  108. arch=m68k
  109. AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
  110. ;;
  111. metag*)
  112. arch=metag
  113. AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
  114. ;;
  115. microblaze*)
  116. arch=microblaze
  117. AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
  118. ;;
  119. mips*)
  120. arch=mips
  121. AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
  122. ;;
  123. nios2*)
  124. arch=nios2
  125. AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
  126. ;;
  127. or1k*)
  128. arch=or1k
  129. AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
  130. ;;
  131. powerpc*)
  132. AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
  133. AC_TRY_COMPILE(
  134. [#ifndef __LP64__
  135. # error 32 bit
  136. #endif], [], arch=powerpc64, arch=powerpc)
  137. if test "$arch" = "powerpc64"; then
  138. arch_m32=powerpc
  139. AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
  140. fi
  141. ;;
  142. riscv*)
  143. arch=riscv
  144. AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
  145. ;;
  146. s390)
  147. arch=s390
  148. AC_DEFINE([S390], 1, [Define for the S390 architecture.])
  149. ;;
  150. s390x)
  151. arch=s390x
  152. arch_m32=s390
  153. cc_flags_m32=-m31
  154. AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
  155. ;;
  156. sh64*)
  157. arch=sh64
  158. AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  159. ;;
  160. sh*)
  161. arch=sh
  162. AC_DEFINE([SH], 1, [Define for the SH architecture.])
  163. ;;
  164. sparc64*)
  165. arch=sparc64
  166. arch_m32=sparc
  167. AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
  168. ;;
  169. sparc*)
  170. arch=sparc
  171. AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
  172. ;;
  173. tile*)
  174. arch=tile
  175. AC_DEFINE([TILE], 1, [Define for the Tile architecture])
  176. ;;
  177. x86?64*)
  178. arch_m32=i386
  179. AC_TRY_COMPILE(
  180. [#ifndef __ILP32__
  181. # error not x32
  182. #endif], [], arch=x32, arch=x86_64)
  183. if test "$arch" = "x86_64"; then
  184. arch_mx32=x32
  185. AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
  186. else
  187. AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
  188. fi
  189. ;;
  190. xtensa*)
  191. arch=xtensa
  192. AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
  193. ;;
  194. *)
  195. AC_MSG_RESULT([NO!])
  196. AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
  197. ;;
  198. esac
  199. AC_MSG_RESULT($arch)
  200. arch_native=$arch
  201. test -n "$arch_m32" ||
  202. arch_m32=$arch
  203. test -n "$arch_mx32" ||
  204. arch_mx32=$arch
  205. AC_SUBST(arch)
  206. AC_SUBST(arch_m32)
  207. AC_SUBST(arch_mx32)
  208. AC_SUBST(cc_flags_m32)
  209. AC_SUBST(cc_flags_mx32)
  210. AC_SUBST(arch_native)
  211. MIPS_ABI=
  212. if test "$arch" = mips; then
  213. AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
  214. [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
  215. [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
  216. # requires GCC >= 3.4
  217. AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
  218. [AC_COMPILE_IFELSE(
  219. [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])],
  220. [st_cv_mips_abi=o32],
  221. [AC_COMPILE_IFELSE(
  222. [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])],
  223. [st_cv_mips_abi=n32],
  224. [AC_COMPILE_IFELSE(
  225. [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])],
  226. [st_cv_mips_abi=n64],
  227. [st_cv_mips_abi=unknown])])])])
  228. case "$st_cv_mips_abi" in
  229. o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);;
  230. n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);;
  231. n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);;
  232. *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
  233. esac
  234. MIPS_ABI="$st_cv_mips_abi"
  235. fi
  236. AC_SUBST(MIPS_ABI)
  237. AC_ARG_ENABLE([arm-oabi],
  238. [AS_HELP_STRING([--enable-arm-oabi],
  239. [enable OABI support on ARM EABI])],
  240. [], [enable_arm_oabi=no])
  241. case "$enable_arm_oabi" in
  242. yes) enable_arm_oabi=1 ;;
  243. no) enable_arm_oabi=0 ;;
  244. *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
  245. esac
  246. AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
  247. [Define to 1 if you want OABI support on ARM EABI.])
  248. AC_C_BIGENDIAN
  249. AC_C_TYPEOF
  250. AC_TYPE_UID_T
  251. AC_CHECK_FUNCS(m4_normalize([
  252. accept4
  253. be64toh
  254. fallocate
  255. fanotify_mark
  256. fopen64
  257. fork
  258. fputs_unlocked
  259. fstatat
  260. ftruncate
  261. futimens
  262. iconv_open
  263. if_indextoname
  264. open64
  265. prctl
  266. preadv
  267. process_vm_readv
  268. pwritev
  269. readahead
  270. signalfd
  271. stpcpy
  272. strerror
  273. strndup
  274. strsignal
  275. sync_file_range
  276. utimensat
  277. ]))
  278. AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
  279. AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
  280. AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
  281. [#include <asm/posix_types.h>])
  282. AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
  283. [#include <sys/types.h>
  284. #include <asm/stat.h>])
  285. AC_CHECK_TYPES([struct user_desc],
  286. [AC_CHECK_MEMBERS([struct user_desc.lm],,,
  287. [#include <asm/ldt.h>])],,
  288. [#include <asm/ldt.h>])
  289. AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
  290. [#include <sys/types.h>
  291. #include <asm/stat.h>])
  292. AC_CHECK_TYPES(m4_normalize([
  293. struct pt_all_user_regs,
  294. struct ia64_fpreg,
  295. struct ptrace_peeksiginfo_args
  296. ]),,, [#include <sys/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_report_aead,
  309. struct crypto_report_blkcipher,
  310. struct crypto_report_cipher,
  311. struct crypto_report_hash,
  312. struct crypto_report_rng
  313. ]),,, [#include <linux/cryptouser.h>])
  314. AC_CHECK_TYPES(m4_normalize([
  315. struct kcmp_epoll_slot
  316. ]),,, [#include <linux/kcmp.h>])
  317. AC_CHECK_TYPES(m4_normalize([
  318. struct keyctl_kdf_params
  319. ]),,, [#include <linux/keyctl.h>])
  320. AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
  321. AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
  322. AC_CHECK_MEMBERS(m4_normalize([
  323. siginfo_t.si_syscall,
  324. siginfo_t.si_timerid,
  325. siginfo_t.si_overrun
  326. ]),,, [#include <signal.h>])
  327. AC_CHECK_MEMBERS(m4_normalize([
  328. struct perf_event_attr.precise_ip,
  329. struct perf_event_attr.mmap_data,
  330. struct perf_event_attr.sample_id_all,
  331. struct perf_event_attr.exclude_host,
  332. struct perf_event_attr.exclude_guest,
  333. struct perf_event_attr.exclude_callchain_kernel,
  334. struct perf_event_attr.exclude_callchain_user,
  335. struct perf_event_attr.mmap2,
  336. struct perf_event_attr.comm_exec,
  337. struct perf_event_attr.use_clockid,
  338. struct perf_event_attr.context_switch,
  339. struct perf_event_attr.write_backward,
  340. struct perf_event_attr.namespaces,
  341. struct perf_event_attr.bp_type,
  342. struct perf_event_attr.config1,
  343. struct perf_event_attr.config2,
  344. struct perf_event_attr.branch_sample_type,
  345. struct perf_event_attr.sample_regs_user,
  346. struct perf_event_attr.sample_stack_user,
  347. struct perf_event_attr.sample_regs_intr,
  348. struct perf_event_attr.aux_watermark,
  349. struct perf_event_attr.sample_max_stack
  350. ]),,, [#include <linux/perf_event.h>])
  351. AC_CHECK_HEADERS(m4_normalize([
  352. asm/cachectl.h
  353. asm/guarded_storage.h
  354. asm/sysmips.h
  355. elf.h
  356. iconv.h
  357. inttypes.h
  358. linux/bsg.h
  359. linux/cryptouser.h
  360. linux/dm-ioctl.h
  361. linux/dqblk_xfs.h
  362. linux/falloc.h
  363. linux/fib_rules.h
  364. linux/fiemap.h
  365. linux/genetlink.h
  366. linux/hiddev.h
  367. linux/if_addr.h
  368. linux/if_link.h
  369. linux/ip_vs.h
  370. linux/ipc.h
  371. linux/kcmp.h
  372. linux/kvm.h
  373. linux/memfd.h
  374. linux/mmtimer.h
  375. linux/msg.h
  376. linux/neighbour.h
  377. linux/netfilter/ipset/ip_set.h
  378. linux/netfilter/nf_tables.h
  379. linux/netfilter/nf_tables_compat.h
  380. linux/netfilter/nfnetlink.h
  381. linux/netfilter/nfnetlink_acct.h
  382. linux/netfilter/nfnetlink_conntrack.h
  383. linux/netfilter/nfnetlink_cthelper.h
  384. linux/netfilter/nfnetlink_cttimeout.h
  385. linux/netfilter/nfnetlink_log.h
  386. linux/netfilter/nfnetlink_queue.h
  387. linux/nsfs.h
  388. linux/perf_event.h
  389. linux/quota.h
  390. linux/seccomp.h
  391. linux/securebits.h
  392. linux/sem.h
  393. linux/shm.h
  394. linux/userfaultfd.h
  395. linux/utsname.h
  396. mqueue.h
  397. netinet/sctp.h
  398. netipx/ipx.h
  399. paths.h
  400. scsi/sg.h
  401. stropts.h
  402. sys/conf.h
  403. sys/eventfd.h
  404. sys/fanotify.h
  405. sys/ipc.h
  406. sys/msg.h
  407. sys/quota.h
  408. sys/sem.h
  409. sys/shm.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/input.h], [
  427. AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
  428. ])
  429. AC_CHECK_HEADERS([linux/bpf.h], [
  430. AC_CHECK_TYPES(m4_normalize([
  431. struct bpf_insn,
  432. struct bpf_map_info,
  433. struct bpf_prog_info
  434. ]),,, [#include <linux/bpf.h>])
  435. st_BPF_ATTR
  436. ])
  437. AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
  438. AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
  439. [#include <bluetooth/bluetooth.h>
  440. #include <bluetooth/l2cap.h>])
  441. ])
  442. AC_CHECK_TYPES(m4_normalize([
  443. struct br_mdb_entry,
  444. struct br_port_msg
  445. ]),,, [#include <linux/if_bridge.h>])
  446. AC_CHECK_MEMBERS(m4_normalize([
  447. struct br_mdb_entry.flags,
  448. struct br_mdb_entry.vid
  449. ]),,, [#include <linux/if_bridge.h>])
  450. AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
  451. AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
  452. AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
  453. AC_CHECK_TYPES(m4_normalize([
  454. struct rta_mfc_stats,
  455. struct rtvia
  456. ]),,, [#include <sys/socket.h>
  457. #include <linux/rtnetlink.h>])
  458. AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
  459. AC_CHECK_TYPES(m4_normalize([
  460. struct ndt_config,
  461. struct ndt_stats
  462. ]),,, [#include <linux/neighbour.h>])
  463. AC_CHECK_TYPES(m4_normalize([
  464. struct ifla_bridge_id,
  465. struct ifla_cacheinfo,
  466. struct ifla_port_vsi,
  467. struct rtnl_link_stats64
  468. ]),,, [#include <sys/socket.h>
  469. #include <linux/rtnetlink.h>])
  470. AC_CHECK_MEMBERS(m4_normalize([
  471. struct rtnl_link_stats.rx_nohandler,
  472. struct rtnl_link_stats64.rx_nohandler
  473. ]),,, [#include <sys/socket.h>
  474. #include <linux/rtnetlink.h>])
  475. AC_CHECK_DECLS(m4_normalize([
  476. IFLA_PORT_SELF,
  477. IFLA_PROTINFO,
  478. IFLA_AF_SPEC,
  479. IFLA_XDP
  480. ]),,, [#include <sys/socket.h>
  481. #include <linux/rtnetlink.h>])
  482. AC_CHECK_TYPES(m4_normalize([
  483. struct gnet_stats_basic,
  484. struct gnet_stats_queue,
  485. struct gnet_stats_rate_est,
  486. struct gnet_stats_rate_est64
  487. ]),,, [#include <linux/gen_stats.h>])
  488. AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/types.h>
  489. #include <linux/pkt_sched.h>])
  490. AC_CHECK_DECLS([TCA_STAB_DATA],,, [#include <linux/types.h>
  491. #include <linux/pkt_sched.h>])
  492. AC_CHECK_TYPES(m4_normalize([
  493. struct fib_rule_uid_range,
  494. struct fib_rule_port_range
  495. ]),,, [#include <linux/fib_rules.h>])
  496. AC_CHECK_TYPES([struct statfs], [
  497. AC_CHECK_MEMBERS(m4_normalize([
  498. struct statfs.f_frsize,
  499. struct statfs.f_flags,
  500. struct statfs.f_fsid.val,
  501. struct statfs.f_fsid.__val
  502. ]),,, [#include <linux/types.h>
  503. #include <asm/statfs.h>])
  504. ],, [#include <linux/types.h>
  505. #include <asm/statfs.h>])
  506. AC_CHECK_TYPES([struct statfs64], [
  507. AC_CHECK_MEMBERS(m4_normalize([
  508. struct statfs64.f_frsize,
  509. struct statfs64.f_flags,
  510. struct statfs64.f_fsid.val,
  511. struct statfs64.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 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_regs,
  524. struct kvm_sregs,
  525. struct kvm_userspace_memory_region
  526. ]),,, [#include <linux/kvm.h>])
  527. saved_CPPFLAGS="$CPPFLAGS"
  528. CPPFLAGS="$CPPFLAGS -I$srcdir/linux"
  529. AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
  530. CPPFLAGS="$saved_CPPFLAGS"
  531. AC_CHECK_HEADERS([linux/btrfs.h], [
  532. AC_CHECK_MEMBERS(m4_normalize([
  533. struct btrfs_ioctl_feature_flags.compat_flags,
  534. struct btrfs_ioctl_fs_info_args.nodesize,
  535. struct btrfs_ioctl_defrag_range_args.start,
  536. struct btrfs_ioctl_search_args_v2.buf_size,
  537. struct btrfs_ioctl_logical_ino_args.flags
  538. ]),,, [ #include <stdio.h>
  539. #include <linux/btrfs.h>])
  540. AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
  541. BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
  542. #include <linux/btrfs.h>])])
  543. AC_CHECK_DECLS([sys_errlist])
  544. AC_CHECK_DECLS(m4_normalize([
  545. PTRACE_PEEKUSER,
  546. PTRACE_POKEUSER
  547. ]),,, [#include <sys/ptrace.h>])
  548. AC_CHECK_DECLS(m4_normalize([
  549. P_PID,
  550. P_PPID,
  551. P_PGID,
  552. P_SID,
  553. P_CID,
  554. P_UID,
  555. P_GID,
  556. P_ALL,
  557. P_LWPID
  558. ]),,, [#include <sys/wait.h>])
  559. AC_CHECK_DECLS(m4_normalize([
  560. LO_FLAGS_READ_ONLY,
  561. LO_FLAGS_USE_AOPS,
  562. LO_FLAGS_AUTOCLEAR,
  563. LO_FLAGS_PARTSCAN,
  564. LO_FLAGS_DIRECT_IO
  565. ]),,, [#include <linux/loop.h>])
  566. AC_CHECK_DECLS(m4_normalize([
  567. CTL_PROC,
  568. CTL_ARLAN,
  569. CTL_S390DBF,
  570. CTL_SUNRPC,
  571. CTL_PM,
  572. CTL_FRV,
  573. KERN_PRINTK_RATELIMIT,
  574. KERN_PRINTK_RATELIMIT_BURST,
  575. KERN_PTY,
  576. KERN_NGROUPS_MAX,
  577. KERN_SPARC_SCONS_PWROFF,
  578. KERN_HZ_TIMER,
  579. KERN_UNKNOWN_NMI_PANIC,
  580. KERN_BOOTLOADER_TYPE,
  581. KERN_RANDOMIZE,
  582. KERN_SETUID_DUMPABLE,
  583. KERN_SPIN_RETRY,
  584. KERN_ACPI_VIDEO_FLAGS,
  585. KERN_IA64_UNALIGNED,
  586. KERN_COMPAT_LOG,
  587. KERN_MAX_LOCK_DEPTH,
  588. KERN_NMI_WATCHDOG,
  589. KERN_PANIC_ON_NMI,
  590. NET_LLC,
  591. NET_NETFILTER,
  592. NET_DCCP,
  593. NET_IRDA,
  594. NET_CORE_DESTROY_DELAY,
  595. NET_CORE_BUDGET,
  596. NET_CORE_AEVENT_ETIME,
  597. NET_CORE_AEVENT_RSEQTH,
  598. NET_CORE_WARNINGS,
  599. NET_IPV4_IGMP_MAX_MSF,
  600. NET_TCP_NO_METRICS_SAVE,
  601. NET_TCP_DEFAULT_WIN_SCALE,
  602. NET_TCP_MODERATE_RCVBUF,
  603. NET_TCP_TSO_WIN_DIVISOR,
  604. NET_TCP_BIC_BETA,
  605. NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
  606. NET_TCP_CONG_CONTROL,
  607. NET_TCP_ABC,
  608. NET_IPV4_IPFRAG_MAX_DIST,
  609. NET_TCP_MTU_PROBING,
  610. NET_TCP_BASE_MSS,
  611. NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
  612. NET_TCP_DMA_COPYBREAK,
  613. NET_TCP_SLOW_START_AFTER_IDLE,
  614. NET_CIPSOV4_CACHE_ENABLE,
  615. NET_CIPSOV4_CACHE_BUCKET_SIZE,
  616. NET_CIPSOV4_RBM_OPTFMT,
  617. NET_CIPSOV4_RBM_STRICTVALID,
  618. NET_TCP_AVAIL_CONG_CONTROL,
  619. NET_TCP_ALLOWED_CONG_CONTROL,
  620. NET_TCP_MAX_SSTHRESH,
  621. NET_TCP_FRTO_RESPONSE,
  622. NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
  623. NET_IPV4_CONF_FORCE_IGMP_VERSION,
  624. NET_IPV4_CONF_ARP_ANNOUNCE,
  625. NET_IPV4_CONF_ARP_IGNORE,
  626. NET_IPV4_CONF_PROMOTE_SECONDARIES,
  627. NET_IPV4_CONF_ARP_ACCEPT,
  628. NET_IPV4_CONF_ARP_NOTIFY,
  629. NET_IPV6_MLD_MAX_MSF,
  630. NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
  631. VM_MAX_MAP_COUNT,
  632. VM_LAPTOP_MODE,
  633. VM_BLOCK_DUMP,
  634. VM_HUGETLB_GROUP,
  635. VM_VFS_CACHE_PRESSURE,
  636. VM_LEGACY_VA_LAYOUT,
  637. VM_SWAP_TOKEN_TIMEOUT
  638. ]),,,
  639. [#include <sys/types.h>
  640. #include <linux/sysctl.h>])
  641. AC_CHECK_DECLS(m4_normalize([
  642. V4L2_FIELD_ANY,
  643. V4L2_FIELD_NONE,
  644. V4L2_FIELD_TOP,
  645. V4L2_FIELD_BOTTOM,
  646. V4L2_FIELD_INTERLACED,
  647. V4L2_FIELD_SEQ_TB,
  648. V4L2_FIELD_SEQ_BT,
  649. V4L2_FIELD_ALTERNATE,
  650. V4L2_FIELD_INTERLACED_TB,
  651. V4L2_FIELD_INTERLACED_BT,
  652. V4L2_BUF_TYPE_VIDEO_CAPTURE,
  653. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
  654. V4L2_BUF_TYPE_VIDEO_OUTPUT,
  655. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
  656. V4L2_BUF_TYPE_VIDEO_OVERLAY,
  657. V4L2_BUF_TYPE_VBI_CAPTURE,
  658. V4L2_BUF_TYPE_VBI_OUTPUT,
  659. V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
  660. V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
  661. V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
  662. V4L2_BUF_TYPE_SDR_CAPTURE,
  663. V4L2_BUF_TYPE_SDR_OUTPUT,
  664. V4L2_TUNER_RADIO,
  665. V4L2_TUNER_ANALOG_TV,
  666. V4L2_TUNER_DIGITAL_TV,
  667. V4L2_MEMORY_MMAP,
  668. V4L2_MEMORY_USERPTR,
  669. V4L2_MEMORY_OVERLAY,
  670. V4L2_MEMORY_DMABUF,
  671. V4L2_COLORSPACE_SMPTE170M,
  672. V4L2_COLORSPACE_SMPTE240M,
  673. V4L2_COLORSPACE_REC709,
  674. V4L2_COLORSPACE_BT878,
  675. V4L2_COLORSPACE_470_SYSTEM_M,
  676. V4L2_COLORSPACE_470_SYSTEM_BG,
  677. V4L2_COLORSPACE_JPEG,
  678. V4L2_COLORSPACE_SRGB,
  679. V4L2_PRIORITY_UNSET,
  680. V4L2_PRIORITY_BACKGROUND,
  681. V4L2_PRIORITY_INTERACTIVE,
  682. V4L2_PRIORITY_RECORD,
  683. V4L2_FRMSIZE_TYPE_DISCRETE,
  684. V4L2_FRMSIZE_TYPE_CONTINUOUS,
  685. V4L2_FRMSIZE_TYPE_STEPWISE,
  686. V4L2_FRMIVAL_TYPE_DISCRETE,
  687. V4L2_FRMIVAL_TYPE_CONTINUOUS,
  688. V4L2_FRMIVAL_TYPE_STEPWISE,
  689. V4L2_CTRL_TYPE_INTEGER,
  690. V4L2_CTRL_TYPE_BOOLEAN,
  691. V4L2_CTRL_TYPE_MENU,
  692. V4L2_CTRL_TYPE_BUTTON,
  693. V4L2_CTRL_TYPE_INTEGER64,
  694. V4L2_CTRL_TYPE_CTRL_CLASS,
  695. V4L2_CTRL_TYPE_STRING,
  696. V4L2_CTRL_TYPE_BITMASK,
  697. V4L2_CTRL_TYPE_INTEGER_MENU
  698. ]),,, [#include <sys/time.h>
  699. #include <linux/ioctl.h>
  700. #include <linux/types.h>
  701. #include <linux/videodev2.h>])
  702. AC_CHECK_MEMBERS(m4_normalize([
  703. struct v4l2_window.global_alpha,
  704. struct v4l2_sdr_format.buffersize
  705. ]),,, [#include <sys/time.h>
  706. #include <linux/ioctl.h>
  707. #include <linux/types.h>
  708. #include <linux/videodev2.h>])
  709. AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
  710. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  711. #include <stdlib.h>
  712. #include <linux/fs.h>], [return !BLKGETSIZE64;])],
  713. [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
  714. if test $ac_cv_have_blkgetsize64 = yes; then
  715. AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
  716. fi)
  717. AC_CHECK_SIZEOF([long])
  718. SIZEOF_LONG="$ac_cv_sizeof_long"
  719. AC_SUBST(SIZEOF_LONG)
  720. AC_CHECK_SIZEOF([long long])
  721. AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
  722. AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
  723. SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
  724. AC_SUBST(SIZEOF_KERNEL_LONG_T)
  725. AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
  726. AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
  727. [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
  728. $CPP $CPPFLAGS -P -imacros asm/signal.h - |
  729. grep '^[0-9]')"
  730. test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
  731. if test "x$st_cv_SIGRTMIN" != xno; then
  732. AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
  733. [SIGRTMIN defined in <asm/signal.h>])
  734. fi
  735. AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
  736. [st_cv_SA_RESTORER="$(echo SA_RESTORER |
  737. $CPP $CPPFLAGS -P -imacros asm/signal.h - |
  738. grep ^0x)"
  739. test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
  740. if test "x$st_cv_SA_RESTORER" != xno; then
  741. AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
  742. [SA_RESTORER defined in <asm/signal.h>])
  743. fi
  744. AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
  745. [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
  746. [st_cv_have___builtin_popcount=yes],
  747. [st_cv_have___builtin_popcount=no])])
  748. if test "x$st_cv_have___builtin_popcount" = xyes; then
  749. AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
  750. [Define to 1 if the system provides __builtin_popcount function])
  751. fi
  752. AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
  753. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
  754. [[return !*program_invocation_name]])],
  755. [st_cv_have_program_invocation_name=yes],
  756. [st_cv_have_program_invocation_name=no])])
  757. if test "x$st_cv_have_program_invocation_name" = xyes; then
  758. AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
  759. [Define to 1 if the system provides program_invocation_name variable])
  760. fi
  761. AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert],
  762. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]],
  763. [[static_assert(1,"")]]
  764. )
  765. ],
  766. [st_cv_have_static_assert=yes],
  767. [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
  768. [[_Static_assert(1,"")]]
  769. )
  770. ],
  771. [st_cv_have_static_assert=_Static_assert],
  772. [st_cv_have_static_assert=no]
  773. )
  774. ]
  775. )
  776. ]
  777. )
  778. case "x$st_cv_have_static_assert" in
  779. xyes)
  780. AC_DEFINE([HAVE_STATIC_ASSERT], [1],
  781. [Define to 1 if the system provides static_assert])
  782. ;;
  783. x_Static_assert)
  784. AC_DEFINE([HAVE__STATIC_ASSERT], [1],
  785. [Define to 1 if the system provides _Static_assert])
  786. ;;
  787. esac
  788. AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
  789. if test "x$ac_cv_lib_dl_dladdr" = xyes; then
  790. AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
  791. fi
  792. AC_SUBST(dl_LIBS)
  793. saved_LIBS="$LIBS"
  794. AC_SEARCH_LIBS([timer_create], [rt])
  795. LIBS="$saved_LIBS"
  796. case "$ac_cv_search_timer_create" in
  797. no) AC_MSG_FAILURE([failed to find timer_create]) ;;
  798. -l*) timer_LIBS="$ac_cv_search_timer_create" ;;
  799. *) timer_LIBS= ;;
  800. esac
  801. AC_SUBST(timer_LIBS)
  802. saved_LIBS="$LIBS"
  803. AC_SEARCH_LIBS([clock_gettime], [rt])
  804. LIBS="$saved_LIBS"
  805. case "$ac_cv_search_clock_gettime" in
  806. no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
  807. -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
  808. *) clock_LIBS= ;;
  809. esac
  810. AC_SUBST(clock_LIBS)
  811. saved_LIBS="$LIBS"
  812. AC_SEARCH_LIBS([mq_open], [rt])
  813. LIBS="$saved_LIBS"
  814. case "$ac_cv_search_mq_open" in
  815. -l*) mq_LIBS="$ac_cv_search_mq_open" ;;
  816. *) mq_LIBS= ;;
  817. esac
  818. AC_SUBST(mq_LIBS)
  819. AC_PATH_PROG([PERL], [perl])
  820. AC_CHECK_TOOL([READELF], [readelf])
  821. st_STACKTRACE
  822. if test "$arch" = mips && test "$no_create" != yes; then
  823. mkdir -p linux/mips
  824. if $srcdir/linux/mips/genstub.sh linux/mips; then
  825. AC_MSG_RESULT([Generated MIPS syscallent stubs])
  826. else
  827. AC_MSG_ERROR([Failed to generate syscallent stubs])
  828. fi
  829. fi
  830. AC_ARG_ENABLE([mpers],
  831. [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
  832. [whether to enable multiple personalities support required
  833. for proper decoding of structures used by tracees with
  834. personalities that differ from the personality of strace,
  835. default is yes.])],
  836. [case "$enableval" in
  837. yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
  838. *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
  839. Valid options are: yes, no, check, m32, mx32.])
  840. ;;
  841. esac],
  842. [enable_mpers=yes])
  843. st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
  844. st_MPERS([mx32], [x86_64])
  845. AX_VALGRIND_DFLT([sgcheck], [off])
  846. AX_VALGRIND_CHECK
  847. AC_CONFIG_FILES([Makefile
  848. tests/Makefile
  849. tests-m32/Makefile
  850. tests-mx32/Makefile
  851. strace.1
  852. strace-log-merge.1
  853. strace.spec
  854. debian/changelog])
  855. AC_OUTPUT