blob: 50d14967d3c6e79c2e9332d665ddda19ebe16410 [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
yaberauneya80a06b52009-12-20 00:39:37 +000035AC_CHECK_HEADERS([ \
yaberauneyaef772532009-10-09 17:55:43 +000036 ifaddrs.h \
Petr Vorelbc2568d2017-10-16 17:41:54 +020037 keyutils.h \
Petr Vorel66923c62017-10-12 20:33:19 +020038 linux/can.h \
Yang Xudf5ce332019-07-30 13:45:32 +080039 linux/cgroupstats.h \
Richard Palethorpea0ce4432018-07-05 16:56:33 +020040 linux/cryptouser.h \
Yang Xudf5ce332019-07-30 13:45:32 +080041 linux/dccp.h \
yaberauneyaef772532009-10-09 17:55:43 +000042 linux/genetlink.h \
Eric Biggersef851012019-03-18 10:13:22 -070043 linux/if_alg.h \
Richard Palethorpedb141702017-11-02 15:34:41 +010044 linux/if_packet.h \
45 linux/if_ether.h \
Yang Xudf5ce332019-07-30 13:45:32 +080046 linux/keyctl.h \
yaberauneyacb805c42009-12-22 23:10:41 +000047 linux/mempolicy.h \
yaberauneyaef772532009-10-09 17:55:43 +000048 linux/module.h \
49 linux/netlink.h \
Yang Xu3ddc2172019-05-23 10:54:00 +080050 linux/seccomp.h \
Yang Xufe9d9212019-07-12 17:54:35 +080051 linux/securebits.h \
Petr Vorel28a9cd82019-06-17 23:00:49 +020052 linux/types.h \
Christian Amannb3621af2019-03-19 09:07:32 +010053 linux/userfaultfd.h \
Petr Vorel839128b2017-10-12 20:33:18 +020054 mm.h \
Xiao Yangbf8f1d72018-04-04 19:12:54 +080055 netinet/sctp.h \
Petr Vorel839128b2017-10-12 20:33:18 +020056 pthread.h \
yaberauneyaef772532009-10-09 17:55:43 +000057 sys/epoll.h \
Jan Karaf057c1c2013-11-20 23:43:13 +010058 sys/fanotify.h \
Petr Vorel839128b2017-10-12 20:33:18 +020059 sys/inotify.h \
yaberauneyaef772532009-10-09 17:55:43 +000060 sys/prctl.h \
Sandeep Patil524edfb2017-11-08 16:34:36 -080061 sys/shm.h \
Petr Vorel0ff33b32017-10-11 15:53:33 +020062 sys/ustat.h \
Petr Vorel2e7b8092019-07-06 22:51:06 +020063 sys/utsname.h \
Petr Vorel839128b2017-10-12 20:33:18 +020064 sys/xattr.h \
Yang Xu208f2312019-10-23 17:00:27 +080065 xfs/xqm.h \
yaberauneyaef772532009-10-09 17:55:43 +000066])
67
Petr Vorel0ff33b32017-10-11 15:53:33 +020068AC_CHECK_FUNCS([ \
Christian Amanna72f4b22019-05-06 12:54:57 +020069 copy_file_range \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080070 epoll_pwait \
71 execveat \
72 fallocate \
73 fchownat \
74 fstatat \
Khem Raj6d9de5f2019-07-26 11:25:23 -070075 getdents \
76 getdents64 \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080077 kcmp \
78 mkdirat \
79 mknodat \
Matthew Bobrowski02b39d82019-06-20 19:57:58 +100080 name_to_handle_at \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080081 openat \
Christian Amanne3c82be2019-06-14 09:28:27 +020082 pidfd_send_signal \
Yang Xudf5ce332019-07-30 13:45:32 +080083 pkey_mprotect \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080084 preadv \
85 preadv2 \
Petr Vorel0ff33b32017-10-11 15:53:33 +020086 profil \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080087 pwritev \
88 pwritev2 \
89 readlinkat \
Steve Muckle1010e922019-07-25 14:11:19 -070090 recvmmsg \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080091 renameat \
92 renameat2 \
Yang Xu4c41cf72019-04-17 14:05:02 +080093 sched_getcpu \
Steve Muckle1010e922019-07-25 14:11:19 -070094 sendmmsg \
Xiao Yanga600c362019-04-05 15:46:24 +080095 sigpending \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080096 splice \
Xiao Yang66c59e92019-04-05 17:12:50 +080097 stime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080098 syncfs \
99 sync_file_range \
100 tee \
101 unshare \
Petr Vorel0ff33b32017-10-11 15:53:33 +0200102 ustat \
Xiao Yang8fd49ce2019-04-05 15:55:39 +0800103 vmsplice \
Petr Vorel0ff33b32017-10-11 15:53:33 +0200104])
Petr Vorel25b35652017-10-02 15:33:41 +0200105
Garrett Cooper52288dc2010-11-16 22:01:43 -0800106# Tools knobs
107
108# Expect
109AC_ARG_WITH([bash],
110 [AC_HELP_STRING([--with-bash],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100111 [have the Bourne Again Shell interpreter])],
112 [with_bash=$withval],
113 [with_bash=no]
Garrett Cooper52288dc2010-11-16 22:01:43 -0800114)
115if test "x$with_bash" = xyes; then
116 AC_SUBST([WITH_BASH],["yes"])
117else
118 AC_SUBST([WITH_BASH],["no"])
119fi
120
121AC_ARG_WITH([expect],
122 [AC_HELP_STRING([--with-expect],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100123 [have the Tcl/expect library])],
124 [with_expect=$withval],
Garrett Cooper52288dc2010-11-16 22:01:43 -0800125 [with_expect=no]
126)
127if test "x$with_expect" = xyes; then
128 AC_SUBST([WITH_EXPECT],["yes"])
129else
130 AC_SUBST([WITH_EXPECT],["no"])
131fi
132
Anders Roxell39a85a12018-02-05 11:56:04 +0100133# Numa
134AC_ARG_WITH([numa],
135 AC_HELP_STRING([--without-numa],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100136 [without numa support]),
137 [with_numa=$withval],
Anders Roxell39a85a12018-02-05 11:56:04 +0100138 [with_numa=yes]
139)
140
Garrett Cooper52288dc2010-11-16 22:01:43 -0800141# Perl
142AC_ARG_WITH([perl],
143 [AC_HELP_STRING([--with-perl],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100144 [have a perl interpreter])],
145 [with_perl=$withval],
Garrett Cooper52288dc2010-11-16 22:01:43 -0800146 [with_perl=no]
147)
148if test "x$with_perl" = xyes; then
149 AC_SUBST([WITH_PERL],["yes"])
150else
151 AC_SUBST([WITH_PERL],["no"])
152fi
153
154# Python
155AC_ARG_WITH([python],
156 [AC_HELP_STRING([--with-python],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100157 [have a python interpreter])],
158 [with_python=$withval],
Garrett Cooper52288dc2010-11-16 22:01:43 -0800159 [with_python=no]
160)
161if test "x$with_python" = xyes; then
162 AC_SUBST([WITH_PYTHON],["yes"])
163else
164 AC_SUBST([WITH_PYTHON],["no"])
165fi
Anders Roxell7b258152018-02-14 13:04:31 +0100166
167# TI RPC
168AC_ARG_WITH([tirpc],
169 AC_HELP_STRING([--without-tirpc],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100170 [without libtirpc support]),
171 [with_tirpc=$withval],
Anders Roxell7b258152018-02-14 13:04:31 +0100172 [with_tirpc=yes]
173)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800174# END tools knobs
175
176# Testsuites knobs
177
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800178AC_ARG_WITH([open-posix-testsuite],
179 [AC_HELP_STRING([--with-open-posix-testsuite],
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100180 [compile and install the open posix testsuite])],
181 [with_open_posix_testsuite=$withval],
182 [with_open_posix_testsuite=no]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800183)
184if test "x$with_open_posix_testsuite" = xyes; then
185 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
186else
187 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
188fi
189
Joerg Vehlow9e7f5682019-11-13 11:41:49 +0100190# TODO: testcases/realtime requires bash and python.
191AC_ARG_WITH([realtime-testsuite],
192 [AC_HELP_STRING([--with-realtime-testsuite],
193 [compile and install the realtime testsuite])],
194 [with_realtime_testsuite=$withval],
195 [with_realtime_testsuite=no]
196)
197
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800198if test "x$with_realtime_testsuite" = xyes; then
199 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800200 # Run configure on testcases/realtime as well.
201 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800202else
203 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
204fi
205
Li Wang8d47fa72017-10-26 16:51:15 +0800206AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200207
Petr Vorela50338c2019-04-12 15:48:53 +0200208# custom functions
Christian Amann4eb139c2019-06-04 09:22:28 +0200209LTP_CHECK_ACCT
Petr Vorela50338c2019-04-12 15:48:53 +0200210LTP_CHECK_ACL_SUPPORT
211LTP_CHECK_ATOMIC_MEMORY_MODEL
212LTP_CHECK_BUILTIN_CLEAR_CACHE
yaberauneyaef772532009-10-09 17:55:43 +0000213LTP_CHECK_CAPABILITY_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200214LTP_CHECK_CC_WARN_OLDSTYLE
215LTP_CHECK_CLONE_SUPPORTS_7_ARGS
yaberauneyaef772532009-10-09 17:55:43 +0000216LTP_CHECK_CRYPTO
Petr Vorelbf027842019-11-12 23:18:32 +0100217LTP_CHECK_FANOTIFY
Petr Vorela50338c2019-04-12 15:48:53 +0200218LTP_CHECK_FIDEDUPE
219LTP_CHECK_FORTIFY_SOURCE
Petr Vorela50338c2019-04-12 15:48:53 +0200220LTP_CHECK_FTS_H
221LTP_CHECK_IF_LINK
222LTP_CHECK_IOVEC
223LTP_CHECK_KCMP_TYPE
224LTP_CHECK_KERNEL_DEVEL
225LTP_CHECK_KEYUTILS_SUPPORT
yaberauneyaef772532009-10-09 17:55:43 +0000226LTP_CHECK_LINUX_PTRACE
Petr Vorela50338c2019-04-12 15:48:53 +0200227LTP_CHECK_LINUXRANDOM
228LTP_CHECK_MADVISE
229LTP_CHECK_MKDTEMP
230LTP_CHECK_MMSGHDR
231LTP_CHECK_MREMAP_FIXED
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400232LTP_CHECK_NOMMU_LINUX
Petr Vorela50338c2019-04-12 15:48:53 +0200233LTP_CHECK_PERF_EVENT
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700234LTP_CHECK_PRCTL_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200235LTP_CHECK_RLIMIT64
yaberauneyaef772532009-10-09 17:55:43 +0000236LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000237LTP_CHECK_SIGNAL
vaishnavid0d28fea2018-09-03 12:16:31 +0000238LTP_CHECK_STATX
Jan Stancekf61391e2016-04-13 13:09:23 +0200239LTP_CHECK_SYNC_ADD_AND_FETCH
Petr Vorela50338c2019-04-12 15:48:53 +0200240LTP_CHECK_SYSCALL_EVENTFD
241LTP_CHECK_SYSCALL_FCNTL
242LTP_CHECK_SYSCALL_MODIFY_LDT
Xing Gua3bfea22014-06-17 15:26:30 +0800243
Petr Vorelf4176722018-02-07 11:29:42 +0100244if test "x$with_numa" = xyes; then
245 LTP_CHECK_SYSCALL_NUMA
246 numa_error_msg="test requires libnuma >= 2 and it's development packages"
247else
248 numa_error_msg="NUMA support was disabled during build"
249fi
250AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
251
Christian Amanne3c82be2019-06-14 09:28:27 +0200252
Petr Vorela50338c2019-04-12 15:48:53 +0200253LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
Yang Xu4acfb8e2019-11-20 17:13:32 +0800254LTP_CHECK_SYSCALL_QUOTACTL
Petr Vorela50338c2019-04-12 15:48:53 +0200255LTP_CHECK_SYSCALL_SIGNALFD
256LTP_CHECK_SYSCALL_UTIMENSAT
257LTP_CHECK_TASKSTATS
Petr Vorela50338c2019-04-12 15:48:53 +0200258LTP_CHECK_TIMERFD
259test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
260LTP_CHECK_TPACKET_V3
261LTP_CHECK_UNAME_DOMAINNAME
Petr Vorela50338c2019-04-12 15:48:53 +0200262LTP_CHECK_X_TABLES
263LTP_DETECT_HOST_CPU
264
subrata_modak3d8666c2008-11-11 08:31:27 +0000265AC_OUTPUT