blob: 5dc85728ad4af7a5b966d2a1761f37f28e59b09a [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([ \
Christian Amanna72f4b22019-05-06 12:54:57 +020063 copy_file_range \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080064 epoll_pwait \
65 execveat \
66 fallocate \
67 fchownat \
68 fstatat \
69 kcmp \
70 mkdirat \
71 mknodat \
72 openat \
73 preadv \
74 preadv2 \
Petr Vorel0ff33b32017-10-11 15:53:33 +020075 profil \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080076 pwritev \
77 pwritev2 \
78 readlinkat \
79 renameat \
80 renameat2 \
Yang Xu4c41cf72019-04-17 14:05:02 +080081 sched_getcpu \
Xiao Yanga600c362019-04-05 15:46:24 +080082 sigpending \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080083 splice \
Xiao Yang66c59e92019-04-05 17:12:50 +080084 stime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080085 syncfs \
86 sync_file_range \
87 tee \
88 unshare \
Petr Vorel0ff33b32017-10-11 15:53:33 +020089 ustat \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080090 vmsplice \
Petr Vorel0ff33b32017-10-11 15:53:33 +020091])
Petr Vorel25b35652017-10-02 15:33:41 +020092
Garrett Cooper52288dc2010-11-16 22:01:43 -080093# Tools knobs
94
95# Expect
96AC_ARG_WITH([bash],
97 [AC_HELP_STRING([--with-bash],
98 [have the Bourne Again SHell interpreter (default=no)])],
99 [with_bash=yes],
100)
101if test "x$with_bash" = xyes; then
102 AC_SUBST([WITH_BASH],["yes"])
103else
104 AC_SUBST([WITH_BASH],["no"])
105fi
106
107AC_ARG_WITH([expect],
108 [AC_HELP_STRING([--with-expect],
109 [have the Tcl/expect library (default=yes)])],
110 [with_expect=yes],
111 [with_expect=no]
112)
113if test "x$with_expect" = xyes; then
114 AC_SUBST([WITH_EXPECT],["yes"])
115else
116 AC_SUBST([WITH_EXPECT],["no"])
117fi
118
Anders Roxell39a85a12018-02-05 11:56:04 +0100119# Numa
120AC_ARG_WITH([numa],
121 AC_HELP_STRING([--without-numa],
Petr Vorel4ace68a2018-02-07 11:09:49 +0100122 [without numa support (default=no)]),
Anders Roxell39a85a12018-02-05 11:56:04 +0100123 [with_numa=no],
124 [with_numa=yes]
125)
126
Garrett Cooper52288dc2010-11-16 22:01:43 -0800127# Perl
128AC_ARG_WITH([perl],
129 [AC_HELP_STRING([--with-perl],
130 [have a perl interpreter (default=yes)])],
131 [with_perl=yes],
132 [with_perl=no]
133)
134if test "x$with_perl" = xyes; then
135 AC_SUBST([WITH_PERL],["yes"])
136else
137 AC_SUBST([WITH_PERL],["no"])
138fi
139
140# Python
141AC_ARG_WITH([python],
142 [AC_HELP_STRING([--with-python],
143 [have a python interpreter (default=yes)])],
144 [with_python=yes],
145 [with_python=no]
146)
147if test "x$with_python" = xyes; then
148 AC_SUBST([WITH_PYTHON],["yes"])
149else
150 AC_SUBST([WITH_PYTHON],["no"])
151fi
Anders Roxell7b258152018-02-14 13:04:31 +0100152
153# TI RPC
154AC_ARG_WITH([tirpc],
155 AC_HELP_STRING([--without-tirpc],
156 [without libtirpc support (default=no)]),
157 [with_tirpc=no],
158 [with_tirpc=yes]
159)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800160# END tools knobs
161
162# Testsuites knobs
163
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800164AC_ARG_WITH([open-posix-testsuite],
165 [AC_HELP_STRING([--with-open-posix-testsuite],
166 [compile and install the open posix testsuite (default=no)])],
Mike Frysinger12298fe2017-03-31 18:12:12 -0400167 [with_open_posix_testsuite=$withval]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800168)
169if test "x$with_open_posix_testsuite" = xyes; then
170 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
171else
172 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
173fi
174
Garrett Cooper52288dc2010-11-16 22:01:43 -0800175# testcases/realtime requires bash and python.
176if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
177 AC_ARG_WITH([realtime-testsuite],
178 [AC_HELP_STRING([--with-realtime-testsuite],
179 [compile and install the realtime testsuite (default=no)])],
180 [with_realtime_testsuite=yes]
181 )
182fi
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800183if test "x$with_realtime_testsuite" = xyes; then
184 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800185 # Run configure on testcases/realtime as well.
186 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800187else
188 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
189fi
190
Mats Liljegrenfb6efc42014-04-15 10:31:15 +0200191AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
192
Li Wang8d47fa72017-10-26 16:51:15 +0800193AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200194
Petr Vorela50338c2019-04-12 15:48:53 +0200195# custom functions
196LTP_CHECK_ACL_SUPPORT
197LTP_CHECK_ATOMIC_MEMORY_MODEL
198LTP_CHECK_BUILTIN_CLEAR_CACHE
yaberauneyaef772532009-10-09 17:55:43 +0000199LTP_CHECK_CAPABILITY_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200200LTP_CHECK_CC_WARN_OLDSTYLE
201LTP_CHECK_CLONE_SUPPORTS_7_ARGS
yaberauneyaef772532009-10-09 17:55:43 +0000202LTP_CHECK_CRYPTO
Petr Vorela50338c2019-04-12 15:48:53 +0200203LTP_CHECK_FIDEDUPE
204LTP_CHECK_FORTIFY_SOURCE
205LTP_CHECK_FS_IOC_FLAGS
206LTP_CHECK_FTS_H
207LTP_CHECK_IF_LINK
208LTP_CHECK_IOVEC
209LTP_CHECK_KCMP_TYPE
210LTP_CHECK_KERNEL_DEVEL
211LTP_CHECK_KEYUTILS_SUPPORT
yaberauneyaef772532009-10-09 17:55:43 +0000212LTP_CHECK_LINUX_PTRACE
Petr Vorela50338c2019-04-12 15:48:53 +0200213LTP_CHECK_LINUXRANDOM
214LTP_CHECK_MADVISE
215LTP_CHECK_MKDTEMP
216LTP_CHECK_MMSGHDR
217LTP_CHECK_MREMAP_FIXED
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400218LTP_CHECK_NOMMU_LINUX
Petr Vorela50338c2019-04-12 15:48:53 +0200219LTP_CHECK_PERF_EVENT
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700220LTP_CHECK_PRCTL_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200221LTP_CHECK_RLIMIT64
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700222LTP_CHECK_SECUREBITS
yaberauneyaef772532009-10-09 17:55:43 +0000223LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000224LTP_CHECK_SIGNAL
vaishnavid0d28fea2018-09-03 12:16:31 +0000225LTP_CHECK_STATX
Jan Stancekf61391e2016-04-13 13:09:23 +0200226LTP_CHECK_SYNC_ADD_AND_FETCH
Petr Vorela50338c2019-04-12 15:48:53 +0200227LTP_CHECK_SYSCALL_EVENTFD
228LTP_CHECK_SYSCALL_FCNTL
229LTP_CHECK_SYSCALL_MODIFY_LDT
Xing Gua3bfea22014-06-17 15:26:30 +0800230
Petr Vorelf4176722018-02-07 11:29:42 +0100231if test "x$with_numa" = xyes; then
232 LTP_CHECK_SYSCALL_NUMA
233 numa_error_msg="test requires libnuma >= 2 and it's development packages"
234else
235 numa_error_msg="NUMA support was disabled during build"
236fi
237AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
238
Petr Vorela50338c2019-04-12 15:48:53 +0200239LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
240LTP_CHECK_SYSCALL_QUOTACTL
241LTP_CHECK_SYSCALL_SIGNALFD
242LTP_CHECK_SYSCALL_UTIMENSAT
243LTP_CHECK_TASKSTATS
244LTP_CHECK_TIME
245LTP_CHECK_TIMERFD
246test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
247LTP_CHECK_TPACKET_V3
248LTP_CHECK_UNAME_DOMAINNAME
249LTP_CHECK_XFS_QUOTACTL
250LTP_CHECK_X_TABLES
251LTP_DETECT_HOST_CPU
252
subrata_modak3d8666c2008-11-11 08:31:27 +0000253AC_OUTPUT