blob: 9ff37af7d6a03699866f710d9d67f9e77e2bf498 [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 \
yaberauneyaef772532009-10-09 17:55:43 +000039 linux/genetlink.h \
Petr Voreld47c06e2017-10-12 20:33:20 +020040 linux/keyctl.h \
Richard Palethorpedb141702017-11-02 15:34:41 +010041 linux/if_packet.h \
42 linux/if_ether.h \
yaberauneyacb805c42009-12-22 23:10:41 +000043 linux/mempolicy.h \
yaberauneyaef772532009-10-09 17:55:43 +000044 linux/module.h \
45 linux/netlink.h \
Petr Vorel839128b2017-10-12 20:33:18 +020046 mm.h \
47 pthread.h \
yaberauneyaef772532009-10-09 17:55:43 +000048 sys/epoll.h \
Jan Karaf057c1c2013-11-20 23:43:13 +010049 sys/fanotify.h \
Petr Vorel839128b2017-10-12 20:33:18 +020050 sys/inotify.h \
yaberauneyaef772532009-10-09 17:55:43 +000051 sys/prctl.h \
Sandeep Patil524edfb2017-11-08 16:34:36 -080052 sys/shm.h \
Petr Vorel0ff33b32017-10-11 15:53:33 +020053 sys/ustat.h \
Petr Vorel839128b2017-10-12 20:33:18 +020054 sys/xattr.h \
yaberauneyaef772532009-10-09 17:55:43 +000055])
56
Petr Vorel0ff33b32017-10-11 15:53:33 +020057AC_CHECK_FUNCS([ \
58 profil \
59 ustat \
60])
Petr Vorel25b35652017-10-02 15:33:41 +020061
Garrett Cooper52288dc2010-11-16 22:01:43 -080062# Tools knobs
63
64# Expect
65AC_ARG_WITH([bash],
66 [AC_HELP_STRING([--with-bash],
67 [have the Bourne Again SHell interpreter (default=no)])],
68 [with_bash=yes],
69)
70if test "x$with_bash" = xyes; then
71 AC_SUBST([WITH_BASH],["yes"])
72else
73 AC_SUBST([WITH_BASH],["no"])
74fi
75
76AC_ARG_WITH([expect],
77 [AC_HELP_STRING([--with-expect],
78 [have the Tcl/expect library (default=yes)])],
79 [with_expect=yes],
80 [with_expect=no]
81)
82if test "x$with_expect" = xyes; then
83 AC_SUBST([WITH_EXPECT],["yes"])
84else
85 AC_SUBST([WITH_EXPECT],["no"])
86fi
87
Anders Roxell39a85a12018-02-05 11:56:04 +010088# Numa
89AC_ARG_WITH([numa],
90 AC_HELP_STRING([--without-numa],
Petr Vorel4ace68a2018-02-07 11:09:49 +010091 [without numa support (default=no)]),
Anders Roxell39a85a12018-02-05 11:56:04 +010092 [with_numa=no],
93 [with_numa=yes]
94)
95
Garrett Cooper52288dc2010-11-16 22:01:43 -080096# Perl
97AC_ARG_WITH([perl],
98 [AC_HELP_STRING([--with-perl],
99 [have a perl interpreter (default=yes)])],
100 [with_perl=yes],
101 [with_perl=no]
102)
103if test "x$with_perl" = xyes; then
104 AC_SUBST([WITH_PERL],["yes"])
105else
106 AC_SUBST([WITH_PERL],["no"])
107fi
108
109# Python
110AC_ARG_WITH([python],
111 [AC_HELP_STRING([--with-python],
112 [have a python interpreter (default=yes)])],
113 [with_python=yes],
114 [with_python=no]
115)
116if test "x$with_python" = xyes; then
117 AC_SUBST([WITH_PYTHON],["yes"])
118else
119 AC_SUBST([WITH_PYTHON],["no"])
120fi
Anders Roxell7b258152018-02-14 13:04:31 +0100121
122# TI RPC
123AC_ARG_WITH([tirpc],
124 AC_HELP_STRING([--without-tirpc],
125 [without libtirpc support (default=no)]),
126 [with_tirpc=no],
127 [with_tirpc=yes]
128)
Garrett Cooper52288dc2010-11-16 22:01:43 -0800129# END tools knobs
130
131# Testsuites knobs
132
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800133AC_ARG_WITH([open-posix-testsuite],
134 [AC_HELP_STRING([--with-open-posix-testsuite],
135 [compile and install the open posix testsuite (default=no)])],
Mike Frysinger12298fe2017-03-31 18:12:12 -0400136 [with_open_posix_testsuite=$withval]
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800137)
138if test "x$with_open_posix_testsuite" = xyes; then
139 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
140else
141 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
142fi
143
Garrett Cooper52288dc2010-11-16 22:01:43 -0800144# testcases/realtime requires bash and python.
145if test "x$with_bash" = xyes && test "x$with_python" = xyes; then
146 AC_ARG_WITH([realtime-testsuite],
147 [AC_HELP_STRING([--with-realtime-testsuite],
148 [compile and install the realtime testsuite (default=no)])],
149 [with_realtime_testsuite=yes]
150 )
151fi
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800152if test "x$with_realtime_testsuite" = xyes; then
153 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
Garrett Cooper52288dc2010-11-16 22:01:43 -0800154 # Run configure on testcases/realtime as well.
155 AC_CONFIG_SUBDIRS([testcases/realtime])
Garrett Cooper92dfd5b2010-11-16 20:02:26 -0800156else
157 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
158fi
159
Mats Liljegrenfb6efc42014-04-15 10:31:15 +0200160AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
161
Li Wang8d47fa72017-10-26 16:51:15 +0800162AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
Cyril Hrubisa07008f2017-06-14 17:25:09 +0200163
Garrett Cooper52288dc2010-11-16 22:01:43 -0800164# END testsuites knobs
Cyril Hrubis4b3007a2013-09-02 16:13:16 +0200165LTP_CHECK_FORTIFY_SOURCE
Alexey Kodanev20eb0712014-04-11 13:26:59 +0400166LTP_CHECK_CC_WARN_OLDSTYLE
Cyril Hrubis6aa37bb2012-08-09 20:36:47 +0300167LTP_CHECK_MKDTEMP
yaberauneyaef772532009-10-09 17:55:43 +0000168LTP_CHECK_CAPABILITY_SUPPORT
169LTP_CHECK_CRYPTO
170LTP_CHECK_LINUX_PTRACE
Mike Frysinger9bd940b2010-08-17 17:22:03 -0400171LTP_CHECK_NOMMU_LINUX
Garrett Cooper4f71cae2010-11-01 21:09:17 -0700172LTP_CHECK_PRCTL_SUPPORT
173LTP_CHECK_SECUREBITS
yaberauneyaef772532009-10-09 17:55:43 +0000174LTP_CHECK_SELINUX
yaberauneyae34a3c22009-11-30 12:26:05 +0000175LTP_CHECK_SIGNAL
subrata_modak4fc9f542009-01-16 09:03:14 +0000176LTP_CHECK_SYSCALL_EVENTFD
vapierdf8759f2009-01-18 22:22:40 +0000177LTP_CHECK_SYSCALL_MODIFY_LDT
yaberauneyaef772532009-10-09 17:55:43 +0000178LTP_CHECK_SYSCALL_QUOTACTL
vapierdf8759f2009-01-18 22:22:40 +0000179LTP_CHECK_SYSCALL_SIGNALFD
subrata_modak5e0db1d2009-08-25 07:37:45 +0000180LTP_CHECK_SYSCALL_UNSHARE
Stanislav Kholmanskikh2d585022013-12-04 16:16:26 +0400181LTP_CHECK_SYSCALL_UTIMENSAT
subrata_modak1c310982009-05-25 15:01:45 +0000182LTP_CHECK_TASKSTATS
Garrett Cooper06c96f32010-02-24 19:16:01 -0800183LTP_CHECK_TIME
Cyril Hrubis877cbae2011-02-07 20:00:31 +0100184LTP_CHECK_MADVISE
Cyril Hrubisdcd79092011-03-31 18:01:23 +0200185LTP_CHECK_ACL_SUPPORT
Cyril Hrubisc57112e2012-02-10 14:06:43 +0100186LTP_CHECK_FS_IOC_FLAGS
Cyril Hrubisbd8ae722012-02-10 15:01:19 +0100187LTP_CHECK_MREMAP_FIXED
Alexey Kodaneve0ad93b2013-06-19 15:56:43 +0400188LTP_CHECK_KERNEL_DEVEL
DAN LI39773182013-08-27 14:26:16 +0800189LTP_CHECK_XFS_QUOTACTL
Zeng Linggang1db62662014-01-09 20:10:11 +0800190LTP_CHECK_CLONE_SUPPORTS_7_ARGS
Cyril Hrubisc5d25422014-01-09 16:54:09 +0100191LTP_CHECK_MKDIRAT
Zeng Linggangf9113612014-02-26 17:35:13 +0800192LTP_CHECK_FCHOWNAT
Alexey Kodaneva84303b2016-03-02 15:32:20 +0300193LTP_CHECK_FSTATAT
Xiaoguang Wang7525e622014-03-04 14:32:00 +0800194LTP_CHECK_MKNODAT
Cyril Hrubis0ea7aa02014-05-07 12:42:38 +0200195LTP_CHECK_READLINKAT
gux.fnst@cn.fujitsu.com0d1cfbe2014-05-08 17:50:52 +0800196LTP_CHECK_OPENAT
Xing Gua3bfea22014-06-17 15:26:30 +0800197LTP_CHECK_RENAMEAT
Cedric Hnydab008b922015-10-01 11:46:25 +0200198LTP_CHECK_RENAMEAT2
Xiaoguang Wang02610ee2014-03-05 10:26:50 +0800199LTP_CHECK_FALLOCATE
Xiaoguang Wang477ea282014-03-19 16:14:43 +0800200LTP_CHECK_SYSCALL_FCNTL
Xiaoguang Wang7e6be182014-04-10 12:08:45 +0800201LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
Anders Roxell7b258152018-02-14 13:04:31 +0100202if test "x$with_tirpc" = xyes; then
Stanislav Kholmanskikha86d71f2014-03-25 18:24:29 +0400203LTP_CHECK_TIRPC
Anders Roxell7b258152018-02-14 13:04:31 +0100204fi
Xing Gufd060ed2014-05-30 15:37:04 +0800205LTP_CHECK_TEE
Xing Gucf900502014-05-30 16:05:25 +0800206LTP_CHECK_SPLICE
Cyril Hrubis42000682014-06-03 12:23:17 +0200207LTP_CHECK_VMSPLICE
Zeng Linggang9ac868c2014-06-27 10:02:52 +0800208LTP_CHECK_TIMERFD
Cyril Hrubis4c256b32014-08-13 15:32:17 +0200209LTP_CHECK_IOVEC
Jan Stancek17dce712015-07-13 13:58:21 +0200210LTP_CHECK_LINUXRANDOM
Cyril Hrubis80edf932015-09-01 15:03:40 +0200211LTP_CHECK_IF_LINK
Cedric Hnyda64059842015-10-08 16:49:07 +0200212LTP_CHECK_KCMP
213LTP_CHECK_KCMP_TYPE
Xiao Yang1274a3c2015-12-03 19:31:12 +0800214LTP_CHECK_PREADV
Xiao Yang4ca27ac2015-12-03 19:31:13 +0800215LTP_CHECK_PWRITEV
Guangwen Feng22c12be2016-03-03 16:24:45 +0800216LTP_CHECK_EPOLL_PWAIT
Xiao Yang2a9c1582016-04-14 17:22:05 +0800217LTP_CHECK_KEYUTILS_SUPPORT
Jan Stancekf61391e2016-04-13 13:09:23 +0200218LTP_CHECK_SYNC_ADD_AND_FETCH
Peter Maydell189aea22016-07-26 17:31:05 +0100219LTP_CHECK_BUILTIN_CLEAR_CACHE
Richard Palethorpe1be8bbd2017-06-23 14:22:04 +0200220LTP_CHECK_MMSGHDR
Richard Palethorpeb0589192017-06-23 14:22:06 +0200221LTP_CHECK_UNAME_DOMAINNAME
Richard Palethorpe4ae583e2017-08-02 16:24:22 +0200222LTP_CHECK_X_TABLES
Richard Palethorpebe880d12017-09-29 12:23:09 +0200223LTP_CHECK_ATOMIC_MEMORY_MODEL
Richard Palethorpedb141702017-11-02 15:34:41 +0100224LTP_CHECK_TPACKET_V3
Petr Vorel00ff2c32018-01-06 02:32:28 +0100225LTP_DETECT_HOST_CPU
Xing Gua3bfea22014-06-17 15:26:30 +0800226
Petr Vorelf4176722018-02-07 11:29:42 +0100227if test "x$with_numa" = xyes; then
228 LTP_CHECK_SYSCALL_NUMA
229 numa_error_msg="test requires libnuma >= 2 and it's development packages"
230else
231 numa_error_msg="NUMA support was disabled during build"
232fi
233AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
234
subrata_modak3d8666c2008-11-11 08:31:27 +0000235AC_OUTPUT