blob: 53ad784d758c08f4706b685b7fbeac5a6fed01f0 [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 \
Alexey Kodanev640f1062018-03-23 18:06:04 +030039 linux/dccp.h \
Richard Palethorpea0ce4432018-07-05 16:56:33 +020040 linux/cryptouser.h \
yaberauneyaef772532009-10-09 17:55:43 +000041 linux/genetlink.h \
Petr Voreld47c06e2017-10-12 20:33:20 +020042 linux/keyctl.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 \
yaberauneyacb805c42009-12-22 23:10:41 +000046 linux/mempolicy.h \
yaberauneyaef772532009-10-09 17:55:43 +000047 linux/module.h \
48 linux/netlink.h \
Christian Amannb3621af2019-03-19 09:07:32 +010049 linux/userfaultfd.h \
Petr Vorel839128b2017-10-12 20:33:18 +020050 mm.h \
Xiao Yangbf8f1d72018-04-04 19:12:54 +080051 netinet/sctp.h \
Petr Vorel839128b2017-10-12 20:33:18 +020052 pthread.h \
yaberauneyaef772532009-10-09 17:55:43 +000053 sys/epoll.h \
Jan Karaf057c1c2013-11-20 23:43:13 +010054 sys/fanotify.h \
Petr Vorel839128b2017-10-12 20:33:18 +020055 sys/inotify.h \
yaberauneyaef772532009-10-09 17:55:43 +000056 sys/prctl.h \
Sandeep Patil524edfb2017-11-08 16:34:36 -080057 sys/shm.h \
Petr Vorel0ff33b32017-10-11 15:53:33 +020058 sys/ustat.h \
Petr Vorel839128b2017-10-12 20:33:18 +020059 sys/xattr.h \
yaberauneyaef772532009-10-09 17:55:43 +000060])
61
Petr Vorel0ff33b32017-10-11 15:53:33 +020062AC_CHECK_FUNCS([ \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080063 epoll_pwait \
64 execveat \
65 fallocate \
66 fchownat \
67 fstatat \
68 kcmp \
69 mkdirat \
70 mknodat \
71 openat \
72 preadv \
73 preadv2 \
Petr Vorel0ff33b32017-10-11 15:53:33 +020074 profil \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080075 pwritev \
76 pwritev2 \
77 readlinkat \
78 renameat \
79 renameat2 \
Yang Xu4c41cf72019-04-17 14:05:02 +080080 sched_getcpu \
Xiao Yanga600c362019-04-05 15:46:24 +080081 sigpending \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080082 splice \
Xiao Yang66c59e92019-04-05 17:12:50 +080083 stime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080084 syncfs \
85 sync_file_range \
86 tee \
87 unshare \
Petr Vorel0ff33b32017-10-11 15:53:33 +020088 ustat \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080089 vmsplice \
Petr Vorel0ff33b32017-10-11 15:53:33 +020090])
Petr Vorel25b35652017-10-02 15:33:41 +020091
Garrett Cooper52288dc2010-11-16 22:01:43 -080092# Tools knobs
93
94# Expect
95AC_ARG_WITH([bash],
96 [AC_HELP_STRING([--with-bash],
97 [have the Bourne Again SHell interpreter (default=no)])],
98 [with_bash=yes],
99)
100if test "x$with_bash" = xyes; then
101 AC_SUBST([WITH_BASH],["yes"])
102else
103 AC_SUBST([WITH_BASH],["no"])
104fi
105
106AC_ARG_WITH([expect],
107 [AC_HELP_STRING([--with-expect],
108 [have the Tcl/expect library (default=yes)])],
109 [with_expect=yes],
110 [with_expect=no]
111)
112if test "x$with_expect" = xyes; then
113 AC_SUBST([WITH_EXPECT],["yes"])
114else
115 AC_SUBST([WITH_EXPECT],["no"])
116fi
117
Anders Roxell39a85a12018-02-05 11:56:04 +0100118# Numa
119AC_ARG_WITH([numa],
120 AC_HELP_STRING([--without-numa],
Petr Vorel4ace68a2018-02-07 11:09:49 +0100121 [without numa support (default=no)]),
Anders Roxell39a85a12018-02-05 11:56:04 +0100122 [with_numa=no],
123 [with_numa=yes]
124)
125
Garrett Cooper52288dc2010-11-16 22:01:43 -0800126# Perl
127AC_ARG_WITH([perl],
128 [AC_HELP_STRING([--with-perl],
129 [have a perl interpreter (default=yes)])],
130 [with_perl=yes],
131 [with_perl=no]
132)
133if test "x$with_perl" = xyes; then
134 AC_SUBST([WITH_PERL],["yes"])
135else
136 AC_SUBST([WITH_PERL],["no"])
137fi
138
139# Python
140AC_ARG_WITH([python],
141 [AC_HELP_STRING([--with-python],
142 [have a python interpreter (default=yes)])],
143 [with_python=yes],
144 [with_python=no]
145)
146if test "x$with_python" = xyes; then
147 AC_SUBST([WITH_PYTHON],["yes"])
148else
149 AC_SUBST([WITH_PYTHON],["no"])
150fi
Anders Roxell7b258152018-02-14 13:04:31 +0100151
152# TI RPC
153AC_ARG_WITH([tirpc],
154 AC_HELP_STRING([--without-tirpc],
155 [without libtirpc support (default=no)]),
156 [with_tirpc=no],
157 [with_tirpc=yes]
158)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800159# END tools knobs
160
161# Testsuites knobs
162
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800163AC_ARG_WITH([open-posix-testsuite],
164 [AC_HELP_STRING([--with-open-posix-testsuite],
165 [compile and install the open posix testsuite (default=no)])],
Mike Frysinger12298fe2017-03-31 18:12:12 -0400166 [with_open_posix_testsuite=$withval]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800167)
168if test "x$with_open_posix_testsuite" = xyes; then
169 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
170else
171 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
172fi
173
Garrett Cooper52288dc2010-11-16 22:01:43 -0800174# testcases/realtime requires bash and python.
175if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
176 AC_ARG_WITH([realtime-testsuite],
177 [AC_HELP_STRING([--with-realtime-testsuite],
178 [compile and install the realtime testsuite (default=no)])],
179 [with_realtime_testsuite=yes]
180 )
181fi
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800182if test "x$with_realtime_testsuite" = xyes; then
183 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800184 # Run configure on testcases/realtime as well.
185 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800186else
187 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
188fi
189
Mats Liljegrenfb6efc42014-04-15 10:31:15 +0200190AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
191
Li Wang8d47fa72017-10-26 16:51:15 +0800192AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200193
Petr Vorela50338c2019-04-12 15:48:53 +0200194# custom functions
195LTP_CHECK_ACL_SUPPORT
196LTP_CHECK_ATOMIC_MEMORY_MODEL
197LTP_CHECK_BUILTIN_CLEAR_CACHE
yaberauneyaef772532009-10-09 17:55:43 +0000198LTP_CHECK_CAPABILITY_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200199LTP_CHECK_CC_WARN_OLDSTYLE
200LTP_CHECK_CLONE_SUPPORTS_7_ARGS
yaberauneyaef772532009-10-09 17:55:43 +0000201LTP_CHECK_CRYPTO
Petr Vorela50338c2019-04-12 15:48:53 +0200202LTP_CHECK_FIDEDUPE
203LTP_CHECK_FORTIFY_SOURCE
204LTP_CHECK_FS_IOC_FLAGS
205LTP_CHECK_FTS_H
206LTP_CHECK_IF_LINK
207LTP_CHECK_IOVEC
208LTP_CHECK_KCMP_TYPE
209LTP_CHECK_KERNEL_DEVEL
210LTP_CHECK_KEYUTILS_SUPPORT
yaberauneyaef772532009-10-09 17:55:43 +0000211LTP_CHECK_LINUX_PTRACE
Petr Vorela50338c2019-04-12 15:48:53 +0200212LTP_CHECK_LINUXRANDOM
213LTP_CHECK_MADVISE
214LTP_CHECK_MKDTEMP
215LTP_CHECK_MMSGHDR
216LTP_CHECK_MREMAP_FIXED
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400217LTP_CHECK_NOMMU_LINUX
Petr Vorela50338c2019-04-12 15:48:53 +0200218LTP_CHECK_PERF_EVENT
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700219LTP_CHECK_PRCTL_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200220LTP_CHECK_RLIMIT64
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700221LTP_CHECK_SECUREBITS
yaberauneyaef772532009-10-09 17:55:43 +0000222LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000223LTP_CHECK_SIGNAL
vaishnavid0d28fea2018-09-03 12:16:31 +0000224LTP_CHECK_STATX
Jan Stancekf61391e2016-04-13 13:09:23 +0200225LTP_CHECK_SYNC_ADD_AND_FETCH
Petr Vorela50338c2019-04-12 15:48:53 +0200226LTP_CHECK_SYSCALL_EVENTFD
227LTP_CHECK_SYSCALL_FCNTL
228LTP_CHECK_SYSCALL_MODIFY_LDT
Xing Gua3bfea22014-06-17 15:26:30 +0800229
Petr Vorelf4176722018-02-07 11:29:42 +0100230if test "x$with_numa" = xyes; then
231 LTP_CHECK_SYSCALL_NUMA
232 numa_error_msg="test requires libnuma >= 2 and it's development packages"
233else
234 numa_error_msg="NUMA support was disabled during build"
235fi
236AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
237
Petr Vorela50338c2019-04-12 15:48:53 +0200238LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
239LTP_CHECK_SYSCALL_QUOTACTL
240LTP_CHECK_SYSCALL_SIGNALFD
241LTP_CHECK_SYSCALL_UTIMENSAT
242LTP_CHECK_TASKSTATS
243LTP_CHECK_TIME
244LTP_CHECK_TIMERFD
245test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
246LTP_CHECK_TPACKET_V3
247LTP_CHECK_UNAME_DOMAINNAME
248LTP_CHECK_XFS_QUOTACTL
249LTP_CHECK_X_TABLES
250LTP_DETECT_HOST_CPU
251
subrata_modak3d8666c2008-11-11 08:31:27 +0000252AC_OUTPUT