blob: fad8f839603cb2512520f800cfc72336c22c7701 [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 \
Xiao Yanga600c362019-04-05 15:46:24 +080080 sigpending \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080081 splice \
Xiao Yang66c59e92019-04-05 17:12:50 +080082 stime \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080083 syncfs \
84 sync_file_range \
85 tee \
86 unshare \
Petr Vorel0ff33b32017-10-11 15:53:33 +020087 ustat \
Xiao Yang8fd49ce2019-04-05 15:55:39 +080088 vmsplice \
Petr Vorel0ff33b32017-10-11 15:53:33 +020089])
Petr Vorel25b35652017-10-02 15:33:41 +020090
Garrett Cooper52288dc2010-11-16 22:01:43 -080091# Tools knobs
92
93# Expect
94AC_ARG_WITH([bash],
95 [AC_HELP_STRING([--with-bash],
96 [have the Bourne Again SHell interpreter (default=no)])],
97 [with_bash=yes],
98)
99if test "x$with_bash" = xyes; then
100 AC_SUBST([WITH_BASH],["yes"])
101else
102 AC_SUBST([WITH_BASH],["no"])
103fi
104
105AC_ARG_WITH([expect],
106 [AC_HELP_STRING([--with-expect],
107 [have the Tcl/expect library (default=yes)])],
108 [with_expect=yes],
109 [with_expect=no]
110)
111if test "x$with_expect" = xyes; then
112 AC_SUBST([WITH_EXPECT],["yes"])
113else
114 AC_SUBST([WITH_EXPECT],["no"])
115fi
116
Anders Roxell39a85a12018-02-05 11:56:04 +0100117# Numa
118AC_ARG_WITH([numa],
119 AC_HELP_STRING([--without-numa],
Petr Vorel4ace68a2018-02-07 11:09:49 +0100120 [without numa support (default=no)]),
Anders Roxell39a85a12018-02-05 11:56:04 +0100121 [with_numa=no],
122 [with_numa=yes]
123)
124
Garrett Cooper52288dc2010-11-16 22:01:43 -0800125# Perl
126AC_ARG_WITH([perl],
127 [AC_HELP_STRING([--with-perl],
128 [have a perl interpreter (default=yes)])],
129 [with_perl=yes],
130 [with_perl=no]
131)
132if test "x$with_perl" = xyes; then
133 AC_SUBST([WITH_PERL],["yes"])
134else
135 AC_SUBST([WITH_PERL],["no"])
136fi
137
138# Python
139AC_ARG_WITH([python],
140 [AC_HELP_STRING([--with-python],
141 [have a python interpreter (default=yes)])],
142 [with_python=yes],
143 [with_python=no]
144)
145if test "x$with_python" = xyes; then
146 AC_SUBST([WITH_PYTHON],["yes"])
147else
148 AC_SUBST([WITH_PYTHON],["no"])
149fi
Anders Roxell7b258152018-02-14 13:04:31 +0100150
151# TI RPC
152AC_ARG_WITH([tirpc],
153 AC_HELP_STRING([--without-tirpc],
154 [without libtirpc support (default=no)]),
155 [with_tirpc=no],
156 [with_tirpc=yes]
157)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800158# END tools knobs
159
160# Testsuites knobs
161
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800162AC_ARG_WITH([open-posix-testsuite],
163 [AC_HELP_STRING([--with-open-posix-testsuite],
164 [compile and install the open posix testsuite (default=no)])],
Mike Frysinger12298fe2017-03-31 18:12:12 -0400165 [with_open_posix_testsuite=$withval]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800166)
167if test "x$with_open_posix_testsuite" = xyes; then
168 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
169else
170 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
171fi
172
Garrett Cooper52288dc2010-11-16 22:01:43 -0800173# testcases/realtime requires bash and python.
174if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
175 AC_ARG_WITH([realtime-testsuite],
176 [AC_HELP_STRING([--with-realtime-testsuite],
177 [compile and install the realtime testsuite (default=no)])],
178 [with_realtime_testsuite=yes]
179 )
180fi
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800181if test "x$with_realtime_testsuite" = xyes; then
182 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800183 # Run configure on testcases/realtime as well.
184 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800185else
186 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
187fi
188
Mats Liljegrenfb6efc42014-04-15 10:31:15 +0200189AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
190
Li Wang8d47fa72017-10-26 16:51:15 +0800191AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200192
Petr Vorela50338c2019-04-12 15:48:53 +0200193# custom functions
194LTP_CHECK_ACL_SUPPORT
195LTP_CHECK_ATOMIC_MEMORY_MODEL
196LTP_CHECK_BUILTIN_CLEAR_CACHE
yaberauneyaef772532009-10-09 17:55:43 +0000197LTP_CHECK_CAPABILITY_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200198LTP_CHECK_CC_WARN_OLDSTYLE
199LTP_CHECK_CLONE_SUPPORTS_7_ARGS
yaberauneyaef772532009-10-09 17:55:43 +0000200LTP_CHECK_CRYPTO
Petr Vorela50338c2019-04-12 15:48:53 +0200201LTP_CHECK_FIDEDUPE
202LTP_CHECK_FORTIFY_SOURCE
203LTP_CHECK_FS_IOC_FLAGS
204LTP_CHECK_FTS_H
205LTP_CHECK_IF_LINK
206LTP_CHECK_IOVEC
207LTP_CHECK_KCMP_TYPE
208LTP_CHECK_KERNEL_DEVEL
209LTP_CHECK_KEYUTILS_SUPPORT
yaberauneyaef772532009-10-09 17:55:43 +0000210LTP_CHECK_LINUX_PTRACE
Petr Vorela50338c2019-04-12 15:48:53 +0200211LTP_CHECK_LINUXRANDOM
212LTP_CHECK_MADVISE
213LTP_CHECK_MKDTEMP
214LTP_CHECK_MMSGHDR
215LTP_CHECK_MREMAP_FIXED
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400216LTP_CHECK_NOMMU_LINUX
Petr Vorela50338c2019-04-12 15:48:53 +0200217LTP_CHECK_PERF_EVENT
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700218LTP_CHECK_PRCTL_SUPPORT
Petr Vorela50338c2019-04-12 15:48:53 +0200219LTP_CHECK_RLIMIT64
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700220LTP_CHECK_SECUREBITS
yaberauneyaef772532009-10-09 17:55:43 +0000221LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000222LTP_CHECK_SIGNAL
vaishnavid0d28fea2018-09-03 12:16:31 +0000223LTP_CHECK_STATX
Jan Stancekf61391e2016-04-13 13:09:23 +0200224LTP_CHECK_SYNC_ADD_AND_FETCH
Petr Vorela50338c2019-04-12 15:48:53 +0200225LTP_CHECK_SYSCALL_EVENTFD
226LTP_CHECK_SYSCALL_FCNTL
227LTP_CHECK_SYSCALL_MODIFY_LDT
Xing Gua3bfea22014-06-17 15:26:30 +0800228
Petr Vorelf4176722018-02-07 11:29:42 +0100229if test "x$with_numa" = xyes; then
230 LTP_CHECK_SYSCALL_NUMA
231 numa_error_msg="test requires libnuma >= 2 and it's development packages"
232else
233 numa_error_msg="NUMA support was disabled during build"
234fi
235AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
236
Petr Vorela50338c2019-04-12 15:48:53 +0200237LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
238LTP_CHECK_SYSCALL_QUOTACTL
239LTP_CHECK_SYSCALL_SIGNALFD
240LTP_CHECK_SYSCALL_UTIMENSAT
241LTP_CHECK_TASKSTATS
242LTP_CHECK_TIME
243LTP_CHECK_TIMERFD
244test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
245LTP_CHECK_TPACKET_V3
246LTP_CHECK_UNAME_DOMAINNAME
247LTP_CHECK_XFS_QUOTACTL
248LTP_CHECK_X_TABLES
249LTP_DETECT_HOST_CPU
250
subrata_modak3d8666c2008-11-11 08:31:27 +0000251AC_OUTPUT