• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1AC_PREREQ(2.61)
2AC_INIT([ltp], [LTP_VERSION], [ltp@lists.linux.it])
3AC_CONFIG_AUX_DIR([.])
4AM_INIT_AUTOMAKE
5AC_CONFIG_HEADERS([include/config.h])
6AC_CONFIG_MACRO_DIR([m4])
7AC_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
16AM_MAINTAINER_MODE([enable])
17
18AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes)
19
20AC_CANONICAL_HOST
21
22AC_PROG_CC
23# <= 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, :)])
26AC_PROG_AR
27AC_PROG_LEX
28AC_PROG_RANLIB
29AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)])
30AC_PROG_STRIP
31AC_PROG_YACC
32
33AC_PREFIX_DEFAULT(/opt/ltp)
34
35AC_CHECK_HEADERS([ \
36    ifaddrs.h \
37    keyutils.h \
38    linux/can.h \
39    linux/cgroupstats.h \
40    linux/cryptouser.h \
41    linux/dccp.h \
42    linux/genetlink.h \
43    linux/if_alg.h \
44    linux/if_packet.h \
45    linux/if_ether.h \
46    linux/keyctl.h \
47    linux/mempolicy.h \
48    linux/module.h \
49    linux/netlink.h \
50    linux/seccomp.h \
51    linux/securebits.h \
52    linux/types.h \
53    linux/userfaultfd.h \
54    mm.h \
55    netinet/sctp.h \
56    pthread.h \
57    sys/epoll.h \
58    sys/fanotify.h \
59    sys/inotify.h \
60    sys/prctl.h \
61    sys/shm.h \
62    sys/ustat.h \
63    sys/utsname.h \
64    sys/xattr.h \
65    xfs/xqm.h \
66])
67
68AC_CHECK_FUNCS([ \
69    copy_file_range \
70    epoll_pwait \
71    execveat \
72    fallocate \
73    fchownat \
74    fstatat \
75    getdents \
76    getdents64 \
77    kcmp \
78    mkdirat \
79    mknodat \
80    name_to_handle_at \
81    openat \
82    pidfd_send_signal \
83    pkey_mprotect \
84    preadv \
85    preadv2 \
86    profil \
87    pwritev \
88    pwritev2 \
89    readlinkat \
90    recvmmsg \
91    renameat \
92    renameat2 \
93    sched_getcpu \
94    sendmmsg \
95    sigpending \
96    splice \
97    stime \
98    syncfs \
99    sync_file_range \
100    tee \
101    unshare \
102    ustat \
103    vmsplice \
104])
105
106# Tools knobs
107
108# Expect
109AC_ARG_WITH([bash],
110  [AC_HELP_STRING([--with-bash],
111    [have the Bourne Again Shell interpreter])],
112  [with_bash=$withval],
113  [with_bash=no]
114)
115if test "x$with_bash" = xyes; then
116    AC_SUBST([WITH_BASH],["yes"])
117else
118    AC_SUBST([WITH_BASH],["no"])
119fi
120
121AC_ARG_WITH([expect],
122  [AC_HELP_STRING([--with-expect],
123    [have the Tcl/expect library])],
124  [with_expect=$withval],
125  [with_expect=no]
126)
127if test "x$with_expect" = xyes; then
128    AC_SUBST([WITH_EXPECT],["yes"])
129else
130    AC_SUBST([WITH_EXPECT],["no"])
131fi
132
133# Numa
134AC_ARG_WITH([numa],
135  AC_HELP_STRING([--without-numa],
136    [without numa support]),
137  [with_numa=$withval],
138  [with_numa=yes]
139)
140
141# Perl
142AC_ARG_WITH([perl],
143  [AC_HELP_STRING([--with-perl],
144    [have a perl interpreter])],
145  [with_perl=$withval],
146  [with_perl=no]
147)
148if test "x$with_perl" = xyes; then
149    AC_SUBST([WITH_PERL],["yes"])
150else
151    AC_SUBST([WITH_PERL],["no"])
152fi
153
154# Python
155AC_ARG_WITH([python],
156  [AC_HELP_STRING([--with-python],
157    [have a python interpreter])],
158  [with_python=$withval],
159  [with_python=no]
160)
161if test "x$with_python" = xyes; then
162    AC_SUBST([WITH_PYTHON],["yes"])
163else
164    AC_SUBST([WITH_PYTHON],["no"])
165fi
166
167# TI RPC
168AC_ARG_WITH([tirpc],
169  AC_HELP_STRING([--without-tirpc],
170    [without libtirpc support]),
171  [with_tirpc=$withval],
172  [with_tirpc=yes]
173)
174# END tools knobs
175
176# Testsuites knobs
177
178AC_ARG_WITH([open-posix-testsuite],
179  [AC_HELP_STRING([--with-open-posix-testsuite],
180    [compile and install the open posix testsuite])],
181  [with_open_posix_testsuite=$withval],
182  [with_open_posix_testsuite=no]
183)
184if test "x$with_open_posix_testsuite" = xyes; then
185    AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
186else
187    AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
188fi
189
190# TODO: testcases/realtime requires bash and python.
191AC_ARG_WITH([realtime-testsuite],
192  [AC_HELP_STRING([--with-realtime-testsuite],
193    [compile and install the realtime testsuite])],
194  [with_realtime_testsuite=$withval],
195  [with_realtime_testsuite=no]
196)
197
198if test "x$with_realtime_testsuite" = xyes; then
199    AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
200    # Run configure on testcases/realtime as well.
201    AC_CONFIG_SUBDIRS([testcases/realtime])
202else
203    AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
204fi
205
206AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
207
208# custom functions
209LTP_CHECK_ACCT
210LTP_CHECK_ACL_SUPPORT
211LTP_CHECK_ATOMIC_MEMORY_MODEL
212LTP_CHECK_BUILTIN_CLEAR_CACHE
213LTP_CHECK_CAPABILITY_SUPPORT
214LTP_CHECK_CC_WARN_OLDSTYLE
215LTP_CHECK_CLONE_SUPPORTS_7_ARGS
216LTP_CHECK_CRYPTO
217LTP_CHECK_FANOTIFY
218LTP_CHECK_FIDEDUPE
219LTP_CHECK_FORTIFY_SOURCE
220LTP_CHECK_FTS_H
221LTP_CHECK_IF_LINK
222LTP_CHECK_IOVEC
223LTP_CHECK_KCMP_TYPE
224LTP_CHECK_KERNEL_DEVEL
225LTP_CHECK_KEYUTILS_SUPPORT
226LTP_CHECK_LINUX_PTRACE
227LTP_CHECK_LINUXRANDOM
228LTP_CHECK_MADVISE
229LTP_CHECK_MKDTEMP
230LTP_CHECK_MMSGHDR
231LTP_CHECK_MREMAP_FIXED
232LTP_CHECK_NOMMU_LINUX
233LTP_CHECK_PERF_EVENT
234LTP_CHECK_PRCTL_SUPPORT
235LTP_CHECK_RLIMIT64
236LTP_CHECK_SELINUX
237LTP_CHECK_SIGNAL
238LTP_CHECK_STATX
239LTP_CHECK_SYNC_ADD_AND_FETCH
240LTP_CHECK_SYSCALL_EVENTFD
241LTP_CHECK_SYSCALL_FCNTL
242LTP_CHECK_SYSCALL_MODIFY_LDT
243
244if test "x$with_numa" = xyes; then
245	LTP_CHECK_SYSCALL_NUMA
246	numa_error_msg="test requires libnuma >= 2 and it's development packages"
247else
248	numa_error_msg="NUMA support was disabled during build"
249fi
250AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
251
252
253LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
254LTP_CHECK_SYSCALL_QUOTACTL
255LTP_CHECK_SYSCALL_SIGNALFD
256LTP_CHECK_SYSCALL_UTIMENSAT
257LTP_CHECK_TASKSTATS
258LTP_CHECK_TIMERFD
259test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
260LTP_CHECK_TPACKET_V3
261LTP_CHECK_UNAME_DOMAINNAME
262LTP_CHECK_X_TABLES
263LTP_DETECT_HOST_CPU
264
265AC_OUTPUT
266