blob: 382963d8bda887d895f90b3aaa5bd37fe7ea9fef [file] [log] [blame]
yaberauneya9913e822009-11-26 11:27:34 +00001AC_PREREQ(2.61)
Cyril Hrubis70d7e8c2015-09-15 12:50:31 +02002AC_INIT([ltp], [LTP_VERSION], [ltp@lists.linux.it])
yaberauneyaef772532009-10-09 17:55:43 +00003AC_CONFIG_AUX_DIR([.])
4AM_INIT_AUTOMAKE
subrata_modak3d8666c2008-11-11 08:31:27 +00005AC_CONFIG_HEADERS([include/config.h])
Cyril Hrubisedbae292014-07-15 14:57:27 +02006AC_CONFIG_MACRO_DIR([m4])
yaberauneyaef772532009-10-09 17:55:43 +00007AC_CONFIG_FILES([ \
8 include/mk/config.mk \
Cyril Hrubis63b65322016-04-20 18:23:53 +02009 include/mk/config-openposix.mk \
Garrett Cooper4f71cae2010-11-01 21:09:17 -070010 include/mk/features.mk \
yaberauneyaef772532009-10-09 17:55:43 +000011 lib/ltp.pc \
yaberauneyaef772532009-10-09 17:55:43 +000012 m4/Makefile \
yaberauneya0d39b832009-11-20 05:45:41 +000013 execltp \
vapierdf8759f2009-01-18 22:22:40 +000014])
subrata_modak3d8666c2008-11-11 08:31:27 +000015
Petr Vorel427b1be2018-02-14 23:27:54 +010016AM_MAINTAINER_MODE([enable])
17
yaberauneyaef772532009-10-09 17:55:43 +000018AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes)
19
20AC_CANONICAL_HOST
21
22AC_PROG_CC
yaberauneyaf7df1402009-10-17 02:24:20 +000023# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about
24# 2.62.
25AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
yaberauneyaef772532009-10-09 17:55:43 +000026AC_PROG_AR
27AC_PROG_LEX
28AC_PROG_RANLIB
yaberauneyaa4bed682009-12-05 23:45:55 +000029AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)])
30AC_PROG_STRIP
yaberauneyaef772532009-10-09 17:55:43 +000031AC_PROG_YACC
32
33AC_PREFIX_DEFAULT(/opt/ltp)
34
Petr Vorel452c5132020-01-29 19:26:27 +010035AC_CHECK_DECLS([IFLA_NET_NS_PID],,,[#include <linux/if_link.h>])
36AC_CHECK_DECLS([MADV_MERGEABLE],,,[#include <sys/mman.h>])
37AC_CHECK_DECLS([PR_CAPBSET_DROP, PR_CAPBSET_READ],,,[#include <sys/prctl.h>])
38
yaberauneya80a06b52009-12-20 00:39:37 +000039AC_CHECK_HEADERS([ \
Petr Vorel452c5132020-01-29 19:26:27 +010040 asm/ldt.h \
yaberauneyaef772532009-10-09 17:55:43 +000041 ifaddrs.h \
Petr Vorelbc2568d2017-10-16 17:41:54 +020042 keyutils.h \
Petr Vorel66923c62017-10-12 20:33:19 +020043 linux/can.h \
Yang Xudf5ce332019-07-30 13:45:32 +080044 linux/cgroupstats.h \
Richard Palethorpea0ce4432018-07-05 16:56:33 +020045 linux/cryptouser.h \
Yang Xudf5ce332019-07-30 13:45:32 +080046 linux/dccp.h \
Petr Vorel452c5132020-01-29 19:26:27 +010047 linux/fs.h \
yaberauneyaef772532009-10-09 17:55:43 +000048 linux/genetlink.h \
Eric Biggersef851012019-03-18 10:13:22 -070049 linux/if_alg.h \
Richard Palethorpedb141702017-11-02 15:34:41 +010050 linux/if_ether.h \
Petr Vorelb6bf84c2020-02-17 15:22:27 +010051 linux/if_packet.h \
Yang Xudf5ce332019-07-30 13:45:32 +080052 linux/keyctl.h \
yaberauneyacb805c42009-12-22 23:10:41 +000053 linux/mempolicy.h \
yaberauneyaef772532009-10-09 17:55:43 +000054 linux/module.h \
55 linux/netlink.h \
Yang Xu3ddc2172019-05-23 10:54:00 +080056 linux/seccomp.h \
Yang Xufe9d9212019-07-12 17:54:35 +080057 linux/securebits.h \
Petr Vorelef12b902020-05-06 13:03:29 +020058 linux/tty.h \
Petr Vorel28a9cd82019-06-17 23:00:49 +020059 linux/types.h \
Christian Amannb3621af2019-03-19 09:07:32 +010060 linux/userfaultfd.h \
Petr Vorel839128b2017-10-12 20:33:18 +020061 mm.h \
Xiao Yangbf8f1d72018-04-04 19:12:54 +080062 netinet/sctp.h \
Petr Vorel839128b2017-10-12 20:33:18 +020063 pthread.h \
yaberauneyaef772532009-10-09 17:55:43 +000064 sys/epoll.h \
Jan Karaf057c1c2013-11-20 23:43:13 +010065 sys/fanotify.h \
Petr Vorel839128b2017-10-12 20:33:18 +020066 sys/inotify.h \
yaberauneyaef772532009-10-09 17:55:43 +000067 sys/prctl.h \
Sandeep Patil524edfb2017-11-08 16:34:36 -080068 sys/shm.h \
Petr Vorel452c5132020-01-29 19:26:27 +010069 sys/timerfd.h \
Petr Vorel0ff33b32017-10-11 15:53:33 +020070 sys/ustat.h \
Petr Vorel2e7b8092019-07-06 22:51:06 +020071 sys/utsname.h \
Petr Vorel839128b2017-10-12 20:33:18 +020072 sys/xattr.h \
Yang Xu208f2312019-10-23 17:00:27 +080073 xfs/xqm.h \
yaberauneyaef772532009-10-09 17:55:43 +000074])
Petr Vorel452c5132020-01-29 19:26:27 +010075AC_CHECK_HEADERS(fts.h, [have_fts=1])
76AC_SUBST(HAVE_FTS_H, $have_fts)
yaberauneyaef772532009-10-09 17:55:43 +000077
Petr Vorel0ff33b32017-10-11 15:53:33 +020078AC_CHECK_FUNCS([ \
Viresh Kumar1b0e8dd2020-03-20 09:54:02 +053079 clone3 \
Christian Amanna72f4b22019-05-06 12:54:57 +020080 copy_file_range \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080081 epoll_pwait \
82 execveat \
83 fallocate \
84 fchownat \
Viresh Kumar9832fd92020-02-14 17:05:50 +053085 fsconfig \
86 fsmount \
87 fsopen \
88 fspick \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080089 fstatat \
Cyril Hrubis6ab05d52020-06-26 11:57:27 +020090 getauxval \
Khem Raj6d9de5f2019-07-26 11:25:23 -070091 getdents \
92 getdents64 \
Viresh Kumar57a961f2020-01-28 08:31:33 +053093 io_pgetevents \
Vikas Kumar95399bc2020-03-13 11:50:58 +053094 io_uring_setup \
95 io_uring_register \
96 io_uring_enter \
Petr Vorelb6bf84c2020-02-17 15:22:27 +010097 kcmp \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080098 mkdirat \
99 mknodat \
Petr Vorel452c5132020-01-29 19:26:27 +0100100 modify_ldt \
Viresh Kumar9832fd92020-02-14 17:05:50 +0530101 move_mount \
Matthew Bobrowski02b39d82019-06-20 19:57:58 +1000102 name_to_handle_at \
Viresh Kumar9832fd92020-02-14 17:05:50 +0530103 open_tree \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800104 openat \
Viresh Kumar1b884d92020-03-16 12:06:15 +0530105 openat2 \
Viresh Kumar54151622020-01-27 14:07:48 +0530106 pidfd_open \
Christian Amanne3c82be2019-06-14 09:28:27 +0200107 pidfd_send_signal \
Yang Xudf5ce332019-07-30 13:45:32 +0800108 pkey_mprotect \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800109 preadv \
110 preadv2 \
Petr Vorel0ff33b32017-10-11 15:53:33 +0200111 profil \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800112 pwritev \
113 pwritev2 \
114 readlinkat \
Steve Muckle1010e922019-07-25 14:11:19 -0700115 recvmmsg \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800116 renameat \
117 renameat2 \
Yang Xu4c41cf72019-04-17 14:05:02 +0800118 sched_getcpu \
Steve Muckle1010e922019-07-25 14:11:19 -0700119 sendmmsg \
Cyril Hrubis7cd69c12020-03-18 16:37:54 +0100120 setns \
Xiao Yanga600c362019-04-05 15:46:24 +0800121 sigpending \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800122 splice \
Petr Vorel452c5132020-01-29 19:26:27 +0100123 statx \
Xiao Yang66c59e92019-04-05 17:12:50 +0800124 stime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800125 sync_file_range \
Petr Vorelb6bf84c2020-02-17 15:22:27 +0100126 syncfs \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800127 tee \
Petr Vorel452c5132020-01-29 19:26:27 +0100128 timerfd_create \
129 timerfd_gettime \
130 timerfd_settime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800131 unshare \
Petr Vorel0ff33b32017-10-11 15:53:33 +0200132 ustat \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800133 vmsplice \
Petr Vorel0ff33b32017-10-11 15:53:33 +0200134])
Petr Vorel452c5132020-01-29 19:26:27 +0100135AC_CHECK_FUNCS(mkdtemp,[],AC_MSG_ERROR(mkdtemp() not found!))
136
137AC_CHECK_MEMBERS([struct fanotify_event_info_fid.fsid.__val],,,[#include <sys/fanotify.h>])
138AC_CHECK_MEMBERS([struct perf_event_mmap_page.aux_head],,,[#include <linux/perf_event.h>])
139AC_CHECK_MEMBERS([struct sigaction.sa_sigaction],[],[],[#include <signal.h>])
140
141AC_CHECK_MEMBERS([struct utsname.domainname],,,[
142#define _GNU_SOURCE
143#include <sys/utsname.h>
144])
145
146AC_CHECK_TYPES([enum kcmp_type],,,[#include <linux/kcmp.h>])
147AC_CHECK_TYPES([struct acct_v3],,,[#include <sys/acct.h>])
Petr Vorel452c5132020-01-29 19:26:27 +0100148AC_CHECK_TYPES([struct fanotify_event_info_fid],,,[#include <sys/fanotify.h>])
Petr Vorelb6bf84c2020-02-17 15:22:27 +0100149AC_CHECK_TYPES([struct fanotify_event_info_header],,,[#include <sys/fanotify.h>])
Petr Vorel452c5132020-01-29 19:26:27 +0100150AC_CHECK_TYPES([struct file_dedupe_range],,,[#include <linux/fs.h>])
151AC_CHECK_TYPES([struct fs_quota_statv],,,[#include <xfs/xqm.h>])
152AC_CHECK_TYPES([struct if_nextdqblk],,,[#include <linux/quota.h>])
153AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>])
Viresh Kumar3e1fc062020-05-22 12:46:04 +0530154AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>])
Yang Xu18987542020-06-11 18:35:13 +0800155AC_CHECK_TYPES([struct loop_config],,,[#include <linux/loop.h>])
Viresh Kumar732ea252020-06-16 15:50:19 +0530156AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>])
Viresh Kumar3168c032020-06-16 15:50:21 +0530157AC_CHECK_TYPES([struct shmid64_ds],,,[#include <sys/shmbuf.h>])
Viresh Kumare4608642020-06-16 15:50:23 +0530158AC_CHECK_TYPES([struct msqid64_ds],,,[#include <sys/msgbuf.h>])
Petr Vorel452c5132020-01-29 19:26:27 +0100159
160AC_CHECK_TYPES([struct mmsghdr],,,[
161#define _GNU_SOURCE
162#include <sys/types.h>
163#include <sys/socket.h>
164])
165
166AC_CHECK_TYPES([struct rlimit64],,,[
167#define _LARGEFILE64_SOURCE
168#include <sys/resource.h>
169])
170
171AC_CHECK_TYPES([struct statx, struct statx_timestamp],,,[
172#define _GNU_SOURCE
173#include <sys/stat.h>
174])
175
176AC_CHECK_TYPES([struct termio],,,[#include <sys/ioctl.h>])
177
178AC_CHECK_TYPES([struct tpacket_req3],,,[
179#ifdef HAVE_LINUX_IF_PACKET_H
180# include <linux/if_packet.h>
181#endif
182])
183
184AC_CHECK_TYPES([struct user_desc, struct modify_ldt_ldt_s],[],[],[
185#include <asm/ldt.h>
186])
187
188AC_CHECK_TYPES([struct xt_entry_match, struct xt_entry_target],,,[
189#include <sys/types.h>
190#include <netinet/in.h>
191#include <net/if.h>
192#include <limits.h>
193#include <linux/netfilter_ipv4/ip_tables.h>
194])
Petr Vorel25b35652017-10-02 15:33:41 +0200195
Garrett Cooper52288dc2010-11-16 22:01:43 -0800196# Tools knobs
197
198# Expect
199AC_ARG_WITH([bash],
200 [AC_HELP_STRING([--with-bash],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100201 [have the Bourne Again Shell interpreter])],
202 [with_bash=$withval],
203 [with_bash=no]
Garrett Cooper52288dc2010-11-16 22:01:43 -0800204)
205if test "x$with_bash" = xyes; then
206 AC_SUBST([WITH_BASH],["yes"])
207else
208 AC_SUBST([WITH_BASH],["no"])
209fi
210
211AC_ARG_WITH([expect],
212 [AC_HELP_STRING([--with-expect],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100213 [have the Tcl/expect library])],
214 [with_expect=$withval],
Garrett Cooper52288dc2010-11-16 22:01:43 -0800215 [with_expect=no]
216)
217if test "x$with_expect" = xyes; then
218 AC_SUBST([WITH_EXPECT],["yes"])
219else
220 AC_SUBST([WITH_EXPECT],["no"])
221fi
222
Anders Roxell39a85a12018-02-05 11:56:04 +0100223# Numa
224AC_ARG_WITH([numa],
225 AC_HELP_STRING([--without-numa],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100226 [without numa support]),
227 [with_numa=$withval],
Anders Roxell39a85a12018-02-05 11:56:04 +0100228 [with_numa=yes]
229)
230
Garrett Cooper52288dc2010-11-16 22:01:43 -0800231# Perl
232AC_ARG_WITH([perl],
233 [AC_HELP_STRING([--with-perl],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100234 [have a perl interpreter])],
235 [with_perl=$withval],
Garrett Cooper52288dc2010-11-16 22:01:43 -0800236 [with_perl=no]
237)
238if test "x$with_perl" = xyes; then
239 AC_SUBST([WITH_PERL],["yes"])
240else
241 AC_SUBST([WITH_PERL],["no"])
242fi
243
244# Python
245AC_ARG_WITH([python],
246 [AC_HELP_STRING([--with-python],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100247 [have a python interpreter])],
248 [with_python=$withval],
Garrett Cooper52288dc2010-11-16 22:01:43 -0800249 [with_python=no]
250)
251if test "x$with_python" = xyes; then
252 AC_SUBST([WITH_PYTHON],["yes"])
253else
254 AC_SUBST([WITH_PYTHON],["no"])
255fi
Anders Roxell7b258152018-02-14 13:04:31 +0100256
257# TI RPC
258AC_ARG_WITH([tirpc],
259 AC_HELP_STRING([--without-tirpc],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100260 [without libtirpc support]),
261 [with_tirpc=$withval],
Anders Roxell7b258152018-02-14 13:04:31 +0100262 [with_tirpc=yes]
263)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800264# END tools knobs
265
266# Testsuites knobs
267
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800268AC_ARG_WITH([open-posix-testsuite],
269 [AC_HELP_STRING([--with-open-posix-testsuite],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100270 [compile and install the open posix testsuite])],
271 [with_open_posix_testsuite=$withval],
272 [with_open_posix_testsuite=no]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800273)
274if test "x$with_open_posix_testsuite" = xyes; then
275 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
276else
277 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
278fi
279
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100280# TODO: testcases/realtime requires bash and python.
281AC_ARG_WITH([realtime-testsuite],
282 [AC_HELP_STRING([--with-realtime-testsuite],
283 [compile and install the realtime testsuite])],
284 [with_realtime_testsuite=$withval],
285 [with_realtime_testsuite=no]
286)
287
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800288if test "x$with_realtime_testsuite" = xyes; then
289 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800290 # Run configure on testcases/realtime as well.
291 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800292else
293 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
294fi
295
Li Wang8d47fa72017-10-26 16:51:15 +0800296AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200297
Petr Vorela50338c2019-04-12 15:48:53 +0200298# custom functions
Petr Vorel452c5132020-01-29 19:26:27 +0100299# NOTE: don't create custom functions for simple checks, put them into this file
Petr Vorela50338c2019-04-12 15:48:53 +0200300LTP_CHECK_ACL_SUPPORT
301LTP_CHECK_ATOMIC_MEMORY_MODEL
302LTP_CHECK_BUILTIN_CLEAR_CACHE
yaberauneyaef772532009-10-09 17:55:43 +0000303LTP_CHECK_CAPABILITY_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200304LTP_CHECK_CC_WARN_OLDSTYLE
305LTP_CHECK_CLONE_SUPPORTS_7_ARGS
yaberauneyaef772532009-10-09 17:55:43 +0000306LTP_CHECK_CRYPTO
Petr Vorela50338c2019-04-12 15:48:53 +0200307LTP_CHECK_FORTIFY_SOURCE
Petr Vorela50338c2019-04-12 15:48:53 +0200308LTP_CHECK_KERNEL_DEVEL
309LTP_CHECK_KEYUTILS_SUPPORT
Petr Vorel553ca8e2019-11-01 14:48:16 +0100310LTP_CHECK_LIBMNL
yaberauneyaef772532009-10-09 17:55:43 +0000311LTP_CHECK_LINUX_PTRACE
Petr Vorela50338c2019-04-12 15:48:53 +0200312LTP_CHECK_LINUXRANDOM
Petr Vorela50338c2019-04-12 15:48:53 +0200313LTP_CHECK_MREMAP_FIXED
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400314LTP_CHECK_NOMMU_LINUX
yaberauneyaef772532009-10-09 17:55:43 +0000315LTP_CHECK_SELINUX
Jan Stancekf61391e2016-04-13 13:09:23 +0200316LTP_CHECK_SYNC_ADD_AND_FETCH
Petr Vorela50338c2019-04-12 15:48:53 +0200317LTP_CHECK_SYSCALL_EVENTFD
318LTP_CHECK_SYSCALL_FCNTL
Xing Gua3bfea22014-06-17 15:26:30 +0800319
Petr Vorelf4176722018-02-07 11:29:42 +0100320if test "x$with_numa" = xyes; then
321 LTP_CHECK_SYSCALL_NUMA
322 numa_error_msg="test requires libnuma >= 2 and it's development packages"
323else
324 numa_error_msg="NUMA support was disabled during build"
325fi
326AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
327
Christian Amanne3c82be2019-06-14 09:28:27 +0200328
Petr Vorela50338c2019-04-12 15:48:53 +0200329LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
Petr Vorela50338c2019-04-12 15:48:53 +0200330LTP_CHECK_SYSCALL_SIGNALFD
331LTP_CHECK_SYSCALL_UTIMENSAT
332LTP_CHECK_TASKSTATS
Petr Vorela50338c2019-04-12 15:48:53 +0200333test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
Petr Vorela50338c2019-04-12 15:48:53 +0200334LTP_DETECT_HOST_CPU
335
subrata_modak3d8666c2008-11-11 08:31:27 +0000336AC_OUTPUT