yaberauneya | 9913e82 | 2009-11-26 11:27:34 +0000 | [diff] [blame] | 1 | AC_PREREQ(2.61) |
Cyril Hrubis | 70d7e8c | 2015-09-15 12:50:31 +0200 | [diff] [blame] | 2 | AC_INIT([ltp], [LTP_VERSION], [ltp@lists.linux.it]) |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 3 | AC_CONFIG_AUX_DIR([.]) |
| 4 | AM_INIT_AUTOMAKE |
subrata_modak | 3d8666c | 2008-11-11 08:31:27 +0000 | [diff] [blame] | 5 | AC_CONFIG_HEADERS([include/config.h]) |
Cyril Hrubis | edbae29 | 2014-07-15 14:57:27 +0200 | [diff] [blame] | 6 | AC_CONFIG_MACRO_DIR([m4]) |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 7 | AC_CONFIG_FILES([ \ |
| 8 | include/mk/config.mk \ |
Cyril Hrubis | 63b6532 | 2016-04-20 18:23:53 +0200 | [diff] [blame] | 9 | include/mk/config-openposix.mk \ |
Garrett Cooper | 4f71cae | 2010-11-01 21:09:17 -0700 | [diff] [blame] | 10 | include/mk/features.mk \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 11 | lib/ltp.pc \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 12 | m4/Makefile \ |
yaberauneya | 0d39b83 | 2009-11-20 05:45:41 +0000 | [diff] [blame] | 13 | execltp \ |
vapier | df8759f | 2009-01-18 22:22:40 +0000 | [diff] [blame] | 14 | ]) |
subrata_modak | 3d8666c | 2008-11-11 08:31:27 +0000 | [diff] [blame] | 15 | |
Petr Vorel | 427b1be | 2018-02-14 23:27:54 +0100 | [diff] [blame] | 16 | AM_MAINTAINER_MODE([enable]) |
| 17 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 18 | AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes) |
| 19 | |
| 20 | AC_CANONICAL_HOST |
| 21 | |
| 22 | AC_PROG_CC |
yaberauneya | f7df140 | 2009-10-17 02:24:20 +0000 | [diff] [blame] | 23 | # <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about |
| 24 | # 2.62. |
| 25 | AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 26 | AC_PROG_AR |
| 27 | AC_PROG_LEX |
| 28 | AC_PROG_RANLIB |
yaberauneya | a4bed68 | 2009-12-05 23:45:55 +0000 | [diff] [blame] | 29 | AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)]) |
| 30 | AC_PROG_STRIP |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 31 | AC_PROG_YACC |
| 32 | |
| 33 | AC_PREFIX_DEFAULT(/opt/ltp) |
| 34 | |
yaberauneya | 80a06b5 | 2009-12-20 00:39:37 +0000 | [diff] [blame] | 35 | AC_CHECK_HEADERS([ \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 36 | ifaddrs.h \ |
Petr Vorel | bc2568d | 2017-10-16 17:41:54 +0200 | [diff] [blame] | 37 | keyutils.h \ |
Petr Vorel | 66923c6 | 2017-10-12 20:33:19 +0200 | [diff] [blame] | 38 | linux/can.h \ |
Alexey Kodanev | 640f106 | 2018-03-23 18:06:04 +0300 | [diff] [blame] | 39 | linux/dccp.h \ |
Richard Palethorpe | a0ce443 | 2018-07-05 16:56:33 +0200 | [diff] [blame] | 40 | linux/cryptouser.h \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 41 | linux/genetlink.h \ |
Petr Vorel | d47c06e | 2017-10-12 20:33:20 +0200 | [diff] [blame] | 42 | linux/keyctl.h \ |
Eric Biggers | ef85101 | 2019-03-18 10:13:22 -0700 | [diff] [blame] | 43 | linux/if_alg.h \ |
Richard Palethorpe | db14170 | 2017-11-02 15:34:41 +0100 | [diff] [blame] | 44 | linux/if_packet.h \ |
| 45 | linux/if_ether.h \ |
yaberauneya | cb805c4 | 2009-12-22 23:10:41 +0000 | [diff] [blame] | 46 | linux/mempolicy.h \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 47 | linux/module.h \ |
| 48 | linux/netlink.h \ |
Christian Amann | b3621af | 2019-03-19 09:07:32 +0100 | [diff] [blame] | 49 | linux/userfaultfd.h \ |
Petr Vorel | 839128b | 2017-10-12 20:33:18 +0200 | [diff] [blame] | 50 | mm.h \ |
Xiao Yang | bf8f1d7 | 2018-04-04 19:12:54 +0800 | [diff] [blame] | 51 | netinet/sctp.h \ |
Petr Vorel | 839128b | 2017-10-12 20:33:18 +0200 | [diff] [blame] | 52 | pthread.h \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 53 | sys/epoll.h \ |
Jan Kara | f057c1c | 2013-11-20 23:43:13 +0100 | [diff] [blame] | 54 | sys/fanotify.h \ |
Petr Vorel | 839128b | 2017-10-12 20:33:18 +0200 | [diff] [blame] | 55 | sys/inotify.h \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 56 | sys/prctl.h \ |
Sandeep Patil | 524edfb | 2017-11-08 16:34:36 -0800 | [diff] [blame] | 57 | sys/shm.h \ |
Petr Vorel | 0ff33b3 | 2017-10-11 15:53:33 +0200 | [diff] [blame] | 58 | sys/ustat.h \ |
Petr Vorel | 839128b | 2017-10-12 20:33:18 +0200 | [diff] [blame] | 59 | sys/xattr.h \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 60 | ]) |
| 61 | |
Petr Vorel | 0ff33b3 | 2017-10-11 15:53:33 +0200 | [diff] [blame] | 62 | AC_CHECK_FUNCS([ \ |
Xiao Yang | 8fd49ce | 2019-04-05 15:55:39 +0800 | [diff] [blame] | 63 | epoll_pwait \ |
| 64 | execveat \ |
| 65 | fallocate \ |
| 66 | fchownat \ |
| 67 | fstatat \ |
| 68 | kcmp \ |
| 69 | mkdirat \ |
| 70 | mknodat \ |
| 71 | openat \ |
| 72 | preadv \ |
| 73 | preadv2 \ |
Petr Vorel | 0ff33b3 | 2017-10-11 15:53:33 +0200 | [diff] [blame] | 74 | profil \ |
Xiao Yang | 8fd49ce | 2019-04-05 15:55:39 +0800 | [diff] [blame] | 75 | pwritev \ |
| 76 | pwritev2 \ |
| 77 | readlinkat \ |
| 78 | renameat \ |
| 79 | renameat2 \ |
Yang Xu | 4c41cf7 | 2019-04-17 14:05:02 +0800 | [diff] [blame] | 80 | sched_getcpu \ |
Xiao Yang | a600c36 | 2019-04-05 15:46:24 +0800 | [diff] [blame] | 81 | sigpending \ |
Xiao Yang | 8fd49ce | 2019-04-05 15:55:39 +0800 | [diff] [blame] | 82 | splice \ |
Xiao Yang | 66c59e9 | 2019-04-05 17:12:50 +0800 | [diff] [blame] | 83 | stime \ |
Xiao Yang | 8fd49ce | 2019-04-05 15:55:39 +0800 | [diff] [blame] | 84 | syncfs \ |
| 85 | sync_file_range \ |
| 86 | tee \ |
| 87 | unshare \ |
Petr Vorel | 0ff33b3 | 2017-10-11 15:53:33 +0200 | [diff] [blame] | 88 | ustat \ |
Xiao Yang | 8fd49ce | 2019-04-05 15:55:39 +0800 | [diff] [blame] | 89 | vmsplice \ |
Petr Vorel | 0ff33b3 | 2017-10-11 15:53:33 +0200 | [diff] [blame] | 90 | ]) |
Petr Vorel | 25b3565 | 2017-10-02 15:33:41 +0200 | [diff] [blame] | 91 | |
Garrett Cooper | 52288dc | 2010-11-16 22:01:43 -0800 | [diff] [blame] | 92 | # Tools knobs |
| 93 | |
| 94 | # Expect |
| 95 | AC_ARG_WITH([bash], |
| 96 | [AC_HELP_STRING([--with-bash], |
| 97 | [have the Bourne Again SHell interpreter (default=no)])], |
| 98 | [with_bash=yes], |
| 99 | ) |
| 100 | if test "x$with_bash" = xyes; then |
| 101 | AC_SUBST([WITH_BASH],["yes"]) |
| 102 | else |
| 103 | AC_SUBST([WITH_BASH],["no"]) |
| 104 | fi |
| 105 | |
| 106 | AC_ARG_WITH([expect], |
| 107 | [AC_HELP_STRING([--with-expect], |
| 108 | [have the Tcl/expect library (default=yes)])], |
| 109 | [with_expect=yes], |
| 110 | [with_expect=no] |
| 111 | ) |
| 112 | if test "x$with_expect" = xyes; then |
| 113 | AC_SUBST([WITH_EXPECT],["yes"]) |
| 114 | else |
| 115 | AC_SUBST([WITH_EXPECT],["no"]) |
| 116 | fi |
| 117 | |
Anders Roxell | 39a85a1 | 2018-02-05 11:56:04 +0100 | [diff] [blame] | 118 | # Numa |
| 119 | AC_ARG_WITH([numa], |
| 120 | AC_HELP_STRING([--without-numa], |
Petr Vorel | 4ace68a | 2018-02-07 11:09:49 +0100 | [diff] [blame] | 121 | [without numa support (default=no)]), |
Anders Roxell | 39a85a1 | 2018-02-05 11:56:04 +0100 | [diff] [blame] | 122 | [with_numa=no], |
| 123 | [with_numa=yes] |
| 124 | ) |
| 125 | |
Garrett Cooper | 52288dc | 2010-11-16 22:01:43 -0800 | [diff] [blame] | 126 | # Perl |
| 127 | AC_ARG_WITH([perl], |
| 128 | [AC_HELP_STRING([--with-perl], |
| 129 | [have a perl interpreter (default=yes)])], |
| 130 | [with_perl=yes], |
| 131 | [with_perl=no] |
| 132 | ) |
| 133 | if test "x$with_perl" = xyes; then |
| 134 | AC_SUBST([WITH_PERL],["yes"]) |
| 135 | else |
| 136 | AC_SUBST([WITH_PERL],["no"]) |
| 137 | fi |
| 138 | |
| 139 | # Python |
| 140 | AC_ARG_WITH([python], |
| 141 | [AC_HELP_STRING([--with-python], |
| 142 | [have a python interpreter (default=yes)])], |
| 143 | [with_python=yes], |
| 144 | [with_python=no] |
| 145 | ) |
| 146 | if test "x$with_python" = xyes; then |
| 147 | AC_SUBST([WITH_PYTHON],["yes"]) |
| 148 | else |
| 149 | AC_SUBST([WITH_PYTHON],["no"]) |
| 150 | fi |
Anders Roxell | 7b25815 | 2018-02-14 13:04:31 +0100 | [diff] [blame] | 151 | |
| 152 | # TI RPC |
| 153 | AC_ARG_WITH([tirpc], |
| 154 | AC_HELP_STRING([--without-tirpc], |
| 155 | [without libtirpc support (default=no)]), |
| 156 | [with_tirpc=no], |
| 157 | [with_tirpc=yes] |
| 158 | ) |
Garrett Cooper | 52288dc | 2010-11-16 22:01:43 -0800 | [diff] [blame] | 159 | # END tools knobs |
| 160 | |
| 161 | # Testsuites knobs |
| 162 | |
Garrett Cooper | 92dfd5b | 2010-11-16 20:02:26 -0800 | [diff] [blame] | 163 | AC_ARG_WITH([open-posix-testsuite], |
| 164 | [AC_HELP_STRING([--with-open-posix-testsuite], |
| 165 | [compile and install the open posix testsuite (default=no)])], |
Mike Frysinger | 12298fe | 2017-03-31 18:12:12 -0400 | [diff] [blame] | 166 | [with_open_posix_testsuite=$withval] |
Garrett Cooper | 92dfd5b | 2010-11-16 20:02:26 -0800 | [diff] [blame] | 167 | ) |
| 168 | if test "x$with_open_posix_testsuite" = xyes; then |
| 169 | AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"]) |
| 170 | else |
| 171 | AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"]) |
| 172 | fi |
| 173 | |
Garrett Cooper | 52288dc | 2010-11-16 22:01:43 -0800 | [diff] [blame] | 174 | # testcases/realtime requires bash and python. |
| 175 | if test "x$with_bash" = xyes && test "x$with_python" = xyes; then |
| 176 | AC_ARG_WITH([realtime-testsuite], |
| 177 | [AC_HELP_STRING([--with-realtime-testsuite], |
| 178 | [compile and install the realtime testsuite (default=no)])], |
| 179 | [with_realtime_testsuite=yes] |
| 180 | ) |
| 181 | fi |
Garrett Cooper | 92dfd5b | 2010-11-16 20:02:26 -0800 | [diff] [blame] | 182 | if test "x$with_realtime_testsuite" = xyes; then |
| 183 | AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"]) |
Garrett Cooper | 52288dc | 2010-11-16 22:01:43 -0800 | [diff] [blame] | 184 | # Run configure on testcases/realtime as well. |
| 185 | AC_CONFIG_SUBDIRS([testcases/realtime]) |
Garrett Cooper | 92dfd5b | 2010-11-16 20:02:26 -0800 | [diff] [blame] | 186 | else |
| 187 | AC_SUBST([WITH_REALTIME_TESTSUITE],["no"]) |
| 188 | fi |
| 189 | |
Mats Liljegren | fb6efc4 | 2014-04-15 10:31:15 +0200 | [diff] [blame] | 190 | AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2]) |
| 191 | |
Li Wang | 8d47fa7 | 2017-10-26 16:51:15 +0800 | [diff] [blame] | 192 | AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh]) |
Cyril Hrubis | a07008f | 2017-06-14 17:25:09 +0200 | [diff] [blame] | 193 | |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 194 | # custom functions |
| 195 | LTP_CHECK_ACL_SUPPORT |
| 196 | LTP_CHECK_ATOMIC_MEMORY_MODEL |
| 197 | LTP_CHECK_BUILTIN_CLEAR_CACHE |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 198 | LTP_CHECK_CAPABILITY_SUPPORT |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 199 | LTP_CHECK_CC_WARN_OLDSTYLE |
| 200 | LTP_CHECK_CLONE_SUPPORTS_7_ARGS |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 201 | LTP_CHECK_CRYPTO |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 202 | LTP_CHECK_FIDEDUPE |
| 203 | LTP_CHECK_FORTIFY_SOURCE |
| 204 | LTP_CHECK_FS_IOC_FLAGS |
| 205 | LTP_CHECK_FTS_H |
| 206 | LTP_CHECK_IF_LINK |
| 207 | LTP_CHECK_IOVEC |
| 208 | LTP_CHECK_KCMP_TYPE |
| 209 | LTP_CHECK_KERNEL_DEVEL |
| 210 | LTP_CHECK_KEYUTILS_SUPPORT |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 211 | LTP_CHECK_LINUX_PTRACE |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 212 | LTP_CHECK_LINUXRANDOM |
| 213 | LTP_CHECK_MADVISE |
| 214 | LTP_CHECK_MKDTEMP |
| 215 | LTP_CHECK_MMSGHDR |
| 216 | LTP_CHECK_MREMAP_FIXED |
Mike Frysinger | 9bd940b | 2010-08-17 17:22:03 -0400 | [diff] [blame] | 217 | LTP_CHECK_NOMMU_LINUX |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 218 | LTP_CHECK_PERF_EVENT |
Garrett Cooper | 4f71cae | 2010-11-01 21:09:17 -0700 | [diff] [blame] | 219 | LTP_CHECK_PRCTL_SUPPORT |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 220 | LTP_CHECK_RLIMIT64 |
Garrett Cooper | 4f71cae | 2010-11-01 21:09:17 -0700 | [diff] [blame] | 221 | LTP_CHECK_SECUREBITS |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 222 | LTP_CHECK_SELINUX |
yaberauneya | e34a3c2 | 2009-11-30 12:26:05 +0000 | [diff] [blame] | 223 | LTP_CHECK_SIGNAL |
vaishnavid | 0d28fea | 2018-09-03 12:16:31 +0000 | [diff] [blame] | 224 | LTP_CHECK_STATX |
Jan Stancek | f61391e | 2016-04-13 13:09:23 +0200 | [diff] [blame] | 225 | LTP_CHECK_SYNC_ADD_AND_FETCH |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 226 | LTP_CHECK_SYSCALL_EVENTFD |
| 227 | LTP_CHECK_SYSCALL_FCNTL |
| 228 | LTP_CHECK_SYSCALL_MODIFY_LDT |
Xing Gu | a3bfea2 | 2014-06-17 15:26:30 +0800 | [diff] [blame] | 229 | |
Petr Vorel | f417672 | 2018-02-07 11:29:42 +0100 | [diff] [blame] | 230 | if test "x$with_numa" = xyes; then |
| 231 | LTP_CHECK_SYSCALL_NUMA |
| 232 | numa_error_msg="test requires libnuma >= 2 and it's development packages" |
| 233 | else |
| 234 | numa_error_msg="NUMA support was disabled during build" |
| 235 | fi |
| 236 | AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support]) |
| 237 | |
Petr Vorel | a50338c | 2019-04-12 15:48:53 +0200 | [diff] [blame] | 238 | LTP_CHECK_SYSCALL_PERF_EVENT_OPEN |
| 239 | LTP_CHECK_SYSCALL_QUOTACTL |
| 240 | LTP_CHECK_SYSCALL_SIGNALFD |
| 241 | LTP_CHECK_SYSCALL_UTIMENSAT |
| 242 | LTP_CHECK_TASKSTATS |
| 243 | LTP_CHECK_TIME |
| 244 | LTP_CHECK_TIMERFD |
| 245 | test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC |
| 246 | LTP_CHECK_TPACKET_V3 |
| 247 | LTP_CHECK_UNAME_DOMAINNAME |
| 248 | LTP_CHECK_XFS_QUOTACTL |
| 249 | LTP_CHECK_X_TABLES |
| 250 | LTP_DETECT_HOST_CPU |
| 251 | |
subrata_modak | 3d8666c | 2008-11-11 08:31:27 +0000 | [diff] [blame] | 252 | AC_OUTPUT |