1 AC_PREREQ(2.61) 2 AC_INIT([ltp], [LTP_VERSION], [ltp (a] lists.linux.it]) 3 AC_CONFIG_AUX_DIR([.]) 4 AM_INIT_AUTOMAKE 5 AC_CONFIG_HEADERS([include/config.h]) 6 AC_CONFIG_MACRO_DIR([m4]) 7 AC_CONFIG_FILES([ \ 8 include/mk/config.mk \ 9 include/mk/config-openposix.mk \ 10 include/mk/features.mk \ 11 lib/ltp.pc \ 12 m4/Makefile \ 13 execltp \ 14 ]) 15 16 AM_MAINTAINER_MODE([enable]) 17 18 AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes) 19 20 AC_CANONICAL_HOST 21 22 AC_PROG_CC 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, :)]) 26 AC_PROG_AR 27 AC_PROG_LEX 28 AC_PROG_RANLIB 29 AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)]) 30 AC_PROG_STRIP 31 AC_PROG_YACC 32 33 AC_PREFIX_DEFAULT(/opt/ltp) 34 35 AC_CHECK_HEADERS([ \ 36 ifaddrs.h \ 37 keyutils.h \ 38 linux/can.h \ 39 linux/dccp.h \ 40 linux/cryptouser.h \ 41 linux/genetlink.h \ 42 linux/keyctl.h \ 43 linux/if_packet.h \ 44 linux/if_ether.h \ 45 linux/mempolicy.h \ 46 linux/module.h \ 47 linux/netlink.h \ 48 mm.h \ 49 netinet/sctp.h \ 50 pthread.h \ 51 sys/epoll.h \ 52 sys/fanotify.h \ 53 sys/inotify.h \ 54 sys/prctl.h \ 55 sys/shm.h \ 56 sys/ustat.h \ 57 sys/xattr.h \ 58 ]) 59 60 AC_CHECK_FUNCS([ \ 61 profil \ 62 ustat \ 63 ]) 64 65 # Tools knobs 66 67 # Expect 68 AC_ARG_WITH([bash], 69 [AC_HELP_STRING([--with-bash], 70 [have the Bourne Again SHell interpreter (default=no)])], 71 [with_bash=yes], 72 ) 73 if test "x$with_bash" = xyes; then 74 AC_SUBST([WITH_BASH],["yes"]) 75 else 76 AC_SUBST([WITH_BASH],["no"]) 77 fi 78 79 AC_ARG_WITH([expect], 80 [AC_HELP_STRING([--with-expect], 81 [have the Tcl/expect library (default=yes)])], 82 [with_expect=yes], 83 [with_expect=no] 84 ) 85 if test "x$with_expect" = xyes; then 86 AC_SUBST([WITH_EXPECT],["yes"]) 87 else 88 AC_SUBST([WITH_EXPECT],["no"]) 89 fi 90 91 # Numa 92 AC_ARG_WITH([numa], 93 AC_HELP_STRING([--without-numa], 94 [without numa support (default=no)]), 95 [with_numa=no], 96 [with_numa=yes] 97 ) 98 99 # Perl 100 AC_ARG_WITH([perl], 101 [AC_HELP_STRING([--with-perl], 102 [have a perl interpreter (default=yes)])], 103 [with_perl=yes], 104 [with_perl=no] 105 ) 106 if test "x$with_perl" = xyes; then 107 AC_SUBST([WITH_PERL],["yes"]) 108 else 109 AC_SUBST([WITH_PERL],["no"]) 110 fi 111 112 # Python 113 AC_ARG_WITH([python], 114 [AC_HELP_STRING([--with-python], 115 [have a python interpreter (default=yes)])], 116 [with_python=yes], 117 [with_python=no] 118 ) 119 if test "x$with_python" = xyes; then 120 AC_SUBST([WITH_PYTHON],["yes"]) 121 else 122 AC_SUBST([WITH_PYTHON],["no"]) 123 fi 124 125 # TI RPC 126 AC_ARG_WITH([tirpc], 127 AC_HELP_STRING([--without-tirpc], 128 [without libtirpc support (default=no)]), 129 [with_tirpc=no], 130 [with_tirpc=yes] 131 ) 132 # END tools knobs 133 134 # Testsuites knobs 135 136 AC_ARG_WITH([open-posix-testsuite], 137 [AC_HELP_STRING([--with-open-posix-testsuite], 138 [compile and install the open posix testsuite (default=no)])], 139 [with_open_posix_testsuite=$withval] 140 ) 141 if test "x$with_open_posix_testsuite" = xyes; then 142 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"]) 143 else 144 AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"]) 145 fi 146 147 # testcases/realtime requires bash and python. 148 if test "x$with_bash" = xyes && test "x$with_python" = xyes; then 149 AC_ARG_WITH([realtime-testsuite], 150 [AC_HELP_STRING([--with-realtime-testsuite], 151 [compile and install the realtime testsuite (default=no)])], 152 [with_realtime_testsuite=yes] 153 ) 154 fi 155 if test "x$with_realtime_testsuite" = xyes; then 156 AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"]) 157 # Run configure on testcases/realtime as well. 158 AC_CONFIG_SUBDIRS([testcases/realtime]) 159 else 160 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"]) 161 fi 162 163 AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2]) 164 165 AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh]) 166 167 # END testsuites knobs 168 LTP_CHECK_FORTIFY_SOURCE 169 LTP_CHECK_CC_WARN_OLDSTYLE 170 LTP_CHECK_MKDTEMP 171 LTP_CHECK_CAPABILITY_SUPPORT 172 LTP_CHECK_CRYPTO 173 LTP_CHECK_LINUX_PTRACE 174 LTP_CHECK_NOMMU_LINUX 175 LTP_CHECK_PRCTL_SUPPORT 176 LTP_CHECK_SECUREBITS 177 LTP_CHECK_SELINUX 178 LTP_CHECK_SIGNAL 179 LTP_CHECK_SYSCALL_EVENTFD 180 LTP_CHECK_SYSCALL_MODIFY_LDT 181 LTP_CHECK_SYSCALL_QUOTACTL 182 LTP_CHECK_SYSCALL_SIGNALFD 183 LTP_CHECK_SYSCALL_UNSHARE 184 LTP_CHECK_SYSCALL_UTIMENSAT 185 LTP_CHECK_TASKSTATS 186 LTP_CHECK_TIME 187 LTP_CHECK_MADVISE 188 LTP_CHECK_ACL_SUPPORT 189 LTP_CHECK_FS_IOC_FLAGS 190 LTP_CHECK_MREMAP_FIXED 191 LTP_CHECK_KERNEL_DEVEL 192 LTP_CHECK_XFS_QUOTACTL 193 LTP_CHECK_CLONE_SUPPORTS_7_ARGS 194 LTP_CHECK_MKDIRAT 195 LTP_CHECK_FCHOWNAT 196 LTP_CHECK_FSTATAT 197 LTP_CHECK_MKNODAT 198 LTP_CHECK_READLINKAT 199 LTP_CHECK_OPENAT 200 LTP_CHECK_EXECVEAT 201 LTP_CHECK_RENAMEAT 202 LTP_CHECK_RENAMEAT2 203 LTP_CHECK_STATX 204 LTP_CHECK_FALLOCATE 205 LTP_CHECK_SYSCALL_FCNTL 206 LTP_CHECK_SYSCALL_PERF_EVENT_OPEN 207 if test "x$with_tirpc" = xyes; then 208 LTP_CHECK_TIRPC 209 fi 210 LTP_CHECK_TEE 211 LTP_CHECK_SPLICE 212 LTP_CHECK_VMSPLICE 213 LTP_CHECK_TIMERFD 214 LTP_CHECK_IOVEC 215 LTP_CHECK_LINUXRANDOM 216 LTP_CHECK_IF_LINK 217 LTP_CHECK_KCMP 218 LTP_CHECK_KCMP_TYPE 219 LTP_CHECK_PREADV 220 LTP_CHECK_PWRITEV 221 LTP_CHECK_PREADV2 222 LTP_CHECK_PWRITEV2 223 LTP_CHECK_EPOLL_PWAIT 224 LTP_CHECK_KEYUTILS_SUPPORT 225 LTP_CHECK_SYNC_ADD_AND_FETCH 226 LTP_CHECK_BUILTIN_CLEAR_CACHE 227 LTP_CHECK_MMSGHDR 228 LTP_CHECK_UNAME_DOMAINNAME 229 LTP_CHECK_X_TABLES 230 LTP_CHECK_ATOMIC_MEMORY_MODEL 231 LTP_CHECK_TPACKET_V3 232 LTP_CHECK_RLIMIT64 233 LTP_DETECT_HOST_CPU 234 LTP_CHECK_PERF_EVENT 235 LTP_CHECK_SYNCFS 236 237 if test "x$with_numa" = xyes; then 238 LTP_CHECK_SYSCALL_NUMA 239 numa_error_msg="test requires libnuma >= 2 and it's development packages" 240 else 241 numa_error_msg="NUMA support was disabled during build" 242 fi 243 AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support]) 244 245 AC_OUTPUT 246