-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathconfigure.ac
408 lines (379 loc) · 10.3 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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
AC_PREREQ(2.64)
AC_INIT([fakechroot], [2.20.2], [[email protected]], [fakechroot], [https://github.com/dex4er/fakechroot])
AC_CONFIG_SRCDIR([src/libfakechroot.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.10 foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AC_ARG_VAR([V], [Verbose output])
AC_ARG_VAR([EXTRA_CFLAGS], [Extra C compiler flags])
AC_ARG_VAR([EXTRA_LDFLAGS], [Extra linker flags])
# C toolchain
AM_PROG_AR
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LN_S
AM_PROG_LIBTOOL
AM_PROG_NM
LT_INIT
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_LANG([C])
# --disable-static by default
AC_DISABLE_STATIC
# --with-libpath
AC_ARG_WITH([libpath],
[AS_HELP_STRING([--with-libpath@<:@=LIBPATH@:>@],
[path list where library might be located @<:@default=$pkglibdir@:>@])],
[with_libpath=$withval],
[with_libpath=$libdir/$PACKAGE_NAME])
AS_IF([test "x$with_libpath" = x],
[AC_MSG_FAILURE([invalid libpath specified])])
AC_SUBST(libpath, $with_libpath)
# Checks for programs.
AC_PATH_PROG([CHROOT], [chroot], [/usr/sbin/chroot], [/usr/sbin:/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:$PATH])
AC_PATH_PROG([DEBOOTSTRAP], [debootstrap], [/usr/sbin/debootstrap], [/usr/sbin:/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:$PATH])
AC_PATH_PROG([DEVFS], [devfs], [/sbin/devfs], [/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:$PATH])
AC_PATH_PROG([ECHO], [echo], [/bin/echo], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([ENV], [env], [/usr/bin/env], [/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([FAKEROOT], [fakeroot], [/usr/bin/fakeroot], [/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([INSSERV], [insserv], [/sbin/insserv], [/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:$PATH])
AC_PATH_PROG([ISCHROOT], [ischroot], [/usr/bin/ischroot], [/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([LDCONFIG], [ldconfig], [/sbin/chroot], [/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:$PATH])
AC_PATH_PROG([LDD], [ldd], [/usr/bin/ldd], [/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([LS], [ls], [/bin/ls], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([MKFIFO], [mkfifo], [/usr/bin/mkfifo], [/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([PERL], [perl], [/usr/bin/perl], [/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/core_perl:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([POD2MAN], [pod2man], [], [/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/core_perl:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([PROVE], [prove], [], [/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/core_perl:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([SEQ], [seq gseq], [], [/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([SH], [sh], [/bin/sh], [/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([SHELL], [bash dash sh], [/bin/sh], [/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:$PATH])
AC_PATH_PROG([SYSTEMCTL], [systemctl], [/sbin/systemctl], [/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:$PATH])
# Additional C macros
AC_DEFINE([FAKECHROOT], [PACKAGE_VERSION], [FAKECHROOT])
AC_DEFINE_UNQUOTED([BIN_LS], ["$ac_cv_path_LS"], [BIN_LS])
AC_DEFINE_UNQUOTED([BIN_SH], ["$ac_cv_path_SH"], [BIN_SH])
# Checks for compiler features
ACX_CHECK_C_ALIGNOF
ACX_CHECK_C_ATTRIBUTE([constructor])
ACX_CHECK_C_ATTRIBUTE_SECTION([data.fakechroot])
ACX_CHECK_C_ATTRIBUTE_VISIBILITY
# Checks for libraries.
AC_CHECK_LIB([dl], [dlsym])
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(m4_normalize([
alloca.h
dirent.h
dlfcn.h
errno.h
fcntl.h
ftw.h
glob.h
libintl.h
link.h
pwd.h
shadow.h
spawn.h
signal.h
stdarg.h
stdint.h
stdio.h
stdlib.h
string.h
sys/inotify.h
sys/mount.h
sys/param.h
sys/socket.h
sys/stat.h
sys/statfs.h
sys/statvfs.h
sys/syscall.h
sys/times.h
sys/types.h
sys/un.h
sys/vfs.h
sys/wait.h
sys/xattr.h
unistd.h
utime.h
]))
AC_CHECK_HEADERS([fts.h], [], [], [
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for additional typedefs.
AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,, ACX_INCLUDES_HEADERS([sys/un.h]))
AC_CHECK_MEMBERS([struct _ftsent.fts_fts],,, ACX_INCLUDES_HEADERS([sys/types.h sys/stat.h fts.h]))
ACX_CHECK_FTS_NAME_TYPE
# Checks for library functions.
AC_CHECK_FUNCS(m4_normalize([
__chk_fail
__fxstat64
__fxstatat
__fxstatat64
__getcwd_chk
__getwd_chk
__lxstat
__lxstat64
__open
__open_2
__open64
__open64_2
__openat_2
__openat64_2
__opendir2
__realpath_chk
__readlink_chk
__readlinkat_chk
__statfs
__xmknod
__xmknodat
__xstat
__xstat64
_xftw
_xftw64
access
acct
audit_log_acct_message
bind
bindtextdomain
canonicalize_file_name
chdir
chmod
chown
chroot
clearenv
connect
creat
creat64
dl_iterate_phdr
dladdr
dlmopen
dlopen
eaccess
euidaccess
execl
execle
execlp
execv
execve
execvp
faccessat
fchdir
fchmodat
fchownat
fopen
fopen64
freopen
freopen64
fstat
fstat64
fts_children
fts_open
fts_read
fts64_open
ftw
ftw64
futimesat
get_current_dir_name
getcwd
getpeername
getsockname
getwd
getxattr
glob
glob64
glob_pattern_p
inotify_add_watch
lchmod
lchown
lckpwdf
lgetxattr
link
linkat
listxattr
llistxattr
lremovexattr
lsetxattr
lstat
lstat64
lutimes
mempcpy
mkdir
mkdirat
mkdtemp
mkfifo
mkfifoat
mknod
mknodat
mkostemp
mkostemp64
mkostemps
mkostemps64
mkstemp
mkstemp64
mkstemps
mkstemps64
mktemp
nftw
nftw64
open
open64
openat
openat64
opendir
pathconf
popen
posix_spawn
posix_spawnp
rawmemchr
readlink
readlinkat
realpath
remove
removexattr
rename
renameat
renameat2
revoke
rmdir
scandir
scandir64
setenv
setxattr
stat
stat64
statfs
statfs64
statvfs
statvfs64
statx
stpcpy
strchrnul
strlcpy
symlink
symlinkat
system
tempnam
tmpnam
truncate
truncate64
unlink
unlinkat
unsetenv
ulckpwdf
utime
utimensat
utimes
vfork
]))
AC_FUNC_ALLOCA
ASX_NO_CROSS_COMPILING([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
# Check for internal dependencies
ACX_CHECK_OPENDIR_CALLS_INTERNALLY([__open])
ACX_CHECK_OPENDIR_CALLS_INTERNALLY([__opendir2])
# Check return type and arguments types for functions
m4_foreach_w([function], [bind connect],
[ACX_CHECK_FUNC_ARGTYPES(function,
[
#define _GNU_SOURCE
], [sys/types.h sys/socket.h],
[[int], [int _], [const struct sockaddr *_], [socklen_t _]],
[[int]],
[[int _]],
[[__CONST_SOCKADDR_ARG _], [const struct sockaddr *_]],
[[socklen_t _]])])
m4_foreach_w([function], [getpeername getsockname],
[ACX_CHECK_FUNC_ARGTYPES(function,
[
#define _GNU_SOURCE
], [sys/types.h sys/socket.h],
[[int], [int _], [struct sockaddr *_], [socklen_t _]],
[[int]],
[[int _]],
[[__SOCKADDR_ARG _], [struct sockaddr *_]],
[[socklen_t *__restrict _], [socket_t *_]])])
ACX_CHECK_FUNC_ARGTYPES([fts_open],
[], [sys/types.h sys/stat.h fts.h],
[[FTSOBJ *], [char * const *_], [int], [int (*_)(const FTSENTRY **, const FTSENTRY **)]],
[[FTSOBJ *]],
[[char * const *_]],
[[int _]],
[[int (*_)(const FTSENTRY * const *, const FTSENTRY * const *)], [int (*_)(const FTSENTRY **, const FTSENTRY **)]])
ACX_CHECK_FUNC_ARGTYPES([fts64_open],
[], [sys/types.h sys/stat.h fts.h],
[[FTSOBJ *], [char * const *_], [int], [int (*_)(const FTSENTRY **, const FTSENTRY **)]],
[[FTSOBJ *]],
[[char * const *_]],
[[int _]],
[[int (*_)(const FTSENTRY * const *, const FTSENTRY * const *)], [int (*_)(const FTSENTRY **, const FTSENTRY **)]])
ACX_CHECK_FUNC_ARGTYPES([readlink],
[
#define _BSD_SOURCE 1
#define _DEFAULT_SOURCE 1
], [unistd.h],
[[ssize_t], [const char *_], [char *_], [size_t _]],
[[ssize_t], [int]],
[[const char *_]],
[[char *_]],
[[size_t _], [int _]])
ACX_CHECK_FUNC_ARGTYPES([scandir],
[
#define _BSD_SOURCE 1
#define _DEFAULT_SOURCE 1
], [dirent.h],
[[int], [const char *_], [struct dirent ***_], [int(*_)(const struct dirent *)], [int(*_)(const void *,const void *)]],
[[int]],
[[const char *_]],
[[struct dirent ***_]],
[[int(*_)(const struct dirent *)], [int(*_)(struct dirent *)]],
[[int(*_)(const struct dirent **, const struct dirent **)], [int(*_)(const void *,const void *)]])
ACX_CHECK_FUNC_ARGTYPES([scandir64],
[
#define _BSD_SOURCE
#define _GNU_SOURCE 1
#define _DEFAULT_SOURCE 1
], [dirent.h],
[[int], [const char *_], [struct dirent64 ***_], [int(*_)(const struct dirent64 *)], [int(*_)(const void *,const void *)]],
[[int]],
[[const char *_]],
[[struct dirent64 ***_]],
[[int(*_)(const struct dirent64 *)], [int(*_)(struct dirent64 *)]],
[[int(*_)(const struct dirent64 **, const struct dirent64 **)], [int(*_)(const void *,const void *)]])
ACX_CHECK_FUNC_ARGTYPES([utimes],
[], [sys/time.h],
[[int], [const char *_], [const struct timeval _@<:@2@:>@]],
[[int]],
[[const char *_]],
[[const struct timeval _@<:@2@:>@], [struct timeval _@<:@2@:>@]])
# List of Makefiles
AC_CONFIG_FILES(m4_normalize([
config.sh
Makefile
man/Makefile
src/Makefile
scripts/Makefile
test/Makefile
test/src/Makefile
]))
# prove --failures --exec /bin/sh
ACX_PROG_PROVE_OPT([--failures])
ACX_PROG_PROVE_OPT([--exec /bin/sh])
# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])
# Generate output
AC_OUTPUT