forked from linux-test-project/ltp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
364 lines (323 loc) · 8.72 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
AC_PREREQ(2.61)
AC_INIT([ltp], [LTP_VERSION], [[email protected]])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_FILES([ \
include/mk/config.mk \
include/mk/config-openposix.mk \
include/mk/features.mk \
lib/ltp.pc \
m4/Makefile \
execltp \
])
AC_ARG_VAR(HOSTCC, [The C compiler on the host])
AM_MAINTAINER_MODE([enable])
AC_CANONICAL_HOST
AC_PROG_CC
# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about
# 2.62.
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
AC_PROG_AR
AC_PROG_LEX
AC_PROG_RANLIB
AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)])
AC_PROG_STRIP
AC_PROG_YACC
AC_PREFIX_DEFAULT(/opt/ltp)
AC_CHECK_DECLS([IFLA_NET_NS_PID],,,[#include <linux/if_link.h>])
AC_CHECK_DECLS([MADV_MERGEABLE],,,[#include <sys/mman.h>])
AC_CHECK_DECLS([PR_CAPBSET_DROP, PR_CAPBSET_READ],,,[#include <sys/prctl.h>])
AC_CHECK_HEADERS_ONCE([ \
asm/ldt.h \
ifaddrs.h \
keyutils.h \
linux/can.h \
linux/cgroupstats.h \
linux/cryptouser.h \
linux/dccp.h \
linux/fs.h \
linux/genetlink.h \
linux/if_alg.h \
linux/if_ether.h \
linux/if_packet.h \
linux/keyctl.h \
linux/mempolicy.h \
linux/module.h \
linux/netlink.h \
linux/seccomp.h \
linux/securebits.h \
linux/tty.h \
linux/types.h \
linux/userfaultfd.h \
netinet/sctp.h \
pthread.h \
sys/epoll.h \
sys/fanotify.h \
sys/inotify.h \
sys/prctl.h \
sys/shm.h \
sys/timerfd.h \
sys/ustat.h \
sys/utsname.h \
sys/xattr.h \
xfs/xqm.h \
])
AC_CHECK_HEADERS(fts.h, [have_fts=1])
AC_SUBST(HAVE_FTS_H, $have_fts)
AC_CHECK_FUNCS_ONCE([ \
clone3 \
copy_file_range \
epoll_pwait \
execveat \
fallocate \
fchownat \
fsconfig \
fsmount \
fsopen \
fspick \
fstatat \
getauxval \
getdents \
getdents64 \
io_pgetevents \
io_uring_setup \
io_uring_register \
io_uring_enter \
kcmp \
mkdirat \
mknodat \
modify_ldt \
move_mount \
name_to_handle_at \
open_tree \
openat \
openat2 \
pidfd_open \
pidfd_send_signal \
pkey_mprotect \
preadv \
preadv2 \
profil \
pwritev \
pwritev2 \
rand_r \
readlinkat \
recvmmsg \
renameat \
renameat2 \
sched_getcpu \
sendmmsg \
setns \
sigpending \
splice \
statx \
stime \
sync_file_range \
syncfs \
tee \
timerfd_create \
timerfd_gettime \
timerfd_settime \
unshare \
ustat \
vmsplice \
])
AC_CHECK_FUNCS(mkdtemp,[],AC_MSG_ERROR(mkdtemp() not found!))
AC_CHECK_MEMBERS([struct fanotify_event_info_fid.fsid.__val],,,[#include <sys/fanotify.h>])
AC_CHECK_MEMBERS([struct perf_event_mmap_page.aux_head],,,[#include <linux/perf_event.h>])
AC_CHECK_MEMBERS([struct sigaction.sa_sigaction],[],[],[#include <signal.h>])
AC_CHECK_MEMBERS([struct utsname.domainname],,,[
#define _GNU_SOURCE
#include <sys/utsname.h>
])
AC_CHECK_TYPES([enum kcmp_type],,,[#include <linux/kcmp.h>])
AC_CHECK_TYPES([struct acct_v3],,,[#include <sys/acct.h>])
AC_CHECK_TYPES([struct af_alg_iv, struct sockaddr_alg],,,[# include <linux/if_alg.h>])
AC_CHECK_TYPES([struct fanotify_event_info_fid, struct fanotify_event_info_header],,,[#include <sys/fanotify.h>])
AC_CHECK_TYPES([struct file_dedupe_range],,,[#include <linux/fs.h>])
AC_CHECK_TYPES([struct file_handle],,,[
#define _GNU_SOURCE
#include <fcntl.h>
])
AC_CHECK_TYPES([struct fs_quota_statv],,,[#include <xfs/xqm.h>])
AC_CHECK_TYPES([struct if_nextdqblk],,,[#include <linux/quota.h>])
AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>])
AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>])
AC_CHECK_TYPES([struct loop_config],,,[#include <linux/loop.h>])
AC_CHECK_TYPES([struct mmsghdr],,,[
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
])
AC_CHECK_TYPES([struct msqid64_ds],,,[#include <sys/msgbuf.h>])
AC_CHECK_TYPES([struct rlimit64],,,[
#define _LARGEFILE64_SOURCE
#include <sys/resource.h>
])
AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>])
AC_CHECK_TYPES([struct shmid64_ds],,,[#include <sys/shmbuf.h>])
AC_CHECK_TYPES([struct statx, struct statx_timestamp],,,[
#define _GNU_SOURCE
#include <sys/stat.h>
])
AC_CHECK_TYPES([struct termio],,,[#include <sys/ioctl.h>])
AC_CHECK_TYPES([struct tpacket_req3],,,[# include <linux/if_packet.h>])
AC_CHECK_TYPES([struct user_desc, struct modify_ldt_ldt_s],[],[],[#include <asm/ldt.h>])
AC_CHECK_TYPES([struct xt_entry_match, struct xt_entry_target],,,[
#include <sys/types.h>
#include <netinet/in.h>
#include <net/if.h>
#include <limits.h>
#include <linux/netfilter_ipv4/ip_tables.h>
])
# Tools knobs
# Bash
AC_ARG_WITH([bash],
[AC_HELP_STRING([--with-bash],
[have the Bourne Again Shell interpreter])],
[with_bash=$withval],
[with_bash=no]
)
if test "x$with_bash" = xyes; then
AC_SUBST([WITH_BASH],["yes"])
else
AC_SUBST([WITH_BASH],["no"])
fi
# metadata
AC_ARG_ENABLE([metadata],
[AC_HELP_STRING([--disable-metadata],
[Disable metadata generation (both HTML and PDF, default no)])],
[], [enable_metadata=yes]
)
AC_ARG_ENABLE([metadata_html],
[AC_HELP_STRING([--disable-metadata-html],
[Disable metadata HTML generation (default no)])],
[], [enable_metadata_html=yes]
)
AC_ARG_ENABLE([metadata_pdf],
[AC_HELP_STRING([--enable-metadata-pdf],
[Enable metadata PDF generation (default no)])],
[], [enable_metadata_pdf=no]
)
AC_ARG_WITH([metadata_generator],
[AC_HELP_STRING([--with-metadata-generator=asciidoc|asciidoctor],
[Specify metadata generator to use (default autodetect)])],
[with_metadata_generator=$withval],
[with_metadata_generator=detect]
)
LTP_DOCPARSE
# Expect
AC_ARG_WITH([expect],
[AC_HELP_STRING([--with-expect],
[have the Tcl/expect library])],
[with_expect=$withval],
[with_expect=no]
)
if test "x$with_expect" = xyes; then
AC_SUBST([WITH_EXPECT],["yes"])
else
AC_SUBST([WITH_EXPECT],["no"])
fi
# Numa
AC_ARG_WITH([numa],
AC_HELP_STRING([--without-numa],
[without numa support]),
[with_numa=$withval],
[with_numa=yes]
)
# Perl
AC_ARG_WITH([perl],
[AC_HELP_STRING([--with-perl],
[have a perl interpreter])],
[with_perl=$withval],
[with_perl=no]
)
if test "x$with_perl" = xyes; then
AC_SUBST([WITH_PERL],["yes"])
else
AC_SUBST([WITH_PERL],["no"])
fi
# Python
AC_ARG_WITH([python],
[AC_HELP_STRING([--with-python],
[have a python interpreter])],
[with_python=$withval],
[with_python=no]
)
if test "x$with_python" = xyes; then
AC_SUBST([WITH_PYTHON],["yes"])
else
AC_SUBST([WITH_PYTHON],["no"])
fi
# TI RPC
AC_ARG_WITH([tirpc],
AC_HELP_STRING([--without-tirpc],
[without libtirpc support]),
[with_tirpc=$withval],
[with_tirpc=yes]
)
# END tools knobs
# Testsuites knobs
AC_ARG_WITH([open-posix-testsuite],
[AC_HELP_STRING([--with-open-posix-testsuite],
[compile and install the open posix testsuite])],
[with_open_posix_testsuite=$withval],
[with_open_posix_testsuite=no]
)
if test "x$with_open_posix_testsuite" = xyes; then
AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
else
AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
fi
# TODO: testcases/realtime requires bash and python.
AC_ARG_WITH([realtime-testsuite],
[AC_HELP_STRING([--with-realtime-testsuite],
[compile and install the realtime testsuite])],
[with_realtime_testsuite=$withval],
[with_realtime_testsuite=no]
)
if test "x$with_realtime_testsuite" = xyes; then
AC_SUBST([WITH_REALTIME_TESTSUITE],["yes"])
# Run configure on testcases/realtime as well.
AC_CONFIG_SUBDIRS([testcases/realtime])
else
AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
fi
AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./regen.sh])
# custom functions
# NOTE: don't create custom functions for simple checks, put them into this file
LTP_CHECK_ACL_SUPPORT
LTP_CHECK_ATOMIC_MEMORY_MODEL
LTP_CHECK_BUILTIN_CLEAR_CACHE
LTP_CHECK_CAPABILITY_SUPPORT
LTP_CHECK_CC_WARN_OLDSTYLE
LTP_CHECK_CLONE_SUPPORTS_7_ARGS
LTP_CHECK_CRYPTO
LTP_CHECK_FORTIFY_SOURCE
LTP_CHECK_KERNEL_DEVEL
LTP_CHECK_KEYUTILS_SUPPORT
LTP_CHECK_LIBMNL
LTP_CHECK_LINUX_PTRACE
LTP_CHECK_LINUXRANDOM
LTP_CHECK_MREMAP_FIXED
LTP_CHECK_NOMMU_LINUX
LTP_CHECK_SELINUX
LTP_CHECK_SYNC_ADD_AND_FETCH
LTP_CHECK_SYSCALL_EVENTFD
LTP_CHECK_SYSCALL_FCNTL
if test "x$with_numa" = xyes; then
LTP_CHECK_SYSCALL_NUMA
numa_error_msg="test requires libnuma development packages with LIBNUMA_API_VERSION >= 2"
else
numa_error_msg="NUMA support was disabled during build"
fi
AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
LTP_CHECK_SYSCALL_SIGNALFD
LTP_CHECK_SYSCALL_UTIMENSAT
LTP_CHECK_TASKSTATS
test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
LTP_DETECT_HOST_CPU
AC_OUTPUT