]>
Commit | Line | Data |
---|---|---|
1 | AC_INIT([util-linux], | |
2 | m4_esyscmd([tools/git-version-gen .tarball-version]), | |
3 | [kzak@redhat.com], [], | |
4 | [https://www.kernel.org/pub/linux/utils/util-linux/]) | |
5 | ||
6 | ||
7 | AC_PREREQ([2.64]) | |
8 | ||
9 | AC_CONFIG_AUX_DIR([config]) | |
10 | AC_CONFIG_MACRO_DIR([m4]) | |
11 | dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run | |
12 | dnl the compiler (like LT_INIT) to avoid autoconf errors. | |
13 | AC_USE_SYSTEM_EXTENSIONS | |
14 | AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) | |
15 | ||
16 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], | |
17 | [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) | |
18 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) | |
19 | ||
20 | AC_CONFIG_SRCDIR([sys-utils/mount.c]) | |
21 | AC_PREFIX_DEFAULT([/usr]) | |
22 | ||
23 | dnl version details from <major>.<minor>[-<suffix>] | |
24 | PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}') | |
25 | PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{ | |
26 | sub("-.*","",$2); print $2}') | |
27 | PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{ | |
28 | sub("-.*","",$3); print $3 ~ /^@<:@0-9@:>@+$/ ? $3 : 0}') | |
29 | ||
30 | dnl libblkid version | |
31 | LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
32 | LIBBLKID_DATE="18-Mar-2025" | |
33 | LIBBLKID_LT_MAJOR=1 | |
34 | LIBBLKID_LT_MINOR=1 | |
35 | LIBBLKID_LT_MICRO=0 | |
36 | LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR | |
37 | ||
38 | dnl libuuid version | |
39 | LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
40 | LIBUUID_LT_MAJOR=1 | |
41 | LIBUUID_LT_MINOR=3 | |
42 | LIBUUID_LT_MICRO=0 | |
43 | LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR | |
44 | ||
45 | dnl liblastlog2 version | |
46 | LIBLASTLOG2_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
47 | LIBLASTLOG2_LT_MAJOR=2 | |
48 | LIBLASTLOG2_LT_MINOR=0 | |
49 | LIBLASTLOG2_LT_MICRO=0 | |
50 | LIBLASTLOG2_VERSION_INFO=`expr $LIBLASTLOG2_LT_MAJOR + $LIBLASTLOG2_LT_MINOR`:$LIBLASTLOG2_LT_MICRO:$LIBLASTLOG2_LT_MINOR | |
51 | ||
52 | dnl libmount version | |
53 | LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
54 | LIBMOUNT_LT_MAJOR=1 | |
55 | LIBMOUNT_LT_MINOR=1 | |
56 | LIBMOUNT_LT_MICRO=0 | |
57 | LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR | |
58 | ||
59 | dnl libsmartcols version | |
60 | LIBSMARTCOLS_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
61 | LIBSMARTCOLS_LT_MAJOR=1 | |
62 | LIBSMARTCOLS_LT_MINOR=1 | |
63 | LIBSMARTCOLS_LT_MICRO=0 | |
64 | LIBSMARTCOLS_VERSION_INFO=`expr $LIBSMARTCOLS_LT_MAJOR + $LIBSMARTCOLS_LT_MINOR`:$LIBSMARTCOLS_LT_MICRO:$LIBSMARTCOLS_LT_MINOR | |
65 | ||
66 | dnl libfdisk version | |
67 | LIBFDISK_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
68 | LIBFDISK_LT_MAJOR=1 | |
69 | LIBFDISK_LT_MINOR=1 | |
70 | LIBFDISK_LT_MICRO=0 | |
71 | LIBFDISK_VERSION_INFO=`expr $LIBFDISK_LT_MAJOR + $LIBFDISK_LT_MINOR`:$LIBFDISK_LT_MICRO:$LIBFDISK_LT_MINOR | |
72 | ||
73 | # Check whether exec_prefix=/usr: | |
74 | AS_CASE([$exec_prefix:$prefix], | |
75 | [NONE:NONE | NONE:/usr | /usr:*], | |
76 | [AC_MSG_NOTICE([Default --exec-prefix detected.]) | |
77 | AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ]) | |
78 | AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])]) | |
79 | AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ]) | |
80 | AS_CASE([$libdir], ['${exec_prefix}/lib64'],[libdir=/lib64; AC_MSG_NOTICE([ --libdir defaults to /lib64]) ]) | |
81 | ] | |
82 | ) | |
83 | ||
84 | # Check whether prefix=/usr | |
85 | AS_CASE([$prefix], | |
86 | [NONE | /usr], | |
87 | [AC_MSG_NOTICE([Default --prefix detected.]) | |
88 | AS_CASE([$localstatedir], [NONE | '${prefix}/var' | "${prefix}"/var ], | |
89 | [localstatedir=/var; AC_MSG_NOTICE([ --localstatedir defaults to /var])]) | |
90 | AS_CASE([$sysconfdir], [NONE | '${prefix}/etc' | "${prefix}"/etc ], | |
91 | [sysconfdir=/etc; AC_MSG_NOTICE([ --sysconfdir defaults to /etc])]) | |
92 | ||
93 | ] | |
94 | ) | |
95 | AC_SUBST([localstatedir]) | |
96 | ||
97 | ||
98 | # default for old versions without $runstatedir | |
99 | AS_IF([test x"$runstatedir" = x], [runstatedir='${localstatedir}/run']) | |
100 | ||
101 | # our default if $localstatedir unchanged | |
102 | AS_CASE([$localstatedir:$runstatedir], | |
103 | [NONE:'${localstatedir}/run' | /var:'${localstatedir}/run' | NONE:'/run' ], | |
104 | [runstatedir=/run; AC_MSG_NOTICE([ --runstatedir defaults to /run])] | |
105 | ) | |
106 | AC_SUBST([runstatedir]) | |
107 | ||
108 | ||
109 | # The original default values of {bin,sbin,lib}dir | |
110 | usrbin_execdir='${exec_prefix}/bin' | |
111 | AC_SUBST([usrbin_execdir]) | |
112 | ||
113 | usrsbin_execdir='${exec_prefix}/sbin' | |
114 | AC_SUBST([usrsbin_execdir]) | |
115 | ||
116 | AS_CASE([$libdir], | |
117 | ['${exec_prefix}/'* | '${prefix}/'* | /usr/* | "${prefix}"/* ], | |
118 | [usrlib_execdir=$libdir], | |
119 | [usrlib_execdir='${exec_prefix}'$libdir] | |
120 | ) | |
121 | AC_SUBST([usrlib_execdir]) | |
122 | ||
123 | securelib_execdir='${libdir}/security' | |
124 | AC_SUBST([securelib_execdir]) | |
125 | ||
126 | # static configuration maintained by packages (e.g. /usr/lib) | |
127 | AC_ARG_VAR([SYSCONFSTATICDIR], | |
128 | [Path to static system configuration, default ${prefix}/lib]) | |
129 | AS_IF([test "x$SYSCONFSTATICDIR" = x], | |
130 | [sysconfstaticdir='${prefix}/lib'], | |
131 | [sysconfstaticdir=$SYSCONFSTATICDIR]) | |
132 | AC_SUBST([sysconfstaticdir]) | |
133 | ||
134 | AC_PROG_CC | |
135 | AM_PROG_CC_C_O | |
136 | AC_PROG_MKDIR_P | |
137 | AC_PROG_YACC | |
138 | AC_PROG_SED | |
139 | ||
140 | # Don't use autotools integrated LEX/YACC support for libsmartcols | |
141 | AC_PATH_PROG([FLEX], [flex]) | |
142 | AC_PATH_PROG([BISON], [bison]) | |
143 | ||
144 | AC_CANONICAL_HOST | |
145 | AC_C_CONST | |
146 | AC_C_VOLATILE | |
147 | ||
148 | dnl Compiler warnings | |
149 | UL_WARN_ADD([-fno-common]) | |
150 | UL_WARN_ADD([-Wall]) | |
151 | UL_WARN_ADD([-Wextra]) | |
152 | ||
153 | UL_WARN_ADD([-Waddress-of-packed-member]) | |
154 | UL_WARN_ADD([-Wdiscarded-qualifiers]) | |
155 | UL_WARN_ADD([-Wembedded-directive]) | |
156 | UL_WARN_ADD([-Wextra-semi]) | |
157 | UL_WARN_ADD([-Wformat-security]) | |
158 | UL_WARN_ADD([-Wimplicit-function-declaration]) | |
159 | UL_WARN_ADD([-Wmissing-declarations]) | |
160 | UL_WARN_ADD([-Wmissing-parameter-type]) | |
161 | UL_WARN_ADD([-Wmissing-prototypes]) | |
162 | UL_WARN_ADD([-Wnested-externs]) | |
163 | UL_WARN_ADD([-Wno-missing-field-initializers]) | |
164 | UL_WARN_ADD([-Wold-style-definition]) | |
165 | UL_WARN_ADD([-Wpointer-arith]) | |
166 | UL_WARN_ADD([-Wredundant-decls]) | |
167 | UL_WARN_ADD([-Wsign-compare]) | |
168 | UL_WARN_ADD([-Wstrict-prototypes]) | |
169 | UL_WARN_ADD([-Wtype-limits]) | |
170 | UL_WARN_ADD([-Wuninitialized]) | |
171 | UL_WARN_ADD([-Wunused-but-set-parameter]) | |
172 | UL_WARN_ADD([-Wunused-but-set-variable]) | |
173 | UL_WARN_ADD([-Wunused-parameter]) | |
174 | UL_WARN_ADD([-Wunused-result]) | |
175 | UL_WARN_ADD([-Wunused-variable]) | |
176 | UL_WARN_ADD([-Wvla]) | |
177 | UL_WARN_ADD([-Walloca]) | |
178 | ||
179 | AC_ARG_ENABLE([werror], | |
180 | AS_HELP_STRING([--enable-werror], [make all compiler warnings into errors]), | |
181 | [], [enable_werror=no] | |
182 | ) | |
183 | AS_IF([test "x$enable_werror" = xyes], [ | |
184 | UL_WARN_ADD([-Werror]) | |
185 | ],[ | |
186 | UL_WARN_ADD([-Werror=sequence-point]) | |
187 | ]) | |
188 | ||
189 | AC_SUBST([WARN_CFLAGS]) | |
190 | ||
191 | ||
192 | UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS]) | |
193 | AC_SUBST([BSD_WARN_CFLAGS]) | |
194 | ||
195 | UL_WARN_ADD([-Wno-cast-function-type], [PYTHON_WARN_CFLAGS]) | |
196 | AC_SUBST([PYTHON_WARN_CFLAGS]) | |
197 | ||
198 | ||
199 | AC_ARG_ENABLE([asan], | |
200 | AS_HELP_STRING([--enable-asan], [compile with Address Sanitizer]), | |
201 | [], [enable_asan=no] | |
202 | ) | |
203 | AS_IF([test "x$enable_asan" = xyes], [ | |
204 | UL_WARN_ADD([-fsanitize=address]) | |
205 | ASAN_LDFLAGS="-fsanitize=address" | |
206 | ]) | |
207 | AC_SUBST([ASAN_LDFLAGS]) | |
208 | ||
209 | AC_ARG_ENABLE([ubsan], | |
210 | AS_HELP_STRING([--enable-ubsan], [compile with UBsan]), | |
211 | [], [enable_ubsan=no] | |
212 | ) | |
213 | AS_IF([test "x$enable_ubsan" = xyes], [ | |
214 | UL_WARN_ADD([-fsanitize=undefined]) | |
215 | UBSAN_LDFLAGS="-fsanitize=undefined" | |
216 | ]) | |
217 | AC_SUBST([UBSAN_LDFLAGS]) | |
218 | ||
219 | AC_ARG_ENABLE([fuzzing-engine], | |
220 | AS_HELP_STRING([--enable-fuzzing-engine], [compile with fuzzing engine]), | |
221 | [], [enable_fuzzing_engine=no] | |
222 | ) | |
223 | AS_IF([test "x$enable_fuzzing_engine" = xyes && test "x$LIB_FUZZING_ENGINE" = x], [ | |
224 | UL_WARN_ADD([-fno-omit-frame-pointer]) | |
225 | UL_WARN_ADD([-gline-tables-only]) | |
226 | UL_WARN_ADD([-fsanitize=fuzzer-no-link]) | |
227 | FUZZING_ENGINE_LDFLAGS="-fsanitize=fuzzer-no-link" | |
228 | ]) | |
229 | AC_SUBST([FUZZING_ENGINE_LDFLAGS]) | |
230 | AC_PROG_CXX | |
231 | AM_CONDITIONAL([FUZZING_ENGINE], [test "x$enable_fuzzing_engine" = xyes]) | |
232 | AM_CONDITIONAL([OSS_FUZZ], [test "x$LIB_FUZZING_ENGINE" != x]) | |
233 | ||
234 | AC_ARG_ENABLE([coverage], | |
235 | AS_HELP_STRING([--enable-coverage], [compile with gcov]), | |
236 | [], [enable_coverage=no] | |
237 | ) | |
238 | AS_IF([test "x$enable_coverage" = xyes], [ | |
239 | UL_WARN_ADD([--coverage]) | |
240 | COVERAGE_LDFLAGS="--coverage" | |
241 | ]) | |
242 | AC_SUBST([COVERAGE_LDFLAGS]) | |
243 | AM_CONDITIONAL([WITH_COVERAGE], [test "x$enable_coverage" = xyes]) | |
244 | ||
245 | dnl libtool-2 | |
246 | LT_INIT | |
247 | ||
248 | dnl check supported linker flags | |
249 | AX_CHECK_VSCRIPT | |
250 | ||
251 | m4_ifndef([PKG_PROG_PKG_CONFIG], | |
252 | [m4_fatal([Could not locate the pkg-config autoconf | |
253 | macros. These are usually located in /usr/share/aclocal/pkg.m4. | |
254 | If your macros are in a different location, try setting the | |
255 | environment variable AL_OPTS="-I/other/macro/dir" before running | |
256 | ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])]) | |
257 | PKG_PROG_PKG_CONFIG | |
258 | PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig']) | |
259 | ||
260 | GTK_DOC_CHECK([1.10]) | |
261 | AC_PATH_PROG([XSLTPROC], [xsltproc]) | |
262 | ||
263 | ||
264 | linux_os=no | |
265 | bsd_os=no | |
266 | gnu_os=no | |
267 | AS_CASE([${host_os}], | |
268 | [*linux*], | |
269 | [linux_os=yes], | |
270 | [*darwin*], | |
271 | [darwin_os=yes], | |
272 | [*bsd*], | |
273 | [bsd_os=yes], | |
274 | [gnu*], | |
275 | [gnu_os=yes]) | |
276 | AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes]) | |
277 | AM_CONDITIONAL([DARWIN], [test "x$darwin_os" = xyes]) | |
278 | AM_CONDITIONAL([BSD], [test "x$bsd_os" = xyes]) | |
279 | AM_CONDITIONAL([HURD], [test "x$gnu_os" = xyes]) | |
280 | ||
281 | AS_IF([test "x$darwin_os" = xyes], [ | |
282 | AC_DEFINE([_DARWIN_C_SOURCE], [1], [Enable MAP_ANON in sys/mman.h on Mac OS X]) | |
283 | ]) | |
284 | ||
285 | dnl define ARCH_<NAME> conditionals | |
286 | UL_SET_ARCH([I86], [i?86-*]) | |
287 | UL_SET_ARCH([86_64], [x86_64*]) | |
288 | UL_SET_ARCH([IA64], [ia64*]) | |
289 | UL_SET_ARCH([S390], [s390*]) | |
290 | UL_SET_ARCH([SPARC], [sparc*]) | |
291 | UL_SET_ARCH([PPC], [ppc*|powerpc*]) | |
292 | UL_SET_ARCH([M68K], [m68*]) | |
293 | UL_SET_ARCH([MIPS], [mips*]) | |
294 | UL_SET_ARCH([HPPA], [hppa*|parisc*]) | |
295 | ||
296 | AC_SYS_LARGEFILE | |
297 | AC_HEADER_ASSERT | |
298 | AC_STRUCT_TIMEZONE | |
299 | UL_YEAR2038_INIT | |
300 | AC_SYS_YEAR2038_RECOMMENDED | |
301 | ||
302 | dnl Don't forget to maintain alternatively allowed versions in autogen.sh! | |
303 | AM_GNU_GETTEXT_VERSION([0.18.3]) | |
304 | AM_GNU_GETTEXT([external]) | |
305 | ||
306 | AS_IF([test -d "$srcdir/po"], [ | |
307 | ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'` | |
308 | ], [dnl echo $ALL_LINGUAS | sed 's/ /\n/g' | sort -u | column -xc 72 -o ' ' | sed 's/^/\t/' | |
309 | ALL_LINGUAS=" | |
310 | af am ar as be bg bn bn_IN ca | |
311 | cs cy da de el en_GB es et eu_ES | |
312 | fa fi fr gl gu he hi hr hu | |
313 | hy id is it ja ka kn ko ku | |
314 | lo lt lv mk ml mr ms my nb | |
315 | nl nn no nso or pa pl pt pt_BR | |
316 | ro ru si sk sl sq sr sr@Latn sv | |
317 | ta te th tr uk ur vi zh_CN zh_TW | |
318 | zu | |
319 | "]) | |
320 | ||
321 | AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [ | |
322 | #ifdef HAVE_LINUX_COMPILER_H | |
323 | #include <linux/compiler.h> | |
324 | #endif | |
325 | ]) | |
326 | AC_CHECK_HEADERS([ \ | |
327 | asm/io.h \ | |
328 | byteswap.h \ | |
329 | endian.h \ | |
330 | err.h \ | |
331 | errno.h \ | |
332 | fcntl.h \ | |
333 | getopt.h \ | |
334 | inttypes.h \ | |
335 | lastlog.h \ | |
336 | libutil.h \ | |
337 | linux/audit.h \ | |
338 | linux/bpf.h \ | |
339 | linux/blkzoned.h \ | |
340 | linux/btrfs.h \ | |
341 | linux/capability.h \ | |
342 | linux/cdrom.h \ | |
343 | linux/falloc.h \ | |
344 | linux/fd.h \ | |
345 | linux/fiemap.h \ | |
346 | linux/landlock.h \ | |
347 | linux/kcmp.h \ | |
348 | linux/net_namespace.h \ | |
349 | linux/nsfs.h \ | |
350 | linux/pr.h \ | |
351 | linux/raw.h \ | |
352 | linux/seccomp.h \ | |
353 | linux/securebits.h \ | |
354 | linux/tiocl.h \ | |
355 | linux/version.h \ | |
356 | linux/watchdog.h \ | |
357 | linux/if_alg.h \ | |
358 | locale.h \ | |
359 | mntent.h \ | |
360 | mqueue.h \ | |
361 | net/if_dl.h \ | |
362 | net/if.h \ | |
363 | netinet/in.h \ | |
364 | paths.h \ | |
365 | pty.h \ | |
366 | security/pam_appl.h \ | |
367 | security/pam_modules.h \ | |
368 | semaphore.h \ | |
369 | shadow.h \ | |
370 | stdint.h \ | |
371 | stdio_ext.h \ | |
372 | stdlib.h \ | |
373 | sys/auxv.h \ | |
374 | sys/disk.h \ | |
375 | sys/disklabel.h \ | |
376 | sys/endian.h \ | |
377 | sys/file.h \ | |
378 | sys/ioccom.h \ | |
379 | sys/ioctl.h \ | |
380 | sys/io.h \ | |
381 | sys/mkdev.h \ | |
382 | sys/mman.h \ | |
383 | sys/mount.h \ | |
384 | sys/param.h \ | |
385 | sys/pidfd.h \ | |
386 | sys/prctl.h \ | |
387 | sys/resource.h \ | |
388 | sys/sendfile.h \ | |
389 | sys/signalfd.h \ | |
390 | sys/socket.h \ | |
391 | sys/sockio.h \ | |
392 | sys/stat.h \ | |
393 | sys/statfs.h \ | |
394 | sys/swap.h \ | |
395 | sys/syscall.h \ | |
396 | sys/sysmacros.h \ | |
397 | sys/time.h \ | |
398 | sys/timex.h \ | |
399 | sys/ttydefaults.h \ | |
400 | sys/types.h \ | |
401 | sys/ucred.h \ | |
402 | sys/un.h \ | |
403 | sys/vfs.h \ | |
404 | sys/xattr.h \ | |
405 | unistd.h \ | |
406 | utmp.h \ | |
407 | utmpx.h \ | |
408 | ]) | |
409 | ||
410 | # There is a collision in old kernel-headers. The both files mount.h and fs.h | |
411 | # define MS_* macros. Fixed by kernel commit e462ec50cb5fad19f6003a3d8087f4a0945dd2b1. | |
412 | # | |
413 | AC_CHECK_HEADERS([linux/fs.h ], [], [], | |
414 | [#ifdef HAVE_SYS_MOUNT_H | |
415 | # include <linux/fs.h> | |
416 | # include <sys/mount.h> | |
417 | #endif | |
418 | ]) | |
419 | ||
420 | AC_CHECK_HEADERS([linux/mount.h ], [], [], | |
421 | [#ifdef HAVE_LINUX_MOUNT_H | |
422 | # include <linux/mount.h> | |
423 | #endif | |
424 | ]) | |
425 | ||
426 | AC_CHECK_HEADERS([linux/gsmmux.h ], [], [], | |
427 | [#ifdef LINUX_GSMMUX_H | |
428 | # include <linux/gsmmux.h> | |
429 | #endif | |
430 | ]) | |
431 | ||
432 | AC_CHECK_HEADERS([security/pam_misc.h], | |
433 | [AM_CONDITIONAL([HAVE_LINUXPAM], [true])], | |
434 | [AM_CONDITIONAL([HAVE_LINUXPAM], [false])], [ | |
435 | #ifdef HAVE_SECURITY_PAM_APPL_H | |
436 | #include <security/pam_appl.h> | |
437 | #endif | |
438 | ]) | |
439 | ||
440 | AC_CHECK_DECLS([BLK_ZONE_REP_CAPACITY], [], [], [ | |
441 | #include <linux/blkzoned.h> | |
442 | ]) | |
443 | ||
444 | AC_CHECK_DECLS([PR_REP_CAPACITY], [], [], [ | |
445 | #include <linux/pr.h> | |
446 | ]) | |
447 | ||
448 | AC_CHECK_HEADERS([security/openpam.h], [], [], [ | |
449 | #ifdef HAVE_SECURITY_PAM_APPL_H | |
450 | #include <security/pam_appl.h> | |
451 | #endif | |
452 | ]) | |
453 | ||
454 | AC_CHECK_HEADERS([langinfo.h], | |
455 | [AM_CONDITIONAL([HAVE_LANGINFO_H], [true])], | |
456 | [AM_CONDITIONAL([HAVE_LANGINFO_H], [false])]) | |
457 | ||
458 | AC_MSG_CHECKING([whether langinfo.h defines ALTMON_x constants]) | |
459 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
460 | #include <langinfo.h> | |
461 | ]], [[ | |
462 | char *str; | |
463 | str = nl_langinfo (ALTMON_1); | |
464 | str = nl_langinfo (ALTMON_2); | |
465 | str = nl_langinfo (ALTMON_3); | |
466 | str = nl_langinfo (ALTMON_4); | |
467 | str = nl_langinfo (ALTMON_5); | |
468 | str = nl_langinfo (ALTMON_6); | |
469 | str = nl_langinfo (ALTMON_7); | |
470 | str = nl_langinfo (ALTMON_8); | |
471 | str = nl_langinfo (ALTMON_9); | |
472 | str = nl_langinfo (ALTMON_10); | |
473 | str = nl_langinfo (ALTMON_11); | |
474 | str = nl_langinfo (ALTMON_12); | |
475 | ]])], [ | |
476 | AC_MSG_RESULT([yes]) | |
477 | AC_DEFINE([HAVE_LANGINFO_ALTMON], [1], | |
478 | [Define if langinfo.h defines ALTMON_x constants]) | |
479 | ], [ | |
480 | AC_MSG_RESULT([no]) | |
481 | ]) | |
482 | ||
483 | ||
484 | AC_MSG_CHECKING([whether langinfo.h defines _NL_ABALTMON_x constants]) | |
485 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
486 | #include <langinfo.h> | |
487 | ]], [[ | |
488 | char *str; | |
489 | str = nl_langinfo (_NL_ABALTMON_1); | |
490 | str = nl_langinfo (_NL_ABALTMON_2); | |
491 | str = nl_langinfo (_NL_ABALTMON_3); | |
492 | str = nl_langinfo (_NL_ABALTMON_4); | |
493 | str = nl_langinfo (_NL_ABALTMON_5); | |
494 | str = nl_langinfo (_NL_ABALTMON_6); | |
495 | str = nl_langinfo (_NL_ABALTMON_7); | |
496 | str = nl_langinfo (_NL_ABALTMON_8); | |
497 | str = nl_langinfo (_NL_ABALTMON_9); | |
498 | str = nl_langinfo (_NL_ABALTMON_10); | |
499 | str = nl_langinfo (_NL_ABALTMON_11); | |
500 | str = nl_langinfo (_NL_ABALTMON_12); | |
501 | ]])], [ | |
502 | AC_MSG_RESULT([yes]) | |
503 | AC_DEFINE([HAVE_LANGINFO_NL_ABALTMON], [1], | |
504 | [Define if langinfo.h defines _NL_ABALTMON_x constants]) | |
505 | ], [ | |
506 | AC_MSG_RESULT([no]) | |
507 | ]) | |
508 | ||
509 | ||
510 | dnl Convert some ac_cv_header_* variables to have_* | |
511 | dnl | |
512 | have_linux_audit_h=$ac_cv_header_linux_audit_h | |
513 | have_linux_blkzoned_h=$ac_cv_header_linux_blkzoned_h | |
514 | have_linux_btrfs_h=$ac_cv_header_linux_btrfs_h | |
515 | have_linux_capability_h=$ac_cv_header_linux_capability_h | |
516 | have_linux_kcmp_h=$ac_cv_header_linux_kcmp_h | |
517 | have_linux_mount_h=$ac_cv_header_linux_mount_h | |
518 | have_linux_pr_h=$ac_cv_header_linux_pr_h | |
519 | have_linux_raw_h=$ac_cv_header_linux_raw_h | |
520 | have_linux_seccomp_h=$ac_cv_header_linux_seccomp_h | |
521 | have_linux_securebits_h=$ac_cv_header_linux_securebits_h | |
522 | have_linux_version_h=$ac_cv_header_linux_version_h | |
523 | have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h | |
524 | have_pty_h=$ac_cv_header_pty_h | |
525 | have_security_openpam_h=$ac_cv_header_security_openpam_h | |
526 | have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h | |
527 | have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h | |
528 | have_security_pam_modules_h=$ac_cv_header_security_pam_modules_h | |
529 | have_shadow_h=$ac_cv_header_shadow_h | |
530 | have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h | |
531 | have_utmpx_h=$ac_cv_header_utmpx_h | |
532 | have_mntent_h=$ac_cv_header_mntent_h | |
533 | have_sys_vfs_h=$ac_cv_header_sys_vfs_h | |
534 | have_linux_bpf_h=$ac_cv_header_linux_bpf_h | |
535 | ||
536 | AS_CASE([$linux_os:$have_linux_version_h], | |
537 | [yes:no], | |
538 | [AC_MSG_ERROR([kernel headers required on Linux])] | |
539 | ) | |
540 | ||
541 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
542 | #include <time.h> | |
543 | #include <unistd.h> | |
544 | ]], [[ | |
545 | int a = 0; | |
546 | struct tm *tm = localtime(0); | |
547 | if (a == -1) /* false */ | |
548 | sleep(tm->tm_gmtoff); | |
549 | ]])], | |
550 | [AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?]) | |
551 | ]) | |
552 | ||
553 | AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]]) | |
554 | AC_CHECK_TYPES([enum fsconfig_command], [], [], [[#include <linux/mount.h>]]) | |
555 | ||
556 | AC_CHECK_MEMBERS([struct termios.c_line],,, | |
557 | [[#include <termios.h>]]) | |
558 | ||
559 | AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, | |
560 | [[#include <sys/stat.h>]]) | |
561 | ||
562 | AC_CHECK_TYPES([struct statx], [], [], [[#include <sys/stat.h>]]) | |
563 | AC_CHECK_MEMBERS([struct statx.stx_mnt_id],,, | |
564 | [[#include <sys/stat.h>]]) | |
565 | ||
566 | AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]]) | |
567 | ||
568 | AC_CHECK_DECL([environ], | |
569 | [AC_DEFINE([HAVE_ENVIRON_DECL], [1], | |
570 | [Define to 1 if have **environ prototype])], | |
571 | ) | |
572 | ||
573 | AC_CHECK_DECL([strsignal], | |
574 | [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1], | |
575 | [Define to 1 if have strsignal function prototype])], | |
576 | ) | |
577 | ||
578 | AC_CHECK_DECL([BPF_OBJ_NAME_LEN], | |
579 | [have_bpf_obj_name_len=yes], [have_bpf_obj_name_len=no], | |
580 | [#include <linux/bpf.h>]) | |
581 | AC_CHECK_DECL([BPF_TAG_SIZE], | |
582 | [have_bpf_tag_size=yes], [have_bpf_tag_size=no], | |
583 | [#include <linux/bpf.h>]) | |
584 | ||
585 | AC_CHECK_DECL([TIOCGLCKTRMIOS], | |
586 | [have_tiocglcktrmios=yes], [have_tiocglcktrmios=no], | |
587 | [#include <sys/ioctl.h>]) | |
588 | AC_CHECK_DECL([SOCK_CLOEXEC], | |
589 | [have_sock_cloexec=yes], [have_sock_cloexec=no], | |
590 | [#include <sys/types.h> | |
591 | #include <sys/socket.h>]) | |
592 | AC_CHECK_DECL([SOCK_NONBLOCK], | |
593 | [have_sock_nonblock=yes], [have_sock_nonblock=no], | |
594 | [#include <sys/types.h> | |
595 | #include <sys/socket.h>]) | |
596 | AC_CHECK_DECL([SO_PASSCRED], | |
597 | [have_so_passcred=yes], [have_so_passcred=no], | |
598 | [#include <sys/types.h> | |
599 | #include <sys/socket.h>]) | |
600 | ||
601 | AC_CHECK_DECLS([VMADDR_CID_LOCAL], [], [], [ | |
602 | #include <sys/socket.h> | |
603 | #include <linux/vm_sockets.h>]) | |
604 | ||
605 | AC_CHECK_FUNCS([ \ | |
606 | cachestat \ | |
607 | clearenv \ | |
608 | close_range \ | |
609 | eaccess \ | |
610 | err \ | |
611 | errx \ | |
612 | explicit_bzero \ | |
613 | __fpending \ | |
614 | __fpurge \ | |
615 | fpurge \ | |
616 | fnmatch \ | |
617 | fsconfig \ | |
618 | fsmount \ | |
619 | fsopen \ | |
620 | fspick \ | |
621 | fsync \ | |
622 | getauxval \ | |
623 | getdomainname \ | |
624 | getdtablesize \ | |
625 | getexecname \ | |
626 | getmntinfo \ | |
627 | getrandom \ | |
628 | getrlimit \ | |
629 | getsgnam \ | |
630 | getttynam \ | |
631 | inotify_init \ | |
632 | jrand48 \ | |
633 | landlock_create_ruleset \ | |
634 | landlock_add_rule \ | |
635 | landlock_restrict_self \ | |
636 | lchown \ | |
637 | lgetxattr \ | |
638 | llistxattr \ | |
639 | llseek \ | |
640 | newlocale \ | |
641 | mempcpy \ | |
642 | mkostemp \ | |
643 | move_mount \ | |
644 | mount_setattr \ | |
645 | nanosleep \ | |
646 | ntp_gettime \ | |
647 | open_tree \ | |
648 | personality \ | |
649 | pidfd_getfd \ | |
650 | pidfd_open \ | |
651 | pidfd_send_signal \ | |
652 | posix_fadvise \ | |
653 | prctl \ | |
654 | qsort_r \ | |
655 | reallocarray \ | |
656 | renameat2 \ | |
657 | rpmatch \ | |
658 | scandirat \ | |
659 | sched_setattr \ | |
660 | sched_setscheduler \ | |
661 | __secure_getenv \ | |
662 | secure_getenv \ | |
663 | sendfile \ | |
664 | setprogname \ | |
665 | setresgid \ | |
666 | setresuid \ | |
667 | sigqueue \ | |
668 | srandom \ | |
669 | statx \ | |
670 | strnchr \ | |
671 | strndup \ | |
672 | strnlen \ | |
673 | strtod_l \ | |
674 | sysconf \ | |
675 | sysinfo \ | |
676 | timegm \ | |
677 | usleep \ | |
678 | uselocale \ | |
679 | utimensat \ | |
680 | vwarnx \ | |
681 | warn \ | |
682 | warnx \ | |
683 | ]) | |
684 | AC_FUNC_FSEEKO | |
685 | ||
686 | AC_CHECK_FUNCS([futimens], [have_futimens=yes]) | |
687 | AC_CHECK_FUNCS([getusershell], [have_getusershell=yes],[have_getusershell=no]) | |
688 | AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes]) | |
689 | AC_CHECK_FUNCS([ioperm iopl], [have_io=yes]) | |
690 | AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no]) | |
691 | AC_CHECK_FUNCS([open_memstream], [have_open_memstream=yes],[have_open_memstream=no]) | |
692 | AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no]) | |
693 | AC_CHECK_FUNCS([updwtmpx updwtmpx], [have_gnu_utmpx=yes], [have_gnu_utmpx=no]) | |
694 | ||
695 | AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes]) | |
696 | AM_CONDITIONAL([HAVE_LINUX_LANDLOCK_H], [test "x$ac_cv_header_linux_landlock_h" = xyes]) | |
697 | ||
698 | have_setns_syscall="yes" | |
699 | UL_CHECK_SYSCALL([setns]) | |
700 | AS_IF([test "x$ul_cv_syscall_setns" = xno], [ | |
701 | have_setns_syscall="no" | |
702 | ]) | |
703 | ||
704 | UL_CHECK_SYSCALL([pidfd_getfd]) | |
705 | UL_CHECK_SYSCALL([pidfd_open]) | |
706 | UL_CHECK_SYSCALL([pidfd_send_signal]) | |
707 | UL_CHECK_SYSCALL([close_range]) | |
708 | UL_CHECK_SYSCALL([fsconfig]) | |
709 | UL_CHECK_SYSCALL([fsmount]) | |
710 | UL_CHECK_SYSCALL([fsopen]) | |
711 | UL_CHECK_SYSCALL([fspick]) | |
712 | UL_CHECK_SYSCALL([mount_setattr]) | |
713 | UL_CHECK_SYSCALL([move_mount]) | |
714 | UL_CHECK_SYSCALL([open_tree]) | |
715 | ||
716 | AS_IF([test "x$ul_cv_syscall_fsconfig" = xno || | |
717 | test "x$ul_cv_syscall_fsmount" = xno || | |
718 | test "x$ul_cv_syscall_fsopen" = xno || | |
719 | test "x$ul_cv_syscall_fspick" = xno || | |
720 | test "x$ul_cv_syscall_mount_setattr" = xno || | |
721 | test "x$ul_cv_syscall_move_mount" = xno || | |
722 | test "x$ul_cv_syscall_open_tree" = xno], | |
723 | [ | |
724 | have_mountfd_api="no" | |
725 | ],[ | |
726 | have_mountfd_api="yes" | |
727 | AC_DEFINE([HAVE_MOUNTFD_API], [1], [Define to 1 if you want to use mount API based on FDs.]) | |
728 | ]) | |
729 | ||
730 | ||
731 | UL_CHECK_SYSCALL([statmount]) | |
732 | UL_CHECK_SYSCALL([listmount]) | |
733 | ||
734 | AS_IF([test "x$ul_cv_syscall_statmount" = xno || | |
735 | test "x$ul_cv_syscall_listmount" = xno], | |
736 | [ | |
737 | have_statmount_api="no" | |
738 | ],[ | |
739 | have_statmount_api="yes" | |
740 | AC_DEFINE([HAVE_STATMOUNT_API], [1], [Define to 1 if you want to use statmount API.]) | |
741 | ]) | |
742 | ||
743 | ||
744 | AC_CHECK_FUNCS([isnan], [], | |
745 | [AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])] | |
746 | [AC_CHECK_LIB([m], [__isnan], [MATH_LIBS="-lm"])] | |
747 | ) | |
748 | AC_SUBST([MATH_LIBS]) | |
749 | ||
750 | ||
751 | dnl lib/mononotic.c may require -lrt | |
752 | AC_CHECK_FUNCS([clock_gettime], [], | |
753 | [AC_CHECK_LIB([rt], [clock_gettime], [REALTIME_LIBS="-lrt"])] | |
754 | ) | |
755 | ||
756 | have_timer="no" | |
757 | AC_CHECK_FUNCS([timer_create], | |
758 | [have_timer="yes"], | |
759 | [AC_CHECK_LIB([rt], [timer_create], [ | |
760 | have_timer="yes" | |
761 | REALTIME_LIBS="-lrt" | |
762 | AC_DEFINE([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt]) | |
763 | ],[ | |
764 | AC_SEARCH_LIBS([timer_create], [rt], [ | |
765 | AC_MSG_RESULT(yes) | |
766 | have_timer="yes" | |
767 | REALTIME_LIBS="-lrt -lpthread" | |
768 | AC_DEFINE([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt -lpthread]) | |
769 | ],[], [-lpthread] | |
770 | ) | |
771 | ])] | |
772 | ) | |
773 | ||
774 | AC_SUBST([REALTIME_LIBS]) | |
775 | ||
776 | AS_IF([test x"$have_timer" = xno], [ | |
777 | AC_CHECK_FUNCS([setitimer], [have_timer="yes"], [have_timer="no"]) | |
778 | ]) | |
779 | ||
780 | ||
781 | AC_CHECK_LIB([pthread], [pthread_atfork], [ | |
782 | PTHREAD_LIBS="-lpthread" | |
783 | AC_DEFINE([HAVE_LIBPTHREAD], [1], [Define if libpthred exist]) | |
784 | ]) | |
785 | AC_SUBST([PTHREAD_LIBS]) | |
786 | ||
787 | ||
788 | AC_CHECK_LIB([rtas], [rtas_get_sysparm], [ | |
789 | RTAS_LIBS="-lrtas" | |
790 | AC_DEFINE([HAVE_LIBRTAS], [1], [Define if librtas exists]) | |
791 | ]) | |
792 | AC_SUBST([RTAS_LIBS]) | |
793 | ||
794 | ||
795 | AC_CHECK_MEMBER([struct sockaddr.sa_len], | |
796 | AC_DEFINE([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [], | |
797 | [#include <sys/types.h> | |
798 | #include <sys/socket.h>]) | |
799 | ||
800 | SOCKET_LIBS= | |
801 | AC_SEARCH_LIBS([socket], [socket], | |
802 | [AS_IF([test x"$ac_cv_search_socket" != x"none required"], | |
803 | [SOCKET_LIBS="$SOCKET_LIBS -lsocket"]) | |
804 | ]) | |
805 | AC_SUBST([SOCKET_LIBS]) | |
806 | ||
807 | ||
808 | have_dirfd=no | |
809 | AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no]) | |
810 | AS_IF([test x"$have_dirfd" = xno], [ | |
811 | AC_CHECK_DECLS([dirfd], | |
812 | [have_dirfd=yes], [have_dirfd=no], | |
813 | [#include <sys/types.h> | |
814 | #include <dirent.h>]) | |
815 | ]) | |
816 | ||
817 | have_ddfd=no | |
818 | AS_IF([test x"$have_dirfd" = xno], [ | |
819 | AC_CHECK_MEMBERS([DIR.dd_fd], | |
820 | [have_ddfd=yes], [have_ddfd=no], | |
821 | [#include <sys/types.h> | |
822 | #include <dirent.h>]) | |
823 | ]) | |
824 | ||
825 | AM_CONDITIONAL([HAVE_DIRFD], [test "x$have_dirfd" = xyes || test "x$have_ddfd" = xyes]) | |
826 | ||
827 | have_fts_open=no | |
828 | AC_CHECK_FUNCS([fts_open], [have_fts_open=yes], [have_fts_open=no]) | |
829 | AM_CONDITIONAL([HAVE_FTS_OPEN], [test "x$have_fts_open" = xyes]) | |
830 | ||
831 | MQ_LIBS= | |
832 | AC_CHECK_LIB([rt], [mq_open], [MQ_LIBS="-lrt"]) | |
833 | AC_SUBST([MQ_LIBS]) | |
834 | ||
835 | AC_MSG_CHECKING([whether program_invocation_short_name is defined]) | |
836 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
837 | #include <errno.h> | |
838 | ]], [[ | |
839 | program_invocation_short_name = "test"; | |
840 | ]])], [ | |
841 | AC_MSG_RESULT([yes]) | |
842 | AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], | |
843 | [Define if program_invocation_short_name is defined]) | |
844 | ], [ | |
845 | AC_MSG_RESULT([no]) | |
846 | ]) | |
847 | ||
848 | ||
849 | AC_MSG_CHECKING([whether __progname is defined]) | |
850 | AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;], | |
851 | [if (*__progname == 0) return 1;])], | |
852 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined]) | |
853 | AC_MSG_RESULT([yes]), | |
854 | AC_MSG_RESULT([no])) | |
855 | ||
856 | AC_CHECK_DECL([IOC_OPAL_GET_STATUS], | |
857 | [AC_DEFINE([HAVE_OPAL_GET_STATUS], [1], | |
858 | [Define to 1 if OPAL status ioctl is defined])],, | |
859 | [#include <linux/sed-opal.h>]) | |
860 | ||
861 | dnl Static compilation | |
862 | m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, partx, sfdisk, umount, unshare]) | |
863 | ||
864 | AC_ARG_ENABLE([static-programs], | |
865 | [AS_HELP_STRING([--enable-static-programs=LIST], | |
866 | [link static the programs in LIST (comma-separated, | |
867 | supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])]) | |
868 | ||
869 | AS_CASE([$enable_static_programs], | |
870 | [yes], | |
871 | [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)], | |
872 | [no], | |
873 | [enable_static_programs=] | |
874 | ) | |
875 | ||
876 | dnl Set all the individual AM_CONDITIONALs | |
877 | m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [ | |
878 | AS_CASE([,$enable_static_programs,], | |
879 | [*,UL_PRG,*], [static_[]UL_PRG=yes] | |
880 | ) | |
881 | AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])]) | |
882 | AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG), | |
883 | [test "x$static_[]UL_PRG" = xyes]) | |
884 | ]) | |
885 | ||
886 | ||
887 | AC_ARG_ENABLE([all-programs], | |
888 | AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]), | |
889 | [], [enable_all_programs=undefined] | |
890 | ) | |
891 | ||
892 | AS_CASE([$enable_all_programs], | |
893 | [yes], [AC_MSG_WARN([force to build all programs by default]) | |
894 | ul_default_estate=check], | |
895 | [no], [AC_MSG_WARN([disable all programs and man pages by default]) | |
896 | ul_default_estate=no] | |
897 | ) | |
898 | ||
899 | ||
900 | AC_ARG_ENABLE([asciidoc], | |
901 | AS_HELP_STRING([--disable-asciidoc], [do not generate man pages from asciidoc]), | |
902 | [], [UL_DEFAULT_ENABLE([asciidoc], [check])] | |
903 | ) | |
904 | UL_BUILD_INIT([asciidoc]) | |
905 | UL_REQUIRES_PROGRAM([asciidoc], [ASCIIDOCTOR], [asciidoctor], [man pages]) | |
906 | AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$build_asciidoc" = xyes]) | |
907 | have_asciidoctor_failure_level=no | |
908 | AS_IF([test "x$build_asciidoc" = xyes], [ | |
909 | AC_MSG_CHECKING([whether ${ASCIIDOCTOR} supports --failure-level]) | |
910 | AS_IF([${ASCIIDOCTOR} --help | grep failure-level >/dev/null 2>&1 ], [ | |
911 | AC_MSG_RESULT([yes]) | |
912 | have_asciidoctor_failure_level=yes | |
913 | ], [ | |
914 | AC_MSG_RESULT([no]) | |
915 | ]) | |
916 | ]) | |
917 | AM_CONDITIONAL([HAVE_ASCIIDOCTOR_FAILURE_LEVEL], [test "x$have_asciidoctor_failure_level" = xyes]) | |
918 | ||
919 | have_manpages=no | |
920 | AS_IF([test -f "$srcdir/sys-utils/mount.8"], [ | |
921 | AC_MSG_NOTICE([re-use already generated man-pages.]) | |
922 | have_manpages=yes] | |
923 | ) | |
924 | AM_CONDITIONAL([HAVE_MANPAGES], [test "x$have_manpages" = xyes]) | |
925 | ||
926 | ||
927 | AC_ARG_ENABLE([poman], | |
928 | AS_HELP_STRING([--disable-poman], [do not generate translated man pages]), | |
929 | [], [UL_DEFAULT_ENABLE([poman], [check])] | |
930 | ) | |
931 | UL_BUILD_INIT([poman]) | |
932 | UL_REQUIRES_PROGRAM([poman], [PO4A], [po4a], [translated man pages]) | |
933 | AM_CONDITIONAL([ENABLE_POMAN], [test "x$build_poman" = xyes]) | |
934 | ||
935 | ||
936 | AX_CHECK_TLS | |
937 | ||
938 | have_pty=no | |
939 | AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]), | |
940 | [], [with_util=auto] | |
941 | ) | |
942 | AS_IF([test "x$with_util" = xno], [ | |
943 | AM_CONDITIONAL([HAVE_UTIL], [false]) | |
944 | have_util=no | |
945 | ], [ | |
946 | UL_CHECK_LIB([util], [openpty]) | |
947 | ]) | |
948 | ||
949 | AS_IF([test "x$have_pty_h" = xyes && test "x$have_sys_signalfd_h" = xyes && test "x$have_util" = xyes], [ | |
950 | AM_CONDITIONAL([HAVE_PTY], [true]) | |
951 | AC_DEFINE([HAVE_PTY], [1], [have PTY support]) | |
952 | have_pty=yes | |
953 | ], [ | |
954 | AM_CONDITIONAL([HAVE_PTY], [false]) | |
955 | ]) | |
956 | ||
957 | AC_CHECK_TYPES([union semun], [], [], [[ | |
958 | #include <sys/sem.h> | |
959 | ]]) | |
960 | AC_CHECK_TYPES([loff_t]) | |
961 | ||
962 | ||
963 | AC_ARG_ENABLE([widechar], | |
964 | AS_HELP_STRING([--disable-widechar], [do not compile wide character support]), | |
965 | [], [enable_widechar=check] | |
966 | ) | |
967 | UL_BUILD_INIT([widechar]) | |
968 | UL_REQUIRES_COMPILE([widechar], [[ | |
969 | #include <wchar.h> | |
970 | #include <wctype.h> | |
971 | #include <stdio.h> | |
972 | #include <stdlib.h> | |
973 | ]], [[ | |
974 | wchar_t wc; | |
975 | wint_t w; | |
976 | w = fgetwc(stdin); | |
977 | if (w == WEOF) exit(1); | |
978 | wc = w; | |
979 | fputwc(wc,stdout); | |
980 | ]], | |
981 | [wchar_t support]) | |
982 | ||
983 | AS_IF([test "x$build_widechar" = xyes ], [ | |
984 | AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?]) | |
985 | ]) | |
986 | ||
987 | ||
988 | AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[ | |
989 | #include <sched.h> | |
990 | ]]) | |
991 | ||
992 | AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes]) | |
993 | ||
994 | AC_CHECK_TYPES([sighandler_t], [], [], [[ | |
995 | #include <signal.h> | |
996 | ]]) | |
997 | ||
998 | # checking sigset_t defined in the kernel header in | |
999 | # asm/signal.h. tests/helpers/test_mkfds_ppoll.c expects the RAW sigset_t | |
1000 | # is defined in the header file. | |
1001 | # However, a slightly older arch/parisc doesn't export the type. | |
1002 | # See https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=487fa28fa8b60417642ac58e8beda6e2509d18f9 | |
1003 | AC_CHECK_TYPES([sigset_t], [], [], [[ | |
1004 | #include <asm/signal.h> | |
1005 | ]]) | |
1006 | ||
1007 | AC_CHECK_DECLS([CPU_ALLOC], [], [], [[ | |
1008 | #include <sched.h> | |
1009 | ]]) | |
1010 | ||
1011 | # on Solaris, you can't mix and match standards, since we use c99 | |
1012 | # apparently at this stage, XOPEN_SOURCE will conflict. As workaround, | |
1013 | # check for crypt.h and use that without XOPEN_SOURCE. | |
1014 | have_crypt=no | |
1015 | AC_CHECK_HEADERS([crypt.h]) | |
1016 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1017 | #ifdef HAVE_CRYPT_H | |
1018 | #include <crypt.h> | |
1019 | #else | |
1020 | #define _XOPEN_SOURCE | |
1021 | #include <unistd.h> | |
1022 | #endif | |
1023 | ]], [[ | |
1024 | char *c = crypt("abc","pw"); | |
1025 | ]])],[ | |
1026 | have_libcrypt=no | |
1027 | have_crypt=yes | |
1028 | ],[ | |
1029 | UL_SET_LIBS([-lcrypt]) | |
1030 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1031 | #ifdef HAVE_CRYPT_H | |
1032 | #include <crypt.h> | |
1033 | #else | |
1034 | #define _XOPEN_SOURCE | |
1035 | #include <unistd.h> | |
1036 | #endif | |
1037 | ]], [[ | |
1038 | char *c = crypt("abc","pw"); | |
1039 | ]])],[ | |
1040 | have_libcrypt=yes | |
1041 | have_crypt=yes | |
1042 | ],[ | |
1043 | AC_MSG_WARN([crypt() is not available]) | |
1044 | ]) | |
1045 | UL_RESTORE_LIBS | |
1046 | ]) | |
1047 | AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes]) | |
1048 | ||
1049 | ||
1050 | AC_ARG_WITH([selinux], | |
1051 | AS_HELP_STRING([--with-selinux], [compile with SELinux support]), | |
1052 | [], [with_selinux=no] | |
1053 | ) | |
1054 | ||
1055 | AS_IF([test "x$with_selinux" = xno], [ | |
1056 | AM_CONDITIONAL([HAVE_SELINUX], [false]) | |
1057 | ], [ | |
1058 | PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.5], [have_selinux=yes], [have_selinux=no]) | |
1059 | AS_CASE([$with_selinux:$have_selinux], | |
1060 | [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])] | |
1061 | ) | |
1062 | AS_IF([test "x$have_selinux" = xyes], [ | |
1063 | AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available]) | |
1064 | UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux]) | |
1065 | AM_CONDITIONAL([HAVE_SELINUX], [true]) | |
1066 | ||
1067 | UL_SET_LIBS([$SELINUX_LIBS]) | |
1068 | # This function is missing in old libselinux 1.xx versions | |
1069 | AC_CHECK_FUNCS([security_get_initial_context]) | |
1070 | UL_RESTORE_LIBS | |
1071 | ]) | |
1072 | ]) | |
1073 | AC_SUBST([SELINUX_LIBS]) | |
1074 | AC_SUBST([SELINUX_LIBS_STATIC]) | |
1075 | ||
1076 | ||
1077 | AC_ARG_WITH([audit], | |
1078 | AS_HELP_STRING([--with-audit], [compile with audit support]), | |
1079 | [], [with_audit=no] | |
1080 | ) | |
1081 | ||
1082 | AS_IF([test "x$with_audit" = xno], [ | |
1083 | AM_CONDITIONAL([HAVE_AUDIT], [false]) | |
1084 | ], [ | |
1085 | UL_CHECK_LIB([audit], [audit_log_user_message]) | |
1086 | AS_CASE([$with_audit:$have_audit], | |
1087 | [yes:no], | |
1088 | [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])] | |
1089 | ) | |
1090 | ]) | |
1091 | ||
1092 | AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]), | |
1093 | [], [with_udev=auto] | |
1094 | ) | |
1095 | ||
1096 | AS_IF([test "x$with_udev" = xno], [ | |
1097 | AM_CONDITIONAL([HAVE_UDEV], [false]) | |
1098 | ], [ | |
1099 | UL_CHECK_LIB([udev], [udev_new]) | |
1100 | AS_CASE([$with_udev:$have_udev], | |
1101 | [yes:no], | |
1102 | [AC_MSG_ERROR([udev selected but libudev not found])] | |
1103 | ) | |
1104 | ]) | |
1105 | ||
1106 | ||
1107 | dnl wide-char ncurses | |
1108 | AC_ARG_WITH([ncursesw], | |
1109 | AS_HELP_STRING([--without-ncursesw], [do not build with wide-char ncurses]), | |
1110 | [], [with_ncursesw=auto] | |
1111 | ) | |
1112 | have_ncursesw=no | |
1113 | have_ncursesw_header=no | |
1114 | ||
1115 | AS_CASE([$with_ncursesw:$build_widechar], | |
1116 | [yes:no], | |
1117 | [AC_MSG_ERROR([wide-char support disabled, but wide-char ncurses required])], | |
1118 | [auto:no], | |
1119 | [ | |
1120 | AC_MSG_WARN([wide-char support disabled, disabling wide-char ncurses]) | |
1121 | with_ncursesw=no | |
1122 | ] | |
1123 | ) | |
1124 | AS_IF([test "x$with_ncursesw" != xno], [ | |
1125 | UL_NCURSES_CHECK([ncursesw]) | |
1126 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
1127 | AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes]) | |
1128 | AC_CHECK_HEADERS([ncursesw/term.h]) | |
1129 | ||
1130 | # Define HAVE_NCURSES_H only if check for HAVE_NCURSESW_NCURSES_H is | |
1131 | # unsuccessful to avoid too many *_H permitations in config.h | |
1132 | AS_IF([test "x$have_ncursesw_header" = xno], [ | |
1133 | AC_CHECK_HEADERS([ncurses.h], [have_ncursesw_header=yes]) | |
1134 | AC_CHECK_HEADERS([term.h]) | |
1135 | ]) | |
1136 | AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no]) | |
1137 | ]) | |
1138 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
1139 | CURSES_LIB_NAME="ncursesw" | |
1140 | AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available]) | |
1141 | ]) | |
1142 | ]) | |
1143 | AS_CASE([$with_ncursesw:$have_ncursesw], | |
1144 | [yes:no], [AC_MSG_ERROR([ncursesw selected, but library not found])]) | |
1145 | ||
1146 | ||
1147 | dnl non-wide ncurses | |
1148 | AC_ARG_WITH([ncurses], | |
1149 | AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses]), | |
1150 | [], [with_ncurses=auto] | |
1151 | ) | |
1152 | have_ncurses=no | |
1153 | have_ncurses_header=no | |
1154 | AS_CASE([$with_ncurses:$build_widechar], | |
1155 | [yes:yes], [AC_MSG_ERROR([wide-char support enabled, but non-wide ncurses selects])]) | |
1156 | ||
1157 | AS_IF([test "x$have_ncursesw" = xno && test "x$with_ncurses" != xno ], [ | |
1158 | UL_NCURSES_CHECK([ncurses]) | |
1159 | AS_IF([test "x$have_ncurses" = xyes], [ | |
1160 | AC_CHECK_HEADERS([ncurses/ncurses.h], [have_ncurses_header=yes]) | |
1161 | AC_CHECK_HEADERS([ncurses/term.h]) | |
1162 | ||
1163 | # Define HAVE_NCURSES_H only if check for HAVE_NCURSES_NCURSES_H is | |
1164 | # unsuccessful to avoid too many *_H permitations in config.h | |
1165 | AS_IF([test "x$have_ncurses_header" = xno], [ | |
1166 | AC_CHECK_HEADERS([ncurses.h], [have_ncurses_header=yes]) | |
1167 | AC_CHECK_HEADERS([term.h]) | |
1168 | ]) | |
1169 | AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no]) | |
1170 | ]) | |
1171 | AS_IF([test "x$have_ncurses" = xyes], [ | |
1172 | CURSES_LIB_NAME="ncurses" | |
1173 | AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available]) | |
1174 | ]) | |
1175 | ]) | |
1176 | AS_CASE([$with_ncurses:$have_ncurses], | |
1177 | [yes:no], [AC_MSG_ERROR([ncurses selected, but library not found])]) | |
1178 | ||
1179 | AC_SUBST([NCURSES_CFLAGS]) | |
1180 | AC_SUBST([NCURSES_LIBS]) | |
1181 | AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes]) | |
1182 | ||
1183 | ||
1184 | AC_ARG_WITH([slang], | |
1185 | AS_HELP_STRING([--with-slang], [compile cfdisk with slang rather than ncurses]), | |
1186 | [], [with_slang=no] | |
1187 | ) | |
1188 | have_slang=no | |
1189 | AS_IF([test "x$with_slang" = xyes], [ | |
1190 | AC_CHECK_HEADERS([slang.h slang/slang.h]) | |
1191 | AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], | |
1192 | [have_slang=yes], [], [ | |
1193 | #ifdef HAVE_SLANG_H | |
1194 | #include <slang.h> | |
1195 | #elif defined(HAVE_SLANG_SLANG_H) | |
1196 | #include <slang/slang.h> | |
1197 | #endif | |
1198 | ]) | |
1199 | AS_IF([test "x$have_slang" = xno], [ | |
1200 | AC_MSG_ERROR([slang selected but slcurses.h not found])], | |
1201 | [CURSES_LIB_NAME=slang | |
1202 | ]) | |
1203 | ]) | |
1204 | AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes]) | |
1205 | ||
1206 | ||
1207 | AS_IF([test "x$have_slang" = xyes || test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes], [ | |
1208 | AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [ | |
1209 | AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, | |
1210 | [Define if curses library has the use_default_colors().]) | |
1211 | ]) | |
1212 | AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [ | |
1213 | AC_DEFINE(HAVE_RESIZETERM, 1, | |
1214 | [Define if curses library has the resizeterm().]) | |
1215 | ]) | |
1216 | ]) | |
1217 | ||
1218 | ||
1219 | AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]), | |
1220 | [], [with_tinfo=auto] | |
1221 | ) | |
1222 | have_tinfo=no | |
1223 | have_tinfow=no | |
1224 | AS_IF([test "x$with_tinfo" != xno], [ | |
1225 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
1226 | UL_TINFO_CHECK([tinfow]) | |
1227 | ]) | |
1228 | AS_IF([test "x$have_tinfow" = xno], [ | |
1229 | UL_TINFO_CHECK([tinfo]) | |
1230 | ]) | |
1231 | ]) | |
1232 | AC_SUBST([TINFO_LIBS]) | |
1233 | AC_SUBST([TINFO_LIBS_STATIC]) | |
1234 | AC_SUBST([TINFO_CFLAGS]) | |
1235 | AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes]) | |
1236 | AS_IF([test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes], [ | |
1237 | AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo or libtinfow available.]) | |
1238 | ]) | |
1239 | ||
1240 | ||
1241 | AC_ARG_WITH([readline], | |
1242 | AS_HELP_STRING([--without-readline], [do not build with GNU Readline support]), | |
1243 | [], [with_readline=auto] | |
1244 | ) | |
1245 | ||
1246 | AS_IF([test "x$with_readline" = xno], [ | |
1247 | AM_CONDITIONAL([HAVE_READLINE], [false]) | |
1248 | ], [ | |
1249 | UL_CHECK_LIB([readline], [readline]) | |
1250 | AS_CASE([$with_readline:$have_readline], | |
1251 | [yes:no], | |
1252 | [AC_MSG_ERROR([readline selected but libreadline not found ])], | |
1253 | [*:yes], | |
1254 | [READLINE_LIBS="-lreadline" | |
1255 | READLINE_LIBS_STATIC="-lreadline $TINFO_LIBS_STATIC"] | |
1256 | ) | |
1257 | ]) | |
1258 | AC_SUBST([READLINE_LIBS]) | |
1259 | AC_SUBST([READLINE_LIBS_STATIC]) | |
1260 | ||
1261 | ||
1262 | AC_ARG_WITH([utempter], | |
1263 | AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]), | |
1264 | [], [with_utempter=no] | |
1265 | ) | |
1266 | ||
1267 | AS_IF([test "x$with_utempter" = xyes], [ | |
1268 | UL_CHECK_LIB([utempter], [utempter_add_record]) | |
1269 | AS_IF([test "x$have_utempter" = xno], [ | |
1270 | AC_MSG_ERROR([utempter selected but libutempter not found]) | |
1271 | ]) | |
1272 | ], [ | |
1273 | AM_CONDITIONAL([HAVE_UTEMPTER], [false]) | |
1274 | ]) | |
1275 | ||
1276 | ||
1277 | dnl | |
1278 | dnl libuuid | |
1279 | dnl | |
1280 | AC_ARG_ENABLE([libuuid], | |
1281 | AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]), | |
1282 | [], [UL_DEFAULT_ENABLE([libuuid], [yes])] | |
1283 | ) | |
1284 | UL_BUILD_INIT([libuuid]) | |
1285 | AC_SUBST([LIBUUID_VERSION]) | |
1286 | AC_SUBST([LIBUUID_VERSION_INFO]) | |
1287 | AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes) | |
1288 | ||
1289 | AC_ARG_ENABLE([libuuid-force-uuidd], | |
1290 | AS_HELP_STRING([--enable-libuuid-force-uuidd], [support uuidd even though the daemon is not built]), | |
1291 | [], [enable_libuuid_force_uuidd=no] | |
1292 | ) | |
1293 | ||
1294 | AS_IF([test "x$build_libuuid" = xyes], [ | |
1295 | AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.]) | |
1296 | ]) | |
1297 | ||
1298 | dnl | |
1299 | dnl liblastlog2 | |
1300 | dnl | |
1301 | AC_ARG_ENABLE([liblastlog2], | |
1302 | AS_HELP_STRING([--disable-liblastlog2], [do not build liblastlog2 and lastlog2 utilities]), | |
1303 | [], [UL_DEFAULT_ENABLE([liblastlog2], [yes])] | |
1304 | ) | |
1305 | UL_BUILD_INIT([liblastlog2]) | |
1306 | ||
1307 | have_sqlite3=no | |
1308 | AS_IF([test "x$build_liblastlog2" = xyes], [ | |
1309 | PKG_CHECK_MODULES([SQLITE3], [sqlite3], [have_sqlite3=yes], [have_sqlite3=no]) | |
1310 | ]) | |
1311 | UL_REQUIRES_HAVE([liblastlog2], [sqlite3], [sqlite3 library]) | |
1312 | AC_SUBST([SQLITE3_LIBS]) | |
1313 | ||
1314 | AC_SUBST([LIBLASTLOG2_VERSION]) | |
1315 | AC_SUBST([LIBLASTLOG2_VERSION_INFO]) | |
1316 | AC_DEFINE_UNQUOTED([LIBLASTLOG2_VERSION], ["$LIBLASTLOG2_VERSION"], [liblastlog2 version string]) | |
1317 | AM_CONDITIONAL([BUILD_LIBLASTLOG2], [test "x$build_liblastlog2" = xyes]) | |
1318 | AM_CONDITIONAL([BUILD_LIBLASTLOG2_TESTS], [test "x$build_liblastlog2" = xyes && test "x$enable_static" = xyes]) | |
1319 | AS_IF([test "x$build_liblastlog2" = xyes], [ | |
1320 | AC_DEFINE([HAVE_LIBLASTLOG2], [1], [Define to 1 if you have the -lblkid.]) | |
1321 | ]) | |
1322 | ||
1323 | ||
1324 | AC_ARG_ENABLE([pam_lastlog2], | |
1325 | AS_HELP_STRING([--disable-pam-lastlog2], [do not build PAM lastlog2 module]), | |
1326 | [], [UL_DEFAULT_ENABLE([pam_lastlog2], [check])] | |
1327 | ) | |
1328 | UL_BUILD_INIT([pam_lastlog2]) | |
1329 | UL_REQUIRES_BUILD([pam_lastlog2], [liblastlog2]) | |
1330 | UL_REQUIRES_HAVE([pam_lastlog2], [security_pam_modules_h], [pam_modules.h header file]) | |
1331 | AM_CONDITIONAL([BUILD_PAM_LASTLOG2], [test "x$build_pam_lastlog2" = xyes]) | |
1332 | ||
1333 | ||
1334 | dnl | |
1335 | dnl libblkid | |
1336 | dnl | |
1337 | AC_ARG_ENABLE([libblkid], | |
1338 | AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]), | |
1339 | [], [UL_DEFAULT_ENABLE([libblkid], [check])] | |
1340 | ) | |
1341 | UL_BUILD_INIT([libblkid]) | |
1342 | UL_REQUIRES_HAVE([libblkid], [openat], [openat functions]) | |
1343 | UL_REQUIRES_HAVE([libblkid], [dirfd,ddfd], [dirfd or ddfd function]) | |
1344 | AC_SUBST([LIBBLKID_DATE]) | |
1345 | AC_SUBST([LIBBLKID_VERSION]) | |
1346 | AC_SUBST([LIBBLKID_VERSION_INFO]) | |
1347 | AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string]) | |
1348 | AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string]) | |
1349 | AS_IF([test "x$build_libblkid" = xyes], [ | |
1350 | AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.]) | |
1351 | ]) | |
1352 | AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes]) | |
1353 | AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes && test "x$enable_static" = xyes]) | |
1354 | ||
1355 | dnl | |
1356 | dnl libmount | |
1357 | dnl | |
1358 | AC_ARG_ENABLE([libmount], | |
1359 | AS_HELP_STRING([--disable-libmount], [do not build libmount]), | |
1360 | [], [UL_DEFAULT_ENABLE([libmount], [check])] | |
1361 | ) | |
1362 | UL_BUILD_INIT([libmount]) | |
1363 | UL_REQUIRES_BUILD([libmount], [libblkid]) | |
1364 | UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function]) | |
1365 | UL_REQUIRES_HAVE([libmount], [mntent_h], [mntent.h header file]) | |
1366 | UL_REQUIRES_HAVE([libmount], [sys_vfs_h], [sys/vfs.h header file]) | |
1367 | AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes]) | |
1368 | AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes && test "x$enable_static" = xyes]) | |
1369 | AS_IF([test "x$build_libmount" = xyes], [ | |
1370 | AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount available.]) | |
1371 | AS_IF([test "x$have_setns_syscall" = "xyes"], [ | |
1372 | AC_DEFINE([USE_LIBMOUNT_SUPPORT_NAMESPACES], [1], [Define to 1 if want to support namepaces.]) | |
1373 | ],[ | |
1374 | AC_MSG_WARN([libmount will be compiled without namespaces support]) | |
1375 | ]) | |
1376 | ]) | |
1377 | ||
1378 | AC_SUBST([LIBMOUNT_VERSION]) | |
1379 | AC_SUBST([LIBMOUNT_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR) | |
1380 | AC_SUBST([LIBMOUNT_MINOR_VERSION], $PACKAGE_VERSION_MINOR) | |
1381 | AC_SUBST([LIBMOUNT_PATCH_VERSION], $PACKAGE_VERSION_RELEASE) | |
1382 | AC_SUBST([LIBMOUNT_VERSION_INFO]) | |
1383 | AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string]) | |
1384 | ||
1385 | AC_ARG_ENABLE([libmount-mountfd-support], | |
1386 | AS_HELP_STRING([--disable-libmount-mountfd-support], [do not use new mount API based on FDs]), | |
1387 | [], [enable_libmount_mountfd_support=check] | |
1388 | ) | |
1389 | UL_BUILD_INIT([libmount_mountfd_support]) | |
1390 | UL_REQUIRES_BUILD([libmount_mountfd_support], [libmount]) | |
1391 | UL_REQUIRES_LINUX([libmount_mountfd_support]) | |
1392 | UL_REQUIRES_HAVE([libmount_mountfd_support], [mountfd_api], [mount FDs based API]) | |
1393 | UL_REQUIRES_HAVE([libmount_mountfd_support], [linux_mount_h], [linux/mount.h]) | |
1394 | AS_IF([test "x$build_libmount_mountfd_support" = xyes ], [ | |
1395 | AC_DEFINE([USE_LIBMOUNT_MOUNTFD_SUPPORT], [1], [Enable support for new mount FD based kernel API]) | |
1396 | ]) | |
1397 | ||
1398 | ||
1399 | dnl | |
1400 | dnl libsmartcols | |
1401 | dnl | |
1402 | AC_ARG_ENABLE([libsmartcols], | |
1403 | AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]), | |
1404 | [], [UL_DEFAULT_ENABLE([libsmartcols], [yes])] | |
1405 | ) | |
1406 | UL_BUILD_INIT([libsmartcols]) | |
1407 | AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes]) | |
1408 | ||
1409 | AC_SUBST([LIBSMARTCOLS_VERSION]) | |
1410 | AC_SUBST([LIBSMARTCOLS_VERSION_INFO]) | |
1411 | AC_DEFINE_UNQUOTED([LIBSMARTCOLS_VERSION], ["$LIBSMARTCOLS_VERSION"], [libsmartcols version string]) | |
1412 | ||
1413 | ||
1414 | dnl | |
1415 | dnl libfdisk | |
1416 | dnl | |
1417 | AC_ARG_ENABLE([libfdisk], | |
1418 | AS_HELP_STRING([--disable-libfdisk], [do not build libfdisk]), | |
1419 | [], [UL_DEFAULT_ENABLE([libfdisk], [check])] | |
1420 | ) | |
1421 | UL_BUILD_INIT([libfdisk]) | |
1422 | UL_REQUIRES_BUILD([libfdisk], [libuuid]) | |
1423 | AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes]) | |
1424 | AM_CONDITIONAL([BUILD_LIBFDISK_TESTS], [test "x$build_libfdisk" = xyes && test "x$enable_static" = xyes]) | |
1425 | ||
1426 | AS_IF([test "x$build_libblkid" = xyes], | |
1427 | [LIBFDISK_PC_REQUIRES="uuid blkid"],[LIBFDISK_PC_REQUIRES="uuid"]) | |
1428 | AC_SUBST([LIBFDISK_PC_REQUIRES]) | |
1429 | ||
1430 | AC_SUBST([LIBFDISK_VERSION]) | |
1431 | AC_SUBST([LIBFDISK_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR) | |
1432 | AC_SUBST([LIBFDISK_MINOR_VERSION], $PACKAGE_VERSION_MINOR) | |
1433 | AC_SUBST([LIBFDISK_PATCH_VERSION], $PACKAGE_VERSION_RELEASE) | |
1434 | AC_SUBST([LIBFDISK_VERSION_INFO]) | |
1435 | AC_DEFINE_UNQUOTED([LIBFDISK_VERSION], ["$LIBFDISK_VERSION"], [libfdisk version string]) | |
1436 | ||
1437 | ||
1438 | AC_ARG_ENABLE([fdisks], | |
1439 | AS_HELP_STRING([--disable-fdisks], [do not build fdisk(8), sfdisk(8) and cfdisk(8)]), | |
1440 | [], [UL_DEFAULT_ENABLE([fdisks], [check])] | |
1441 | ) | |
1442 | enable_fdisk=$enable_fdisks | |
1443 | enable_sfdisk=$enable_fdisks | |
1444 | enable_cfdisk=$enable_fdisks | |
1445 | ||
1446 | UL_BUILD_INIT([fdisk]) | |
1447 | UL_REQUIRES_HAVE([fdisk], [openat], [openat functions]) | |
1448 | UL_REQUIRES_HAVE([fdisk], [dirfd,ddfd], [dirfd or ddfd function]) | |
1449 | UL_REQUIRES_BUILD([fdisk], [libfdisk]) | |
1450 | UL_REQUIRES_BUILD([fdisk], [libsmartcols]) | |
1451 | AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes]) | |
1452 | ||
1453 | ||
1454 | UL_BUILD_INIT([sfdisk]) | |
1455 | UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions]) | |
1456 | UL_REQUIRES_HAVE([sfdisk], [dirfd,ddfd], [dirfd or ddfd function]) | |
1457 | UL_REQUIRES_BUILD([sfdisk], [libfdisk]) | |
1458 | UL_REQUIRES_BUILD([sfdisk], [libsmartcols]) | |
1459 | AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes]) | |
1460 | ||
1461 | ||
1462 | UL_BUILD_INIT([cfdisk]) | |
1463 | UL_REQUIRES_BUILD([cfdisk], [libfdisk]) | |
1464 | UL_REQUIRES_BUILD([cfdisk], [libsmartcols]) | |
1465 | UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function]) | |
1466 | UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) | |
1467 | AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes]) | |
1468 | ||
1469 | ||
1470 | AC_ARG_ENABLE([mount], | |
1471 | AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]), | |
1472 | [], [UL_DEFAULT_ENABLE([mount], [check])] | |
1473 | ) | |
1474 | UL_BUILD_INIT([mount]) | |
1475 | UL_REQUIRES_LINUX([mount]) | |
1476 | UL_REQUIRES_BUILD([mount], [libmount]) | |
1477 | AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes]) | |
1478 | ||
1479 | ||
1480 | AC_ARG_ENABLE([losetup], | |
1481 | AS_HELP_STRING([--disable-losetup], [do not build losetup]), | |
1482 | [], [UL_DEFAULT_ENABLE([losetup], [check])] | |
1483 | ) | |
1484 | UL_BUILD_INIT([losetup]) | |
1485 | UL_REQUIRES_LINUX([losetup]) | |
1486 | UL_REQUIRES_BUILD([losetup], [libsmartcols]) | |
1487 | AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes]) | |
1488 | ||
1489 | AC_ARG_ENABLE([zramctl], | |
1490 | AS_HELP_STRING([--disable-zramctl], [do not build zramctl]), | |
1491 | [], [UL_DEFAULT_ENABLE([zramctl], [check])] | |
1492 | ) | |
1493 | UL_BUILD_INIT([zramctl]) | |
1494 | UL_REQUIRES_LINUX([zramctl]) | |
1495 | UL_REQUIRES_BUILD([zramctl], [libsmartcols]) | |
1496 | AM_CONDITIONAL([BUILD_ZRAMCTL], [test "x$build_zramctl" = xyes]) | |
1497 | ||
1498 | AC_ARG_ENABLE([fsck], | |
1499 | AS_HELP_STRING([--disable-fsck], [do not build fsck]), | |
1500 | [], [UL_DEFAULT_ENABLE([fsck], [check])] | |
1501 | ) | |
1502 | UL_BUILD_INIT([fsck]) | |
1503 | UL_REQUIRES_BUILD([fsck], [libmount]) | |
1504 | AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes]) | |
1505 | ||
1506 | ||
1507 | AC_ARG_ENABLE([partx], | |
1508 | AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]), | |
1509 | [], [UL_DEFAULT_ENABLE([partx], [check])] | |
1510 | ) | |
1511 | UL_BUILD_INIT([partx]) | |
1512 | UL_REQUIRES_LINUX([partx]) | |
1513 | UL_REQUIRES_BUILD([partx], [libblkid]) | |
1514 | UL_REQUIRES_BUILD([partx], [libsmartcols]) | |
1515 | AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes]) | |
1516 | ||
1517 | ||
1518 | AC_ARG_ENABLE([uuidd], | |
1519 | AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]), | |
1520 | [], [UL_DEFAULT_ENABLE([uuidd], [check])] | |
1521 | ) | |
1522 | UL_BUILD_INIT([uuidd]) | |
1523 | UL_REQUIRES_BUILD([uuidd], [libuuid]) | |
1524 | UL_REQUIRES_HAVE([uuidd], [timer], [timer_create function]) | |
1525 | UL_REQUIRES_HAVE([uuidd], [sys_signalfd_h], [sys/signalfd.h header]) | |
1526 | AS_IF([test "x$build_uuidd" = xyes || test "x$enable_libuuid_force_uuidd" = xyes], [ | |
1527 | AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.]) | |
1528 | ]) | |
1529 | AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes]) | |
1530 | ||
1531 | ||
1532 | AC_ARG_ENABLE([uuidgen], | |
1533 | AS_HELP_STRING([--disable-uuidgen], [do not build uuidgen]), | |
1534 | [], [UL_DEFAULT_ENABLE([uuidgen], [check])] | |
1535 | ) | |
1536 | UL_BUILD_INIT([uuidgen]) | |
1537 | UL_REQUIRES_BUILD([uuidgen], [libuuid]) | |
1538 | AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes]) | |
1539 | ||
1540 | UL_BUILD_INIT([uuidparse], [check]) | |
1541 | UL_REQUIRES_BUILD([uuidparse], [libuuid]) | |
1542 | UL_REQUIRES_BUILD([uuidparse], [libsmartcols]) | |
1543 | AM_CONDITIONAL([BUILD_UUIDPARSE], [test "x$build_uuidparse" = xyes]) | |
1544 | ||
1545 | AC_ARG_ENABLE([blkid], | |
1546 | AS_HELP_STRING([--disable-blkid], [do not build blkid(8)]), | |
1547 | [], [UL_DEFAULT_ENABLE([blkid], [check])] | |
1548 | ) | |
1549 | UL_BUILD_INIT([blkid]) | |
1550 | UL_REQUIRES_BUILD([blkid], [libblkid]) | |
1551 | AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes]) | |
1552 | ||
1553 | UL_BUILD_INIT([findfs], [check]) | |
1554 | UL_REQUIRES_BUILD([findfs], [libblkid]) | |
1555 | AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes]) | |
1556 | ||
1557 | AC_ARG_ENABLE([wipefs], | |
1558 | AS_HELP_STRING([--disable-wipefs], [do not build wipefs]), | |
1559 | [], [UL_DEFAULT_ENABLE([wipefs], [check])] | |
1560 | ) | |
1561 | UL_BUILD_INIT([wipefs]) | |
1562 | UL_REQUIRES_BUILD([wipefs], [libblkid]) | |
1563 | UL_REQUIRES_BUILD([wipefs], [libsmartcols]) | |
1564 | AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes]) | |
1565 | ||
1566 | UL_BUILD_INIT([findmnt], [check]) | |
1567 | UL_REQUIRES_BUILD([findmnt], [libmount]) | |
1568 | UL_REQUIRES_BUILD([findmnt], [libblkid]) | |
1569 | UL_REQUIRES_BUILD([findmnt], [libsmartcols]) | |
1570 | AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes]) | |
1571 | ||
1572 | ||
1573 | AC_ARG_ENABLE([mountpoint], | |
1574 | AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]), | |
1575 | [], [UL_DEFAULT_ENABLE([mountpoint], [check])] | |
1576 | ) | |
1577 | UL_BUILD_INIT([mountpoint]) | |
1578 | UL_REQUIRES_BUILD([mountpoint], [libmount]) | |
1579 | AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes]) | |
1580 | ||
1581 | ||
1582 | AC_ARG_ENABLE([fallocate], | |
1583 | AS_HELP_STRING([--disable-fallocate], [do not build fallocate]), | |
1584 | [], [UL_DEFAULT_ENABLE([fallocate], [check])] | |
1585 | ) | |
1586 | UL_BUILD_INIT([fallocate]) | |
1587 | UL_REQUIRES_LINUX([fallocate]) | |
1588 | UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])]) | |
1589 | AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes]) | |
1590 | ||
1591 | AS_IF([test "x$build_fallocate" = xyes], [ | |
1592 | dnl check for valid fallocate() function | |
1593 | dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64() | |
1594 | dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64() | |
1595 | dnl and program can't be linked. | |
1596 | dnl AC_CHECK_FUNC can't catch such errors since it's redefining | |
1597 | dnl function prototype. | |
1598 | AC_MSG_CHECKING([for valid fallocate() function]) | |
1599 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1600 | #ifdef HAVE_UNISTD_H | |
1601 | # include <unistd.h> | |
1602 | #endif | |
1603 | #ifdef HAVE_SYS_TYPES_H | |
1604 | # include <sys/types.h> | |
1605 | #endif | |
1606 | #ifdef HAVE_LINUX_FALLOC_H | |
1607 | # include <linux/falloc.h> | |
1608 | #endif | |
1609 | #ifdef HAVE_FCNTL_H | |
1610 | # include <fcntl.h> | |
1611 | #endif | |
1612 | ]],[[ | |
1613 | long ret; | |
1614 | ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful); | |
1615 | if (ret != 0) { | |
1616 | return 1; | |
1617 | } | |
1618 | ]])],[ | |
1619 | AC_MSG_RESULT([yes]) | |
1620 | AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[ | |
1621 | AC_MSG_RESULT([no])]) | |
1622 | ]) | |
1623 | ||
1624 | AS_IF([test "x$build_fallocate" = xyes], [ | |
1625 | dnl check for valid posix_fallocate() function | |
1626 | AC_MSG_CHECKING([for valid posix_fallocate() function]) | |
1627 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1628 | #ifdef HAVE_UNISTD_H | |
1629 | # include <unistd.h> | |
1630 | #endif | |
1631 | #ifdef HAVE_SYS_TYPES_H | |
1632 | # include <sys/types.h> | |
1633 | #endif | |
1634 | #ifdef HAVE_LINUX_FALLOC_H | |
1635 | # include <linux/falloc.h> | |
1636 | #endif | |
1637 | #ifdef HAVE_FCNTL_H | |
1638 | # include <fcntl.h> | |
1639 | #endif | |
1640 | ]],[[ | |
1641 | long ret; | |
1642 | ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful); | |
1643 | if (ret != 0) { | |
1644 | return 1; | |
1645 | } | |
1646 | ]])],[ | |
1647 | AC_MSG_RESULT([yes]) | |
1648 | AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Have valid posix_fallocate() function])],[ | |
1649 | AC_MSG_RESULT([no])]) | |
1650 | ]) | |
1651 | ||
1652 | ||
1653 | AC_ARG_ENABLE([unshare], | |
1654 | AS_HELP_STRING([--disable-unshare], [do not build unshare]), | |
1655 | [], [UL_DEFAULT_ENABLE([unshare], [check])] | |
1656 | ) | |
1657 | UL_BUILD_INIT([unshare]) | |
1658 | UL_REQUIRES_LINUX([unshare]) | |
1659 | UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])]) | |
1660 | UL_REQUIRES_HAVE([unshare], [linux_capability_h], [linux/capability.h header file]) | |
1661 | AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes]) | |
1662 | ||
1663 | AC_MSG_CHECKING([for valid unshare() function]) | |
1664 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1665 | #include <sched.h> | |
1666 | ]],[[ | |
1667 | int ret; | |
1668 | ret = unshare(0); | |
1669 | if (ret != 0) { | |
1670 | return 1; | |
1671 | } | |
1672 | ]])],[ | |
1673 | AC_MSG_RESULT([yes]) | |
1674 | AC_DEFINE([HAVE_UNSHARE], [1], [Have valid unshare() function])], | |
1675 | [ | |
1676 | AC_MSG_RESULT([no]) | |
1677 | ]) | |
1678 | ||
1679 | ||
1680 | AC_ARG_ENABLE([nsenter], | |
1681 | AS_HELP_STRING([--disable-nsenter], [do not build nsenter]), | |
1682 | [], [UL_DEFAULT_ENABLE([nsenter], [check])] | |
1683 | ) | |
1684 | UL_BUILD_INIT([nsenter]) | |
1685 | UL_REQUIRES_LINUX([nsenter]) | |
1686 | UL_REQUIRES_HAVE([nsenter], [setns_syscall], [setns syscall]) | |
1687 | AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes]) | |
1688 | ||
1689 | AC_MSG_CHECKING([for valid setns() function]) | |
1690 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1691 | #include <sched.h> | |
1692 | #include <errno.h> | |
1693 | ]],[[ | |
1694 | int ret; | |
1695 | ret = setns(0, 0); | |
1696 | if (ret != EINVAL && ret != EBADF && ret != EPERM) { | |
1697 | return 1; | |
1698 | } | |
1699 | ]])],[ | |
1700 | AC_MSG_RESULT([yes]) | |
1701 | AC_DEFINE([HAVE_SETNS], [1], [Have valid setns() function])], | |
1702 | [ | |
1703 | AC_MSG_RESULT([no]) | |
1704 | ]) | |
1705 | ||
1706 | ||
1707 | AC_ARG_WITH([cap_ng], | |
1708 | AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]), | |
1709 | [], [with_cap_ng=auto] | |
1710 | ) | |
1711 | AS_IF([test "x$with_cap_ng" = xno], [ | |
1712 | AM_CONDITIONAL([HAVE_CAP_NG], [false]) | |
1713 | have_cap_ng=no | |
1714 | ],[ | |
1715 | UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng]) | |
1716 | ]) | |
1717 | ||
1718 | ||
1719 | AC_ARG_ENABLE([setpriv], | |
1720 | AS_HELP_STRING([--disable-setpriv], [do not build setpriv]), | |
1721 | [], [UL_DEFAULT_ENABLE([setpriv], [check])] | |
1722 | ) | |
1723 | UL_BUILD_INIT([setpriv]) | |
1724 | UL_REQUIRES_LINUX([setpriv]) | |
1725 | UL_REQUIRES_HAVE([setpriv], [linux_seccomp_h], [linux/seccomp.h header file]) | |
1726 | UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [linux/securebits.h header file]) | |
1727 | UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header file]) | |
1728 | UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library]) | |
1729 | AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes]) | |
1730 | ||
1731 | AC_ARG_ENABLE([hardlink], | |
1732 | AS_HELP_STRING([--disable-hardlink], [do not build hardlink]), | |
1733 | [], [UL_DEFAULT_ENABLE([hardlink], [check])] | |
1734 | ) | |
1735 | UL_BUILD_INIT([hardlink]) | |
1736 | AM_CONDITIONAL([BUILD_HARDLINK], [test "x$build_hardlink" = xyes]) | |
1737 | ||
1738 | ||
1739 | AC_ARG_ENABLE([eject], | |
1740 | AS_HELP_STRING([--disable-eject], [do not build eject]), | |
1741 | [], [UL_DEFAULT_ENABLE([eject], [check])] | |
1742 | ) | |
1743 | UL_BUILD_INIT([eject]) | |
1744 | UL_REQUIRES_LINUX([eject]) | |
1745 | UL_REQUIRES_BUILD([eject], [libmount]) | |
1746 | AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes]) | |
1747 | ||
1748 | ||
1749 | AC_ARG_ENABLE([agetty], | |
1750 | AS_HELP_STRING([--disable-agetty], [do not build agetty]), | |
1751 | [], [UL_DEFAULT_ENABLE([agetty], [check])] | |
1752 | ) | |
1753 | UL_BUILD_INIT([agetty]) | |
1754 | UL_REQUIRES_HAVE([agetty], [utmpx_h], [utmpx.h header]) | |
1755 | UL_REQUIRES_HAVE([agetty], [gnu_utmpx], [GNU utmpx functions]) | |
1756 | AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes]) | |
1757 | AS_IF([test "x$have_futimens" = xyes && test "x$have_inotify_init1" = xyes ], [ | |
1758 | AC_DEFINE([AGETTY_RELOAD], [1], [Enable agetty --reload feature]) | |
1759 | ],[ | |
1760 | AC_MSG_WARN([futimens or inotify_init1 not found; agetty(8) will not provide ---reload functionality]) | |
1761 | ]) | |
1762 | ||
1763 | ||
1764 | AC_ARG_ENABLE([plymouth_support], | |
1765 | AS_HELP_STRING([--disable-plymouth_support], [do not care about plymouth in sulogin(8) and agetty(8)]), | |
1766 | [], [enable_plymouth_support=check] | |
1767 | ) | |
1768 | UL_BUILD_INIT([plymouth_support]) | |
1769 | UL_REQUIRES_HAVE([plymouth_support], [tiocglcktrmios], [TIOCGLCKTRMIOS flag]) | |
1770 | UL_REQUIRES_HAVE([plymouth_support], [sock_cloexec], [SOCK_CLOEXEC flag]) | |
1771 | UL_REQUIRES_HAVE([plymouth_support], [sock_nonblock], [SOCK_NONBLOCK flag]) | |
1772 | UL_REQUIRES_HAVE([plymouth_support], [so_passcred], [SO_PASSCRED flag]) | |
1773 | AM_CONDITIONAL([USE_PLYMOUTH_SUPPORT], [test "x$build_plymouth_support" = xyes]) | |
1774 | AS_IF([test "x$build_plymouth_support" = xyes ], [ | |
1775 | AC_DEFINE([USE_PLYMOUTH_SUPPORT], [1], [Enable plymouth support feature for sulogin and agetty]) | |
1776 | ]) | |
1777 | ||
1778 | ||
1779 | AC_ARG_WITH([libz], | |
1780 | AS_HELP_STRING([--without-libz], [compile without libz]), | |
1781 | [], [with_libz=auto] | |
1782 | ) | |
1783 | AS_IF([test "x$with_libz" = xno], [have_z=no], [ | |
1784 | AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no]) | |
1785 | ]) | |
1786 | ||
1787 | AC_ARG_WITH([libmagic], | |
1788 | AS_HELP_STRING([--without-libmagic], [compile without libmagic]), | |
1789 | [], [with_libmagic=auto] | |
1790 | ) | |
1791 | AS_IF([test "x$with_libmagic" = xno], [have_magic=no], [ | |
1792 | AC_CHECK_LIB([magic], [magic_open], [ | |
1793 | AC_CHECK_HEADER(magic.h, [ | |
1794 | AC_DEFINE([HAVE_MAGIC], [1], [Define to 1 if you have the libmagic present.]) | |
1795 | MAGIC_LIBS="-lmagic" | |
1796 | ]) | |
1797 | ]) | |
1798 | ]) | |
1799 | AC_SUBST([MAGIC_LIBS]) | |
1800 | ||
1801 | ||
1802 | AC_ARG_ENABLE([cramfs], | |
1803 | AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]), | |
1804 | [], [UL_DEFAULT_ENABLE([cramfs], [check])] | |
1805 | ) | |
1806 | UL_BUILD_INIT([cramfs]) | |
1807 | UL_REQUIRES_HAVE([cramfs], [z], [z library]) | |
1808 | AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes]) | |
1809 | ||
1810 | ||
1811 | AC_ARG_ENABLE([bfs], | |
1812 | AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]), | |
1813 | [], [UL_DEFAULT_ENABLE([bfs], [yes])] | |
1814 | ) | |
1815 | UL_BUILD_INIT([bfs]) | |
1816 | AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes]) | |
1817 | ||
1818 | ||
1819 | AC_ARG_ENABLE([minix], | |
1820 | AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]), | |
1821 | [], [UL_DEFAULT_ENABLE([minix], [yes])] | |
1822 | ) | |
1823 | UL_BUILD_INIT([minix]) | |
1824 | AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes]) | |
1825 | ||
1826 | ||
1827 | AC_ARG_ENABLE([fdformat], | |
1828 | AS_HELP_STRING([--enable-fdformat], [build fdformat]), | |
1829 | [], [UL_DEFAULT_ENABLE([fdformat], [no])] | |
1830 | ) | |
1831 | UL_BUILD_INIT([fdformat]) | |
1832 | UL_REQUIRES_LINUX([fdformat]) | |
1833 | AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes]) | |
1834 | ||
1835 | ||
1836 | AC_ARG_ENABLE([hwclock], | |
1837 | AS_HELP_STRING([--disable-hwclock], [do not build hwclock]), | |
1838 | [], [UL_DEFAULT_ENABLE([hwclock], [check])] | |
1839 | ) | |
1840 | have_linuxdummy=$linux_os | |
1841 | ||
1842 | UL_BUILD_INIT([hwclock]) | |
1843 | UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux]) | |
1844 | AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes]) | |
1845 | ||
1846 | AC_ARG_ENABLE([hwclock_cmos], | |
1847 | AS_HELP_STRING([--disable-hwclock-cmos], [do not use CMOS clock]), | |
1848 | [], [enable_hwclock_cmos=check] | |
1849 | ) | |
1850 | UL_BUILD_INIT([hwclock_cmos]) | |
1851 | UL_REQUIRES_BUILD([hwclock_cmos], [hwclock]) | |
1852 | UL_REQUIRES_ARCH([hwclock_cmos], [i?86-*,x86_64*]) | |
1853 | AM_CONDITIONAL([USE_HWCLOCK_CMOS], [test "x$build_hwclock_cmos" = xyes]) | |
1854 | AS_IF([test "x$build_hwclock_cmos" = xyes ], [ | |
1855 | AC_DEFINE([USE_HWCLOCK_CMOS], [1], [Define to 1 if want to use CMOS clock.]) | |
1856 | ]) | |
1857 | ||
1858 | AC_ARG_ENABLE([hwclock_gplv3], | |
1859 | AS_HELP_STRING([--disable-hwclock-gplv3], [do not use datetime parsing GPLv3 code]), | |
1860 | [], [enable_hwclock_gplv3=yes] | |
1861 | ) | |
1862 | AM_CONDITIONAL([USE_HWCLOCK_GPLv3_DATETIME], [test "x$enable_hwclock_gplv3" = xyes]) | |
1863 | AS_IF([test "x$enable_hwclock_gplv3" = xyes ], [ | |
1864 | AC_DEFINE([USE_HWCLOCK_GPLv3_DATETIME], [1], [use datetime parsing GPLv3 code to hwclock]) | |
1865 | ]) | |
1866 | ||
1867 | ||
1868 | AC_ARG_ENABLE([mkfs], | |
1869 | AS_HELP_STRING([--disable-mkfs], [do not build mkfs(8)]), | |
1870 | [], [UL_DEFAULT_ENABLE([mkfs], [check])] | |
1871 | ) | |
1872 | UL_BUILD_INIT([mkfs]) | |
1873 | AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes]) | |
1874 | ||
1875 | UL_BUILD_INIT([isosize], [yes]) | |
1876 | AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes]) | |
1877 | ||
1878 | ||
1879 | AC_ARG_ENABLE([fstrim], | |
1880 | AS_HELP_STRING([--disable-fstrim], [do not build fstrim(8)]), | |
1881 | [], [UL_DEFAULT_ENABLE([fstrim], [check])] | |
1882 | ) | |
1883 | UL_BUILD_INIT([fstrim]) | |
1884 | UL_REQUIRES_LINUX([fstrim]) | |
1885 | UL_REQUIRES_BUILD([fstrim], [libmount]) | |
1886 | AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes]) | |
1887 | ||
1888 | ||
1889 | AC_ARG_ENABLE([swapon], | |
1890 | AS_HELP_STRING([--disable-swapon], [do not build swapon(8) and swapoff(8)]), | |
1891 | [], [UL_DEFAULT_ENABLE([swapon], [check])] | |
1892 | ) | |
1893 | UL_BUILD_INIT([swapon]) | |
1894 | UL_REQUIRES_LINUX([swapon]) | |
1895 | UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapon])], [swapon]) | |
1896 | UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapoff])], [swapoff]) | |
1897 | UL_REQUIRES_BUILD([swapon], [libblkid]) | |
1898 | UL_REQUIRES_BUILD([swapon], [libmount]) | |
1899 | UL_REQUIRES_BUILD([swapon], [libsmartcols]) | |
1900 | AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes]) | |
1901 | AC_CHECK_FUNCS([swapon]) | |
1902 | AC_CHECK_FUNCS([swapoff]) | |
1903 | ||
1904 | ||
1905 | AC_ARG_ENABLE([lsblk], | |
1906 | AS_HELP_STRING([--disable-lsblk], [do not build lsblk]), | |
1907 | [], [UL_DEFAULT_ENABLE([lsblk], [check])] | |
1908 | ) | |
1909 | UL_BUILD_INIT([lsblk]) | |
1910 | UL_REQUIRES_LINUX([lsblk]) | |
1911 | UL_REQUIRES_BUILD([lsblk], [libblkid]) | |
1912 | UL_REQUIRES_BUILD([lsblk], [libmount]) | |
1913 | UL_REQUIRES_BUILD([lsblk], [libsmartcols]) | |
1914 | AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes]) | |
1915 | ||
1916 | ||
1917 | AC_ARG_ENABLE([lscpu], | |
1918 | AS_HELP_STRING([--disable-lscpu], [do not build lscpu]), | |
1919 | [], [UL_DEFAULT_ENABLE([lscpu], [check])] | |
1920 | ) | |
1921 | UL_BUILD_INIT([lscpu]) | |
1922 | UL_REQUIRES_LINUX([lscpu]) | |
1923 | UL_REQUIRES_BUILD([lscpu], [libsmartcols]) | |
1924 | UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type]) | |
1925 | AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes]) | |
1926 | ||
1927 | AC_ARG_ENABLE([lsfd], | |
1928 | AS_HELP_STRING([--disable-lsfd], [do not build lsfd]), | |
1929 | [], [UL_DEFAULT_ENABLE([lsfd], [check])] | |
1930 | ) | |
1931 | UL_BUILD_INIT([lsfd]) | |
1932 | UL_REQUIRES_LINUX([lsfd]) | |
1933 | UL_REQUIRES_BUILD([lsfd], [libsmartcols]) | |
1934 | UL_REQUIRES_HAVE([lsfd], [linux_bpf_h], [linux/bpf.h header file]) | |
1935 | UL_REQUIRES_HAVE([lsfd], [bpf_obj_name_len], [BPF_OBJ_NAME_LEN macro in linux/bpf.h]) | |
1936 | UL_REQUIRES_HAVE([lsfd], [bpf_tag_size], [BPF_TAG_SIZE macro in linux/bpf.h]) | |
1937 | AM_CONDITIONAL([BUILD_LSFD], [test "x$build_lsfd" = xyes]) | |
1938 | ||
1939 | AC_ARG_ENABLE([lslogins], | |
1940 | AS_HELP_STRING([--disable-lslogins], [do not build lslogins]), | |
1941 | [], [UL_DEFAULT_ENABLE([lslogins], [check])] | |
1942 | ) | |
1943 | UL_BUILD_INIT([lslogins]) | |
1944 | UL_REQUIRES_BUILD([lslogins], [libsmartcols]) | |
1945 | UL_REQUIRES_HAVE([lslogins], [shadow_h], [shadow.h header]) | |
1946 | UL_REQUIRES_HAVE([lslogins], [utmpx_h], [utmpx.h header]) | |
1947 | UL_REQUIRES_HAVE([lslogins], [gnu_utmpx], [GNU utmpx functions]) | |
1948 | AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes]) | |
1949 | ||
1950 | ||
1951 | UL_BUILD_INIT([chcpu], [check]) | |
1952 | UL_REQUIRES_LINUX([chcpu]) | |
1953 | UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type]) | |
1954 | AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes]) | |
1955 | ||
1956 | ||
1957 | AC_ARG_ENABLE([wdctl], | |
1958 | AS_HELP_STRING([--disable-wdctl], [do not build wdctl]), | |
1959 | [], [UL_DEFAULT_ENABLE([wdctl], [check])] | |
1960 | ) | |
1961 | UL_BUILD_INIT([wdctl]) | |
1962 | UL_REQUIRES_LINUX([wdctl]) | |
1963 | UL_REQUIRES_BUILD([wdctl], [libsmartcols]) | |
1964 | UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file]) | |
1965 | AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes]) | |
1966 | ||
1967 | ||
1968 | UL_BUILD_INIT([swaplabel], [check]) | |
1969 | UL_REQUIRES_BUILD([swaplabel], [libblkid]) | |
1970 | AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes]) | |
1971 | ||
1972 | ||
1973 | UL_BUILD_INIT([mkswap], [yes]) | |
1974 | AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes]) | |
1975 | AS_IF([test "x$build_mkswap" = xyes && test "x$build_libuuid" != xyes], [ | |
1976 | AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs]) | |
1977 | ]) | |
1978 | ||
1979 | ||
1980 | AC_ARG_ENABLE([cal], | |
1981 | AS_HELP_STRING([--disable-cal], [do not build cal]), | |
1982 | [], [UL_DEFAULT_ENABLE([cal], [check])] | |
1983 | ) | |
1984 | UL_BUILD_INIT([cal]) | |
1985 | AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes]) | |
1986 | ||
1987 | AC_ARG_ENABLE([logger], | |
1988 | AS_HELP_STRING([--disable-logger], [do not build logger]), | |
1989 | [], [UL_DEFAULT_ENABLE([logger], [check])] | |
1990 | ) | |
1991 | UL_BUILD_INIT([logger]) | |
1992 | AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes]) | |
1993 | ||
1994 | UL_BUILD_INIT([look], [yes]) | |
1995 | AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes]) | |
1996 | ||
1997 | UL_BUILD_INIT([mcookie], [yes]) | |
1998 | AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes]) | |
1999 | ||
2000 | UL_BUILD_INIT([namei], [yes]) | |
2001 | AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes]) | |
2002 | ||
2003 | matriplet="$($CC -print-multiarch 2>/dev/null || true)" | |
2004 | if test "x$matriplet" != "x"; then | |
2005 | AC_DEFINE_UNQUOTED([MULTIARCHTRIPLET], ["$matriplet"], | |
2006 | ["Multi-arch triplet for whereis library search path"]) | |
2007 | fi | |
2008 | AC_ARG_ENABLE([whereis], | |
2009 | AS_HELP_STRING([--disable-whereis], [do not build whereis]), | |
2010 | [], [UL_DEFAULT_ENABLE([whereis], [check])] | |
2011 | ) | |
2012 | UL_BUILD_INIT([whereis]) | |
2013 | AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes]) | |
2014 | ||
2015 | AC_ARG_ENABLE([pipesz], | |
2016 | AS_HELP_STRING([--disable-pipesz], [do not build pipesz]), | |
2017 | [], [UL_DEFAULT_ENABLE([pipesz], [check])] | |
2018 | ) | |
2019 | UL_BUILD_INIT([pipesz]) | |
2020 | UL_REQUIRES_LINUX([pipesz]) | |
2021 | AM_CONDITIONAL([BUILD_PIPESZ], [test "x$build_pipesz" = xyes]) | |
2022 | ||
2023 | UL_BUILD_INIT([fadvise], [check]) | |
2024 | UL_REQUIRES_LINUX([fadvise]) | |
2025 | AM_CONDITIONAL([BUILD_FADVISE], [test "x$build_fadvise" = xyes]) | |
2026 | ||
2027 | AC_ARG_ENABLE([waitpid], | |
2028 | AS_HELP_STRING([--disable-waitpid], [do not build waitpid]), | |
2029 | [], [UL_DEFAULT_ENABLE([waitpid], [check])] | |
2030 | ) | |
2031 | UL_BUILD_INIT([waitpid]) | |
2032 | UL_REQUIRES_LINUX([waitpid]) | |
2033 | UL_REQUIRES_SYSCALL_CHECK([waitpid], [UL_CHECK_SYSCALL([pidfd_open])], [pidfd_open]) | |
2034 | AM_CONDITIONAL([BUILD_WAITPID], [test "x$build_waitpid" = xyes]) | |
2035 | ||
2036 | AC_ARG_ENABLE([enosys], | |
2037 | AS_HELP_STRING([--disable-enosys], [do not build enosys]), | |
2038 | [], [UL_DEFAULT_ENABLE([enosys], [check])] | |
2039 | ) | |
2040 | UL_BUILD_INIT([enosys]) | |
2041 | UL_REQUIRES_LINUX([enosys]) | |
2042 | UL_REQUIRES_HAVE([enosys], [linux_audit_h], [linux/audit.h header file]) | |
2043 | UL_REQUIRES_HAVE([enosys], [linux_seccomp_h], [linux/seccomp.h header file]) | |
2044 | AS_IF([test "x$build_enosys" = xyes], [ | |
2045 | AC_MSG_CHECKING([for valid audit arch]) | |
2046 | AC_COMPILE_IFELSE( | |
2047 | [AC_LANG_PROGRAM([[#include "${srcdir}/include/audit-arch.h"]])], | |
2048 | [AC_MSG_RESULT([yes])], | |
2049 | [AC_MSG_RESULT([no]) | |
2050 | build_enosys=no | |
2051 | ]) | |
2052 | ]) | |
2053 | AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes]) | |
2054 | ||
2055 | UL_BUILD_INIT([lsclocks], [check]) | |
2056 | UL_REQUIRES_LINUX([lsclocks]) | |
2057 | UL_REQUIRES_BUILD([lsclocks], [libsmartcols]) | |
2058 | AM_CONDITIONAL([BUILD_LSCLOCKS], [test "x$build_lsclocks" = xyes]) | |
2059 | ||
2060 | UL_BUILD_INIT([getopt], [yes]) | |
2061 | AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes]) | |
2062 | ||
2063 | ||
2064 | UL_BUILD_INIT([blockdev], [check]) | |
2065 | UL_REQUIRES_LINUX([blockdev]) | |
2066 | AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes]) | |
2067 | ||
2068 | ||
2069 | UL_BUILD_INIT([prlimit], [check]) | |
2070 | UL_REQUIRES_LINUX([prlimit]) | |
2071 | UL_REQUIRES_BUILD([prlimit], [libsmartcols]) | |
2072 | UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64]) | |
2073 | AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes]) | |
2074 | AS_IF([test "x$build_prlimit" = xyes], [ | |
2075 | dnl check for valid prlimit() function | |
2076 | AC_MSG_CHECKING([for valid prlimit() function]) | |
2077 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
2078 | #include <sys/types.h> | |
2079 | #include <sys/time.h> | |
2080 | #include <sys/resource.h> | |
2081 | #include <stddef.h> | |
2082 | ]],[[ | |
2083 | int ret; | |
2084 | ret = prlimit(0, RLIMIT_AS, NULL, NULL); | |
2085 | if (ret != 0) { | |
2086 | return 1; | |
2087 | } | |
2088 | ]])],[ | |
2089 | AC_MSG_RESULT([yes]) | |
2090 | AC_DEFINE([HAVE_PRLIMIT], [1], [Have valid prlimit() function])],[ | |
2091 | AC_MSG_RESULT([no])]) | |
2092 | ]) | |
2093 | ||
2094 | ||
2095 | ||
2096 | UL_BUILD_INIT([lslocks], [check]) | |
2097 | UL_REQUIRES_LINUX([lslocks]) | |
2098 | UL_REQUIRES_BUILD([lslocks], [libmount]) | |
2099 | UL_REQUIRES_BUILD([lslocks], [libsmartcols]) | |
2100 | AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes]) | |
2101 | ||
2102 | ||
2103 | AC_ARG_ENABLE([switch_root], | |
2104 | AS_HELP_STRING([--disable-switch_root], [do not build switch_root]), | |
2105 | [], [UL_DEFAULT_ENABLE([switch_root], [check])] | |
2106 | ) | |
2107 | UL_BUILD_INIT([switch_root]) | |
2108 | UL_REQUIRES_LINUX([switch_root]) | |
2109 | UL_REQUIRES_HAVE([switch_root], [openat], [openat function]) | |
2110 | UL_REQUIRES_HAVE([switch_root], [dirfd,ddfd], [dirfd or ddfd function]) | |
2111 | AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes]) | |
2112 | ||
2113 | ||
2114 | AC_ARG_ENABLE([pivot_root], | |
2115 | AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]), | |
2116 | [], [UL_DEFAULT_ENABLE([pivot_root], [check])] | |
2117 | ) | |
2118 | UL_BUILD_INIT([pivot_root]) | |
2119 | UL_REQUIRES_LINUX([pivot_root]) | |
2120 | UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])]) | |
2121 | AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes]) | |
2122 | ||
2123 | ||
2124 | UL_BUILD_INIT([flock], [check]) | |
2125 | UL_REQUIRES_HAVE([flock], [timer], [timer_create/setitimer function]) | |
2126 | AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes]) | |
2127 | ||
2128 | ||
2129 | AC_ARG_ENABLE([lsmem], | |
2130 | AS_HELP_STRING([--disable-lsmem], [do not build lsmem]), | |
2131 | [], [UL_DEFAULT_ENABLE([lsmem], [check])] | |
2132 | ) | |
2133 | UL_BUILD_INIT([lsmem]) | |
2134 | UL_REQUIRES_LINUX([lsmem]) | |
2135 | UL_REQUIRES_BUILD([lsmem], [libsmartcols]) | |
2136 | AM_CONDITIONAL([BUILD_LSMEM], [test "x$build_lsmem" = xyes]) | |
2137 | ||
2138 | ||
2139 | AC_ARG_ENABLE([chmem], | |
2140 | AS_HELP_STRING([--disable-chmem], [do not build chmem]), | |
2141 | [], [UL_DEFAULT_ENABLE([chmem], [check])] | |
2142 | ) | |
2143 | UL_BUILD_INIT([chmem]) | |
2144 | UL_REQUIRES_LINUX([chmem]) | |
2145 | AM_CONDITIONAL([BUILD_CHMEM], [test "x$build_chmem" = xyes]) | |
2146 | ||
2147 | AC_CHECK_FUNCS([shm_open], [], [ | |
2148 | AC_CHECK_LIB([rt], [shm_open], [POSIXIPC_LIBS="-lrt"]) | |
2149 | ]) | |
2150 | AC_CHECK_FUNCS([sem_close], [], [ | |
2151 | AC_CHECK_LIB([pthread], [sem_close], [POSIXIPC_LIBS="$POSIXIPC_LIBS -lpthread"]) | |
2152 | ]) | |
2153 | AC_SUBST([POSIXIPC_LIBS]) | |
2154 | ||
2155 | AC_ARG_ENABLE([ipcmk], | |
2156 | AS_HELP_STRING([--disable-ipcmk], [do not build ipcmk]), | |
2157 | [], [UL_DEFAULT_ENABLE([ipcmk], [check])] | |
2158 | ) | |
2159 | UL_BUILD_INIT([ipcmk]) | |
2160 | UL_EXCLUDE_ARCH([ipcmk], [*darwin*]) | |
2161 | AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes]) | |
2162 | ||
2163 | AC_ARG_ENABLE([ipcrm], | |
2164 | AS_HELP_STRING([--disable-ipcrm], [do not build ipcrm]), | |
2165 | [], [UL_DEFAULT_ENABLE([ipcrm], [check])] | |
2166 | ) | |
2167 | UL_BUILD_INIT([ipcrm]) | |
2168 | UL_EXCLUDE_ARCH([ipcrm], [*darwin*]) | |
2169 | AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes]) | |
2170 | ||
2171 | AC_ARG_ENABLE([ipcs], | |
2172 | AS_HELP_STRING([--disable-ipcs], [do not build ipcs]), | |
2173 | [], [UL_DEFAULT_ENABLE([ipcs], [check])] | |
2174 | ) | |
2175 | UL_BUILD_INIT([ipcs]) | |
2176 | UL_EXCLUDE_ARCH([ipcs], [*darwin*]) | |
2177 | AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes]) | |
2178 | ||
2179 | ||
2180 | AC_ARG_ENABLE([irqtop], | |
2181 | AS_HELP_STRING([--disable-irqtop], [do not build irqtop]), | |
2182 | [], [UL_DEFAULT_ENABLE([irqtop], [check])] | |
2183 | ) | |
2184 | UL_BUILD_INIT([irqtop]) | |
2185 | UL_REQUIRES_LINUX([irqtop]) | |
2186 | UL_REQUIRES_BUILD([irqtop], [libsmartcols]) | |
2187 | UL_REQUIRES_HAVE([irqtop], [open_memstream], [open_memstream function]) | |
2188 | UL_REQUIRES_HAVE([irqtop], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) | |
2189 | AM_CONDITIONAL([BUILD_IRQTOP], [test "x$build_irqtop" = xyes]) | |
2190 | ||
2191 | AC_ARG_ENABLE([lsirq], | |
2192 | AS_HELP_STRING([--disable-lsirq], [do not build lsirq]), | |
2193 | [], [UL_DEFAULT_ENABLE([lsirq], [check])] | |
2194 | ) | |
2195 | UL_BUILD_INIT([lsirq]) | |
2196 | UL_REQUIRES_LINUX([lsirq]) | |
2197 | UL_REQUIRES_BUILD([lsirq], [libsmartcols]) | |
2198 | AM_CONDITIONAL([BUILD_LSIRQ], [test "x$build_lsirq" = xyes]) | |
2199 | ||
2200 | ||
2201 | UL_BUILD_INIT([choom], [check]) | |
2202 | UL_REQUIRES_LINUX([choom]) | |
2203 | AM_CONDITIONAL([BUILD_CHOOM], [test "x$build_choom" = xyes]) | |
2204 | ||
2205 | UL_BUILD_INIT([lsipc], [check]) | |
2206 | UL_REQUIRES_LINUX([lsipc]) | |
2207 | UL_REQUIRES_BUILD([lsipc], [libsmartcols]) | |
2208 | AM_CONDITIONAL([BUILD_LSIPC], [test "x$build_lsipc" = xyes]) | |
2209 | ||
2210 | AC_ARG_ENABLE([lsns], | |
2211 | AS_HELP_STRING([--disable-lsns], [do not build lsns]), | |
2212 | [], [UL_DEFAULT_ENABLE([lsns], [check])] | |
2213 | ) | |
2214 | UL_BUILD_INIT([lsns]) | |
2215 | UL_REQUIRES_LINUX([lsns]) | |
2216 | UL_REQUIRES_BUILD([lsns], [libsmartcols]) | |
2217 | UL_REQUIRES_BUILD([lsns], [libmount]) | |
2218 | AM_CONDITIONAL([BUILD_LSNS], [test "x$build_lsns" = xyes]) | |
2219 | ||
2220 | UL_BUILD_INIT([renice], [yes]) | |
2221 | AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes]) | |
2222 | ||
2223 | ||
2224 | AC_ARG_ENABLE([rfkill], | |
2225 | AS_HELP_STRING([--disable-rfkill], [do not build rfkill]), | |
2226 | [], [UL_DEFAULT_ENABLE([rfkill], [check])] | |
2227 | ) | |
2228 | UL_BUILD_INIT([rfkill]) | |
2229 | UL_REQUIRES_LINUX([rfkill]) | |
2230 | UL_REQUIRES_BUILD([rfkill], [libsmartcols]) | |
2231 | AM_CONDITIONAL([BUILD_RFKILL], [test "x$build_rfkill" = xyes]) | |
2232 | ||
2233 | ||
2234 | UL_BUILD_INIT([setpgid], [yes]) | |
2235 | AM_CONDITIONAL([BUILD_SETPGID], [test "x$build_setpgid" = xyes]) | |
2236 | ||
2237 | UL_BUILD_INIT([setsid], [yes]) | |
2238 | AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes]) | |
2239 | ||
2240 | UL_BUILD_INIT([readprofile], [check]) | |
2241 | UL_REQUIRES_LINUX([readprofile]) | |
2242 | AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes]) | |
2243 | ||
2244 | AC_ARG_ENABLE([dmesg], | |
2245 | AS_HELP_STRING([--disable-dmesg], [do not build dmesg]), | |
2246 | [], [UL_DEFAULT_ENABLE([dmesg], [check])] | |
2247 | ) | |
2248 | UL_BUILD_INIT([dmesg]) | |
2249 | UL_REQUIRES_LINUX([dmesg]) | |
2250 | AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes]) | |
2251 | ||
2252 | UL_BUILD_INIT([ctrlaltdel], [check]) | |
2253 | UL_REQUIRES_LINUX([ctrlaltdel]) | |
2254 | dnl we assume reboot() to be the 1-argument variant, because even considering | |
2255 | dnl widely used alternative C libraries like uclibc, dietlibc and musl, | |
2256 | dnl reboot() with multiple arguments is yet only found in glibc versions | |
2257 | dnl earlier than 2.x. | |
2258 | UL_REQUIRES_HAVE([ctrlaltdel], [reboot], [reboot function]) | |
2259 | AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes]) | |
2260 | ||
2261 | AC_ARG_ENABLE([exch], | |
2262 | AS_HELP_STRING([--disable-exch], [do not build exch]), | |
2263 | [], [UL_DEFAULT_ENABLE([exch], [check])] | |
2264 | ) | |
2265 | UL_BUILD_INIT([exch]) | |
2266 | UL_REQUIRES_LINUX([exch]) | |
2267 | UL_REQUIRES_SYSCALL_CHECK([exch], [UL_CHECK_SYSCALL([renameat2])]) | |
2268 | AM_CONDITIONAL([BUILD_EXCH], [test "x$build_exch" = xyes]) | |
2269 | ||
2270 | UL_BUILD_INIT([fincore], [check]) | |
2271 | UL_REQUIRES_LINUX([fincore]) | |
2272 | UL_REQUIRES_BUILD([fincore], [libsmartcols]) | |
2273 | AM_CONDITIONAL([BUILD_FINCORE], [test "x$build_fincore" = xyes]) | |
2274 | ||
2275 | UL_BUILD_INIT([fsfreeze], [check]) | |
2276 | UL_REQUIRES_LINUX([fsfreeze]) | |
2277 | AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes]) | |
2278 | ||
2279 | UL_BUILD_INIT([blkdiscard], [check]) | |
2280 | UL_REQUIRES_LINUX([blkdiscard]) | |
2281 | AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes]) | |
2282 | ||
2283 | UL_BUILD_INIT([blkzone], [check]) | |
2284 | UL_REQUIRES_LINUX([blkzone]) | |
2285 | UL_REQUIRES_HAVE([blkzone], [linux_blkzoned_h], [linux/blkzoned.h header]) | |
2286 | AM_CONDITIONAL([BUILD_BLKZONE], [test "x$build_blkzone" = xyes]) | |
2287 | ||
2288 | UL_BUILD_INIT([blkpr], [check]) | |
2289 | UL_REQUIRES_LINUX([blkpr]) | |
2290 | UL_REQUIRES_HAVE([blkpr], [linux_pr_h], [linux/pr.h header]) | |
2291 | AM_CONDITIONAL([BUILD_BLKPR], [test "x$build_blkpr" = xyes]) | |
2292 | ||
2293 | UL_BUILD_INIT([ldattach], [check]) | |
2294 | UL_REQUIRES_LINUX([ldattach]) | |
2295 | AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes]) | |
2296 | ||
2297 | UL_BUILD_INIT([rtcwake], [check]) | |
2298 | UL_REQUIRES_LINUX([rtcwake]) | |
2299 | AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes]) | |
2300 | ||
2301 | UL_BUILD_INIT([setarch], [check]) | |
2302 | UL_REQUIRES_LINUX([setarch]) | |
2303 | AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes]) | |
2304 | ||
2305 | ||
2306 | # build_scriptutils= is just configure-only variable to control | |
2307 | # script, scriptreplay and scriptlive | |
2308 | AC_ARG_ENABLE([scriptutils], | |
2309 | AS_HELP_STRING([--disable-scriptutils], [do not build script, scriptreplay and scriptlive]), | |
2310 | [], [UL_DEFAULT_ENABLE([scriptutils], [check])] | |
2311 | ) | |
2312 | ||
2313 | UL_ENABLE_ALIAS([script], [scriptutils]) | |
2314 | UL_BUILD_INIT([script]) | |
2315 | UL_REQUIRES_HAVE([script], [pty], [openpty function (libutil)]) | |
2316 | AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes]) | |
2317 | ||
2318 | UL_ENABLE_ALIAS([scriptreplay], [scriptutils]) | |
2319 | UL_BUILD_INIT([scriptreplay]) | |
2320 | AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes]) | |
2321 | ||
2322 | UL_ENABLE_ALIAS([scriptlive], [scriptutils]) | |
2323 | UL_BUILD_INIT([scriptlive]) | |
2324 | UL_REQUIRES_HAVE([scriptlive], [pty], [openpty function (libutil)]) | |
2325 | AM_CONDITIONAL([BUILD_SCRIPTLIVE], [test "x$build_scriptlive" = xyes]) | |
2326 | ||
2327 | ||
2328 | AC_ARG_ENABLE([bits], | |
2329 | AS_HELP_STRING([--disable-bits], [do not build bits]), | |
2330 | [], [UL_DEFAULT_ENABLE([bits], [check])]) | |
2331 | UL_BUILD_INIT([bits]) | |
2332 | UL_REQUIRES_HAVE([bits], [cpu_set_t], [cpu_set_t type]) | |
2333 | AM_CONDITIONAL([BUILD_BITS], [test "x$build_bits" = xyes]) | |
2334 | ||
2335 | UL_BUILD_INIT([col], [check]) | |
2336 | UL_REQUIRES_COMPILE([col], [#include <limits.h>], [__GLIBC__], [building for glibc]) | |
2337 | AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes]) | |
2338 | ||
2339 | UL_BUILD_INIT([colcrt], [yes]) | |
2340 | AM_CONDITIONAL([BUILD_COLCRT], [test "x$build_colcrt" = xyes]) | |
2341 | ||
2342 | UL_BUILD_INIT([colrm], [yes]) | |
2343 | AM_CONDITIONAL([BUILD_COLRM], [test "x$build_colrm" = xyes]) | |
2344 | ||
2345 | UL_BUILD_INIT([column], [check]) | |
2346 | UL_REQUIRES_BUILD([column], [libsmartcols]) | |
2347 | AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes]) | |
2348 | ||
2349 | AC_ARG_ENABLE([hexdump], | |
2350 | AS_HELP_STRING([--disable-hexdump], [do not build hexdump]), | |
2351 | [], [UL_DEFAULT_ENABLE([hexdump], [check])] | |
2352 | ) | |
2353 | UL_BUILD_INIT([hexdump]) | |
2354 | AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes]) | |
2355 | ||
2356 | UL_BUILD_INIT([rev], [yes]) | |
2357 | AM_CONDITIONAL([BUILD_REV], [test "x$build_rev" = xyes]) | |
2358 | ||
2359 | ||
2360 | AC_ARG_ENABLE([tunelp], | |
2361 | AS_HELP_STRING([--enable-tunelp], [build tunelp]), | |
2362 | [], [UL_DEFAULT_ENABLE([tunelp], [no])] | |
2363 | ) | |
2364 | UL_BUILD_INIT([tunelp]) | |
2365 | UL_REQUIRES_LINUX([tunelp]) | |
2366 | AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes]) | |
2367 | ||
2368 | ||
2369 | AC_ARG_ENABLE([kill], | |
2370 | AS_HELP_STRING([--disable-kill], [do not build kill]), | |
2371 | [], [UL_DEFAULT_ENABLE([kill], [check])] | |
2372 | ) | |
2373 | UL_BUILD_INIT([kill]) | |
2374 | UL_REQUIRES_LINUX([kill]) | |
2375 | AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes]) | |
2376 | ||
2377 | ||
2378 | AC_ARG_ENABLE([last], | |
2379 | AS_HELP_STRING([--disable-last], [do not build last]), | |
2380 | [], [UL_DEFAULT_ENABLE([last], [check])] | |
2381 | ) | |
2382 | UL_BUILD_INIT([last]) | |
2383 | UL_REQUIRES_HAVE([last], [utmpx_h], [utmpx.h header]) | |
2384 | UL_REQUIRES_HAVE([last], [gnu_utmpx], [GNU utmpx functions]) | |
2385 | AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes]) | |
2386 | ||
2387 | ||
2388 | AC_ARG_ENABLE([utmpdump], | |
2389 | AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]), | |
2390 | [], [UL_DEFAULT_ENABLE([utmpdump], [check])] | |
2391 | ) | |
2392 | UL_BUILD_INIT([utmpdump]) | |
2393 | UL_REQUIRES_HAVE([utmpdump], [utmpx_h], [utmpx.h header]) | |
2394 | UL_REQUIRES_HAVE([utmpdump], [gnu_utmpx], [GNU utmpx functions]) | |
2395 | AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes]) | |
2396 | ||
2397 | ||
2398 | AC_ARG_ENABLE([line], | |
2399 | AS_HELP_STRING([--enable-line], [build line]), | |
2400 | [], [UL_DEFAULT_ENABLE([line], [no])] | |
2401 | ) | |
2402 | UL_BUILD_INIT([line]) | |
2403 | AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes]) | |
2404 | ||
2405 | ||
2406 | AC_ARG_ENABLE([mesg], | |
2407 | AS_HELP_STRING([--disable-mesg], [do not build mesg]), | |
2408 | [], [UL_DEFAULT_ENABLE([mesg], [yes])] | |
2409 | ) | |
2410 | UL_BUILD_INIT([mesg]) | |
2411 | AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes]) | |
2412 | ||
2413 | ||
2414 | AC_ARG_ENABLE([raw], | |
2415 | AS_HELP_STRING([--disable-raw], [do not build raw]), | |
2416 | [], [UL_DEFAULT_ENABLE([raw], [check])] | |
2417 | ) | |
2418 | UL_BUILD_INIT([raw]) | |
2419 | UL_REQUIRES_LINUX([raw]) | |
2420 | UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file]) | |
2421 | AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes]) | |
2422 | ||
2423 | ||
2424 | AC_ARG_ENABLE([rename], | |
2425 | AS_HELP_STRING([--disable-rename], [do not build rename]), | |
2426 | [], [UL_DEFAULT_ENABLE([rename], [yes])] | |
2427 | ) | |
2428 | UL_BUILD_INIT([rename]) | |
2429 | AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes]) | |
2430 | ||
2431 | ||
2432 | AC_ARG_ENABLE([vipw], | |
2433 | AS_HELP_STRING([--enable-vipw], [build vipw]), | |
2434 | [], [UL_DEFAULT_ENABLE([vipw], [no])] | |
2435 | ) | |
2436 | UL_BUILD_INIT([vipw]) | |
2437 | UL_REQUIRES_HAVE([vipw], [shadow_h], [shadow.h header]) | |
2438 | AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes]) | |
2439 | ||
2440 | ||
2441 | AC_ARG_ENABLE([newgrp], | |
2442 | AS_HELP_STRING([--enable-newgrp], [build newgrp]), | |
2443 | [], [UL_DEFAULT_ENABLE([newgrp], [no])] | |
2444 | ) | |
2445 | UL_BUILD_INIT([newgrp]) | |
2446 | UL_REQUIRES_HAVE([newgrp], [crypt], [crypt function]) | |
2447 | AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes]) | |
2448 | ||
2449 | ||
2450 | AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]), | |
2451 | [], [with_user=check] | |
2452 | ) | |
2453 | have_user=no | |
2454 | AS_IF([test "x$with_user" != xno], [ | |
2455 | PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no]) | |
2456 | AS_CASE([$with_user:$have_user], | |
2457 | [yes:no], | |
2458 | [AC_MSG_ERROR([user selected but libuser not found])], | |
2459 | [*:yes], | |
2460 | [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])] | |
2461 | ) | |
2462 | # temporary solution, libuser has stupid .pc where are exported all | |
2463 | # private dependencies to Requires: instead of Requires.private: | |
2464 | AS_IF([test "x$have_user" = xyes], [ | |
2465 | LIBUSER_LIBS=-luser | |
2466 | ]) | |
2467 | ]) | |
2468 | AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes]) | |
2469 | ||
2470 | AC_ARG_ENABLE([chfn-chsh-password], | |
2471 | AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]), | |
2472 | [], [enable_chfn_chsh_password=yes] | |
2473 | ) | |
2474 | ||
2475 | AC_ARG_ENABLE([chfn-chsh], | |
2476 | AS_HELP_STRING([--disable-chfn-chsh], [do not build chfn and chsh]), | |
2477 | [], [UL_DEFAULT_ENABLE([chfn_chsh], [check])] | |
2478 | ) | |
2479 | UL_BUILD_INIT([chfn_chsh]) | |
2480 | UL_REQUIRES_HAVE([chfn_chsh], [shadow_h], [shadow.h header]) | |
2481 | UL_REQUIRES_HAVE([chfn_chsh], [getusershell], [getusershell function]) | |
2482 | ||
2483 | AS_IF([test "x$enable_chfn_chsh_password" = xyes || test "x$have_user" = xyes], [ | |
2484 | UL_REQUIRES_HAVE([chfn_chsh], [security_pam_appl_h], [PAM header file]) | |
2485 | AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?]) | |
2486 | ]) | |
2487 | AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes]) | |
2488 | AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes]) | |
2489 | ||
2490 | AC_ARG_ENABLE([chsh-only-listed], | |
2491 | AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]), | |
2492 | [], enable_chsh_only_listed=yes | |
2493 | ) | |
2494 | ||
2495 | AS_IF([test "x$enable_chsh_only_listed" = xyes], [ | |
2496 | AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?]) | |
2497 | ]) | |
2498 | ||
2499 | ||
2500 | AC_ARG_ENABLE([login], | |
2501 | AS_HELP_STRING([--disable-login], [do not build login]), | |
2502 | [], [UL_DEFAULT_ENABLE([login], [check])] | |
2503 | ) | |
2504 | UL_BUILD_INIT([login]) | |
2505 | UL_REQUIRES_HAVE([login], [security_pam_appl_h], [PAM header file]) | |
2506 | UL_REQUIRES_HAVE([login], [security_pam_misc_h, security_openpam_h], [PAM conversation functions]) | |
2507 | UL_REQUIRES_HAVE([login], [utmpx_h], [utmpx.h header]) | |
2508 | UL_REQUIRES_HAVE([login], [gnu_utmpx], [GNU utmpx functions]) | |
2509 | AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes]) | |
2510 | ||
2511 | AC_ARG_ENABLE([login-chown-vcs], | |
2512 | AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]), | |
2513 | [], [enable_login_chown_vcs=no] | |
2514 | ) | |
2515 | ||
2516 | AS_IF([test "x$enable_login_chown_vcs" = xyes], [ | |
2517 | AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?]) | |
2518 | ]) | |
2519 | ||
2520 | AC_ARG_ENABLE([login-stat-mail], | |
2521 | AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]), | |
2522 | [], [enable_login_stat_mail=no] | |
2523 | ) | |
2524 | ||
2525 | AS_IF([test "x$enable_login_stat_mail" = xyes], [ | |
2526 | AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?]) | |
2527 | ]) | |
2528 | ||
2529 | AC_ARG_ENABLE([login-lastlog], | |
2530 | AS_HELP_STRING([--enable-login-lastlog], [program login writes lastlog entries]), | |
2531 | [], [enable_login_lastlogin=no] | |
2532 | ) | |
2533 | ||
2534 | AS_IF([test "x$enable_login_lastlogin" != xno], [ | |
2535 | AC_DEFINE([USE_LOGIN_LASTLOG], | |
2536 | [1], | |
2537 | [Define if program login writes lastlog entries]) | |
2538 | ]) | |
2539 | ||
2540 | AC_ARG_ENABLE([nologin], | |
2541 | AS_HELP_STRING([--disable-nologin], [do not build nologin]), | |
2542 | [], [UL_DEFAULT_ENABLE([nologin], [yes])] | |
2543 | ) | |
2544 | UL_BUILD_INIT([nologin]) | |
2545 | AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes]) | |
2546 | ||
2547 | ||
2548 | AC_ARG_ENABLE([sulogin], | |
2549 | AS_HELP_STRING([--disable-sulogin], [do not build sulogin]), | |
2550 | [], [UL_DEFAULT_ENABLE([sulogin], [check])] | |
2551 | ) | |
2552 | UL_BUILD_INIT([sulogin]) | |
2553 | UL_REQUIRES_HAVE([sulogin], [crypt], [crypt function]) | |
2554 | UL_REQUIRES_HAVE([sulogin], [shadow_h], [shadow.h header]) | |
2555 | AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes]) | |
2556 | ||
2557 | ||
2558 | AC_ARG_ENABLE([su], | |
2559 | AS_HELP_STRING([--disable-su], [do not build su]), | |
2560 | [], [UL_DEFAULT_ENABLE([su], [check])] | |
2561 | ) | |
2562 | UL_BUILD_INIT([su]) | |
2563 | UL_REQUIRES_HAVE([su], [security_pam_appl_h], [PAM header file]) | |
2564 | UL_REQUIRES_HAVE([su], [utmpx_h], [utmpx.h header]) | |
2565 | UL_REQUIRES_HAVE([su], [gnu_utmpx], [GNU utmpx functions]) | |
2566 | AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes]) | |
2567 | ||
2568 | ||
2569 | AC_ARG_ENABLE([runuser], | |
2570 | AS_HELP_STRING([--disable-runuser], [do not build runuser]), | |
2571 | [], [UL_DEFAULT_ENABLE([runuser], [check])] | |
2572 | ) | |
2573 | UL_BUILD_INIT([runuser]) | |
2574 | UL_REQUIRES_HAVE([runuser], [security_pam_appl_h], [PAM header file]) | |
2575 | UL_REQUIRES_HAVE([runuser], [utmpx_h], [utmpx.h header]) | |
2576 | UL_REQUIRES_HAVE([runuser], [gnu_utmpx], [GNU utmpx functions]) | |
2577 | AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes]) | |
2578 | ||
2579 | ||
2580 | AC_ARG_ENABLE([ul], | |
2581 | AS_HELP_STRING([--disable-ul], [do not build ul]), | |
2582 | [], [UL_DEFAULT_ENABLE([ul], [check])] | |
2583 | ) | |
2584 | UL_BUILD_INIT([ul]) | |
2585 | UL_REQUIRES_HAVE([ul], [ncursesw, ncurses], [ncursesw or ncurses libraries]) | |
2586 | AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes]) | |
2587 | ||
2588 | ||
2589 | AC_ARG_ENABLE([more], | |
2590 | AS_HELP_STRING([--disable-more], [do not build more]), | |
2591 | [], [UL_DEFAULT_ENABLE([more], [check])] | |
2592 | ) | |
2593 | UL_BUILD_INIT([more]) | |
2594 | UL_REQUIRES_HAVE([more], [ncursesw, ncurses], [ncursesw or ncurses libraries]) | |
2595 | UL_REQUIRES_HAVE([more], [sys_signalfd_h], [sys/signalfd.h header]) | |
2596 | AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes]) | |
2597 | ||
2598 | ||
2599 | AC_ARG_ENABLE([pg], | |
2600 | AS_HELP_STRING([--enable-pg], [build pg]), | |
2601 | [], [UL_DEFAULT_ENABLE([pg], [no])] | |
2602 | ) | |
2603 | UL_BUILD_INIT([pg]) | |
2604 | UL_REQUIRES_HAVE([pg], [ncursesw, ncurses], [ncursesw or ncurses library]) | |
2605 | AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes]) | |
2606 | ||
2607 | ||
2608 | AC_ARG_ENABLE([setterm], | |
2609 | AS_HELP_STRING([--disable-setterm], [do not build setterm]), | |
2610 | [], [UL_DEFAULT_ENABLE([setterm], [check])] | |
2611 | ) | |
2612 | UL_BUILD_INIT([setterm]) | |
2613 | UL_REQUIRES_LINUX([setterm]) | |
2614 | UL_REQUIRES_HAVE([setterm], [ncursesw, ncurses], [ncursesw or ncurses library]) | |
2615 | AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes]) | |
2616 | ||
2617 | # build_schedutils= is just configure-only variable to control | |
2618 | # ionice, taskset, coresched and chrt | |
2619 | AC_ARG_ENABLE([schedutils], | |
2620 | AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset, coresched]), | |
2621 | [], [UL_DEFAULT_ENABLE([schedutils], [check])] | |
2622 | ) | |
2623 | ||
2624 | ||
2625 | UL_ENABLE_ALIAS([ionice], [schedutils]) | |
2626 | UL_BUILD_INIT([ionice]) | |
2627 | UL_REQUIRES_SYSCALL_CHECK([ionice], | |
2628 | [UL_CHECK_SYSCALL([ioprio_set], | |
2629 | [alpha], [442], | |
2630 | [i*86], [289], | |
2631 | [ia64*], [1274], | |
2632 | [powerpc*], [273], | |
2633 | [s390*], [282], | |
2634 | [sparc*], [196], | |
2635 | [sh*], [288], | |
2636 | [x86_64*], [251])], | |
2637 | [ioprio_set]) | |
2638 | ||
2639 | UL_REQUIRES_SYSCALL_CHECK([ionice], | |
2640 | [UL_CHECK_SYSCALL([ioprio_get], | |
2641 | [alpha], [443], | |
2642 | [i*86], [290], | |
2643 | [ia64*], [1275], | |
2644 | [powerpc*], [274], | |
2645 | [s390*], [283], | |
2646 | [sparc*], [218], | |
2647 | [sh*], [289], | |
2648 | [x86_64*], [252])], | |
2649 | [ioprio_get]) | |
2650 | ||
2651 | AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes]) | |
2652 | ||
2653 | ||
2654 | UL_ENABLE_ALIAS([taskset], [schedutils]) | |
2655 | UL_BUILD_INIT([taskset]) | |
2656 | UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type]) | |
2657 | UL_REQUIRES_SYSCALL_CHECK([taskset], | |
2658 | [UL_CHECK_SYSCALL([sched_getaffinity])], | |
2659 | [sched_getaffinity]) | |
2660 | AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes]) | |
2661 | ||
2662 | ||
2663 | UL_ENABLE_ALIAS([coresched], [schedutils]) | |
2664 | UL_BUILD_INIT([coresched]) | |
2665 | UL_REQUIRES_SYSCALL_CHECK([coresched], | |
2666 | [UL_CHECK_SYSCALL([prctl])], | |
2667 | [prctl]) | |
2668 | AM_CONDITIONAL([BUILD_CORESCHED], [test "x$build_coresched" = xyes]) | |
2669 | ||
2670 | ||
2671 | have_schedsetter=no | |
2672 | AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes], | |
2673 | [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes]) | |
2674 | ||
2675 | UL_ENABLE_ALIAS([chrt], [schedutils]) | |
2676 | UL_BUILD_INIT([chrt]) | |
2677 | UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions]) | |
2678 | AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes]) | |
2679 | ||
2680 | AS_IF([test "x$build_chrt" = xyes], [ | |
2681 | UL_CHECK_SYSCALL([sched_setattr]) | |
2682 | ]) | |
2683 | ||
2684 | UL_ENABLE_ALIAS([uclampset], [schedutils]) | |
2685 | UL_BUILD_INIT([uclampset]) | |
2686 | UL_REQUIRES_SYSCALL_CHECK([uclampset], | |
2687 | [UL_CHECK_SYSCALL([sched_setattr])], [sched_setattr]) | |
2688 | AM_CONDITIONAL([BUILD_UCLAMPSET], [test "x$build_uclampset" = xyes]) | |
2689 | ||
2690 | ||
2691 | AC_ARG_ENABLE([wall], | |
2692 | AS_HELP_STRING([--disable-wall], [do not build wall]), | |
2693 | [], [UL_DEFAULT_ENABLE([wall], [check])] | |
2694 | ) | |
2695 | UL_BUILD_INIT([wall]) | |
2696 | UL_REQUIRES_HAVE([wall], [utmpx_h], [utmpx.h header]) | |
2697 | AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes]) | |
2698 | ||
2699 | ||
2700 | AC_ARG_ENABLE([write], | |
2701 | AS_HELP_STRING([--enable-write], [build write]), | |
2702 | [], [UL_DEFAULT_ENABLE([write], [no])] | |
2703 | ) | |
2704 | UL_BUILD_INIT([write]) | |
2705 | UL_REQUIRES_HAVE([write], [utmpx_h], [utmpx.h header]) | |
2706 | UL_REQUIRES_HAVE([write], [gnu_utmpx], [GNU utmpx functions]) | |
2707 | AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes]) | |
2708 | ||
2709 | ||
2710 | AC_ARG_WITH([btrfs], | |
2711 | AS_HELP_STRING([--without-btrfs], [do not build with btrfs support]), | |
2712 | [], [with_btrfs=check] | |
2713 | ) | |
2714 | have_btrfs=no | |
2715 | AS_IF([test "x$with_btrfs" != xno], [ | |
2716 | AS_CASE([$with_btrfs:$have_linux_btrfs_h], | |
2717 | [yes:no], | |
2718 | [AC_MSG_ERROR([btrfs selected but linux/btrfs.h not found])], | |
2719 | [check:no], | |
2720 | [AC_MSG_WARN([linux/btrfs.h not found, do not build with btrfs support])], | |
2721 | [*:yes], | |
2722 | [have_btrfs=yes | |
2723 | AC_DEFINE([HAVE_BTRFS_SUPPORT], [1], [Define if btrfs stuff is available])] | |
2724 | ) | |
2725 | ]) | |
2726 | AM_CONDITIONAL([HAVE_BTRFS], [test "x$have_btrfs" = xyes]) | |
2727 | ||
2728 | ||
2729 | AC_ARG_WITH([systemd], | |
2730 | AS_HELP_STRING([--without-systemd], [do not build with systemd support]), | |
2731 | [], [with_systemd=check] | |
2732 | ) | |
2733 | ||
2734 | have_systemd=no | |
2735 | AS_IF([test "x$with_systemd" != xno], [ | |
2736 | # new version -- all libsystemd-* libs merged into libsystemd | |
2737 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no]) | |
2738 | # old versions | |
2739 | AS_IF([test "x$have_systemd" != "xyes"], [ | |
2740 | PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], | |
2741 | [have_systemd_daemon=yes], [have_systemd_daemon=no]) | |
2742 | PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal], | |
2743 | [have_systemd_journal=yes], [have_systemd_journal=no]) | |
2744 | AS_IF([test "x$have_systemd_daemon" = "xyes" && test "x$have_systemd_journal" = "xyes" ],[ | |
2745 | have_systemd=yes]) | |
2746 | ]) | |
2747 | AS_CASE([$with_systemd:$have_systemd], | |
2748 | [yes:no], | |
2749 | [AC_MSG_ERROR([systemd expected but libsystemd not found])], | |
2750 | [*:yes], | |
2751 | AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available]) | |
2752 | AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ]) | |
2753 | AC_CHECK_DECLS([sd_session_get_username], [], [], [#include <systemd/sd-login.h>]) | |
2754 | AC_CHECK_DECLS([sd_device_new_from_syspath], [], [], [#include <systemd/sd-device.h>]) | |
2755 | AC_CHECK_DECLS([sd_device_open], [], [], [#include <systemd/sd-device.h>]) | |
2756 | ) | |
2757 | ]) | |
2758 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes]) | |
2759 | ||
2760 | ||
2761 | AC_ARG_WITH([systemdsystemunitdir], | |
2762 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd unit files (requires systemd support)]), | |
2763 | [], [ | |
2764 | AS_IF([test "x$have_systemd" = xyes], [ | |
2765 | PKG_CHECK_VAR([with_systemdsystemunitdir], [systemd], [systemdsystemunitdir], | |
2766 | [], | |
2767 | [with_systemdsystemunitdir=no]) | |
2768 | ]) | |
2769 | ]) | |
2770 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ | |
2771 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) | |
2772 | ]) | |
2773 | ||
2774 | AC_ARG_WITH([tmpfilesdir], | |
2775 | AS_HELP_STRING([--with-tmpfilesdir=DIR], [directory for tmpfiles. See tmpfiles.d(5) for details]), | |
2776 | [], [ | |
2777 | AS_IF([test "x$have_systemd" = xyes], [ | |
2778 | PKG_CHECK_VAR([with_tmpfilesdir], [systemd], [tmpfilesdir], | |
2779 | [], | |
2780 | [with_tmpfilesdir=no]) | |
2781 | ]) | |
2782 | ]) | |
2783 | AS_IF([test "x$with_tmpfilesdir" != "xno"], [ | |
2784 | AC_SUBST([tmpfilesdir], [$with_tmpfilesdir]) | |
2785 | ]) | |
2786 | ||
2787 | ||
2788 | AC_ARG_WITH([sysusersdir], | |
2789 | AS_HELP_STRING([--with-sysusersdir=DIR], [directory for sysusers. See sysusers.d(5) for details]), | |
2790 | [], [ | |
2791 | AS_IF([test "x$have_systemd" = xyes], [ | |
2792 | PKG_CHECK_VAR([with_sysusersdir], [systemd], [sysusersdir], | |
2793 | [], | |
2794 | [with_sysusersdir=no]) | |
2795 | ]) | |
2796 | ]) | |
2797 | AS_IF([test "x$with_sysusersdir" != "xno"], [ | |
2798 | AC_SUBST([sysusersdir], [$with_sysusersdir]) | |
2799 | ]) | |
2800 | ||
2801 | AC_ARG_WITH([smack], | |
2802 | AS_HELP_STRING([--with-smack], [build with SMACK support]), | |
2803 | [], [with_smack=no] | |
2804 | ) | |
2805 | AS_IF([test "x$with_smack" = xyes], [ | |
2806 | AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support]) | |
2807 | ]) | |
2808 | ||
2809 | AC_ARG_WITH([econf], | |
2810 | AS_HELP_STRING([--without-econf], [do not use libeconf]), | |
2811 | [], [with_econf=check] | |
2812 | ) | |
2813 | ||
2814 | have_econf=no | |
2815 | AS_IF([test "x$with_econf" != xno], [ | |
2816 | PKG_CHECK_MODULES([ECONF], [libeconf], | |
2817 | [have_econf=yes | |
2818 | AC_CHECK_LIB([econf], [econf_readConfig], [ | |
2819 | AC_DEFINE([HAVE_ECONF_READCONFIG], [1], [Define if econf_readConfig exist in -leconf]) | |
2820 | ]) | |
2821 | ], | |
2822 | [have_econf=no] | |
2823 | ) | |
2824 | AS_CASE([$with_econf:$have_econf], | |
2825 | [yes:no], | |
2826 | [AC_MSG_ERROR([libeconf expected but libeconf not found])], | |
2827 | [*:yes], | |
2828 | AC_DEFINE([HAVE_LIBECONF], [1], [Define if libeconf is available]) | |
2829 | ) | |
2830 | ]) | |
2831 | AM_CONDITIONAL([HAVE_ECONF], [test "x$have_econf" = xyes]) | |
2832 | ||
2833 | AC_ARG_WITH([vendordir], | |
2834 | AS_HELP_STRING([--with-vendordir=DIR], [Directory for distribution provided configuration files]), | |
2835 | [], [] | |
2836 | ) | |
2837 | AC_SUBST([vendordir], [$with_vendordir]) | |
2838 | AM_CONDITIONAL([USE_VENDORDIR], [test "x$with_vendordir" != x]) | |
2839 | AS_IF([test "x$with_vendordir" != x], [ | |
2840 | AC_DEFINE([USE_VENDORDIR], [1], [Define to 1 to use vendordir]) | |
2841 | ]) | |
2842 | ||
2843 | ||
2844 | AC_ARG_ENABLE([bash-completion], | |
2845 | AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]), | |
2846 | [], [enable_bash_completion=yes] | |
2847 | ) | |
2848 | ||
2849 | AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes]) | |
2850 | ||
2851 | AC_ARG_WITH([bashcompletiondir], | |
2852 | AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), | |
2853 | [], [ | |
2854 | AS_IF([test "x$enable_bash_completion" = xyes], [ | |
2855 | PKG_CHECK_VAR([with_bashcompletiondir], [bash-completion], [completionsdir], | |
2856 | [], | |
2857 | [with_bashcompletiondir=${datadir}/bash-completion/completions]) | |
2858 | ]) | |
2859 | ]) | |
2860 | AS_IF([test "x$enable_bash_completion" = xyes], [ | |
2861 | AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) | |
2862 | ]) | |
2863 | ||
2864 | ||
2865 | AC_ARG_WITH([python], | |
2866 | AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]), | |
2867 | [], [with_python=check withval=check] | |
2868 | ) | |
2869 | ||
2870 | have_python=no | |
2871 | have_libpython=no | |
2872 | AS_IF([test "x$with_python" != xno], [ | |
2873 | # We follow distributions default and look for PKG module name "python" | |
2874 | # (minimal version is 2) but if major version is explicitly specified by | |
2875 | # --with-python=2 or --with-python=3 then we look for PKG module "python2" or | |
2876 | # "python3". | |
2877 | AS_IF([test "x$withval" != xno && test "x$withval" != xyes && test "x$withval" != xcheck], | |
2878 | [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"]) | |
2879 | ||
2880 | # check for python interpreter | |
2881 | AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no]) | |
2882 | AS_CASE([$with_python:$have_python], | |
2883 | [yes:no], | |
2884 | [AC_MSG_ERROR([python selected but python interpreter not found])], | |
2885 | [check:no], | |
2886 | [AC_MSG_WARN([python interpreter not found, do not build python bindings])], | |
2887 | [*:yes], | |
2888 | # check for python development stuff | |
2889 | [ | |
2890 | PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_libpython=yes], [have_libpython=no]) | |
2891 | ||
2892 | # https://github.com/util-linux/util-linux/issues/2366 | |
2893 | AX_COMPARE_VERSION([$PYTHON_VERSION], [ge], [3.12], [ | |
2894 | UL_WARN_ADD([-Wno-error=redundant-decls], [PYTHON_CFLAGS]) | |
2895 | ]) | |
2896 | ] | |
2897 | ) | |
2898 | ]) | |
2899 | ||
2900 | ||
2901 | AC_ARG_ENABLE([pylibmount], | |
2902 | AS_HELP_STRING([--disable-pylibmount], [do not build pylibmount]), | |
2903 | [], [UL_DEFAULT_ENABLE([pylibmount], [check])] | |
2904 | ) | |
2905 | UL_BUILD_INIT([pylibmount]) | |
2906 | UL_REQUIRES_HAVE([pylibmount], [libpython], [libpython]) | |
2907 | UL_REQUIRES_BUILD([pylibmount], [libmount]) | |
2908 | AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"]) | |
2909 | ||
2910 | # We need to introduce a verbatim dependency into the Makefile, without automake | |
2911 | # trying to interpret it, so push it as a AM_SUBST_NOTMAKE variable. | |
2912 | verbatim_extra_dependency=' | |
2913 | ||
2914 | # pylibmountexec module must be installed after usrlib_exec libraries, | |
2915 | # otherwise the libtool relink step will fail to find libmount.la and | |
2916 | # will try -lmount which is possibly not available. | |
2917 | install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES | |
2918 | install-securelib_execLTLIBRARIES: install-usrlib_execLTLIBRARIES | |
2919 | ||
2920 | ' | |
2921 | AC_SUBST([verbatim_extra_dependency]) | |
2922 | AM_SUBST_NOTMAKE([verbatim_extra_dependency]) | |
2923 | ||
2924 | AC_ARG_ENABLE([pg-bell], | |
2925 | AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]), | |
2926 | [], [enable_pg_bell=yes] | |
2927 | ) | |
2928 | ||
2929 | AS_IF([test "x$enable_pg_bell" = xyes], [ | |
2930 | AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?]) | |
2931 | ]) | |
2932 | ||
2933 | ||
2934 | AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs]) | |
2935 | AC_ARG_ENABLE([fs-paths-default], | |
2936 | AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]), | |
2937 | [AS_CASE([$enableval], | |
2938 | [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"], | |
2939 | [no], [fs_paths_defaults=""], | |
2940 | [fs_paths_defaults="$enableval"] | |
2941 | )], | |
2942 | [fs_paths_defaults="FS_PATHS_DEFAULT"] | |
2943 | ) | |
2944 | AC_ARG_ENABLE([fs-paths-extra], | |
2945 | AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]), | |
2946 | [AS_CASE([$enableval], | |
2947 | [yes|no], [fs_paths_extra=""], | |
2948 | [fs_paths_extra="$enableval"] | |
2949 | )], | |
2950 | [fs_paths_extra=""] | |
2951 | ) | |
2952 | fs_paths="$fs_paths_defaults" | |
2953 | AS_IF([test "x$fs_paths_extra" != "x"], [ | |
2954 | AS_IF([test "x$fs_paths" != "x"], [ | |
2955 | fs_paths="${fs_paths}:" | |
2956 | ]) | |
2957 | fs_paths="${fs_paths}${fs_paths_extra}" | |
2958 | ]) | |
2959 | AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers]) | |
2960 | ||
2961 | ||
2962 | AC_ARG_ENABLE([use-tty-group], | |
2963 | AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]), | |
2964 | [], [enable_use_tty_group=yes] | |
2965 | ) | |
2966 | AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes]) | |
2967 | ||
2968 | AS_IF([test "x$enable_use_tty_group" = xyes], [ | |
2969 | AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?]) | |
2970 | ]) | |
2971 | ||
2972 | ||
2973 | AC_ARG_ENABLE([sulogin-emergency-mount], | |
2974 | AS_HELP_STRING([--enable-sulogin-emergency-mount], | |
2975 | [use emergency mount of /dev and /proc for sulogin]), | |
2976 | [], [enable_sulogin_emergency_mount=no] | |
2977 | ) | |
2978 | ||
2979 | AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [ | |
2980 | AS_IF([test "x$linux_os" = xyes], [ ], | |
2981 | [AC_MSG_ERROR([--enable-sulogin-emergency-mount selected for non-linux system])]) | |
2982 | AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1], | |
2983 | [Should sulogin use an emergency mount of /dev and /proc?]) | |
2984 | ]) | |
2985 | ||
2986 | ||
2987 | AC_ARG_ENABLE([usrdir-path], | |
2988 | AS_HELP_STRING([--enable-usrdir-path], [use only /usr paths in PATH env. variable (recommended on systems with /bin -> /usr/bin symlinks)]), | |
2989 | [], [enable_usrdir_path=no] | |
2990 | ) | |
2991 | ||
2992 | AS_IF([test "x$enable_usrdir_path" = xyes], [ | |
2993 | AC_DEFINE([USE_USRDIR_PATHS_ONLY], [1], [Define to 1 to remove /bin and /sbin from PATH env.variable]) | |
2994 | ]) | |
2995 | ||
2996 | ||
2997 | AC_ARG_ENABLE([makeinstall-chown], | |
2998 | AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]), | |
2999 | [], [enable_makeinstall_chown=yes] | |
3000 | ) | |
3001 | AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes]) | |
3002 | ||
3003 | ||
3004 | AC_ARG_ENABLE([makeinstall-setuid], | |
3005 | AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]), | |
3006 | [], [enable_makeinstall_setuid=yes] | |
3007 | ) | |
3008 | AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes]) | |
3009 | ||
3010 | ||
3011 | AC_ARG_ENABLE([makeinstall-tty-setgid], | |
3012 | AS_HELP_STRING([--disable-makeinstall-tty-setgid], [do not setgid for wall, and write during "make install"]), | |
3013 | [], [enable_makeinstall_tty_setgid=yes] | |
3014 | ) | |
3015 | AM_CONDITIONAL([MAKEINSTALL_DO_TTY_SETGID], [test "x$enable_makeinstall_tty_setgid" = xyes]) | |
3016 | ||
3017 | ||
3018 | ||
3019 | AC_ARG_ENABLE([colors-default], | |
3020 | AS_HELP_STRING([--disable-colors-default], [do not colorize output from utils by default]), | |
3021 | [], [enable_colors_default=yes] | |
3022 | ) | |
3023 | AS_IF([test "x$enable_colors_default" = xyes], [ | |
3024 | AC_DEFINE([USE_COLORS_BY_DEFAULT], [1], [Enables colorized output from utils by default]) | |
3025 | ]) | |
3026 | ||
3027 | ||
3028 | AC_ARG_WITH([cryptsetup], | |
3029 | AS_HELP_STRING([--with-cryptsetup], [compile with cryptsetup support]), | |
3030 | [], [with_cryptsetup=no] | |
3031 | ) | |
3032 | ||
3033 | AS_IF([test "x$with_cryptsetup" = xno], [ | |
3034 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [false]) | |
3035 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
3036 | ], [ | |
3037 | PKG_CHECK_MODULES([CRYPTSETUP], [libcryptsetup], | |
3038 | [AC_DEFINE([HAVE_CRYPTSETUP], [1], [Define if cryptsetup is available]) | |
3039 | UL_PKG_STATIC([CRYPTSETUP_LIBS_STATIC], [libcryptsetup]) | |
3040 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [true]) | |
3041 | SAVE_CFLAGS="$CFLAGS" | |
3042 | CFLAGS="$CRYPTSETUP_CFLAGS $CFLAGS" | |
3043 | SAVE_LIBS="$LIBS" | |
3044 | LIBS="$CRYPTSETUP_LIBS $LIBS" | |
3045 | AC_CHECK_LIB([cryptsetup], [crypt_activate_by_signed_key], [ | |
3046 | AC_DEFINE([HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY], [1], [Define if crypt_activate_by_signed_key exist in -lcryptsetup]) | |
3047 | ]) | |
3048 | AS_IF([test "x$with_cryptsetup" = xdlopen], [ | |
3049 | LIBS="-ldl $LIBS" | |
3050 | AC_CHECK_LIB([dl], [dlsym], [ | |
3051 | AC_DEFINE([CRYPTSETUP_VIA_DLOPEN], [1], [Define if cryptsetup is to be loaded via dlopen]) | |
3052 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [true]) | |
3053 | ], [AC_MSG_ERROR([libdl required to build with cryptsetup support])]) | |
3054 | ], [ | |
3055 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
3056 | ]) | |
3057 | CFLAGS="$SAVE_CFLAGS" | |
3058 | LIBS="$SAVE_LIBS" | |
3059 | have_cryptsetup=yes], | |
3060 | [have_cryptsetup=no | |
3061 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [false]) | |
3062 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
3063 | ]) | |
3064 | ||
3065 | AS_CASE([$with_cryptsetup:$have_cryptsetup], | |
3066 | [yes:no], [AC_MSG_WARN([cryptsetup selected but libcryptsetup not found])] | |
3067 | ) | |
3068 | ]) | |
3069 | AC_SUBST([CRYPTSETUP_LIBS]) | |
3070 | AC_SUBST([CRYPTSETUP_LIBS_STATIC]) | |
3071 | ||
3072 | ||
3073 | AC_ARG_VAR([SUID_CFLAGS], | |
3074 | [CFLAGS used for binaries which are usually with the suid bit]) | |
3075 | AC_ARG_VAR([SUID_LDFLAGS], | |
3076 | [LDFLAGS used for binaries which are usually with the suid bit]) | |
3077 | ||
3078 | AC_ARG_VAR([DAEMON_CFLAGS], | |
3079 | [CFLAGS used for binaries which are usually executed as daemons]) | |
3080 | AC_ARG_VAR([DAEMON_LDFLAGS], | |
3081 | [LDFLAGS used for binaries which are usually executed as daemons]) | |
3082 | ||
3083 | AC_ARG_VAR([SOLIB_CFLAGS], | |
3084 | [CFLAGS used for shared libraries]) | |
3085 | AC_ARG_VAR([SOLIB_LDFLAGS], | |
3086 | [LDFLAGS used for shared libraries]) | |
3087 | ||
3088 | AC_ARG_VAR([ADJTIME_PATH], | |
3089 | [Path to hwclock adjtime file, default /etc/adjtime]) | |
3090 | AS_IF([test "x$ADJTIME_PATH" = x], [ADJTIME_PATH="/etc/adjtime"]) | |
3091 | AC_DEFINE_UNQUOTED([CONFIG_ADJTIME_PATH], "$ADJTIME_PATH", [Path to hwclock adjtime file]) | |
3092 | ||
3093 | if test "x${build_alias}" != "x${host_alias}"; then | |
3094 | AC_MSG_NOTICE([setting link_all_deplibs=unknown for libtool]) | |
3095 | # work around Debian patch to libtool breaking cross-compiles | |
3096 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702737 | |
3097 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297726 | |
3098 | link_all_deplibs=unknown | |
3099 | fi | |
3100 | ||
3101 | ||
3102 | LIBS="" | |
3103 | ||
3104 | ||
3105 | AC_CONFIG_HEADERS([config.h]) | |
3106 | ||
3107 | # | |
3108 | # Don't use configure.ac to replace install paths! See Makefile PATHFILES for | |
3109 | # more details. | |
3110 | # | |
3111 | AC_CONFIG_FILES([ | |
3112 | Makefile | |
3113 | libblkid/docs/Makefile | |
3114 | libblkid/docs/version.xml | |
3115 | libblkid/src/blkid.h | |
3116 | libfdisk/docs/Makefile | |
3117 | libfdisk/docs/version.xml | |
3118 | libfdisk/src/libfdisk.h | |
3119 | libmount/docs/Makefile | |
3120 | libmount/docs/version.xml | |
3121 | libmount/src/libmount.h | |
3122 | libsmartcols/docs/Makefile | |
3123 | libsmartcols/docs/version.xml | |
3124 | libsmartcols/src/libsmartcols.h | |
3125 | po/Makefile.in | |
3126 | ]) | |
3127 | ||
3128 | AC_OUTPUT | |
3129 | ||
3130 | AC_MSG_RESULT([ | |
3131 | ${PACKAGE} ${VERSION} | |
3132 | ||
3133 | prefix: ${prefix} | |
3134 | exec prefix: ${exec_prefix} | |
3135 | ||
3136 | bindir: ${bindir} | |
3137 | sbindir: ${sbindir} | |
3138 | libdir: ${libdir} | |
3139 | usrbin_execdir: ${usrbin_execdir} | |
3140 | usrsbin_execdir: ${usrsbin_execdir} | |
3141 | usrlib_execdir: ${usrlib_execdir} | |
3142 | ||
3143 | localstatedir: ${localstatedir} | |
3144 | runstatedir: ${runstatedir} | |
3145 | includedir: ${includedir} | |
3146 | sysconfdir: ${sysconfdir} | |
3147 | sysconfstaticdir: ${sysconfstaticdir} | |
3148 | ||
3149 | vendordir: ${with_vendordir} | |
3150 | ||
3151 | Python: ${PYTHON} | |
3152 | Python version: ${PYTHON_VERSION} | |
3153 | Python libs: ${pyexecdir} | |
3154 | ||
3155 | Bash completions: ${with_bashcompletiondir} | |
3156 | Systemd support: ${have_systemd} | |
3157 | Systemd unitdir: ${with_systemdsystemunitdir} | |
3158 | tmpfilesdir: ${with_tmpfilesdir} | |
3159 | libeconf support: ${have_econf} | |
3160 | Btrfs support: ${have_btrfs} | |
3161 | lastlog2 support: ${build_liblastlog2} | |
3162 | Wide-char support: ${build_widechar} | |
3163 | libcryptsetup support: ${have_cryptsetup} | |
3164 | ||
3165 | Manual pages: ${build_asciidoc} | |
3166 | Manual pages translated: ${build_poman} | |
3167 | ||
3168 | compiler: ${CC} / ${CXX} | |
3169 | suid cflags: ${SUID_CFLAGS} | |
3170 | ldflags: ${LDFLAGS} | |
3171 | suid ldflags: ${SUID_LDFLAGS} | |
3172 | ASAN enabled: ${enable_asan} | |
3173 | Fuzzing enabled: ${enable_fuzzing_engine} | |
3174 | Coverage enabled ${enable_coverage} | |
3175 | ||
3176 | cflags: ${CFLAGS} | |
3177 | ||
3178 | warnings: | |
3179 | ||
3180 | ${WARN_CFLAGS} | |
3181 | ||
3182 | Type 'make' or 'make <utilname>' to compile. | |
3183 | ]) |