blob: 9208f1c6c6fd90b3710b456be24817c98f93b470 [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 \
yaberauneyaef772532009-10-09 17:55:43 +000040 linux/genetlink.h \
Petr Voreld47c06e2017-10-12 20:33:20 +020041 linux/keyctl.h \
Richard Palethorpedb141702017-11-02 15:34:41 +010042 linux/if_packet.h \
43 linux/if_ether.h \
yaberauneyacb805c42009-12-22 23:10:41 +000044 linux/mempolicy.h \
yaberauneyaef772532009-10-09 17:55:43 +000045 linux/module.h \
46 linux/netlink.h \
Petr Vorel839128b2017-10-12 20:33:18 +020047 mm.h \
Xiao Yangbf8f1d72018-04-04 19:12:54 +080048 netinet/sctp.h \
Petr Vorel839128b2017-10-12 20:33:18 +020049 pthread.h \
yaberauneyaef772532009-10-09 17:55:43 +000050 sys/epoll.h \
Jan Karaf057c1c2013-11-20 23:43:13 +010051 sys/fanotify.h \
Petr Vorel839128b2017-10-12 20:33:18 +020052 sys/inotify.h \
yaberauneyaef772532009-10-09 17:55:43 +000053 sys/prctl.h \
Sandeep Patil524edfb2017-11-08 16:34:36 -080054 sys/shm.h \
Petr Vorel0ff33b32017-10-11 15:53:33 +020055 sys/ustat.h \
Petr Vorel839128b2017-10-12 20:33:18 +020056 sys/xattr.h \
yaberauneyaef772532009-10-09 17:55:43 +000057])
58
Petr Vorel0ff33b32017-10-11 15:53:33 +020059AC_CHECK_FUNCS([ \
60 profil \
61 ustat \
62])
Petr Vorel25b35652017-10-02 15:33:41 +020063
Garrett Cooper52288dc2010-11-16 22:01:43 -080064# Tools knobs
65
66# Expect
67AC_ARG_WITH([bash],
68 [AC_HELP_STRING([--with-bash],
69 [have the Bourne Again SHell interpreter (default=no)])],
70 [with_bash=yes],
71)
72if test "x$with_bash" = xyes; then
73 AC_SUBST([WITH_BASH],["yes"])
74else
75 AC_SUBST([WITH_BASH],["no"])
76fi
77
78AC_ARG_WITH([expect],
79 [AC_HELP_STRING([--with-expect],
80 [have the Tcl/expect library (default=yes)])],
81 [with_expect=yes],
82 [with_expect=no]
83)
84if test "x$with_expect" = xyes; then
85 AC_SUBST([WITH_EXPECT],["yes"])
86else
87 AC_SUBST([WITH_EXPECT],["no"])
88fi
89
Anders Roxell39a85a12018-02-05 11:56:04 +010090# Numa
91AC_ARG_WITH([numa],
92 AC_HELP_STRING([--without-numa],
Petr Vorel4ace68a2018-02-07 11:09:49 +010093 [without numa support (default=no)]),
Anders Roxell39a85a12018-02-05 11:56:04 +010094 [with_numa=no],
95 [with_numa=yes]
96)
97
Garrett Cooper52288dc2010-11-16 22:01:43 -080098# Perl
99AC_ARG_WITH([perl],
100 [AC_HELP_STRING([--with-perl],
101 [have a perl interpreter (default=yes)])],
102 [with_perl=yes],
103 [with_perl=no]
104)
105if test "x$with_perl" = xyes; then
106 AC_SUBST([WITH_PERL],["yes"])
107else
108 AC_SUBST([WITH_PERL],["no"])
109fi
110
111# Python
112AC_ARG_WITH([python],
113 [AC_HELP_STRING([--with-python],
114 [have a python interpreter (default=yes)])],
115 [with_python=yes],
116 [with_python=no]
117)
118if test "x$with_python" = xyes; then
119 AC_SUBST([WITH_PYTHON],["yes"])
120else
121 AC_SUBST([WITH_PYTHON],["no"])
122fi
Anders Roxell7b258152018-02-14 13:04:31 +0100123
124# TI RPC
125AC_ARG_WITH([tirpc],
126 AC_HELP_STRING([--without-tirpc],
127 [without libtirpc support (default=no)]),
128 [with_tirpc=no],
129 [with_tirpc=yes]
130)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800131# END tools knobs
132
133# Testsuites knobs
134
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800135AC_ARG_WITH([open-posix-testsuite],
136 [AC_HELP_STRING([--with-open-posix-testsuite],
137 [compile and install the open posix testsuite (default=no)])],
Mike Frysinger12298fe2017-03-31 18:12:12 -0400138 [with_open_posix_testsuite=$withval]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800139)
140if test "x$with_open_posix_testsuite" = xyes; then
141 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
142else
143 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
144fi
145
Garrett Cooper52288dc2010-11-16 22:01:43 -0800146# testcases/realtime requires bash and python.
147if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
148 AC_ARG_WITH([realtime-testsuite],
149 [AC_HELP_STRING([--with-realtime-testsuite],
150 [compile and install the realtime testsuite (default=no)])],
151 [with_realtime_testsuite=yes]
152 )
153fi
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800154if test "x$with_realtime_testsuite" = xyes; then
155 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800156 # Run configure on testcases/realtime as well.
157 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800158else
159 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
160fi
161
Mats Liljegrenfb6efc42014-04-15 10:31:15 +0200162AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
163
Li Wang8d47fa72017-10-26 16:51:15 +0800164AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200165
Garrett Cooper52288dc2010-11-16 22:01:43 -0800166# END testsuites knobs
Cyril Hrubis4b3007a2013-09-02 16:13:16 +0200167LTP_CHECK_FORTIFY_SOURCE
Alexey Kodanev20eb0712014-04-11 13:26:59 +0400168LTP_CHECK_CC_WARN_OLDSTYLE
Cyril Hrubis6aa37bb2012-08-09 20:36:47 +0300169LTP_CHECK_MKDTEMP
yaberauneyaef772532009-10-09 17:55:43 +0000170LTP_CHECK_CAPABILITY_SUPPORT
171LTP_CHECK_CRYPTO
172LTP_CHECK_LINUX_PTRACE
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400173LTP_CHECK_NOMMU_LINUX
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700174LTP_CHECK_PRCTL_SUPPORT
175LTP_CHECK_SECUREBITS
yaberauneyaef772532009-10-09 17:55:43 +0000176LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000177LTP_CHECK_SIGNAL
subrata_modak4fc9f542009-01-16 09:03:14 +0000178LTP_CHECK_SYSCALL_EVENTFD
vapierdf8759f2009-01-18 22:22:40 +0000179LTP_CHECK_SYSCALL_MODIFY_LDT
yaberauneyaef772532009-10-09 17:55:43 +0000180LTP_CHECK_SYSCALL_QUOTACTL
vapierdf8759f2009-01-18 22:22:40 +0000181LTP_CHECK_SYSCALL_SIGNALFD
subrata_modak5e0db1d2009-08-25 07:37:45 +0000182LTP_CHECK_SYSCALL_UNSHARE
Stanislav Kholmanskikh2d585022013-12-04 16:16:26 +0400183LTP_CHECK_SYSCALL_UTIMENSAT
subrata_modak1c310982009-05-25 15:01:45 +0000184LTP_CHECK_TASKSTATS
Garrett Cooper06c96f32010-02-24 19:16:01 -0800185LTP_CHECK_TIME
Cyril Hrubis877cbae2011-02-07 20:00:31 +0100186LTP_CHECK_MADVISE
Cyril Hrubisdcd79092011-03-31 18:01:23 +0200187LTP_CHECK_ACL_SUPPORT
Cyril Hrubisc57112e2012-02-10 14:06:43 +0100188LTP_CHECK_FS_IOC_FLAGS
Cyril Hrubisbd8ae722012-02-10 15:01:19 +0100189LTP_CHECK_MREMAP_FIXED
Alexey Kodaneve0ad93b2013-06-19 15:56:43 +0400190LTP_CHECK_KERNEL_DEVEL
DAN LI39773182013-08-27 14:26:16 +0800191LTP_CHECK_XFS_QUOTACTL
Zeng Linggang1db62662014-01-09 20:10:11 +0800192LTP_CHECK_CLONE_SUPPORTS_7_ARGS
Cyril Hrubisc5d25422014-01-09 16:54:09 +0100193LTP_CHECK_MKDIRAT
Zeng Linggangf9113612014-02-26 17:35:13 +0800194LTP_CHECK_FCHOWNAT
Alexey Kodaneva84303b2016-03-02 15:32:20 +0300195LTP_CHECK_FSTATAT
Xiaoguang Wang7525e622014-03-04 14:32:00 +0800196LTP_CHECK_MKNODAT
Cyril Hrubis0ea7aa02014-05-07 12:42:38 +0200197LTP_CHECK_READLINKAT
gux.fnst@cn.fujitsu.com0d1cfbe2014-05-08 17:50:52 +0800198LTP_CHECK_OPENAT
Xing Gua3bfea22014-06-17 15:26:30 +0800199LTP_CHECK_RENAMEAT
Cedric Hnydab008b922015-10-01 11:46:25 +0200200LTP_CHECK_RENAMEAT2
Xiaoguang Wang02610ee2014-03-05 10:26:50 +0800201LTP_CHECK_FALLOCATE
Xiaoguang Wang477ea282014-03-19 16:14:43 +0800202LTP_CHECK_SYSCALL_FCNTL
Xiaoguang Wang7e6be182014-04-10 12:08:45 +0800203LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
Anders Roxell7b258152018-02-14 13:04:31 +0100204if test "x$with_tirpc" = xyes; then
Stanislav Kholmanskikha86d71f2014-03-25 18:24:29 +0400205LTP_CHECK_TIRPC
Anders Roxell7b258152018-02-14 13:04:31 +0100206fi
Xing Gufd060ed2014-05-30 15:37:04 +0800207LTP_CHECK_TEE
Xing Gucf900502014-05-30 16:05:25 +0800208LTP_CHECK_SPLICE
Cyril Hrubis42000682014-06-03 12:23:17 +0200209LTP_CHECK_VMSPLICE
Zeng Linggang9ac868c2014-06-27 10:02:52 +0800210LTP_CHECK_TIMERFD
Cyril Hrubis4c256b32014-08-13 15:32:17 +0200211LTP_CHECK_IOVEC
Jan Stancek17dce712015-07-13 13:58:21 +0200212LTP_CHECK_LINUXRANDOM
Cyril Hrubis80edf932015-09-01 15:03:40 +0200213LTP_CHECK_IF_LINK
Cedric Hnyda64059842015-10-08 16:49:07 +0200214LTP_CHECK_KCMP
215LTP_CHECK_KCMP_TYPE
Xiao Yang1274a3c2015-12-03 19:31:12 +0800216LTP_CHECK_PREADV
Xiao Yang4ca27ac2015-12-03 19:31:13 +0800217LTP_CHECK_PWRITEV
Guangwen Feng22c12be2016-03-03 16:24:45 +0800218LTP_CHECK_EPOLL_PWAIT
Xiao Yang2a9c1582016-04-14 17:22:05 +0800219LTP_CHECK_KEYUTILS_SUPPORT
Jan Stancekf61391e2016-04-13 13:09:23 +0200220LTP_CHECK_SYNC_ADD_AND_FETCH
Peter Maydell189aea22016-07-26 17:31:05 +0100221LTP_CHECK_BUILTIN_CLEAR_CACHE
Richard Palethorpe1be8bbd2017-06-23 14:22:04 +0200222LTP_CHECK_MMSGHDR
Richard Palethorpeb0589192017-06-23 14:22:06 +0200223LTP_CHECK_UNAME_DOMAINNAME
Richard Palethorpe4ae583e2017-08-02 16:24:22 +0200224LTP_CHECK_X_TABLES
Richard Palethorpebe880d12017-09-29 12:23:09 +0200225LTP_CHECK_ATOMIC_MEMORY_MODEL
Richard Palethorpedb141702017-11-02 15:34:41 +0100226LTP_CHECK_TPACKET_V3
Petr Vorel00ff2c32018-01-06 02:32:28 +0100227LTP_DETECT_HOST_CPU
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
subrata_modak3d8666c2008-11-11 08:31:27 +0000237AC_OUTPUT