blob: 5a3dc5b62893f3e9152e33821c663ecb9ecbd219 [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 \
Yang Xu3ddc2172019-05-23 10:54:00 +080049 linux/seccomp.h \
Christian Amannb3621af2019-03-19 09:07:32 +010050 linux/userfaultfd.h \
Petr Vorel839128b2017-10-12 20:33:18 +020051 mm.h \
Xiao Yangbf8f1d72018-04-04 19:12:54 +080052 netinet/sctp.h \
Petr Vorel839128b2017-10-12 20:33:18 +020053 pthread.h \
yaberauneyaef772532009-10-09 17:55:43 +000054 sys/epoll.h \
Jan Karaf057c1c2013-11-20 23:43:13 +010055 sys/fanotify.h \
Petr Vorel839128b2017-10-12 20:33:18 +020056 sys/inotify.h \
yaberauneyaef772532009-10-09 17:55:43 +000057 sys/prctl.h \
Sandeep Patil524edfb2017-11-08 16:34:36 -080058 sys/shm.h \
Petr Vorel0ff33b32017-10-11 15:53:33 +020059 sys/ustat.h \
Petr Vorel839128b2017-10-12 20:33:18 +020060 sys/xattr.h \
yaberauneyaef772532009-10-09 17:55:43 +000061])
62
Petr Vorel0ff33b32017-10-11 15:53:33 +020063AC_CHECK_FUNCS([ \
Christian Amanna72f4b22019-05-06 12:54:57 +020064 copy_file_range \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080065 epoll_pwait \
66 execveat \
67 fallocate \
68 fchownat \
69 fstatat \
70 kcmp \
71 mkdirat \
72 mknodat \
73 openat \
74 preadv \
75 preadv2 \
Petr Vorel0ff33b32017-10-11 15:53:33 +020076 profil \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080077 pwritev \
78 pwritev2 \
79 readlinkat \
80 renameat \
81 renameat2 \
Yang Xu4c41cf72019-04-17 14:05:02 +080082 sched_getcpu \
Xiao Yanga600c362019-04-05 15:46:24 +080083 sigpending \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080084 splice \
Xiao Yang66c59e92019-04-05 17:12:50 +080085 stime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080086 syncfs \
87 sync_file_range \
88 tee \
89 unshare \
Petr Vorel0ff33b32017-10-11 15:53:33 +020090 ustat \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080091 vmsplice \
Petr Vorel0ff33b32017-10-11 15:53:33 +020092])
Petr Vorel25b35652017-10-02 15:33:41 +020093
Garrett Cooper52288dc2010-11-16 22:01:43 -080094# Tools knobs
95
96# Expect
97AC_ARG_WITH([bash],
98 [AC_HELP_STRING([--with-bash],
99 [have the Bourne Again SHell interpreter (default=no)])],
100 [with_bash=yes],
101)
102if test "x$with_bash" = xyes; then
103 AC_SUBST([WITH_BASH],["yes"])
104else
105 AC_SUBST([WITH_BASH],["no"])
106fi
107
108AC_ARG_WITH([expect],
109 [AC_HELP_STRING([--with-expect],
110 [have the Tcl/expect library (default=yes)])],
111 [with_expect=yes],
112 [with_expect=no]
113)
114if test "x$with_expect" = xyes; then
115 AC_SUBST([WITH_EXPECT],["yes"])
116else
117 AC_SUBST([WITH_EXPECT],["no"])
118fi
119
Anders Roxell39a85a12018-02-05 11:56:04 +0100120# Numa
121AC_ARG_WITH([numa],
122 AC_HELP_STRING([--without-numa],
Petr Vorel4ace68a2018-02-07 11:09:49 +0100123 [without numa support (default=no)]),
Anders Roxell39a85a12018-02-05 11:56:04 +0100124 [with_numa=no],
125 [with_numa=yes]
126)
127
Garrett Cooper52288dc2010-11-16 22:01:43 -0800128# Perl
129AC_ARG_WITH([perl],
130 [AC_HELP_STRING([--with-perl],
131 [have a perl interpreter (default=yes)])],
132 [with_perl=yes],
133 [with_perl=no]
134)
135if test "x$with_perl" = xyes; then
136 AC_SUBST([WITH_PERL],["yes"])
137else
138 AC_SUBST([WITH_PERL],["no"])
139fi
140
141# Python
142AC_ARG_WITH([python],
143 [AC_HELP_STRING([--with-python],
144 [have a python interpreter (default=yes)])],
145 [with_python=yes],
146 [with_python=no]
147)
148if test "x$with_python" = xyes; then
149 AC_SUBST([WITH_PYTHON],["yes"])
150else
151 AC_SUBST([WITH_PYTHON],["no"])
152fi
Anders Roxell7b258152018-02-14 13:04:31 +0100153
154# TI RPC
155AC_ARG_WITH([tirpc],
156 AC_HELP_STRING([--without-tirpc],
157 [without libtirpc support (default=no)]),
158 [with_tirpc=no],
159 [with_tirpc=yes]
160)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800161# END tools knobs
162
163# Testsuites knobs
164
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800165AC_ARG_WITH([open-posix-testsuite],
166 [AC_HELP_STRING([--with-open-posix-testsuite],
167 [compile and install the open posix testsuite (default=no)])],
Mike Frysinger12298fe2017-03-31 18:12:12 -0400168 [with_open_posix_testsuite=$withval]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800169)
170if test "x$with_open_posix_testsuite" = xyes; then
171 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
172else
173 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
174fi
175
Garrett Cooper52288dc2010-11-16 22:01:43 -0800176# testcases/realtime requires bash and python.
177if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
178 AC_ARG_WITH([realtime-testsuite],
179 [AC_HELP_STRING([--with-realtime-testsuite],
180 [compile and install the realtime testsuite (default=no)])],
181 [with_realtime_testsuite=yes]
182 )
183fi
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800184if test "x$with_realtime_testsuite" = xyes; then
185 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800186 # Run configure on testcases/realtime as well.
187 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800188else
189 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
190fi
191
Mats Liljegrenfb6efc42014-04-15 10:31:15 +0200192AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
193
Li Wang8d47fa72017-10-26 16:51:15 +0800194AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200195
Petr Vorela50338c2019-04-12 15:48:53 +0200196# custom functions
197LTP_CHECK_ACL_SUPPORT
198LTP_CHECK_ATOMIC_MEMORY_MODEL
199LTP_CHECK_BUILTIN_CLEAR_CACHE
yaberauneyaef772532009-10-09 17:55:43 +0000200LTP_CHECK_CAPABILITY_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200201LTP_CHECK_CC_WARN_OLDSTYLE
202LTP_CHECK_CLONE_SUPPORTS_7_ARGS
yaberauneyaef772532009-10-09 17:55:43 +0000203LTP_CHECK_CRYPTO
Petr Vorela50338c2019-04-12 15:48:53 +0200204LTP_CHECK_FIDEDUPE
205LTP_CHECK_FORTIFY_SOURCE
206LTP_CHECK_FS_IOC_FLAGS
207LTP_CHECK_FTS_H
208LTP_CHECK_IF_LINK
209LTP_CHECK_IOVEC
210LTP_CHECK_KCMP_TYPE
211LTP_CHECK_KERNEL_DEVEL
212LTP_CHECK_KEYUTILS_SUPPORT
yaberauneyaef772532009-10-09 17:55:43 +0000213LTP_CHECK_LINUX_PTRACE
Petr Vorela50338c2019-04-12 15:48:53 +0200214LTP_CHECK_LINUXRANDOM
215LTP_CHECK_MADVISE
216LTP_CHECK_MKDTEMP
217LTP_CHECK_MMSGHDR
218LTP_CHECK_MREMAP_FIXED
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400219LTP_CHECK_NOMMU_LINUX
Petr Vorela50338c2019-04-12 15:48:53 +0200220LTP_CHECK_PERF_EVENT
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700221LTP_CHECK_PRCTL_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200222LTP_CHECK_RLIMIT64
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700223LTP_CHECK_SECUREBITS
yaberauneyaef772532009-10-09 17:55:43 +0000224LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000225LTP_CHECK_SIGNAL
vaishnavid0d28fea2018-09-03 12:16:31 +0000226LTP_CHECK_STATX
Jan Stancekf61391e2016-04-13 13:09:23 +0200227LTP_CHECK_SYNC_ADD_AND_FETCH
Petr Vorela50338c2019-04-12 15:48:53 +0200228LTP_CHECK_SYSCALL_EVENTFD
229LTP_CHECK_SYSCALL_FCNTL
230LTP_CHECK_SYSCALL_MODIFY_LDT
Xing Gua3bfea22014-06-17 15:26:30 +0800231
Petr Vorelf4176722018-02-07 11:29:42 +0100232if test "x$with_numa" = xyes; then
233 LTP_CHECK_SYSCALL_NUMA
234 numa_error_msg="test requires libnuma >= 2 and it's development packages"
235else
236 numa_error_msg="NUMA support was disabled during build"
237fi
238AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
239
Petr Vorela50338c2019-04-12 15:48:53 +0200240LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
241LTP_CHECK_SYSCALL_QUOTACTL
242LTP_CHECK_SYSCALL_SIGNALFD
243LTP_CHECK_SYSCALL_UTIMENSAT
244LTP_CHECK_TASKSTATS
245LTP_CHECK_TIME
246LTP_CHECK_TIMERFD
247test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
248LTP_CHECK_TPACKET_V3
249LTP_CHECK_UNAME_DOMAINNAME
250LTP_CHECK_XFS_QUOTACTL
251LTP_CHECK_X_TABLES
252LTP_DETECT_HOST_CPU
253
subrata_modak3d8666c2008-11-11 08:31:27 +0000254AC_OUTPUT