]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
po: update de.po (from translationproject.org)
[thirdparty/util-linux.git] / configure.ac
CommitLineData
034d378b 1AC_INIT([util-linux],
38c75b59 2 m4_esyscmd([tools/git-version-gen .tarball-version]),
4230b2d4 3 [kzak@redhat.com], [],
5564a8c7 4 [http://www.kernel.org/pub/linux/utils/util-linux/])
baf39af1 5
b0e6b25e 6
4230b2d4 7AC_PREREQ([2.64])
48d7b13a 8
034d378b 9AC_CONFIG_AUX_DIR([config])
b12991dd 10AC_CONFIG_MACRO_DIR([m4])
eaf70198 11dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
4230b2d4 12dnl the compiler (like LT_INIT) to avoid autoconf errors.
eaf70198 13AC_USE_SYSTEM_EXTENSIONS
a527a360 14AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects])
48d7b13a 15
eb35c251 16m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
f06b4328 17 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
316795fc 18m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
eb35c251 19
034d378b 20AC_CONFIG_SRCDIR([sys-utils/mount.c])
15a9b48c
SK
21AC_PREFIX_DEFAULT([/usr])
22
33b0be6d
KZ
23dnl version details from <major>.<minor>[-<suffix>]
24PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
0f0972ac 25PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{
c25b7d8a 26 sub("-.*","",$2); print $2}')
c42a6d4d 27PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
c25b7d8a 28 sub("-.*","",$3); print $3 ~ /^@<:@0-9@:>@+$/ ? $3 : 0}')
a0948ffe 29
33b0be6d
KZ
30dnl libblkid version
31LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
99ec4011 32LIBBLKID_DATE="16-Mar-2022"
dc2b8d87
KZ
33LIBBLKID_LT_MAJOR=1
34LIBBLKID_LT_MINOR=1
35LIBBLKID_LT_MICRO=0
36LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR
a0948ffe 37
f6076f55
KZ
38dnl libuuid version
39LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
dc2b8d87
KZ
40LIBUUID_LT_MAJOR=1
41LIBUUID_LT_MINOR=3
42LIBUUID_LT_MICRO=0
43LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR
f6076f55 44
f1cde479
KZ
45dnl libmount version
46LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
47LIBMOUNT_LT_MAJOR=1
48LIBMOUNT_LT_MINOR=1
49LIBMOUNT_LT_MICRO=0
50LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR
51
1a4d989e
OO
52dnl libsmartcols version
53LIBSMARTCOLS_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
54LIBSMARTCOLS_LT_MAJOR=1
55LIBSMARTCOLS_LT_MINOR=1
56LIBSMARTCOLS_LT_MICRO=0
57LIBSMARTCOLS_VERSION_INFO=`expr $LIBSMARTCOLS_LT_MAJOR + $LIBSMARTCOLS_LT_MINOR`:$LIBSMARTCOLS_LT_MICRO:$LIBSMARTCOLS_LT_MINOR
58
0bb4c979
KZ
59dnl libfdisk version
60LIBFDISK_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
61LIBFDISK_LT_MAJOR=1
62LIBFDISK_LT_MINOR=1
63LIBFDISK_LT_MICRO=0
64LIBFDISK_VERSION_INFO=`expr $LIBFDISK_LT_MAJOR + $LIBFDISK_LT_MINOR`:$LIBFDISK_LT_MICRO:$LIBFDISK_LT_MINOR
65
15a9b48c 66# Check whether exec_prefix=/usr:
9f57e6e8
SK
67AS_CASE([$exec_prefix:$prefix],
68[NONE:NONE | NONE:/usr | /usr:*],
69 [AC_MSG_NOTICE([Default --exec-prefix detected.])
17794746
KZ
70 AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ])
71 AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])])
72 AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ])
f40e316f 73 AS_CASE([$libdir], ['${exec_prefix}/lib64'],[libdir=/lib64; AC_MSG_NOTICE([ --libdir defaults to /lib64]) ])
9f57e6e8
SK
74 ]
75)
76
3d289965
KZ
77# Check whether prefix=/usr
78AS_CASE([$prefix],
79[NONE | /usr],
80 [AC_MSG_NOTICE([Default --prefix detected.])
81 AS_CASE([$localstatedir], [NONE | '${prefix}/var' | "${prefix}"/var ],
82 [localstatedir=/var; AC_MSG_NOTICE([ --localstatedir defaults to /var])])
83 AS_CASE([$sysconfdir], [NONE | '${prefix}/etc' | "${prefix}"/etc ],
84 [sysconfdir=/etc; AC_MSG_NOTICE([ --sysconfdir defaults to /etc])])
85
86 ]
87)
8df54559
AH
88
89# default for old versions without $runstatedir
90AS_IF([test x"$runstatedir" = x], [runstatedir='${localstatedir}/run'])
91
92# our default if $localstatedir unchanged
93AS_CASE([$localstatedir:$runstatedir],
94 [NONE:'${localstatedir}/run' | /var:'${localstatedir}/run' | NONE:'/run' ],
95 [runstatedir=/run; AC_MSG_NOTICE([ --runstatedir defaults to /run])]
9f57e6e8 96)
8df54559
AH
97
98AC_SUBST([runstatedir])
07a16b9d 99
b0a0d7d5 100
996fb358 101# The original default values of {bin,sbin,lib}dir
aaf3e8f5 102usrbin_execdir='${exec_prefix}/bin'
30688dde 103AC_SUBST([usrbin_execdir])
996fb358 104
aaf3e8f5 105usrsbin_execdir='${exec_prefix}/sbin'
30688dde 106AC_SUBST([usrsbin_execdir])
996fb358 107
9f57e6e8 108AS_CASE([$libdir],
b2b61efc 109 ['${exec_prefix}/'* | '${prefix}/'* | /usr/* | "${prefix}"/* ],
9f57e6e8
SK
110 [usrlib_execdir=$libdir],
111 [usrlib_execdir='${exec_prefix}'$libdir]
112)
30688dde 113AC_SUBST([usrlib_execdir])
996fb358 114
c2409b55
KZ
115# static configuration maintaned by packages (e.g. /usr/lib)
116AC_ARG_VAR([SYSCONFSTATICDIR],
117 [Path to static system configuration, default ${prefix}/lib])
118AS_IF([test "x$SYSCONFSTATICDIR" = x],
119 [sysconfstaticdir='${prefix}/lib'],
120 [sysconfstaticdir=$SYSCONFSTATICDIR])
121AC_SUBST([sysconfstaticdir])
122
4230b2d4 123AC_PROG_CC
31c9c1c4 124AM_PROG_CC_C_O
18336d16 125AC_PROG_MKDIR_P
30d7f61f 126AC_PROG_YACC
a6996860 127AC_CANONICAL_HOST
85b4c147 128AC_C_CONST
e79829db 129AC_C_VOLATILE
fbaec83b 130AC_C_BIGENDIAN
b12991dd 131
0e60bc9b 132dnl Compiler warnings
b1b54edf 133UL_WARN_ADD([-fno-common])
9dc72d0b 134UL_WARN_ADD([-Wall])
0e60bc9b 135UL_WARN_ADD([-Wextra])
c25b7d8a
SK
136
137UL_WARN_ADD([-Waddress-of-packed-member])
138UL_WARN_ADD([-Wdiscarded-qualifiers])
4230d576 139UL_WARN_ADD([-Wembedded-directive])
c25b7d8a
SK
140UL_WARN_ADD([-Wextra-semi])
141UL_WARN_ADD([-Wformat-security])
142UL_WARN_ADD([-Wimplicit-function-declaration])
b1b54edf
KZ
143UL_WARN_ADD([-Wmissing-declarations])
144UL_WARN_ADD([-Wmissing-parameter-type])
145UL_WARN_ADD([-Wmissing-prototypes])
c25b7d8a 146UL_WARN_ADD([-Wnested-externs])
0e60bc9b 147UL_WARN_ADD([-Wno-missing-field-initializers])
c25b7d8a 148UL_WARN_ADD([-Wpointer-arith])
b1b54edf 149UL_WARN_ADD([-Wredundant-decls])
0e60bc9b 150UL_WARN_ADD([-Wsign-compare])
c25b7d8a 151UL_WARN_ADD([-Wstrict-prototypes])
0e60bc9b
KZ
152UL_WARN_ADD([-Wtype-limits])
153UL_WARN_ADD([-Wuninitialized])
b1b54edf
KZ
154UL_WARN_ADD([-Wunused-but-set-parameter])
155UL_WARN_ADD([-Wunused-but-set-variable])
0e60bc9b 156UL_WARN_ADD([-Wunused-parameter])
0e60bc9b 157UL_WARN_ADD([-Wunused-result])
bec5c9db 158UL_WARN_ADD([-Wunused-variable])
63c80c4c
KZ
159
160AC_ARG_ENABLE([werror],
161 AS_HELP_STRING([--enable-werror], [make all compiler warnings into errors]),
162 [], [enable_werror=no]
163)
164AS_IF([test "x$enable_werror" = xyes], [
165 UL_WARN_ADD([-Werror])
166],[
167 UL_WARN_ADD([-Werror=sequence-point])
168])
169
0e60bc9b
KZ
170AC_SUBST([WARN_CFLAGS])
171
63c80c4c 172
034d378b 173UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS])
7697771d 174AC_SUBST([BSD_WARN_CFLAGS])
4f9d999a
KZ
175
176UL_WARN_ADD([-Wno-cast-function-type], [PYTHON_WARN_CFLAGS])
177AC_SUBST([PYTHON_WARN_CFLAGS])
178
2013b33f
RM
179UL_WARN_ADD([-Wno-unused-parameter], [NO_UNUSED_WARN_CFLAGS])
180AC_SUBST([NO_UNUSED_WARN_CFLAGS])
7697771d 181
b97cc9a8
KZ
182
183AC_ARG_ENABLE([asan],
184 AS_HELP_STRING([--enable-asan], [compile with Address Sanitizer]),
185 [], [enable_asan=no]
186)
2afbcec5 187AS_IF([test "x$enable_asan" = xyes], [
b97cc9a8 188 UL_WARN_ADD([-fsanitize=address])
ef61c093 189 ASAN_LDFLAGS="-fsanitize=address"
b97cc9a8 190])
ef61c093 191AC_SUBST([ASAN_LDFLAGS])
b97cc9a8 192
e6a4d8cc
EV
193AC_ARG_ENABLE([ubsan],
194 AS_HELP_STRING([--enable-ubsan], [compile with UBsan]),
195 [], [enable_ubsan=no]
196)
197AS_IF([test "x$enable_ubsan" = xyes], [
198 UL_WARN_ADD([-fsanitize=undefined])
199 UBSAN_LDFLAGS="-fsanitize=undefined"
200])
201AC_SUBST([UBSAN_LDFLAGS])
202
ccdc47b7
EV
203AC_ARG_ENABLE([fuzzing-engine],
204 AS_HELP_STRING([--enable-fuzzing-engine], [compile with fuzzing engine]),
205 [], [enable_fuzzing_engine=no]
206)
948182f4 207AS_IF([test "x$enable_fuzzing_engine" = xyes && test "x$LIB_FUZZING_ENGINE" = x], [
75196cd8
EV
208 UL_WARN_ADD([-fno-omit-frame-pointer])
209 UL_WARN_ADD([-gline-tables-only])
210 UL_WARN_ADD([-fsanitize=fuzzer-no-link])
211 FUZZING_ENGINE_LDFLAGS="-fsanitize=fuzzer-no-link"
212])
213AC_SUBST([FUZZING_ENGINE_LDFLAGS])
ccdc47b7 214AC_PROG_CXX
75196cd8
EV
215AM_CONDITIONAL([FUZZING_ENGINE], [test "x$enable_fuzzing_engine" = xyes])
216AM_CONDITIONAL([OSS_FUZZ], [test "x$LIB_FUZZING_ENGINE" != x])
ccdc47b7 217
b12991dd
KZ
218dnl libtool-2
219LT_INIT
48d7b13a 220
3719bf8d
RM
221dnl check supported linker flags
222AX_CHECK_VSCRIPT
223
fd0f4132
SK
224m4_ifndef([PKG_PROG_PKG_CONFIG],
225 [m4_fatal([Could not locate the pkg-config autoconf
226 macros. These are usually located in /usr/share/aclocal/pkg.m4.
227 If your macros are in a different location, try setting the
228 environment variable AL_OPTS="-I/other/macro/dir" before running
bf2603c7 229 ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])])
d06d028a 230PKG_PROG_PKG_CONFIG
99f95a1e 231PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig'])
d06d028a 232
22aa5166
KZ
233GTK_DOC_CHECK([1.10])
234AC_PATH_PROG([XSLTPROC], [xsltproc])
236421a4
KZ
235
236
8c182554 237linux_os=no
8026fa9b
KZ
238bsd_os=no
239AS_CASE([${host_os}],
240 [*linux*],
241 [linux_os=yes],
40733239
RM
242 [*darwin*],
243 [darwin_os=yes],
8026fa9b
KZ
244 [*bsd*],
245 [bsd_os=yes])
034d378b 246AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes])
40733239 247AM_CONDITIONAL([DARWIN], [test "x$darwin_os" = xyes])
8026fa9b
KZ
248AM_CONDITIONAL([BSD], [test "x$bsd_os" = xyes])
249
40733239
RM
250AS_IF([test "x$darwin_os" = xyes], [
251 AC_DEFINE([_DARWIN_C_SOURCE], [1], [Enable MAP_ANON in sys/mman.h on Mac OS X])
252])
8c182554 253
3c6e292c 254dnl define ARCH_<NAME> conditionals
034d378b
SK
255UL_SET_ARCH([I86], [i?86-*])
256UL_SET_ARCH([86_64], [x86_64*])
257UL_SET_ARCH([IA64], [ia64*])
258UL_SET_ARCH([S390], [s390*])
259UL_SET_ARCH([SPARC], [sparc*])
260UL_SET_ARCH([PPC], [ppc*|powerpc*])
261UL_SET_ARCH([M68K], [m68*])
262UL_SET_ARCH([MIPS], [mips*])
f319e301 263UL_SET_ARCH([HPPA], [hppa*|parisc*])
3c6e292c 264
48d7b13a 265AC_SYS_LARGEFILE
2c656779 266AC_HEADER_ASSERT
f69eba17 267AC_STRUCT_TIMEZONE
48d7b13a 268
f8d75a66 269dnl Don't forget to maintain alternatively allowed versions in autogen.sh!
91c520bc 270AM_GNU_GETTEXT_VERSION([0.18.3])
09734b00 271AM_GNU_GETTEXT([external])
3013eb9d
SK
272
273AS_IF([test -d "$srcdir/po"], [
274 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
c25b7d8a
SK
275], [dnl echo $ALL_LINGUAS | sed 's/ /\n/g' | sort -u | column -xc 72 -o ' ' | sed 's/^/\t/'
276 ALL_LINGUAS="
277 af am ar as be bg bn bn_IN ca
278 cs cy da de el en_GB es et eu_ES
279 fa fi fr gl gu he hi hr hu
280 hy id is it ja ka kn ko ku
281 lo lt lv mk ml mr ms my nb
282 nl nn no nso or pa pl pt pt_BR
283 ro ru si sk sl sq sr sr@Latn sv
284 ta te th tr uk ur vi zh_CN zh_TW
285 zu
286"])
09734b00 287
e460a5bf 288AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
48d7b13a
KZ
289#ifdef HAVE_LINUX_COMPILER_H
290#include <linux/compiler.h>
291#endif
292])
f06b4328
SK
293AC_CHECK_HEADERS([ \
294 asm/io.h \
c25b7d8a
SK
295 byteswap.h \
296 endian.h \
f06b4328 297 err.h \
a0948ffe 298 errno.h \
f06b4328 299 fcntl.h \
a0948ffe 300 getopt.h \
f06b4328 301 inttypes.h \
6578ced7 302 lastlog.h \
77835be2 303 libutil.h \
647f80e4 304 linux/blkzoned.h \
5a971329 305 linux/btrfs.h \
c25b7d8a 306 linux/capability.h \
f06b4328
SK
307 linux/cdrom.h \
308 linux/falloc.h \
a0948ffe 309 linux/fd.h \
c25b7d8a 310 linux/fiemap.h \
f4d700d7 311 linux/kcmp.h \
c25b7d8a 312 linux/net_namespace.h \
d652d4c6 313 linux/nsfs.h \
f06b4328 314 linux/raw.h \
c25b7d8a 315 linux/securebits.h \
a0948ffe
KZ
316 linux/tiocl.h \
317 linux/version.h \
c25b7d8a 318 linux/watchdog.h \
259bed15 319 linux/if_alg.h \
8b7f16fc 320 locale.h \
607c2a72 321 mntent.h \
754fed0c 322 net/if_dl.h \
c25b7d8a 323 net/if.h \
f06b4328
SK
324 netinet/in.h \
325 paths.h \
326 pty.h \
fe2c9909 327 security/pam_appl.h \
c25b7d8a 328 shadow.h \
f06b4328 329 stdint.h \
78288764 330 stdio_ext.h \
a0948ffe
KZ
331 stdlib.h \
332 sys/disk.h \
333 sys/disklabel.h \
c25b7d8a 334 sys/endian.h \
f06b4328 335 sys/file.h \
f06b4328
SK
336 sys/ioccom.h \
337 sys/ioctl.h \
c25b7d8a 338 sys/io.h \
a0948ffe 339 sys/mkdev.h \
ac1c53e4 340 sys/mount.h \
4ebac79f 341 sys/param.h \
a0948ffe 342 sys/prctl.h \
f06b4328 343 sys/resource.h \
c25b7d8a 344 sys/sendfile.h \
651b25cd 345 sys/signalfd.h \
2a7c1f70 346 sys/socket.h \
f06b4328 347 sys/sockio.h \
a0948ffe 348 sys/stat.h \
f06b4328
SK
349 sys/swap.h \
350 sys/syscall.h \
c25b7d8a 351 sys/sysmacros.h \
f06b4328 352 sys/time.h \
87ee2658 353 sys/timex.h \
00c505d9 354 sys/ttydefaults.h \
a0948ffe 355 sys/types.h \
ac1c53e4 356 sys/ucred.h \
754fed0c 357 sys/un.h \
40b119b9 358 sys/xattr.h \
f06b4328 359 unistd.h \
77835be2 360 utmp.h \
b4b919fe 361 utmpx.h \
f06b4328 362])
dc61d398 363
a0357292
KZ
364# There is a collision in old kernel-headers. The both files mount.h and fs.h
365# define MS_* macros. Fixed by kernel commit e462ec50cb5fad19f6003a3d8087f4a0945dd2b1.
366#
367AC_CHECK_HEADERS([linux/fs.h ], [], [],
368 [#ifdef HAVE_SYS_MOUNT_H
369 # include <linux/fs.h>
370 # include <sys/mount.h>
371 #endif
372])
373
db4e2645
KZ
374AC_CHECK_HEADERS([linux/gsmmux.h ], [], [],
375 [#ifdef LINUX_GSMMUX_H
376 # include <linux/gsmmux.h>
377 #endif
378])
379
fe2c9909
WJ
380AC_CHECK_HEADERS([security/pam_misc.h],
381 [AM_CONDITIONAL([HAVE_LINUXPAM], [true])],
382 [AM_CONDITIONAL([HAVE_LINUXPAM], [false])], [
383#ifdef HAVE_SECURITY_PAM_APPL_H
384#include <security/pam_appl.h>
385#endif
386])
387
e5ad3a6a
SK
388AC_CHECK_DECLS([BLK_ZONE_REP_CAPACITY], [], [], [
389 #include <linux/blkzoned.h>
390])
391
fe2c9909
WJ
392AC_CHECK_HEADERS([security/openpam.h], [], [], [
393#ifdef HAVE_SECURITY_PAM_APPL_H
394#include <security/pam_appl.h>
395#endif
396])
397
a67387b7 398AC_CHECK_HEADERS([langinfo.h],
ac660b80
ZJS
399 [AM_CONDITIONAL([HAVE_LANGINFO_H], [true])],
400 [AM_CONDITIONAL([HAVE_LANGINFO_H], [false])])
a67387b7 401
4e12a62e
RL
402AC_MSG_CHECKING([whether langinfo.h defines ALTMON_x constants])
403AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
404 #include <langinfo.h>
405]], [[
406 char *str;
407 str = nl_langinfo (ALTMON_1);
408 str = nl_langinfo (ALTMON_2);
409 str = nl_langinfo (ALTMON_3);
410 str = nl_langinfo (ALTMON_4);
411 str = nl_langinfo (ALTMON_5);
412 str = nl_langinfo (ALTMON_6);
413 str = nl_langinfo (ALTMON_7);
414 str = nl_langinfo (ALTMON_8);
415 str = nl_langinfo (ALTMON_9);
416 str = nl_langinfo (ALTMON_10);
417 str = nl_langinfo (ALTMON_11);
418 str = nl_langinfo (ALTMON_12);
419]])], [
420 AC_MSG_RESULT([yes])
421 AC_DEFINE([HAVE_LANGINFO_ALTMON], [1],
422 [Define if langinfo.h defines ALTMON_x constants])
423], [
424 AC_MSG_RESULT([no])
425])
426
427
428AC_MSG_CHECKING([whether langinfo.h defines _NL_ABALTMON_x constants])
429AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
430 #include <langinfo.h>
431]], [[
432 char *str;
433 str = nl_langinfo (_NL_ABALTMON_1);
434 str = nl_langinfo (_NL_ABALTMON_2);
435 str = nl_langinfo (_NL_ABALTMON_3);
436 str = nl_langinfo (_NL_ABALTMON_4);
437 str = nl_langinfo (_NL_ABALTMON_5);
438 str = nl_langinfo (_NL_ABALTMON_6);
439 str = nl_langinfo (_NL_ABALTMON_7);
440 str = nl_langinfo (_NL_ABALTMON_8);
441 str = nl_langinfo (_NL_ABALTMON_9);
442 str = nl_langinfo (_NL_ABALTMON_10);
443 str = nl_langinfo (_NL_ABALTMON_11);
444 str = nl_langinfo (_NL_ABALTMON_12);
445]])], [
446 AC_MSG_RESULT([yes])
447 AC_DEFINE([HAVE_LANGINFO_NL_ABALTMON], [1],
448 [Define if langinfo.h defines _NL_ABALTMON_x constants])
449], [
450 AC_MSG_RESULT([no])
451])
452
453
16ba8d58
KZ
454dnl Convert some ac_cv_header_* variables to have_*
455dnl
70bb5345 456have_linux_blkzoned_h=$ac_cv_header_linux_blkzoned_h
5a971329 457have_linux_btrfs_h=$ac_cv_header_linux_btrfs_h
c25b7d8a 458have_linux_capability_h=$ac_cv_header_linux_capability_h
f4d700d7 459have_linux_kcmp_h=$ac_cv_header_linux_kcmp_h
16ba8d58 460have_linux_raw_h=$ac_cv_header_linux_raw_h
48469f90 461have_linux_securebits_h=$ac_cv_header_linux_securebits_h
c25b7d8a 462have_linux_version_h=$ac_cv_header_linux_version_h
5b0289b9 463have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
c25b7d8a
SK
464have_pty_h=$ac_cv_header_pty_h
465have_security_openpam_h=$ac_cv_header_security_openpam_h
fe2c9909 466have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h
ff0cb84d 467have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
d00c10ed 468have_shadow_h=$ac_cv_header_shadow_h
651b25cd 469have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h
b4b919fe 470have_utmpx_h=$ac_cv_header_utmpx_h
94c8821b 471have_mntent_h=$ac_cv_header_mntent_h
a67387b7 472
8a931412
KZ
473AS_CASE([$linux_os:$have_linux_version_h],
474 [yes:no],
475 [AC_MSG_ERROR([kernel headers required on Linux])]
476)
477
a67387b7
KZ
478AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
479#include <time.h>
480#include <unistd.h>
481]], [[
482 int a = 0;
483 struct tm *tm = localtime(0);
484 if (a == -1) /* false */
f06b4328 485 sleep(tm->tm_gmtoff);
a67387b7 486]])],
034d378b 487[AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
a67387b7
KZ
488])
489
490AC_CHECK_MEMBERS([struct termios.c_line],,,
491 [[#include <termios.h>]])
492
493AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
494 [#include <sys/stat.h>])
495
a88057d9
TP
496AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
497
0e9b73d3 498AC_CHECK_DECL([environ],
034d378b 499 [AC_DEFINE([HAVE_ENVIRON_DECL], [1],
0e9b73d3
SK
500 [Define to 1 if have **environ prototype])],
501)
502
503AC_CHECK_DECL([strsignal],
034d378b 504 [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1],
0e9b73d3
SK
505 [Define to 1 if have strsignal function prototype])],
506)
507
1eb16fd7
KZ
508AC_CHECK_DECL([TIOCGLCKTRMIOS],
509 [have_tiocglcktrmios=yes], [have_tiocglcktrmios=no],
c25b7d8a 510 [#include <sys/ioctl.h>])
1eb16fd7
KZ
511AC_CHECK_DECL([SOCK_CLOEXEC],
512 [have_sock_cloexec=yes], [have_sock_cloexec=no],
513 [#include <sys/types.h>
c25b7d8a 514 #include <sys/socket.h>])
1eb16fd7
KZ
515AC_CHECK_DECL([SOCK_NONBLOCK],
516 [have_sock_nonblock=yes], [have_sock_nonblock=no],
517 [#include <sys/types.h>
c25b7d8a 518 #include <sys/socket.h>])
1eb16fd7
KZ
519AC_CHECK_DECL([SO_PASSCRED],
520 [have_so_passcred=yes], [have_so_passcred=no],
521 [#include <sys/types.h>
c25b7d8a 522 #include <sys/socket.h>])
1eb16fd7 523
f06b4328 524AC_CHECK_FUNCS([ \
75efef98 525 clearenv \
f0649c0d 526 close_range \
c08396c7 527 eaccess \
eb76ca98
FG
528 err \
529 errx \
87583438 530 explicit_bzero \
c25b7d8a
SK
531 __fpending \
532 __fpurge \
533 fpurge \
bf962c0a
SK
534 fsync \
535 getdomainname \
f06b4328
SK
536 getdtablesize \
537 getexecname \
538 getmntinfo \
cc01c2dc 539 getrandom \
f06b4328 540 getrlimit \
c829aebc 541 getsgnam \
1cf6e936 542 getttynam \
f06b4328 543 inotify_init \
3ac22f7a 544 jrand48 \
bf962c0a 545 lchown \
3854515c
KZ
546 lgetxattr \
547 llistxattr \
a0948ffe 548 llseek \
670b10ae 549 newlocale \
02887b73 550 mempcpy \
4d751c00 551 mkostemp \
f06b4328 552 nanosleep \
7d3a07d8 553 ntp_gettime \
f06b4328 554 personality \
6e6b9a1d
SK
555 pidfd_open \
556 pidfd_send_signal \
f06b4328
SK
557 posix_fadvise \
558 prctl \
9c7955da 559 qsort_r \
f06b4328 560 rpmatch \
485a8bfa 561 scandirat \
c25b7d8a
SK
562 sched_setattr \
563 sched_setscheduler \
564 __secure_getenv \
565 secure_getenv \
360cdaa6 566 sendfile \
30fbf2f6 567 setprogname \
69045d3d
KZ
568 setresgid \
569 setresuid \
f06b4328
SK
570 sigqueue \
571 srandom \
572 strnchr \
69b7e41e
KZ
573 strndup \
574 strnlen \
670b10ae 575 strtod_l \
f06b4328 576 sysconf \
88e0f3df 577 sysinfo \
b72a75e9 578 timegm \
f06b4328 579 usleep \
670b10ae 580 uselocale \
c25b7d8a 581 utimensat \
31f85fce 582 vwarnx \
eb76ca98
FG
583 warn \
584 warnx \
f06b4328 585])
48d7b13a 586AC_FUNC_FSEEKO
48d7b13a 587
90d5285d 588AC_CHECK_FUNCS([futimens], [have_futimens=yes])
c25b7d8a 589AC_CHECK_FUNCS([getusershell], [have_getusershell=yes],[have_getusershell=no])
90d5285d 590AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes])
c25b7d8a
SK
591AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
592AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
f9c4d138 593AC_CHECK_FUNCS([open_memstream], [have_open_memstream=yes],[have_open_memstream=no])
e52b58e6 594AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no])
227ebea7 595AC_CHECK_FUNCS([updwtmpx updwtmpx], [have_gnu_utmpx=yes], [have_gnu_utmpx=no])
465e9973 596
dc049516
RM
597AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes])
598
7a3b35b9
KZ
599have_setns_syscall="yes"
600UL_CHECK_SYSCALL([setns])
601AS_IF([test "x$ul_cv_syscall_setns" = xno], [
602 have_setns_syscall="no"
603])
feda4342 604
6e6b9a1d
SK
605UL_CHECK_SYSCALL([pidfd_open])
606UL_CHECK_SYSCALL([pidfd_send_signal])
f0649c0d 607UL_CHECK_SYSCALL([close_range])
6e6b9a1d 608
feda4342
KZ
609AC_CHECK_FUNCS([isnan], [],
610 [AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])]
4953018e 611 [AC_CHECK_LIB([m], [__isnan], [MATH_LIBS="-lm"])]
feda4342
KZ
612)
613AC_SUBST([MATH_LIBS])
614
615
378543e1 616dnl lib/mononotic.c may require -lrt
254743e4
KZ
617AC_CHECK_FUNCS([clock_gettime], [],
618 [AC_CHECK_LIB([rt], [clock_gettime], [REALTIME_LIBS="-lrt"])]
619)
bd9b94d1 620
254743e4 621have_timer="no"
f07a82c9 622AC_CHECK_FUNCS([timer_create],
7944a03c 623 [have_timer="yes"],
254743e4
KZ
624 [AC_CHECK_LIB([rt], [timer_create], [
625 have_timer="yes"
626 REALTIME_LIBS="-lrt"
9a558f9c 627 AC_DEFINE_UNQUOTED([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt])
bf6be9f5
LT
628 ],[
629 AC_SEARCH_LIBS([timer_create], [rt], [
630 AC_MSG_RESULT(yes)
631 have_timer="yes"
632 REALTIME_LIBS="-lrt -lpthread"
9a558f9c 633 AC_DEFINE_UNQUOTED([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt -lpthread])
bf6be9f5
LT
634 ],[], [-lpthread]
635 )
9a558f9c 636 ])]
254743e4 637)
8fc4a886 638
f07a82c9
KZ
639AC_SUBST([REALTIME_LIBS])
640
6df5acf9
KZ
641AS_IF([test x"$have_timer" = xno], [
642 AC_CHECK_FUNCS([setitimer], [have_timer="yes"], [have_timer="no"])
643])
644
f07a82c9
KZ
645
646AC_CHECK_LIB([rtas], [rtas_get_sysparm], [
647 RTAS_LIBS="-lrtas"
648 AC_DEFINE_UNQUOTED([HAVE_LIBRTAS], [1], [Define if librtas exists]), [],
649])
650AC_SUBST([RTAS_LIBS])
651
8fc4a886 652
034d378b
SK
653AC_CHECK_MEMBER([struct sockaddr.sa_len],
654 AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
754fed0c
KZ
655 [#include <sys/types.h>
656 #include <sys/socket.h>])
657
60cc9f94 658SOCKET_LIBS=
60cc9f94 659AC_SEARCH_LIBS([socket], [socket],
3013eb9d
SK
660 [AS_IF([test x"$ac_cv_search_socket" != x"none required"],
661 [SOCKET_LIBS="$SOCKET_LIBS -lsocket"])
662])
60cc9f94
FG
663AC_SUBST([SOCKET_LIBS])
664
d58c47d9
FG
665
666have_dirfd=no
667AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
3013eb9d 668AS_IF([test x"$have_dirfd" = xno], [
d58c47d9
FG
669 AC_CHECK_DECLS([dirfd],
670 [have_dirfd=yes], [have_dirfd=no],
671 [#include <sys/types.h>
672 #include <dirent.h>])
3013eb9d 673])
d58c47d9
FG
674
675have_ddfd=no
3013eb9d 676AS_IF([test x"$have_dirfd" = xno], [
d58c47d9
FG
677 AC_CHECK_MEMBERS([DIR.dd_fd],
678 [have_ddfd=yes], [have_ddfd=no],
679 [#include <sys/types.h>
680 #include <dirent.h>])
3013eb9d 681])
d58c47d9 682
948182f4 683AM_CONDITIONAL([HAVE_DIRFD], [test "x$have_dirfd" = xyes || test "x$have_ddfd" = xyes])
d58c47d9
FG
684
685
d6abf168
SK
686AC_MSG_CHECKING([whether program_invocation_short_name is defined])
687AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
37edac9a 688 #include <errno.h>
d6abf168
SK
689]], [[
690 program_invocation_short_name = "test";
691]])], [
692 AC_MSG_RESULT([yes])
693 AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
694 [Define if program_invocation_short_name is defined])
695], [
696 AC_MSG_RESULT([no])
697])
698
a804f444
FG
699
700AC_MSG_CHECKING([whether __progname is defined])
701AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;],
cf582a2e 702 [if (*__progname == 0) return 1;])],
034d378b
SK
703 AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined])
704 AC_MSG_RESULT([yes]),
705 AC_MSG_RESULT([no]))
a804f444 706
8569410c 707dnl Static compilation
c25b7d8a 708m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, sfdisk, umount, unshare])
8569410c
SK
709
710AC_ARG_ENABLE([static-programs],
711 [AS_HELP_STRING([--enable-static-programs=LIST],
712 [link static the programs in LIST (comma-separated,
132ea941 713 supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])])
8569410c 714
9f57e6e8
SK
715AS_CASE([$enable_static_programs],
716 [yes],
d924b10b 717 [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)],
9f57e6e8
SK
718 [no],
719 [enable_static_programs=]
720)
8569410c 721
8569410c 722dnl Set all the individual AM_CONDITIONALs
132ea941 723m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
9f57e6e8
SK
724 AS_CASE([,$enable_static_programs,],
725 [*,UL_PRG,*], [static_[]UL_PRG=yes]
726 )
d924b10b 727 AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])])
132ea941
KZ
728 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG),
729 [test "x$static_[]UL_PRG" = xyes])
8569410c
SK
730])
731
08b1c219
KZ
732
733AC_ARG_ENABLE([all-programs],
734 AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]),
735 [], [enable_all_programs=undefined]
736)
737
738AS_CASE([$enable_all_programs],
7477f356 739 [yes], [AC_MSG_WARN([force to build all programs by default])
c25b7d8a 740 ul_default_estate=check],
22a900a9 741 [no], [AC_MSG_WARN([disable all programs and man pages by default])
c25b7d8a 742 ul_default_estate=no]
08b1c219
KZ
743)
744
745
22a900a9
KZ
746AC_ARG_ENABLE([asciidoc],
747 AS_HELP_STRING([--disable-asciidoc], [do not generate man pages from asciidoc]),
748 [], [UL_DEFAULT_ENABLE([asciidoc], [check])]
749)
750UL_BUILD_INIT([asciidoc])
751UL_REQUIRES_PROGRAM([asciidoc], [ASCIIDOCTOR], [asciidoctor], [man pages])
752AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$build_asciidoc" = xyes])
753
1a30b2bd
KZ
754have_manpages=no
755AS_IF([test -f "$srcdir/sys-utils/mount.8"], [
756 AC_MSG_NOTICE([re-use already generated man-pages.])
757 have_manpages=yes]
758)
759AM_CONDITIONAL([HAVE_MANPAGES], [test "x$have_manpages" = xyes])
760
22a900a9 761
8f5fff53
KZ
762AC_ARG_ENABLE([poman],
763 AS_HELP_STRING([--enable-poman], [generate translated man pages]),
a73035dc 764 [], [enable_poman=no]
8f5fff53
KZ
765)
766UL_BUILD_INIT([poman])
767UL_REQUIRES_PROGRAM([poman], [PO4A], [po4a], [translated man pages])
5e42ec32 768AM_CONDITIONAL([ENABLE_POMAN], [test "x$build_poman" = xyes])
8f5fff53
KZ
769
770
d7a01582 771AX_CHECK_TLS
3ac22f7a 772
37a11e1a 773have_pty=no
17d71034
KZ
774AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]),
775 [], [with_util=auto]
776)
777AS_IF([test "x$with_util" = xno], [
778 AM_CONDITIONAL([HAVE_UTIL], [false])
779 have_util=no
780], [
781 UL_CHECK_LIB([util], [openpty])
782])
783
948182f4 784AS_IF([test "x$have_pty_h" = xyes && test "x$have_sys_signalfd_h" = xyes && test "x$have_util" = xyes], [
6954895c
KZ
785 AM_CONDITIONAL([HAVE_PTY], [true])
786 AC_DEFINE([HAVE_PTY], [1], [have PTY support])
37a11e1a 787 have_pty=yes
6954895c
KZ
788], [
789 AM_CONDITIONAL([HAVE_PTY], [false])
790])
17d71034 791
3aecf79d
KZ
792AC_CHECK_TYPES([union semun], [], [], [[
793#include <sys/sem.h>
794]])
034d378b 795AC_CHECK_TYPES([loff_t])
3aecf79d 796
4cb6fea5
KZ
797
798AC_ARG_ENABLE([widechar],
799 AS_HELP_STRING([--disable-widechar], [do not compile wide character support]),
800 [], [enable_widechar=check]
801)
802UL_BUILD_INIT([widechar])
803UL_REQUIRES_COMPILE([widechar], [[
804 #include <wchar.h>
805 #include <wctype.h>
806 #include <stdio.h>
1632856e 807 #include <stdlib.h>
4cb6fea5
KZ
808 ]], [[
809 wchar_t wc;
810 wint_t w;
811 w = fgetwc(stdin);
812 if (w == WEOF) exit(1);
813 wc = w;
814 fputwc(wc,stdout);
815 ]],
816 [wchar_t support])
817
818AS_IF([test "x$build_widechar" = xyes ], [
819 AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?])
3aecf79d
KZ
820])
821
4cb6fea5 822
3aecf79d
KZ
823AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
824#include <sched.h>
825]])
826
034d378b 827AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes])
3aecf79d 828
b09bc508
MF
829AC_CHECK_TYPES([sighandler_t], [], [], [[
830#include <signal.h>
831]])
832
3aecf79d
KZ
833AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
834#include <sched.h>
835]])
836
8d35bdc9 837# on Solaris, you can't mix and match standards, since we use c99
218b1dd6 838# apparently at this stage, XOPEN_SOURCE will conflict. As workaround,
8d35bdc9 839# check for crypt.h and use that without XOPEN_SOURCE.
8229ed2f 840have_crypt=no
8d35bdc9
KZ
841AC_CHECK_HEADERS([crypt.h])
842AC_LINK_IFELSE([AC_LANG_PROGRAM([[
843#ifdef HAVE_CRYPT_H
844#include <crypt.h>
845#else
846#define _XOPEN_SOURCE
847#include <unistd.h>
848#endif
849]], [[
850char *c = crypt("abc","pw");
70c364b4
JN
851]])],[
852 have_libcrypt=no
853 have_crypt=yes
854],[
75cba8d5 855 UL_SET_LIBS([-lcrypt])
637cc045 856 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
8d35bdc9
KZ
857 #ifdef HAVE_CRYPT_H
858 #include <crypt.h>
859 #else
860 #define _XOPEN_SOURCE
861 #include <unistd.h>
862 #endif
863 ]], [[
864 char *c = crypt("abc","pw");
865 ]])],[
8d35bdc9 866 have_libcrypt=yes
8229ed2f 867 have_crypt=yes
8d35bdc9 868 ],[
8229ed2f 869 AC_MSG_WARN([crypt() is not available])
8d35bdc9 870 ])
75cba8d5 871 UL_RESTORE_LIBS
8d35bdc9 872])
034d378b 873AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
8d35bdc9 874
13f5473e 875
75ad4910
KZ
876AC_ARG_WITH([selinux],
877 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
034d378b 878 [], [with_selinux=no]
75ad4910
KZ
879)
880
3013eb9d 881AS_IF([test "x$with_selinux" = xno], [
034d378b 882 AM_CONDITIONAL([HAVE_SELINUX], [false])
3013eb9d 883], [
ca27216a 884 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.5], [have_selinux=yes], [have_selinux=no])
9f57e6e8
SK
885 AS_CASE([$with_selinux:$have_selinux],
886 [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])]
887 )
3013eb9d 888 AS_IF([test "x$have_selinux" = xyes], [
1468eda6
KZ
889 AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available])
890 UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
891 AM_CONDITIONAL([HAVE_SELINUX], [true])
892
75cba8d5 893 UL_SET_LIBS([$SELINUX_LIBS])
312f04f4
KZ
894 # This function is missing in old libselinux 1.xx versions
895 AC_CHECK_FUNCS([security_get_initial_context])
75cba8d5 896 UL_RESTORE_LIBS
3013eb9d
SK
897 ])
898])
75ad4910
KZ
899AC_SUBST([SELINUX_LIBS])
900AC_SUBST([SELINUX_LIBS_STATIC])
901
0273afda 902
75ad4910
KZ
903AC_ARG_WITH([audit],
904 AS_HELP_STRING([--with-audit], [compile with audit support]),
034d378b 905 [], [with_audit=no]
75ad4910
KZ
906)
907
3013eb9d 908AS_IF([test "x$with_audit" = xno], [
034d378b 909 AM_CONDITIONAL([HAVE_AUDIT], [false])
3013eb9d 910], [
034d378b 911 UL_CHECK_LIB([audit], [audit_log_user_message])
9f57e6e8
SK
912 AS_CASE([$with_audit:$have_audit],
913 [yes:no],
914 [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])]
915 )
3013eb9d 916])
75ad4910
KZ
917
918AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]),
034d378b 919 [], [with_udev=auto]
75ad4910
KZ
920)
921
3013eb9d 922AS_IF([test "x$with_udev" = xno], [
034d378b 923 AM_CONDITIONAL([HAVE_UDEV], [false])
3013eb9d 924], [
034d378b 925 UL_CHECK_LIB([udev], [udev_new])
9f57e6e8
SK
926 AS_CASE([$with_udev:$have_udev],
927 [yes:no],
928 [AC_MSG_ERROR([udev selected but libudev not found])]
929 )
3013eb9d 930])
75ad4910 931
2b8f22bd 932
4ffcc7a9
KZ
933dnl wide-char ncurses
934AC_ARG_WITH([ncursesw],
95a89bd3 935 AS_HELP_STRING([--without-ncursesw], [do not build with wide-char ncurses]),
4ffcc7a9
KZ
936 [], [with_ncursesw=auto]
937)
938have_ncursesw=no
3cc8a9f4 939have_ncursesw_header=no
4ffcc7a9 940AS_IF([test "x$with_ncursesw" != xno], [
e5cc93b5
KZ
941 UL_NCURSES_CHECK([ncursesw])
942 AS_IF([test "x$have_ncursesw" = xyes], [
3947ca4c
KZ
943 AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes])
944 AC_CHECK_HEADERS([ncursesw/term.h])
87c26ce5
KZ
945
946 # Define HAVE_NCURSES_H only if check for HAVE_NCURSESW_NCURSES_H is
947 # unsuccessful to avoid too many *_H permitations in config.h
948 AS_IF([test "x$have_ncursesw_header" = xno], [
949 AC_CHECK_HEADERS([ncurses.h], [have_ncursesw_header=yes])
950 AC_CHECK_HEADERS([term.h])
951 ])
3cc8a9f4
KZ
952 AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no])
953 ])
954 AS_IF([test "x$have_ncursesw" = xyes], [
f1512be8 955 CURSES_LIB_NAME="ncursesw"
3cc8a9f4 956 AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available])
e5cc93b5 957 ])
4ffcc7a9
KZ
958])
959AS_CASE([$with_ncursesw:$have_ncursesw],
960 [yes:no], [AC_MSG_ERROR([ncursesw selected, but library not found])])
2b8f22bd 961
43cc76e2 962
4ffcc7a9
KZ
963dnl non-wide ncurses
964AC_ARG_WITH([ncurses],
95a89bd3 965 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses]),
4ffcc7a9
KZ
966 [], [with_ncurses=auto]
967)
968have_ncurses=no
3cc8a9f4 969have_ncurses_header=no
18dae5d8
KZ
970AS_CASE([$with_ncurses:$build_widechar],
971 [yes:yes], [AC_MSG_ERROR([wide-char support enabled, but non-wide ncurses selects])])
972
948182f4 973AS_IF([test "x$have_ncursesw" = xno && test "x$with_ncurses" != xno ], [
e5cc93b5
KZ
974 UL_NCURSES_CHECK([ncurses])
975 AS_IF([test "x$have_ncurses" = xyes], [
87c26ce5
KZ
976 AC_CHECK_HEADERS([ncurses/ncurses.h], [have_ncurses_header=yes])
977 AC_CHECK_HEADERS([ncurses/term.h])
978
979 # Define HAVE_NCURSES_H only if check for HAVE_NCURSES_NCURSES_H is
980 # unsuccessful to avoid too many *_H permitations in config.h
981 AS_IF([test "x$have_ncurses_header" = xno], [
982 AC_CHECK_HEADERS([ncurses.h], [have_ncurses_header=yes])
983 AC_CHECK_HEADERS([term.h])
984 ])
3cc8a9f4
KZ
985 AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no])
986 ])
987 AS_IF([test "x$have_ncurses" = xyes], [
4ffcc7a9 988 CURSES_LIB_NAME="ncurses"
3cc8a9f4 989 AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available])
e5cc93b5 990 ])
3013eb9d 991])
4ffcc7a9
KZ
992AS_CASE([$with_ncurses:$have_ncurses],
993 [yes:no], [AC_MSG_ERROR([ncurses selected, but library not found])])
994
2b8f22bd 995AC_SUBST([NCURSES_CFLAGS])
75ad4910 996AC_SUBST([NCURSES_LIBS])
948182f4 997AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes])
75ad4910
KZ
998
999
1000AC_ARG_WITH([slang],
4ffcc7a9 1001 AS_HELP_STRING([--with-slang], [compile cfdisk with slang rather than ncurses]),
034d378b 1002 [], [with_slang=no]
75ad4910 1003)
50ea6795 1004have_slang=no
3013eb9d 1005AS_IF([test "x$with_slang" = xyes], [
75ad4910
KZ
1006 AC_CHECK_HEADERS([slang.h slang/slang.h])
1007 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
50ea6795 1008 [have_slang=yes], [], [
75ad4910
KZ
1009#ifdef HAVE_SLANG_H
1010#include <slang.h>
1011#elif defined(HAVE_SLANG_SLANG_H)
1012#include <slang/slang.h>
1013#endif
1014])
3013eb9d 1015 AS_IF([test "x$have_slang" = xno], [
f1512be8
KZ
1016 AC_MSG_ERROR([slang selected but slcurses.h not found])],
1017 [CURSES_LIB_NAME=slang
3013eb9d
SK
1018 ])
1019])
034d378b 1020AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes])
50ea6795 1021
50ea6795 1022
948182f4 1023AS_IF([test "x$have_slang" = xyes || test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes], [
f1512be8
KZ
1024 AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [
1025 AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1,
7556c944
KZ
1026 [Define if curses library has the use_default_colors().])
1027 ])
1028 AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [
1029 AC_DEFINE(HAVE_RESIZETERM, 1,
1030 [Define if curses library has the resizeterm().])
f1512be8
KZ
1031 ])
1032])
1033
50ea6795 1034
17d71034
KZ
1035AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]),
1036 [], [with_tinfo=auto]
1037)
1038have_tinfo=no
ad442a81 1039have_tinfow=no
17d71034 1040AS_IF([test "x$with_tinfo" != xno], [
ad442a81
KZ
1041 AS_IF([test "x$have_ncursesw" = xyes], [
1042 UL_TINFO_CHECK([tinfow])
1043 ])
1044 AS_IF([test "x$have_tinfow" = xno], [
1045 UL_TINFO_CHECK([tinfo])
17d71034 1046 ])
2b8f22bd
MF
1047])
1048AC_SUBST([TINFO_LIBS])
0b28c2ec 1049AC_SUBST([TINFO_LIBS_STATIC])
ccf92e6d 1050AC_SUBST([TINFO_CFLAGS])
948182f4
IM
1051AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes])
1052AS_IF([test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes], [
ad442a81 1053 AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo or libtinfow available.])
4310faf9 1054])
75ad4910
KZ
1055
1056
0b28c2ec 1057AC_ARG_WITH([readline],
95a89bd3 1058 AS_HELP_STRING([--without-readline], [do not build with GNU Readline support]),
0b28c2ec
KZ
1059 [], [with_readline=auto]
1060)
1061
1062AS_IF([test "x$with_readline" = xno], [
1063 AM_CONDITIONAL([HAVE_READLINE], [false])
1064], [
1065 UL_CHECK_LIB([readline], [readline])
1066 AS_CASE([$with_readline:$have_readline],
1067 [yes:no],
1068 [AC_MSG_ERROR([readline selected but libreadline not found ])],
1069 [*:yes],
1070 [READLINE_LIBS="-lreadline"
1071 READLINE_LIBS_STATIC="-lreadline $TINFO_LIBS_STATIC"]
1072 )
1073])
1074AC_SUBST([READLINE_LIBS])
1075AC_SUBST([READLINE_LIBS_STATIC])
1076
1077
75ad4910
KZ
1078AC_ARG_WITH([utempter],
1079 AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
034d378b 1080 [], [with_utempter=no]
75ad4910
KZ
1081)
1082
3013eb9d 1083AS_IF([test "x$with_utempter" = xyes], [
034d378b 1084 UL_CHECK_LIB([utempter], [utempter_add_record])
3013eb9d 1085 AS_IF([test "x$have_utempter" = xno], [
75ad4910 1086 AC_MSG_ERROR([utempter selected but libutempter not found])
3013eb9d
SK
1087 ])
1088], [
034d378b 1089 AM_CONDITIONAL([HAVE_UTEMPTER], [false])
3013eb9d 1090])
75ad4910
KZ
1091
1092
1dbbde66
KZ
1093dnl
1094dnl libuuid
1095dnl
17afb032
KZ
1096AC_ARG_ENABLE([libuuid],
1097 AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
08b1c219 1098 [], [UL_DEFAULT_ENABLE([libuuid], [yes])]
17afb032 1099)
fa7be20e 1100UL_BUILD_INIT([libuuid])
dc2b8d87
KZ
1101AC_SUBST([LIBUUID_VERSION])
1102AC_SUBST([LIBUUID_VERSION_INFO])
fa7be20e 1103AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
9dc801d2 1104
3e584e85
RM
1105AC_ARG_ENABLE([libuuid-force-uuidd],
1106 AS_HELP_STRING([--enable-libuuid-force-uuidd], [support uuidd even though the daemon is not built]),
1107 [], [enable_libuuid_force_uuidd=no]
1108)
1109
13985252 1110AS_IF([test "x$build_libuuid" = xyes], [
17afb032 1111 AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
3013eb9d 1112])
48d7b13a 1113
1dbbde66
KZ
1114dnl
1115dnl libblkid
1116dnl
f910b559 1117AC_ARG_ENABLE([libblkid],
1d12ed57 1118 AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
dc049516 1119 [], [UL_DEFAULT_ENABLE([libblkid], [check])]
40f07ff7 1120)
61a074f7 1121UL_BUILD_INIT([libblkid])
dc049516 1122UL_REQUIRES_HAVE([libblkid], [openat], [openat functions])
a68ed87f 1123UL_REQUIRES_HAVE([libblkid], [dirfd,ddfd], [dirfd or ddfd function])
033cf439 1124AC_SUBST([LIBBLKID_DATE])
dc2b8d87
KZ
1125AC_SUBST([LIBBLKID_VERSION])
1126AC_SUBST([LIBBLKID_VERSION_INFO])
034d378b
SK
1127AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string])
1128AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string])
3013eb9d 1129AS_IF([test "x$build_libblkid" = xyes], [
034d378b 1130 AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.])
3013eb9d 1131])
034d378b 1132AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes])
948182f4 1133AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes && test "x$enable_static" = xyes])
f910b559 1134
1dbbde66
KZ
1135dnl
1136dnl libmount
1137dnl
f1cde479
KZ
1138AC_ARG_ENABLE([libmount],
1139 AS_HELP_STRING([--disable-libmount], [do not build libmount]),
08b1c219 1140 [], [UL_DEFAULT_ENABLE([libmount], [check])]
f1cde479 1141)
61a074f7 1142UL_BUILD_INIT([libmount])
13f5473e 1143UL_REQUIRES_BUILD([libmount], [libblkid])
a68ed87f 1144UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function])
94c8821b 1145UL_REQUIRES_HAVE([libmount], [mntent_h], [mntent.h header file])
034d378b 1146AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
948182f4 1147AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes && test "x$enable_static" = xyes])
30c34afb 1148AS_IF([test "x$build_libmount" = xyes], [
7a3b35b9
KZ
1149 AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount available.])
1150 AS_IF([test "x$have_setns_syscall" = "xyes"], [
1151 AC_DEFINE([USE_LIBMOUNT_SUPPORT_NAMESPACES], [1], [Define to 1 if want to support namepaces.])
1152 ],[
1153 AC_MSG_WARN([libmount will be compiled without namespaces support])
1154 ])
30c34afb 1155])
8e368761 1156
f1cde479 1157AC_SUBST([LIBMOUNT_VERSION])
10e1d2e5
SH
1158AC_SUBST([LIBMOUNT_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR)
1159AC_SUBST([LIBMOUNT_MINOR_VERSION], $PACKAGE_VERSION_MINOR)
1160AC_SUBST([LIBMOUNT_PATCH_VERSION], $PACKAGE_VERSION_RELEASE)
f1cde479 1161AC_SUBST([LIBMOUNT_VERSION_INFO])
034d378b 1162AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])
13f5473e 1163
e778642a
KZ
1164AC_ARG_ENABLE([libmount-support-mtab],
1165 AS_HELP_STRING([--enable-libmount-support-mtab], [support /etc/mtab (default is use /proc/self/mountinfo)]),
1166 [], [enable_libmount_support_mtab=no]
e3f72275
KZ
1167)
1168
2afbcec5 1169AS_IF([test "x$enable_libmount_support_mtab" = xyes], [
e778642a 1170 AC_DEFINE([USE_LIBMOUNT_SUPPORT_MTAB], [1], [Define to 1 if want to support mtab.])
e3f72275
KZ
1171])
1172
1a4d989e
OO
1173dnl
1174dnl libsmartcols
1175dnl
1176AC_ARG_ENABLE([libsmartcols],
1177 AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]),
08b1c219 1178 [], [UL_DEFAULT_ENABLE([libsmartcols], [yes])]
1a4d989e
OO
1179)
1180UL_BUILD_INIT([libsmartcols])
1a4d989e 1181AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes])
1a4d989e
OO
1182
1183AC_SUBST([LIBSMARTCOLS_VERSION])
1184AC_SUBST([LIBSMARTCOLS_VERSION_INFO])
1185AC_DEFINE_UNQUOTED([LIBSMARTCOLS_VERSION], ["$LIBSMARTCOLS_VERSION"], [libsmartcols version string])
1186
1187
eb6a03f3 1188dnl
0bb4c979 1189dnl libfdisk
eb6a03f3 1190dnl
0bb4c979
KZ
1191AC_ARG_ENABLE([libfdisk],
1192 AS_HELP_STRING([--disable-libfdisk], [do not build libfdisk]),
1193 [], [UL_DEFAULT_ENABLE([libfdisk], [check])]
1194)
1195UL_BUILD_INIT([libfdisk])
eb6a03f3 1196UL_REQUIRES_BUILD([libfdisk], [libuuid])
034d378b 1197AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes])
948182f4 1198AM_CONDITIONAL([BUILD_LIBFDISK_TESTS], [test "x$build_libfdisk" = xyes && test "x$enable_static" = xyes])
0bb4c979 1199
ed79557e
KZ
1200AS_IF([test "x$build_libblkid" = xyes],
1201 [LIBFDISK_PC_REQUIRES="uuid blkid"],[LIBFDISK_PC_REQUIRES="uuid"])
1202AC_SUBST([LIBFDISK_PC_REQUIRES])
1203
0bb4c979 1204AC_SUBST([LIBFDISK_VERSION])
791da22d
KZ
1205AC_SUBST([LIBFDISK_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR)
1206AC_SUBST([LIBFDISK_MINOR_VERSION], $PACKAGE_VERSION_MINOR)
1207AC_SUBST([LIBFDISK_PATCH_VERSION], $PACKAGE_VERSION_RELEASE)
0bb4c979
KZ
1208AC_SUBST([LIBFDISK_VERSION_INFO])
1209AC_DEFINE_UNQUOTED([LIBFDISK_VERSION], ["$LIBFDISK_VERSION"], [libfdisk version string])
1210
eb6a03f3 1211
9c7431fd
CS
1212AC_ARG_ENABLE([fdisks],
1213 AS_HELP_STRING([--disable-fdisks], [do not build fdisk(8), sfdisk(8) and cfdisk(8)]),
1214 [], [UL_DEFAULT_ENABLE([fdisks], [check])]
1215)
1216enable_fdisk=$enable_fdisks
1217enable_sfdisk=$enable_fdisks
1218enable_cfdisk=$enable_fdisks
1219
1220UL_BUILD_INIT([fdisk])
dc049516 1221UL_REQUIRES_HAVE([fdisk], [openat], [openat functions])
a68ed87f 1222UL_REQUIRES_HAVE([fdisk], [dirfd,ddfd], [dirfd or ddfd function])
eb6a03f3 1223UL_REQUIRES_BUILD([fdisk], [libfdisk])
d44115f3 1224UL_REQUIRES_BUILD([fdisk], [libsmartcols])
034d378b 1225AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes])
eb6a03f3
KZ
1226
1227
9c7431fd 1228UL_BUILD_INIT([sfdisk])
dc049516 1229UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions])
a68ed87f 1230UL_REQUIRES_HAVE([sfdisk], [dirfd,ddfd], [dirfd or ddfd function])
9c1f9dd3
KZ
1231UL_REQUIRES_BUILD([sfdisk], [libfdisk])
1232UL_REQUIRES_BUILD([sfdisk], [libsmartcols])
ecc6047e
KZ
1233AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
1234
1235
9c7431fd 1236UL_BUILD_INIT([cfdisk])
08b1c219
KZ
1237UL_REQUIRES_BUILD([cfdisk], [libfdisk])
1238UL_REQUIRES_BUILD([cfdisk], [libsmartcols])
9dd55a04 1239UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function])
4ffcc7a9 1240UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library])
08b1c219
KZ
1241AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes])
1242
1243
434b07a0
KZ
1244AC_ARG_ENABLE([mount],
1245 AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
08b1c219 1246 [], [UL_DEFAULT_ENABLE([mount], [check])]
ecdba5dd 1247)
434b07a0 1248UL_BUILD_INIT([mount])
53e8c16e 1249UL_REQUIRES_LINUX([mount])
434b07a0 1250UL_REQUIRES_BUILD([mount], [libmount])
034d378b 1251AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
ecdba5dd
KZ
1252
1253
bafe1a75
KZ
1254AC_ARG_ENABLE([losetup],
1255 AS_HELP_STRING([--disable-losetup], [do not build losetup]),
08b1c219 1256 [], [UL_DEFAULT_ENABLE([losetup], [check])]
bafe1a75
KZ
1257)
1258UL_BUILD_INIT([losetup])
1259UL_REQUIRES_LINUX([losetup])
7477f356 1260UL_REQUIRES_BUILD([losetup], [libsmartcols])
034d378b 1261AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes])
bafe1a75 1262
0624d840
KZ
1263AC_ARG_ENABLE([zramctl],
1264 AS_HELP_STRING([--disable-zramctl], [do not build zramctl]),
1265 [], [UL_DEFAULT_ENABLE([zramctl], [check])]
1266)
1267UL_BUILD_INIT([zramctl])
1268UL_REQUIRES_LINUX([zramctl])
1269UL_REQUIRES_BUILD([zramctl], [libsmartcols])
1270AM_CONDITIONAL([BUILD_ZRAMCTL], [test "x$build_zramctl" = xyes])
bafe1a75 1271
1dbbde66
KZ
1272AC_ARG_ENABLE([fsck],
1273 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
08b1c219 1274 [], [UL_DEFAULT_ENABLE([fsck], [check])]
1dbbde66 1275)
61a074f7 1276UL_BUILD_INIT([fsck])
a7b585ea 1277UL_REQUIRES_BUILD([fsck], [libmount])
034d378b 1278AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes])
1dbbde66
KZ
1279
1280
1281AC_ARG_ENABLE([partx],
1282 AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
08b1c219 1283 [], [UL_DEFAULT_ENABLE([partx], [check])]
1dbbde66 1284)
61a074f7 1285UL_BUILD_INIT([partx])
ecde2536
KZ
1286UL_REQUIRES_LINUX([partx])
1287UL_REQUIRES_BUILD([partx], [libblkid])
08b1c219 1288UL_REQUIRES_BUILD([partx], [libsmartcols])
034d378b 1289AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes])
1dbbde66
KZ
1290
1291
1dbbde66
KZ
1292AC_ARG_ENABLE([uuidd],
1293 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
08b1c219 1294 [], [UL_DEFAULT_ENABLE([uuidd], [check])]
1dbbde66 1295)
61a074f7 1296UL_BUILD_INIT([uuidd])
bcdab497 1297UL_REQUIRES_BUILD([uuidd], [libuuid])
651b25cd
RM
1298UL_REQUIRES_HAVE([uuidd], [timer], [timer_create function])
1299UL_REQUIRES_HAVE([uuidd], [sys_signalfd_h], [sys/signalfd.h header])
2afbcec5 1300AS_IF([test "x$build_uuidd" = xyes || test "x$enable_libuuid_force_uuidd" = xyes], [
034d378b 1301 AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])
3013eb9d 1302])
034d378b 1303AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes])
1dbbde66
KZ
1304
1305
5ec1108c 1306AC_ARG_ENABLE([uuidgen],
1307 AS_HELP_STRING([--disable-uuidgen], [do not build uuidgen]),
1308 [], [UL_DEFAULT_ENABLE([uuidgen], [check])]
1309)
1310UL_BUILD_INIT([uuidgen])
1b15cbd1
KZ
1311UL_REQUIRES_BUILD([uuidgen], [libuuid])
1312AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes])
1313
83893f26
SK
1314UL_BUILD_INIT([uuidparse], [check])
1315UL_REQUIRES_BUILD([uuidparse], [libuuid])
1316UL_REQUIRES_BUILD([uuidparse], [libsmartcols])
1317AM_CONDITIONAL([BUILD_UUIDPARSE], [test "x$build_uuidparse" = xyes])
1318
5ec1108c 1319AC_ARG_ENABLE([blkid],
1320 AS_HELP_STRING([--disable-blkid], [do not build blkid(8)]),
1321 [], [UL_DEFAULT_ENABLE([blkid], [check])]
1322)
1323UL_BUILD_INIT([blkid])
15a2c741
KZ
1324UL_REQUIRES_BUILD([blkid], [libblkid])
1325AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes])
1326
1327UL_BUILD_INIT([findfs], [check])
1328UL_REQUIRES_BUILD([findfs], [libblkid])
1329AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes])
1330
a76cd5f6
SV
1331AC_ARG_ENABLE([wipefs],
1332 AS_HELP_STRING([--disable-wipefs], [do not build wipefs]),
1333 [], [UL_DEFAULT_ENABLE([wipefs], [check])]
1334)
1335UL_BUILD_INIT([wipefs])
15a2c741 1336UL_REQUIRES_BUILD([wipefs], [libblkid])
d9921b2a 1337UL_REQUIRES_BUILD([wipefs], [libsmartcols])
15a2c741
KZ
1338AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes])
1339
1340UL_BUILD_INIT([findmnt], [check])
1341UL_REQUIRES_BUILD([findmnt], [libmount])
169b4a8c 1342UL_REQUIRES_BUILD([findmnt], [libblkid])
15a2c741
KZ
1343UL_REQUIRES_BUILD([findmnt], [libsmartcols])
1344AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes])
1345
1b15cbd1 1346
0164c245 1347AC_ARG_ENABLE([mountpoint],
2023ccc4 1348 AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
08b1c219 1349 [], [UL_DEFAULT_ENABLE([mountpoint], [check])]
0164c245 1350)
61a074f7 1351UL_BUILD_INIT([mountpoint])
a9127bc1 1352UL_REQUIRES_BUILD([mountpoint], [libmount])
034d378b 1353AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes])
0164c245
KZ
1354
1355
10e56b49
KZ
1356AC_ARG_ENABLE([fallocate],
1357 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
08b1c219 1358 [], [UL_DEFAULT_ENABLE([fallocate], [check])]
10e56b49 1359)
61a074f7 1360UL_BUILD_INIT([fallocate])
10e56b49
KZ
1361UL_REQUIRES_LINUX([fallocate])
1362UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
034d378b 1363AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes])
10e56b49 1364
3013eb9d 1365AS_IF([test "x$build_fallocate" = xyes], [
10e56b49
KZ
1366 dnl check for valid fallocate() function
1367 dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
1368 dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
1369 dnl and program can't be linked.
1370 dnl AC_CHECK_FUNC can't catch such errors since it's redefining
1371 dnl function prototype.
1372 AC_MSG_CHECKING([for valid fallocate() function])
1373 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
b832c2fe
YD
1374#ifdef HAVE_UNISTD_H
1375# include <unistd.h>
1376#endif
1377#ifdef HAVE_SYS_TYPES_H
1378# include <sys/types.h>
1379#endif
1380#ifdef HAVE_LINUX_FALLOC_H
1381# include <linux/falloc.h>
1382#endif
1383#ifdef HAVE_FCNTL_H
1384# include <fcntl.h>
1385#endif
1386]],[[
1387 long ret;
b832c2fe 1388 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
b832c2fe
YD
1389 if (ret != 0) {
1390 return 1;
1391 }
1392 ]])],[
10e56b49 1393 AC_MSG_RESULT([yes])
034d378b 1394 AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[
10e56b49 1395 AC_MSG_RESULT([no])])
3013eb9d 1396])
10e56b49 1397
833f9a7a
DC
1398AS_IF([test "x$build_fallocate" = xyes], [
1399 dnl check for valid posix_fallocate() function
1400 AC_MSG_CHECKING([for valid posix_fallocate() function])
1401 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1402#ifdef HAVE_UNISTD_H
1403# include <unistd.h>
1404#endif
1405#ifdef HAVE_SYS_TYPES_H
1406# include <sys/types.h>
1407#endif
1408#ifdef HAVE_LINUX_FALLOC_H
1409# include <linux/falloc.h>
1410#endif
1411#ifdef HAVE_FCNTL_H
1412# include <fcntl.h>
1413#endif
1414]],[[
1415 long ret;
1416 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
1417 if (ret != 0) {
1418 return 1;
1419 }
1420 ]])],[
1421 AC_MSG_RESULT([yes])
1422 AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Have valid posix_fallocate() function])],[
1423 AC_MSG_RESULT([no])])
1424])
1425
19a224ad 1426
a2ea6670
KZ
1427AC_ARG_ENABLE([unshare],
1428 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
08b1c219 1429 [], [UL_DEFAULT_ENABLE([unshare], [check])]
a2ea6670 1430)
61a074f7 1431UL_BUILD_INIT([unshare])
a2ea6670
KZ
1432UL_REQUIRES_LINUX([unshare])
1433UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
2c2ff2ed 1434UL_REQUIRES_HAVE([unshare], [linux_capability_h], [linux/capability.h header file])
034d378b 1435AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes])
01e94325
KZ
1436
1437AC_MSG_CHECKING([for valid unshare() function])
1438AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1439#include <sched.h>
1440]],[[
1441 int ret;
1442 ret = unshare(0);
1443 if (ret != 0) {
1444 return 1;
1445 }
1446 ]])],[
1447 AC_MSG_RESULT([yes])
1448 AC_DEFINE([HAVE_UNSHARE], [1], [Have valid unshare() function])],
1449[
1450 AC_MSG_RESULT([no])
1451])
1452
b3425806 1453
f8aa8e94
EB
1454AC_ARG_ENABLE([nsenter],
1455 AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
08b1c219 1456 [], [UL_DEFAULT_ENABLE([nsenter], [check])]
f8aa8e94
EB
1457)
1458UL_BUILD_INIT([nsenter])
1459UL_REQUIRES_LINUX([nsenter])
7a3b35b9 1460UL_REQUIRES_HAVE([nsenter], [setns_syscall], [setns syscall])
034d378b 1461AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
01e94325
KZ
1462
1463AC_MSG_CHECKING([for valid setns() function])
1464AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1465#include <sched.h>
1466#include <errno.h>
1467]],[[
1468 int ret;
1469 ret = setns(0, 0);
1470 if (ret != EINVAL && ret != EBADF && ret != EPERM) {
1471 return 1;
1472 }
1473 ]])],[
1474 AC_MSG_RESULT([yes])
1475 AC_DEFINE([HAVE_SETNS], [1], [Have valid setns() function])],
1476[
1477 AC_MSG_RESULT([no])
1478])
b3425806 1479
17d71034
KZ
1480
1481AC_ARG_WITH([cap_ng],
801afcb0 1482 AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]),
17d71034
KZ
1483 [], [with_cap_ng=auto]
1484)
801afcb0
MF
1485AS_IF([test "x$with_cap_ng" = xno], [
1486 AM_CONDITIONAL([HAVE_CAP_NG], [false])
1487 have_cap_ng=no
1488],[
17d71034
KZ
1489 UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
1490])
1491
1492
5600c405
AL
1493AC_ARG_ENABLE([setpriv],
1494 AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
08b1c219 1495 [], [UL_DEFAULT_ENABLE([setpriv], [check])]
5600c405
AL
1496)
1497UL_BUILD_INIT([setpriv])
1498UL_REQUIRES_LINUX([setpriv])
2c2ff2ed
KZ
1499UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [linux/securebits.h header file])
1500UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header file])
e1b8ba20 1501UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
034d378b 1502AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
5600c405 1503
04ae85a7
RM
1504AC_ARG_ENABLE([hardlink],
1505 AS_HELP_STRING([--disable-hardlink], [do not build hardlink]),
1506 [], [UL_DEFAULT_ENABLE([hardlink], [check])]
1507)
1508UL_BUILD_INIT([hardlink])
1509AM_CONDITIONAL([BUILD_HARDLINK], [test "x$build_hardlink" = xyes])
5600c405 1510
43989bad 1511
539feec1
ML
1512AC_ARG_ENABLE([eject],
1513 AS_HELP_STRING([--disable-eject], [do not build eject]),
08b1c219 1514 [], [UL_DEFAULT_ENABLE([eject], [check])]
539feec1
ML
1515)
1516UL_BUILD_INIT([eject])
1517UL_REQUIRES_LINUX([eject])
7770e7df 1518UL_REQUIRES_BUILD([eject], [libmount])
034d378b 1519AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes])
539feec1
ML
1520
1521
48d7b13a 1522AC_ARG_ENABLE([agetty],
7fa4f112 1523 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
d00c10ed 1524 [], [UL_DEFAULT_ENABLE([agetty], [check])]
48d7b13a 1525)
61a074f7 1526UL_BUILD_INIT([agetty])
b4b919fe 1527UL_REQUIRES_HAVE([agetty], [utmpx_h], [utmpx.h header])
73afd3f8 1528UL_REQUIRES_HAVE([agetty], [gnu_utmpx], [GNU utmpx functions])
034d378b 1529AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
948182f4 1530AS_IF([test "x$have_futimens" = xyes && test "x$have_inotify_init1" = xyes ], [
90d5285d
KZ
1531 AC_DEFINE([AGETTY_RELOAD], [1], [Enable agetty --reload feature])
1532],[
1533 AC_MSG_WARN([futimens or inotify_init1 not found; agetty(8) will not provide ---reload functionality])
1534])
0fc74be1 1535
48d7b13a 1536
1eb16fd7 1537AC_ARG_ENABLE([plymouth_support],
41f58b60 1538 AS_HELP_STRING([--disable-plymouth_support], [do not care about plymouth in sylogin(8) and agetty(8)]),
d67f61c0 1539 [], [enable_plymouth_support=check]
1eb16fd7
KZ
1540)
1541UL_BUILD_INIT([plymouth_support])
1542UL_REQUIRES_HAVE([plymouth_support], [tiocglcktrmios], [TIOCGLCKTRMIOS flag])
1543UL_REQUIRES_HAVE([plymouth_support], [sock_cloexec], [SOCK_CLOEXEC flag])
1544UL_REQUIRES_HAVE([plymouth_support], [sock_nonblock], [SOCK_NONBLOCK flag])
1545UL_REQUIRES_HAVE([plymouth_support], [so_passcred], [SO_PASSCRED flag])
1546AM_CONDITIONAL([USE_PLYMOUTH_SUPPORT], [test "x$build_plymouth_support" = xyes])
1547AS_IF([test "x$build_plymouth_support" = xyes ], [
1548 AC_DEFINE([USE_PLYMOUTH_SUPPORT], [1], [Enable plymouth support feature for sulogin and aggety])
1549])
1550
1551
17d71034
KZ
1552AC_ARG_WITH([libz],
1553 AS_HELP_STRING([--without-libz], [compile without libz]),
1554 [], [with_libz=auto]
1555)
1556AS_IF([test "x$with_libz" = xno], [have_z=no], [
1557 AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
1558])
1559
09070e1a
SK
1560AC_ARG_WITH([libmagic],
1561 AS_HELP_STRING([--without-libmagic], [compile without libmagic]),
1562 [], [with_libmagic=auto]
1563)
1564AS_IF([test "x$with_libmagic" = xno], [have_magic=no], [
1565 AC_CHECK_LIB([magic], [magic_open], [
1566 AC_DEFINE([HAVE_MAGIC], [1], [Define to 1 if you have the libmagic present.])
1567 MAGIC_LIBS="-lmagic"
1568 ])
1569])
1570AC_SUBST([MAGIC_LIBS])
1571
17d71034 1572
9cb68977 1573AC_ARG_ENABLE([cramfs],
7fa4f112 1574 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
08b1c219 1575 [], [UL_DEFAULT_ENABLE([cramfs], [check])]
9cb68977 1576)
61a074f7 1577UL_BUILD_INIT([cramfs])
d81b5a52 1578UL_REQUIRES_HAVE([cramfs], [z], [z library])
034d378b 1579AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])
9cb68977 1580
a13cdb7a 1581
8d6f0bae 1582AC_ARG_ENABLE([bfs],
834fc88c 1583 AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]),
08b1c219 1584 [], [UL_DEFAULT_ENABLE([bfs], [yes])]
834fc88c
KZ
1585)
1586UL_BUILD_INIT([bfs])
034d378b 1587AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
834fc88c
KZ
1588
1589
3d9fdac5
KZ
1590AC_ARG_ENABLE([minix],
1591 AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]),
08b1c219 1592 [], [UL_DEFAULT_ENABLE([minix], [yes])]
3d9fdac5
KZ
1593)
1594UL_BUILD_INIT([minix])
1595AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes])
1596
1597
8d6f0bae 1598AC_ARG_ENABLE([fdformat],
13b26e3c
SK
1599 AS_HELP_STRING([--enable-fdformat], [build fdformat]),
1600 [], [UL_DEFAULT_ENABLE([fdformat], [no])]
8d6f0bae
KZ
1601)
1602UL_BUILD_INIT([fdformat])
1603UL_REQUIRES_LINUX([fdformat])
034d378b 1604AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes])
8d6f0bae
KZ
1605
1606
6acf31ac
KZ
1607AC_ARG_ENABLE([hwclock],
1608 AS_HELP_STRING([--disable-hwclock], [do not build hwclock]),
08b1c219 1609 [], [UL_DEFAULT_ENABLE([hwclock], [check])]
6acf31ac
KZ
1610)
1611have_linuxdummy=$linux_os
1612
1613UL_BUILD_INIT([hwclock])
1614UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux])
034d378b 1615AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes])
e09ebf22 1616
b1062292 1617AC_ARG_ENABLE([hwclock_cmos],
88bc304b 1618 AS_HELP_STRING([--disable-hwclock-cmos], [do not use CMOS clock]),
b1062292 1619 [], [enable_hwclock_cmos=check]
88bc304b 1620)
b1062292
KZ
1621UL_BUILD_INIT([hwclock_cmos])
1622UL_REQUIRES_BUILD([hwclock_cmos], [hwclock])
1623UL_REQUIRES_ARCH([hwclock_cmos], [i?86-*,x86_64*])
1624AM_CONDITIONAL([USE_HWCLOCK_CMOS], [test "x$build_hwclock_cmos" = xyes])
1625AS_IF([test "x$build_hwclock_cmos" = xyes ], [
1626 AC_DEFINE([USE_HWCLOCK_CMOS], [1], [Define to 1 if want to use CMOS clock.])
88bc304b
CS
1627])
1628
e8c21c89
KZ
1629AC_ARG_ENABLE([hwclock_gplv3],
1630 AS_HELP_STRING([--disable-hwclock-gplv3], [do not use datetime parsing GPLv3 code]),
1631 [], [enable_hwclock_gplv3=yes]
1632)
1633AM_CONDITIONAL([USE_HWCLOCK_GPLv3_DATETIME], [test "x$enable_hwclock_gplv3" = xyes])
1634AS_IF([test "x$enable_hwclock_gplv3" = xyes ], [
1635 AC_DEFINE([USE_HWCLOCK_GPLv3_DATETIME], [1], [use datetime parsing GPLv3 code to hwclock])
1636])
1637
88bc304b 1638
5ec1108c 1639AC_ARG_ENABLE([mkfs],
1640 AS_HELP_STRING([--disable-mkfs], [do not build mkfs(8)]),
1641 [], [UL_DEFAULT_ENABLE([mkfs], [check])]
1642)
1643UL_BUILD_INIT([mkfs])
ecc6047e
KZ
1644AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes])
1645
1646UL_BUILD_INIT([isosize], [yes])
1647AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes])
1648
3d9fdac5 1649
5ec1108c 1650AC_ARG_ENABLE([fstrim],
1651 AS_HELP_STRING([--disable-fstrim], [do not build fstrim(8)]),
1652 [], [UL_DEFAULT_ENABLE([fstrim], [check])]
1653)
1654UL_BUILD_INIT([fstrim])
7b040214
KZ
1655UL_REQUIRES_LINUX([fstrim])
1656UL_REQUIRES_BUILD([fstrim], [libmount])
1657AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes])
1658
1659
5ec1108c 1660AC_ARG_ENABLE([swapon],
1661 AS_HELP_STRING([--disable-swapon], [do not build swapon(8) and swapoff(8)]),
1662 [], [UL_DEFAULT_ENABLE([swapon], [check])]
1663)
1664UL_BUILD_INIT([swapon])
143635c9 1665UL_REQUIRES_LINUX([swapon])
cf9b16f1
KZ
1666UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapon])], [swapon])
1667UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapoff])], [swapoff])
143635c9 1668UL_REQUIRES_BUILD([swapon], [libblkid])
7770e7df 1669UL_REQUIRES_BUILD([swapon], [libmount])
7477f356 1670UL_REQUIRES_BUILD([swapon], [libsmartcols])
034d378b 1671AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
cf9b16f1
KZ
1672AC_CHECK_FUNCS([swapon])
1673AC_CHECK_FUNCS([swapoff])
143635c9
KZ
1674
1675
61a074f7 1676UL_BUILD_INIT([lsblk], [check])
a13cdb7a
KZ
1677UL_REQUIRES_LINUX([lsblk])
1678UL_REQUIRES_BUILD([lsblk], [libblkid])
9554f7ab 1679UL_REQUIRES_BUILD([lsblk], [libmount])
7477f356 1680UL_REQUIRES_BUILD([lsblk], [libsmartcols])
034d378b 1681AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes])
9cb68977 1682
a3d3b770 1683
5ec1108c 1684AC_ARG_ENABLE([lscpu],
1685 AS_HELP_STRING([--disable-lscpu], [do not build lscpu]),
1686 [], [UL_DEFAULT_ENABLE([lscpu], [check])]
1687)
1688UL_BUILD_INIT([lscpu])
da396d88 1689UL_REQUIRES_LINUX([lscpu])
7477f356 1690UL_REQUIRES_BUILD([lscpu], [libsmartcols])
da396d88 1691UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
034d378b 1692AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes])
da396d88 1693
f2c3f2c7
AP
1694AC_ARG_ENABLE([lsfd],
1695 AS_HELP_STRING([--disable-lsfd], [do not build lsfd]),
1696 [], [UL_DEFAULT_ENABLE([lsfd], [check])]
1697)
1698UL_BUILD_INIT([lsfd])
128beb71
MY
1699UL_REQUIRES_LINUX([lsfd])
1700UL_REQUIRES_BUILD([lsfd], [libsmartcols])
f4d700d7 1701UL_REQUIRES_HAVE([lsfd], [linux_kcmp_h], [linux/kcmp.h header file])
128beb71 1702AM_CONDITIONAL([BUILD_LSFD], [test "x$build_lsfd" = xyes])
a3d3b770 1703
50e6f15b
RM
1704AC_ARG_ENABLE([lslogins],
1705 AS_HELP_STRING([--disable-lslogins], [do not build lslogins]),
1706 [], [UL_DEFAULT_ENABLE([lslogins], [check])]
1707)
1708UL_BUILD_INIT([lslogins])
ab1cfad5 1709UL_REQUIRES_BUILD([lslogins], [libsmartcols])
d00c10ed 1710UL_REQUIRES_HAVE([lslogins], [shadow_h], [shadow.h header])
b4b919fe 1711UL_REQUIRES_HAVE([lslogins], [utmpx_h], [utmpx.h header])
73afd3f8 1712UL_REQUIRES_HAVE([lslogins], [gnu_utmpx], [GNU utmpx functions])
ab1cfad5
OO
1713AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes])
1714
1715
61a074f7 1716UL_BUILD_INIT([chcpu], [check])
da396d88
KZ
1717UL_REQUIRES_LINUX([chcpu])
1718UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
034d378b 1719AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes])
da396d88 1720
a13cdb7a 1721
7fcccbdf
KZ
1722AC_ARG_ENABLE([wdctl],
1723 AS_HELP_STRING([--disable-wdctl], [do not build wdctl]),
08b1c219 1724 [], [UL_DEFAULT_ENABLE([wdctl], [check])]
7fcccbdf
KZ
1725)
1726UL_BUILD_INIT([wdctl])
5b0289b9 1727UL_REQUIRES_LINUX([wdctl])
7477f356 1728UL_REQUIRES_BUILD([wdctl], [libsmartcols])
5b0289b9 1729UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
034d378b 1730AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes])
5b0289b9
KZ
1731
1732
54dbc8cf
KZ
1733UL_BUILD_INIT([swaplabel], [check])
1734UL_REQUIRES_BUILD([swaplabel], [libblkid])
034d378b 1735AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
54dbc8cf
KZ
1736
1737
ecc6047e
KZ
1738UL_BUILD_INIT([mkswap], [yes])
1739AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes])
948182f4 1740AS_IF([test "x$build_mkswap" = xyes && test "x$build_libuuid" != xyes], [
08b1c219
KZ
1741 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
1742])
ecc6047e 1743
328eb445
KZ
1744
1745AC_ARG_ENABLE([cal],
1746 AS_HELP_STRING([--disable-cal], [do not build cal]),
1747 [], [UL_DEFAULT_ENABLE([cal], [check])]
1748)
1749UL_BUILD_INIT([cal])
1b15cbd1
KZ
1750AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes])
1751
50e6f15b
RM
1752AC_ARG_ENABLE([logger],
1753 AS_HELP_STRING([--disable-logger], [do not build logger]),
1754 [], [UL_DEFAULT_ENABLE([logger], [check])]
1755)
1756UL_BUILD_INIT([logger])
1b15cbd1
KZ
1757AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes])
1758
4c838e6c 1759UL_BUILD_INIT([look], [yes])
1b15cbd1
KZ
1760AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes])
1761
1762UL_BUILD_INIT([mcookie], [yes])
1763AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes])
1764
1765UL_BUILD_INIT([namei], [yes])
1766AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes])
1767
c9ab7387
AH
1768matriplet="$($CC -print-multiarch 2>/dev/null || true)"
1769if test "x$matriplet" != "x"; then
1770 AC_DEFINE_UNQUOTED([MULTIARCHTRIPLET], ["$matriplet"],
1771 ["Multi-arch triplet for whereis library search path"])
1772fi
b7fc158a
SN
1773AC_ARG_ENABLE([whereis],
1774 AS_HELP_STRING([--disable-whereis], [do not build whereis]),
1775 [], [UL_DEFAULT_ENABLE([whereis], [check])]
1776)
1777UL_BUILD_INIT([whereis])
1b15cbd1
KZ
1778AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes])
1779
3adaaa15
KZ
1780UL_BUILD_INIT([getopt], [yes])
1781AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes])
1782
ecc6047e
KZ
1783
1784UL_BUILD_INIT([blockdev], [check])
1785UL_REQUIRES_LINUX([blockdev])
1786AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes])
1787
1788
945ac250
KZ
1789UL_BUILD_INIT([prlimit], [check])
1790UL_REQUIRES_LINUX([prlimit])
7477f356 1791UL_REQUIRES_BUILD([prlimit], [libsmartcols])
945ac250 1792UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
034d378b 1793AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes])
3013eb9d 1794AS_IF([test "x$build_prlimit" = xyes], [
01e94325
KZ
1795 dnl check for valid prlimit() function
1796 AC_MSG_CHECKING([for valid prlimit() function])
1797 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1798#include <sys/types.h>
1799#include <sys/time.h>
1800#include <sys/resource.h>
1801#include <stddef.h>
1802]],[[
1803 int ret;
1804 ret = prlimit(0, RLIMIT_AS, NULL, NULL);
1805 if (ret != 0) {
1806 return 1;
1807 }
1808 ]])],[
1809 AC_MSG_RESULT([yes])
1810 AC_DEFINE([HAVE_PRLIMIT], [1], [Have valid prlimit() function])],[
1811 AC_MSG_RESULT([no])])
3013eb9d 1812])
945ac250
KZ
1813
1814
01e94325 1815
3dc02ef4
DB
1816UL_BUILD_INIT([lslocks], [check])
1817UL_REQUIRES_LINUX([lslocks])
ec1204dc 1818UL_REQUIRES_BUILD([lslocks], [libmount])
7477f356 1819UL_REQUIRES_BUILD([lslocks], [libsmartcols])
034d378b 1820AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes])
3dc02ef4
DB
1821
1822
bd671347
KZ
1823AC_ARG_ENABLE([switch_root],
1824 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
08b1c219 1825 [], [UL_DEFAULT_ENABLE([switch_root], [check])]
bd671347 1826)
61a074f7 1827UL_BUILD_INIT([switch_root])
a3d3b770
KZ
1828UL_REQUIRES_LINUX([switch_root])
1829UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
a68ed87f 1830UL_REQUIRES_HAVE([switch_root], [dirfd,ddfd], [dirfd or ddfd function])
034d378b 1831AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
bd671347
KZ
1832
1833
11125e7a
KZ
1834AC_ARG_ENABLE([pivot_root],
1835 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
08b1c219 1836 [], [UL_DEFAULT_ENABLE([pivot_root], [check])]
11125e7a 1837)
61a074f7 1838UL_BUILD_INIT([pivot_root])
5cbbdfbf 1839UL_REQUIRES_LINUX([pivot_root])
9f632667 1840UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
034d378b 1841AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes])
11125e7a
KZ
1842
1843
c12fc5e1 1844UL_BUILD_INIT([flock], [check])
3001923b 1845UL_REQUIRES_HAVE([flock], [timer], [timer_create/setitimer function])
205dbb7a
KZ
1846AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes])
1847
bdfe4601 1848
cad2d1ac
HC
1849AC_ARG_ENABLE([lsmem],
1850 AS_HELP_STRING([--disable-lsmem], [do not build lsmem]),
bdfe4601 1851 [], [UL_DEFAULT_ENABLE([lsmem], [check])]
cad2d1ac
HC
1852)
1853UL_BUILD_INIT([lsmem])
bdfe4601 1854UL_REQUIRES_LINUX([lsmem])
8b7f00a8 1855UL_REQUIRES_BUILD([lsmem], [libsmartcols])
cad2d1ac
HC
1856AM_CONDITIONAL([BUILD_LSMEM], [test "x$build_lsmem" = xyes])
1857
bdfe4601 1858
30e1ea8b
HC
1859AC_ARG_ENABLE([chmem],
1860 AS_HELP_STRING([--disable-chmem], [do not build chmem]),
bdfe4601 1861 [], [UL_DEFAULT_ENABLE([chmem], [check])]
30e1ea8b
HC
1862)
1863UL_BUILD_INIT([chmem])
bdfe4601 1864UL_REQUIRES_LINUX([chmem])
30e1ea8b
HC
1865AM_CONDITIONAL([BUILD_CHMEM], [test "x$build_chmem" = xyes])
1866
205dbb7a 1867
45020b67
KZ
1868AC_ARG_ENABLE([ipcmk],
1869 AS_HELP_STRING([--disable-ipcmk], [do not build ipcmk]),
1870 [], [UL_DEFAULT_ENABLE([ipcmk], [check])]
1871)
1872UL_BUILD_INIT([ipcmk])
1873UL_EXCLUDE_ARCH([ipcmk], [*darwin*])
1874AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes])
bdfe4601 1875
42a4a152
RM
1876AC_ARG_ENABLE([ipcrm],
1877 AS_HELP_STRING([--disable-ipcrm], [do not build ipcrm]),
45020b67 1878 [], [UL_DEFAULT_ENABLE([ipcrm], [check])]
42a4a152
RM
1879)
1880UL_BUILD_INIT([ipcrm])
45020b67 1881UL_EXCLUDE_ARCH([ipcrm], [*darwin*])
205dbb7a
KZ
1882AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes])
1883
42a4a152
RM
1884AC_ARG_ENABLE([ipcs],
1885 AS_HELP_STRING([--disable-ipcs], [do not build ipcs]),
45020b67 1886 [], [UL_DEFAULT_ENABLE([ipcs], [check])]
42a4a152
RM
1887)
1888UL_BUILD_INIT([ipcs])
45020b67 1889UL_EXCLUDE_ARCH([ipcs], [*darwin*])
205dbb7a
KZ
1890AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes])
1891
a0f62b0b 1892
4f6610f5
SK
1893AC_ARG_ENABLE([irqtop],
1894 AS_HELP_STRING([--disable-irqtop], [do not build irqtop]),
c61470c7 1895 [], [UL_DEFAULT_ENABLE([irqtop], [check])]
4f6610f5
SK
1896)
1897UL_BUILD_INIT([irqtop])
fa8c5cd5 1898UL_REQUIRES_LINUX([irqtop])
a0f62b0b
KZ
1899UL_REQUIRES_BUILD([irqtop], [libsmartcols])
1900UL_REQUIRES_HAVE([irqtop], [open_memstream], [open_memstream function])
1901UL_REQUIRES_HAVE([irqtop], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library])
4f6610f5
SK
1902AM_CONDITIONAL([BUILD_IRQTOP], [test "x$build_irqtop" = xyes])
1903
a0f62b0b
KZ
1904AC_ARG_ENABLE([lsirq],
1905 AS_HELP_STRING([--disable-lsirq], [do not build lsirq]),
c61470c7 1906 [], [UL_DEFAULT_ENABLE([lsirq], [check])]
a0f62b0b
KZ
1907)
1908UL_BUILD_INIT([lsirq])
1909UL_REQUIRES_LINUX([lsirq])
1910UL_REQUIRES_BUILD([lsirq], [libsmartcols])
1911AM_CONDITIONAL([BUILD_LSIRQ], [test "x$build_lsirq" = xyes])
1912
1913
8fa223da
KZ
1914UL_BUILD_INIT([choom], [check])
1915UL_REQUIRES_LINUX([choom])
1916AM_CONDITIONAL([BUILD_CHOOM], [test "x$build_choom" = xyes])
1917
9d20ffda
KZ
1918UL_BUILD_INIT([lsipc], [check])
1919UL_REQUIRES_LINUX([lsipc])
1920UL_REQUIRES_BUILD([lsipc], [libsmartcols])
1921AM_CONDITIONAL([BUILD_LSIPC], [test "x$build_lsipc" = xyes])
1922
8a204562
KZ
1923UL_BUILD_INIT([lsns], [check])
1924UL_REQUIRES_LINUX([lsns])
1925UL_REQUIRES_BUILD([lsns], [libsmartcols])
4b328279 1926UL_REQUIRES_BUILD([lsns], [libmount])
8a204562
KZ
1927AM_CONDITIONAL([BUILD_LSNS], [test "x$build_lsns" = xyes])
1928
205dbb7a
KZ
1929UL_BUILD_INIT([renice], [yes])
1930AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes])
1931
3d47ab05
KZ
1932
1933AC_ARG_ENABLE([rfkill],
1934 AS_HELP_STRING([--disable-rfkill], [do not build rfkill]),
271552c7 1935 [], [UL_DEFAULT_ENABLE([rfkill], [check])]
3d47ab05
KZ
1936)
1937UL_BUILD_INIT([rfkill])
367f4080 1938UL_REQUIRES_LINUX([rfkill])
b3849c66 1939UL_REQUIRES_BUILD([rfkill], [libsmartcols])
c0d78c90
SK
1940AM_CONDITIONAL([BUILD_RFKILL], [test "x$build_rfkill" = xyes])
1941
3d47ab05 1942
205dbb7a
KZ
1943UL_BUILD_INIT([setsid], [yes])
1944AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes])
1945
1946UL_BUILD_INIT([readprofile], [check])
1947UL_REQUIRES_LINUX([readprofile])
1948AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes])
1949
1950UL_BUILD_INIT([dmesg], [check])
1951UL_REQUIRES_LINUX([dmesg])
1952AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes])
1953
1954UL_BUILD_INIT([ctrlaltdel], [check])
1955UL_REQUIRES_LINUX([ctrlaltdel])
e52b58e6
CTV
1956dnl we assume reboot() to be the 1-argument variant, because even considering
1957dnl widely used alternative C libraries like uclibc, dietlibc and musl,
1958dnl reboot() with multiple arguments is yet only found in glibc versions
1959dnl earlier than 2.x.
9dd55a04 1960UL_REQUIRES_HAVE([ctrlaltdel], [reboot], [reboot function])
205dbb7a
KZ
1961AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes])
1962
a921a7de
MY
1963UL_BUILD_INIT([fincore], [check])
1964UL_REQUIRES_LINUX([fincore])
3e37d7b7 1965UL_REQUIRES_BUILD([fincore], [libsmartcols])
a921a7de
MY
1966AM_CONDITIONAL([BUILD_FINCORE], [test "x$build_fincore" = xyes])
1967
205dbb7a
KZ
1968UL_BUILD_INIT([fsfreeze], [check])
1969UL_REQUIRES_LINUX([fsfreeze])
1970AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes])
1971
1972UL_BUILD_INIT([blkdiscard], [check])
1973UL_REQUIRES_LINUX([blkdiscard])
1974AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes])
1975
1ad8ef91
KZ
1976UL_BUILD_INIT([blkzone], [check])
1977UL_REQUIRES_LINUX([blkzone])
1978UL_REQUIRES_HAVE([blkzone], [linux_blkzoned_h], [linux/blkzoned.h header])
1979AM_CONDITIONAL([BUILD_BLKZONE], [test "x$build_blkzone" = xyes])
1980
205dbb7a
KZ
1981UL_BUILD_INIT([ldattach], [check])
1982UL_REQUIRES_LINUX([ldattach])
1983AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes])
1984
1985UL_BUILD_INIT([rtcwake], [check])
1986UL_REQUIRES_LINUX([rtcwake])
1987AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes])
1988
1989UL_BUILD_INIT([setarch], [check])
1990UL_REQUIRES_LINUX([setarch])
1991AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes])
1992
d4b58873
KZ
1993
1994# build_scriptutils= is just configure-only variable to control
1995# script, scriptreplay and scriptlive
1996AC_ARG_ENABLE([scriptutils],
1997 AS_HELP_STRING([--disable-scriptutils], [do not build script, scriptreplay and scriptlive]),
1998 [], [UL_DEFAULT_ENABLE([scriptutils], [check])]
1999)
2000
2001UL_ENABLE_ALIAS([script], [scriptutils])
2002UL_BUILD_INIT([script])
ec10634e 2003UL_REQUIRES_HAVE([script], [pty])
3f91b990
KZ
2004AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes])
2005
d4b58873
KZ
2006UL_ENABLE_ALIAS([scriptreplay], [scriptutils])
2007UL_BUILD_INIT([scriptreplay])
3f91b990
KZ
2008AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes])
2009
d4b58873
KZ
2010UL_ENABLE_ALIAS([scriptlive], [scriptutils])
2011UL_BUILD_INIT([scriptlive])
37a11e1a 2012UL_REQUIRES_HAVE([scriptlive], [pty])
33869e5a
KZ
2013AM_CONDITIONAL([BUILD_SCRIPTLIVE], [test "x$build_scriptlive" = xyes])
2014
d4b58873 2015
cb45354e
KZ
2016UL_BUILD_INIT([col], [yes])
2017AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes])
2018
2019UL_BUILD_INIT([colcrt], [yes])
2020AM_CONDITIONAL([BUILD_COLCRT], [test "x$build_colcrt" = xyes])
2021
2022UL_BUILD_INIT([colrm], [yes])
2023AM_CONDITIONAL([BUILD_COLRM], [test "x$build_colrm" = xyes])
2024
38d69192
KZ
2025UL_BUILD_INIT([column], [check])
2026UL_REQUIRES_BUILD([column], [libsmartcols])
cb45354e
KZ
2027AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes])
2028
2029UL_BUILD_INIT([hexdump], [yes])
2030AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes])
2031
2032UL_BUILD_INIT([rev], [yes])
2033AM_CONDITIONAL([BUILD_REV], [test "x$build_rev" = xyes])
2034
3f91b990 2035
1342ffcb
SK
2036AC_ARG_ENABLE([tunelp],
2037 AS_HELP_STRING([--enable-tunelp], [build tunelp]),
08b1c219 2038 [], [UL_DEFAULT_ENABLE([tunelp], [no])]
1342ffcb
SK
2039)
2040UL_BUILD_INIT([tunelp])
2041UL_REQUIRES_LINUX([tunelp])
034d378b 2042AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes])
1342ffcb
SK
2043
2044
48d7b13a 2045AC_ARG_ENABLE([kill],
4be753aa 2046 AS_HELP_STRING([--disable-kill], [do not build kill]),
08b1c219 2047 [], [UL_DEFAULT_ENABLE([kill], [check])]
48d7b13a 2048)
61a074f7 2049UL_BUILD_INIT([kill])
4be753aa 2050UL_REQUIRES_LINUX([kill])
034d378b 2051AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])
48d7b13a 2052
ce602720 2053
48d7b13a 2054AC_ARG_ENABLE([last],
ce602720 2055 AS_HELP_STRING([--disable-last], [do not build last]),
08b1c219 2056 [], [UL_DEFAULT_ENABLE([last], [check])]
48d7b13a 2057)
61a074f7 2058UL_BUILD_INIT([last])
b4b919fe 2059UL_REQUIRES_HAVE([last], [utmpx_h], [utmpx.h header])
73afd3f8 2060UL_REQUIRES_HAVE([last], [gnu_utmpx], [GNU utmpx functions])
034d378b 2061AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
2dc68529 2062
48d7b13a 2063
78d5ceac 2064AC_ARG_ENABLE([utmpdump],
c9b53461 2065 AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]),
d00c10ed 2066 [], [UL_DEFAULT_ENABLE([utmpdump], [check])]
78d5ceac
KZ
2067)
2068UL_BUILD_INIT([utmpdump])
b4b919fe 2069UL_REQUIRES_HAVE([utmpdump], [utmpx_h], [utmpx.h header])
73afd3f8 2070UL_REQUIRES_HAVE([utmpdump], [gnu_utmpx], [GNU utmpx functions])
034d378b 2071AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
78d5ceac
KZ
2072
2073
c135a8bd
SK
2074AC_ARG_ENABLE([line],
2075 AS_HELP_STRING([--enable-line], [build line]),
08b1c219 2076 [], [UL_DEFAULT_ENABLE([line], [no])]
c135a8bd 2077)
61a074f7 2078UL_BUILD_INIT([line])
034d378b 2079AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
2dc68529 2080
48d7b13a
KZ
2081
2082AC_ARG_ENABLE([mesg],
5c0b406d 2083 AS_HELP_STRING([--disable-mesg], [do not build mesg]),
08b1c219 2084 [], [UL_DEFAULT_ENABLE([mesg], [yes])]
48d7b13a 2085)
61a074f7 2086UL_BUILD_INIT([mesg])
034d378b 2087AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
48d7b13a
KZ
2088
2089
48d7b13a 2090AC_ARG_ENABLE([raw],
5c0b406d 2091 AS_HELP_STRING([--disable-raw], [do not build raw]),
08b1c219 2092 [], [UL_DEFAULT_ENABLE([raw], [check])]
48d7b13a 2093)
61a074f7 2094UL_BUILD_INIT([raw])
16ba8d58
KZ
2095UL_REQUIRES_LINUX([raw])
2096UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
034d378b 2097AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes])
48d7b13a
KZ
2098
2099
48d7b13a 2100AC_ARG_ENABLE([rename],
7fa4f112 2101 AS_HELP_STRING([--disable-rename], [do not build rename]),
08b1c219 2102 [], [UL_DEFAULT_ENABLE([rename], [yes])]
48d7b13a 2103)
61a074f7 2104UL_BUILD_INIT([rename])
034d378b 2105AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
48d7b13a
KZ
2106
2107
cc76731e
KZ
2108AC_ARG_ENABLE([vipw],
2109 AS_HELP_STRING([--enable-vipw], [build vipw]),
08b1c219 2110 [], [UL_DEFAULT_ENABLE([vipw], [no])]
48d7b13a 2111)
cc76731e 2112UL_BUILD_INIT([vipw])
d00c10ed 2113UL_REQUIRES_HAVE([vipw], [shadow_h], [shadow.h header])
034d378b 2114AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
9cb68977 2115
c94b3604 2116
aec9ecbd
KZ
2117AC_ARG_ENABLE([newgrp],
2118 AS_HELP_STRING([--enable-newgrp], [build newgrp]),
08b1c219 2119 [], [UL_DEFAULT_ENABLE([newgrp], [no])]
aec9ecbd
KZ
2120)
2121UL_BUILD_INIT([newgrp])
8229ed2f 2122UL_REQUIRES_HAVE([newgrp], [crypt], [crypt function])
034d378b 2123AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes])
aec9ecbd
KZ
2124
2125
d86918b6 2126AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]),
034d378b 2127 [], [with_user=check]
7e4714f2 2128)
6e93c52f 2129have_user=no
3013eb9d 2130AS_IF([test "x$with_user" != xno], [
2771954b 2131 PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no])
9f57e6e8
SK
2132 AS_CASE([$with_user:$have_user],
2133 [yes:no],
2134 [AC_MSG_ERROR([user selected but libuser not found])],
2135 [*:yes],
2136 [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])]
2137 )
1f6ec24c
KZ
2138 # temporary solution, libuser has stupid .pc where are exported all
2139 # private dependencies to Requires: instead of Requires.private:
3013eb9d 2140 AS_IF([test "x$have_user" = xyes], [
1f6ec24c 2141 LIBUSER_LIBS=-luser
3013eb9d
SK
2142 ])
2143])
034d378b 2144AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes])
7e4714f2 2145
d86918b6
KZ
2146AC_ARG_ENABLE([chfn-chsh-password],
2147 AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]),
034d378b 2148 [], [enable_chfn_chsh_password=yes]
d86918b6
KZ
2149)
2150
2151AC_ARG_ENABLE([chfn-chsh],
f205a073 2152 AS_HELP_STRING([--disable-chfn-chsh], [do not build chfn and chsh]),
9a4e9c9d 2153 [], [UL_DEFAULT_ENABLE([chfn_chsh], [check])]
d86918b6
KZ
2154)
2155UL_BUILD_INIT([chfn_chsh])
d00c10ed 2156UL_REQUIRES_HAVE([chfn_chsh], [shadow_h], [shadow.h header])
49a3d609 2157UL_REQUIRES_HAVE([chfn_chsh], [getusershell], [getusershell function])
d86918b6 2158
948182f4 2159AS_IF([test "x$enable_chfn_chsh_password" = xyes || test "x$have_user" = xyes], [
fe2c9909 2160 UL_REQUIRES_HAVE([chfn_chsh], [security_pam_appl_h], [PAM header file])
034d378b 2161 AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?])
3013eb9d 2162])
034d378b
SK
2163AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes])
2164AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes])
d86918b6
KZ
2165
2166AC_ARG_ENABLE([chsh-only-listed],
5c0b406d
BS
2167 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
2168 [], enable_chsh_only_listed=yes
d86918b6 2169)
7e4714f2 2170
3013eb9d
SK
2171AS_IF([test "x$enable_chsh_only_listed" = xyes], [
2172 AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?])
2173])
71681ee5 2174
2c8a3e16 2175
e7614a07
KZ
2176AC_ARG_ENABLE([login],
2177 AS_HELP_STRING([--disable-login], [do not build login]),
08b1c219 2178 [], [UL_DEFAULT_ENABLE([login], [check])]
e7614a07
KZ
2179)
2180UL_BUILD_INIT([login])
fe2c9909
WJ
2181UL_REQUIRES_HAVE([login], [security_pam_appl_h], [PAM header file])
2182UL_REQUIRES_HAVE([login], [security_pam_misc_h, security_openpam_h], [PAM conversation functions])
b4b919fe 2183UL_REQUIRES_HAVE([login], [utmpx_h], [utmpx.h header])
73afd3f8 2184UL_REQUIRES_HAVE([login], [gnu_utmpx], [GNU utmpx functions])
034d378b 2185AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes])
e7614a07 2186
71681ee5
KZ
2187AC_ARG_ENABLE([login-chown-vcs],
2188 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
034d378b 2189 [], [enable_login_chown_vcs=no]
71681ee5
KZ
2190)
2191
3013eb9d 2192AS_IF([test "x$enable_login_chown_vcs" = xyes], [
034d378b 2193 AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?])
3013eb9d 2194])
71681ee5
KZ
2195
2196AC_ARG_ENABLE([login-stat-mail],
2197 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
034d378b 2198 [], [enable_login_stat_mail=no]
71681ee5
KZ
2199)
2200
3013eb9d 2201AS_IF([test "x$enable_login_stat_mail" = xyes], [
034d378b 2202 AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?])
3013eb9d 2203])
71681ee5 2204
e7614a07 2205
88407b93
KZ
2206AC_ARG_ENABLE([nologin],
2207 AS_HELP_STRING([--disable-nologin], [do not build nologin]),
08b1c219 2208 [], [UL_DEFAULT_ENABLE([nologin], [yes])]
88407b93
KZ
2209)
2210UL_BUILD_INIT([nologin])
2211AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
2212
2213
e7614a07
KZ
2214AC_ARG_ENABLE([sulogin],
2215 AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
d00c10ed 2216 [], [UL_DEFAULT_ENABLE([sulogin], [check])]
e7614a07
KZ
2217)
2218UL_BUILD_INIT([sulogin])
8229ed2f 2219UL_REQUIRES_HAVE([sulogin], [crypt], [crypt function])
d00c10ed 2220UL_REQUIRES_HAVE([sulogin], [shadow_h], [shadow.h header])
034d378b 2221AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
e7614a07 2222
f17f5f48 2223
ff4c5555
KZ
2224AC_ARG_ENABLE([su],
2225 AS_HELP_STRING([--disable-su], [do not build su]),
08b1c219 2226 [], [UL_DEFAULT_ENABLE([su], [check])]
ff4c5555
KZ
2227)
2228UL_BUILD_INIT([su])
fe2c9909 2229UL_REQUIRES_HAVE([su], [security_pam_appl_h], [PAM header file])
b4b919fe 2230UL_REQUIRES_HAVE([su], [utmpx_h], [utmpx.h header])
73afd3f8 2231UL_REQUIRES_HAVE([su], [gnu_utmpx], [GNU utmpx functions])
034d378b 2232AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
ff4c5555
KZ
2233
2234
7ec6adb1
KZ
2235AC_ARG_ENABLE([runuser],
2236 AS_HELP_STRING([--disable-runuser], [do not build runuser]),
08b1c219 2237 [], [UL_DEFAULT_ENABLE([runuser], [check])]
7ec6adb1
KZ
2238)
2239UL_BUILD_INIT([runuser])
fe2c9909 2240UL_REQUIRES_HAVE([runuser], [security_pam_appl_h], [PAM header file])
b4b919fe 2241UL_REQUIRES_HAVE([runuser], [utmpx_h], [utmpx.h header])
73afd3f8 2242UL_REQUIRES_HAVE([runuser], [gnu_utmpx], [GNU utmpx functions])
034d378b 2243AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
7ec6adb1
KZ
2244
2245
53b22add
KZ
2246AC_ARG_ENABLE([ul],
2247 AS_HELP_STRING([--disable-ul], [do not build ul]),
08b1c219 2248 [], [UL_DEFAULT_ENABLE([ul], [check])]
53b22add
KZ
2249)
2250UL_BUILD_INIT([ul])
3cc8a9f4 2251UL_REQUIRES_HAVE([ul], [ncursesw, ncurses], [ncursesw or ncurses libraries])
034d378b 2252AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
53b22add
KZ
2253
2254
2255AC_ARG_ENABLE([more],
2256 AS_HELP_STRING([--disable-more], [do not build more]),
08b1c219 2257 [], [UL_DEFAULT_ENABLE([more], [check])]
53b22add
KZ
2258)
2259UL_BUILD_INIT([more])
3cc8a9f4 2260UL_REQUIRES_HAVE([more], [ncursesw, ncurses], [ncursesw or ncurses libraries])
823ef319 2261UL_REQUIRES_LINUX([more])
034d378b 2262AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])
53b22add
KZ
2263
2264
2265AC_ARG_ENABLE([pg],
00971cca
SK
2266 AS_HELP_STRING([--enable-pg], [build pg]),
2267 [], [UL_DEFAULT_ENABLE([pg], [no])]
53b22add
KZ
2268)
2269UL_BUILD_INIT([pg])
4b439e2d 2270UL_REQUIRES_HAVE([pg], [ncursesw, ncurses], [ncursesw or ncurses library])
034d378b 2271AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes])
53b22add
KZ
2272
2273
d78d0409
KZ
2274AC_ARG_ENABLE([setterm],
2275 AS_HELP_STRING([--disable-setterm], [do not build setterm]),
08b1c219 2276 [], [UL_DEFAULT_ENABLE([setterm], [check])]
d78d0409
KZ
2277)
2278UL_BUILD_INIT([setterm])
2279UL_REQUIRES_LINUX([setterm])
4b439e2d 2280UL_REQUIRES_HAVE([setterm], [ncursesw, ncurses], [ncursesw or ncurses library])
034d378b 2281AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
d78d0409 2282
d6ace0b8
KZ
2283# build_schedutils= is just configure-only variable to control
2284# ionice, taskset and chrt
48d7b13a 2285AC_ARG_ENABLE([schedutils],
34228e69 2286 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
fc72f51e 2287 [], [UL_DEFAULT_ENABLE([schedutils], [check])]
48d7b13a 2288)
17d5e11b 2289
6f2eb034
KZ
2290
2291UL_ENABLE_ALIAS([ionice], [schedutils])
2292UL_BUILD_INIT([ionice])
17d5e11b
KZ
2293UL_REQUIRES_SYSCALL_CHECK([ionice],
2294 [UL_CHECK_SYSCALL([ioprio_set],
f06b4328
SK
2295 [alpha], [442],
2296 [i*86], [289],
2297 [ia64*], [1274],
2298 [powerpc*], [273],
2299 [s390*], [282],
2300 [sparc*], [196],
2301 [sh*], [288],
2302 [x86_64*], [251])],
17d5e11b
KZ
2303 [ioprio_set])
2304
2305UL_REQUIRES_SYSCALL_CHECK([ionice],
2306 [UL_CHECK_SYSCALL([ioprio_get],
f06b4328
SK
2307 [alpha], [443],
2308 [i*86], [290],
2309 [ia64*], [1275],
2310 [powerpc*], [274],
2311 [s390*], [283],
2312 [sparc*], [218],
2313 [sh*], [289],
2314 [x86_64*], [252])],
17d5e11b
KZ
2315 [ioprio_get])
2316
034d378b 2317AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
17d5e11b 2318
6f2eb034
KZ
2319
2320UL_ENABLE_ALIAS([taskset], [schedutils])
2321UL_BUILD_INIT([taskset])
e21e6d26 2322UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
17d5e11b
KZ
2323UL_REQUIRES_SYSCALL_CHECK([taskset],
2324 [UL_CHECK_SYSCALL([sched_getaffinity])],
2325 [sched_getaffinity])
034d378b 2326AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
48d7b13a 2327
ee20c303
RM
2328
2329have_schedsetter=no
2330AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes],
2331 [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes])
2332
6f2eb034
KZ
2333UL_ENABLE_ALIAS([chrt], [schedutils])
2334UL_BUILD_INIT([chrt])
ee20c303 2335UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions])
d6ace0b8
KZ
2336AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
2337
15167589
KZ
2338AS_IF([test "x$build_chrt" = xyes], [
2339 UL_CHECK_SYSCALL([sched_setattr])
2340])
2341
f59654bb
QY
2342UL_ENABLE_ALIAS([uclampset], [schedutils])
2343UL_BUILD_INIT([uclampset])
82643a9b
KZ
2344UL_REQUIRES_SYSCALL_CHECK([uclampset],
2345 [UL_CHECK_SYSCALL([sched_setattr])], [sched_setattr])
f59654bb
QY
2346AM_CONDITIONAL([BUILD_UCLAMPSET], [test "x$build_uclampset" = xyes])
2347
48d7b13a
KZ
2348
2349AC_ARG_ENABLE([wall],
7fa4f112 2350 AS_HELP_STRING([--disable-wall], [do not build wall]),
d00c10ed 2351 [], [UL_DEFAULT_ENABLE([wall], [check])]
48d7b13a 2352)
8fc8888b 2353UL_BUILD_INIT([wall])
b4b919fe 2354UL_REQUIRES_HAVE([wall], [utmpx_h], [utmpx.h header])
034d378b 2355AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
48d7b13a
KZ
2356
2357
2358AC_ARG_ENABLE([write],
7fa4f112 2359 AS_HELP_STRING([--enable-write], [build write]),
08b1c219 2360 [], [UL_DEFAULT_ENABLE([write], [no])]
48d7b13a 2361)
61a074f7 2362UL_BUILD_INIT([write])
b4b919fe 2363UL_REQUIRES_HAVE([write], [utmpx_h], [utmpx.h header])
73afd3f8 2364UL_REQUIRES_HAVE([write], [gnu_utmpx], [GNU utmpx functions])
034d378b 2365AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes])
48d7b13a
KZ
2366
2367
5a971329 2368AC_ARG_WITH([btrfs],
95a89bd3 2369 AS_HELP_STRING([--without-btrfs], [do not build with btrfs support]),
5a971329
KZ
2370 [], [with_btrfs=check]
2371)
2372have_btrfs=no
2373AS_IF([test "x$with_btrfs" != xno], [
2374 AS_CASE([$with_btrfs:$have_linux_btrfs_h],
2375 [yes:no],
2376 [AC_MSG_ERROR([btrfs selected but linux/btrfs.h not found])],
2377 [check:no],
2378 [AC_MSG_WARN([linux/btrfs.h not found, do not build with btrfs support])],
2379 [*:yes],
2380 [have_btrfs=yes
2381 AC_DEFINE([HAVE_BTRFS_SUPPORT], [1], [Define if btrfs stuff is available])]
2382 )
2383])
2384AM_CONDITIONAL([HAVE_BTRFS], [test "x$have_btrfs" = xyes])
2385
2386
ebff016a 2387AC_ARG_WITH([systemd],
95a89bd3 2388 AS_HELP_STRING([--without-systemd], [do not build with systemd support]),
ebff016a
KZ
2389 [], [with_systemd=check]
2390)
2391
2392have_systemd=no
2393AS_IF([test "x$with_systemd" != xno], [
2394 # new version -- all libsystemd-* libs merged into libsystemd
2395 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
2396 # old versions
2397 AS_IF([test "x$have_systemd" != "xyes"], [
2398 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
2399 [have_systemd_daemon=yes], [have_systemd_daemon=no])
2400 PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal],
2401 [have_systemd_journal=yes], [have_systemd_journal=no])
948182f4 2402 AS_IF([test "x$have_systemd_daemon" = "xyes" && test "x$have_systemd_journal" = "xyes" ],[
ebff016a 2403 have_systemd=yes])
ea45d34c 2404 ])
ebff016a
KZ
2405 AS_CASE([$with_systemd:$have_systemd],
2406 [yes:no],
2407 [AC_MSG_ERROR([systemd expected but libsystemd not found])],
2408 [*:yes],
2409 AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
b66b5b97 2410 AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ])
ebff016a 2411 )
3013eb9d 2412])
ebff016a
KZ
2413AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes])
2414
bbe289c4 2415
1b68c379 2416AC_ARG_WITH([systemdsystemunitdir],
95a89bd3 2417 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd unit files (requires systemd support)]),
7a95313c
KZ
2418 [], [with_systemdsystemunitdir=check]
2419)
2420AS_IF([test "x$with_systemdsystemunitdir" = xcheck], [
2421 AS_IF([test "x$have_systemd" = xyes], [
2422 with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
2423 ],[
2424 with_systemdsystemunitdir=no
2425 ])
2426])
3013eb9d 2427AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
1b68c379 2428 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
3013eb9d 2429])
1b68c379 2430
bbe289c4 2431
b8095d25
KZ
2432AC_ARG_WITH([smack],
2433 AS_HELP_STRING([--with-smack], [build with SMACK support]),
2434 [], [with_smack=no]
2435)
2436AS_IF([test "x$with_smack" = xyes], [
2437 AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support])
2438])
2439
9e584ff3
TK
2440AC_ARG_WITH([econf],
2441 AS_HELP_STRING([--without-econf], [do not use libeconf]),
2442 [], [with_econf=check]
2443)
2444
2445have_econf=no
2446AS_IF([test "x$with_econf" != xno], [
9e584ff3
TK
2447 PKG_CHECK_MODULES([ECONF], [libeconf], [have_econf=yes], [have_econf=no])
2448 AS_CASE([$with_econf:$have_econf],
2449 [yes:no],
2450 [AC_MSG_ERROR([libeconf expected but libeconf not found])],
2451 [*:yes],
2452 AC_DEFINE([HAVE_LIBECONF], [1], [Define if libeconf is available])
2453 )
2454])
2455AM_CONDITIONAL([HAVE_ECONF], [test "x$have_econf" = xyes])
2456
fee99106 2457AC_ARG_WITH([vendordir],
cb776288 2458 AS_HELP_STRING([--with-vendordir=DIR], [Directory for distribution provided configuration files]),
fee99106 2459 [], []
9e584ff3 2460)
fee99106
KZ
2461AC_SUBST([vendordir], [$with_vendordir])
2462AM_CONDITIONAL([USE_VENDORDIR], [test "x$with_vendordir" != x])
2463AS_IF([test "x$with_vendordir" != x], [
2464 AC_DEFINE([USE_VENDORDIR], [1], [Define to 1 to use vendordir])
2465])
9e584ff3 2466
b8095d25 2467
9cc36e9f
SK
2468AC_ARG_WITH([bashcompletiondir],
2469 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
2470 [],
c8498f2f
SK
2471 [AS_IF([`$PKG_CONFIG --exists bash-completion`], [
2472 with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`
9cc36e9f
SK
2473 ], [
2474 with_bashcompletiondir=${datadir}/bash-completion/completions
2475 ])
2476])
2477AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
2478
ece777e9
KZ
2479AC_ARG_ENABLE([bash-completion],
2480 AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]),
034d378b 2481 [], [enable_bash_completion=yes]
ece777e9
KZ
2482)
2483
034d378b 2484AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
ece777e9 2485
9cc36e9f 2486
d78df0ac 2487AC_ARG_WITH([python],
4c54effb
KZ
2488 AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]),
2489 [], [with_python=check withval=check]
d78df0ac 2490)
8e5c4675 2491
d78df0ac 2492have_python=no
b2ae8c57 2493have_libpython=no
8e5c4675
KZ
2494AS_IF([test "x$with_python" != xno], [
2495 # We follow distributions default and look for PKG module name "python"
2496 # (minimal version is 2) but if major version is explicitly specified by
2497 # --with-python=2 or --with-python=3 then we look for PKG module "python2" or
2498 # "python3".
948182f4 2499 AS_IF([test "x$withval" != xno && test "x$withval" != xyes && test "x$withval" != xcheck],
0b567ae5 2500 [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"])
b2ae8c57
KZ
2501
2502 # check for python interpreter
0b567ae5 2503 AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no])
8e5c4675
KZ
2504 AS_CASE([$with_python:$have_python],
2505 [yes:no],
b2ae8c57 2506 [AC_MSG_ERROR([python selected but python interpreter not found])],
4c54effb 2507 [check:no],
b2ae8c57 2508 [AC_MSG_WARN([python interpreter not found, do not build python bindings])],
4c54effb 2509 [*:yes],
b2ae8c57
KZ
2510 # check for python development stuff
2511 [PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION],
2512 [have_libpython=yes], [have_libpython=no])]
8e5c4675 2513 )
d78df0ac
KZ
2514])
2515
da0ec90b
KZ
2516
2517AC_ARG_ENABLE([pylibmount],
2518 AS_HELP_STRING([--disable-pylibmount], [do not build pylibmount]),
2519 [], [UL_DEFAULT_ENABLE([pylibmount], [check])]
2520)
2521UL_BUILD_INIT([pylibmount])
b2ae8c57 2522UL_REQUIRES_HAVE([pylibmount], [libpython], [libpython])
da0ec90b 2523UL_REQUIRES_BUILD([pylibmount], [libmount])
d78df0ac
KZ
2524AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"])
2525
324330ac
FB
2526# We need to introduce a verbatim dependency into the Makefile, without automake
2527# trying to interpret it, so push it as a AM_SUBST_NOTMAKE variable.
2528verbatim_pylibmount_dependency='
2529
2530# pylibmountexec module must be installed after usrlib_exec libraries,
2531# otherwise the libtool relink step will fail to find libmount.la and
2532# will try -lmount which is possibly not available.
2533install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES
2534
2535'
2536AC_SUBST([verbatim_pylibmount_dependency])
2537AM_SUBST_NOTMAKE([verbatim_pylibmount_dependency])
d78df0ac 2538
48d7b13a 2539AC_ARG_ENABLE([pg-bell],
7fa4f112 2540 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
034d378b 2541 [], [enable_pg_bell=yes]
48d7b13a
KZ
2542)
2543
3013eb9d 2544AS_IF([test "x$enable_pg_bell" = xyes], [
034d378b 2545 AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?])
3013eb9d 2546])
48d7b13a
KZ
2547
2548
bb4cb69d
MF
2549AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
2550AC_ARG_ENABLE([fs-paths-default],
2551 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
9f57e6e8
SK
2552 [AS_CASE([$enableval],
2553 [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"],
2554 [no], [fs_paths_defaults=""],
2555 [fs_paths_defaults="$enableval"]
2556 )],
bb4cb69d
MF
2557 [fs_paths_defaults="FS_PATHS_DEFAULT"]
2558)
2559AC_ARG_ENABLE([fs-paths-extra],
2560 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
9f57e6e8
SK
2561 [AS_CASE([$enableval],
2562 [yes|no], [fs_paths_extra=""],
2563 [fs_paths_extra="$enableval"]
2564 )],
bb4cb69d
MF
2565 [fs_paths_extra=""]
2566)
2567fs_paths="$fs_paths_defaults"
3013eb9d
SK
2568AS_IF([test "x$fs_paths_extra" != "x"], [
2569 AS_IF([test "x$fs_paths" != "x"], [
bb4cb69d 2570 fs_paths="${fs_paths}:"
3013eb9d 2571 ])
bb4cb69d 2572 fs_paths="${fs_paths}${fs_paths_extra}"
3013eb9d 2573])
bb4cb69d
MF
2574AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
2575
2576
48d7b13a 2577AC_ARG_ENABLE([use-tty-group],
7fa4f112 2578 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
034d378b 2579 [], [enable_use_tty_group=yes]
48d7b13a 2580)
034d378b 2581AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes])
48d7b13a 2582
3013eb9d 2583AS_IF([test "x$enable_use_tty_group" = xyes], [
034d378b 2584 AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?])
3013eb9d 2585])
48d7b13a 2586
ab6478ef
WF
2587
2588AC_ARG_ENABLE([sulogin-emergency-mount],
479d50bd
DR
2589 AS_HELP_STRING([--enable-sulogin-emergency-mount],
2590 [use emergency mount of /dev and /proc for sulogin]),
034d378b 2591 [], [enable_sulogin_emergency_mount=no]
ab6478ef
WF
2592)
2593
3013eb9d 2594AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [
034d378b 2595 AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1],
3c560686 2596 [Should sulogin use an emergency mount of /dev and /proc?])
3013eb9d 2597])
ab6478ef
WF
2598
2599
f71d1104
KZ
2600AC_ARG_ENABLE([usrdir-path],
2601 AS_HELP_STRING([--enable-usrdir-path], [use only /usr paths in PATH env. variable (recommended on systems with /bin -> /usr/bin symlinks)]),
2602 [], [enable_usrdir_path=no]
2603)
2604
2afbcec5 2605AS_IF([test "x$enable_usrdir_path" = xyes], [
f71d1104
KZ
2606 AC_DEFINE([USE_USRDIR_PATHS_ONLY], [1], [Define to 1 to remove /bin and /sbin from PATH env.variable])
2607])
2608
2609
f3831bbd
KZ
2610AC_ARG_ENABLE([makeinstall-chown],
2611 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
034d378b 2612 [], [enable_makeinstall_chown=yes]
f3831bbd 2613)
034d378b 2614AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes])
f3831bbd 2615
81f55ab9 2616
4c24a7ae
KZ
2617AC_ARG_ENABLE([makeinstall-setuid],
2618 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
034d378b 2619 [], [enable_makeinstall_setuid=yes]
4c24a7ae 2620)
034d378b 2621AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes])
4c24a7ae 2622
06bcee19 2623
81f55ab9
KZ
2624AC_ARG_ENABLE([colors-default],
2625 AS_HELP_STRING([--disable-colors-default], [do not colorize output from utils by default]),
2626 [], [enable_colors_default=yes]
2627)
2628AS_IF([test "x$enable_colors_default" = xyes], [
2629 AC_DEFINE([USE_COLORS_BY_DEFAULT], [1], [Enables colorized output from utils by default])
2630])
2631
2632
e6a49887
LB
2633AC_ARG_WITH([cryptsetup],
2634 AS_HELP_STRING([--with-cryptsetup], [compile with cryptsetup support]),
2635 [], [with_cryptsetup=no]
2636)
2637
2638AS_IF([test "x$with_cryptsetup" = xno], [
2639 AM_CONDITIONAL([HAVE_CRYPTSETUP], [false])
488fd4c3 2640 AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false])
e6a49887
LB
2641], [
2642 PKG_CHECK_MODULES([CRYPTSETUP], [libcryptsetup],
2643 [AC_DEFINE([HAVE_CRYPTSETUP], [1], [Define if cryptsetup is available])
2644 UL_PKG_STATIC([CRYPTSETUP_LIBS_STATIC], [libcryptsetup])
2645 AM_CONDITIONAL([HAVE_CRYPTSETUP], [true])
123b1a67
LB
2646 SAVE_CFLAGS="$CFLAGS"
2647 CFLAGS="$CRYPTSETUP_CFLAGS $CFLAGS"
2648 SAVE_LIBS="$LIBS"
2649 LIBS="$CRYPTSETUP_LIBS $LIBS"
2650 AC_CHECK_LIB([cryptsetup], [crypt_activate_by_signed_key], [
2651 AC_DEFINE_UNQUOTED([HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY], [1], [Define if crypt_activate_by_signed_key exist in -lcryptsetup])
2652 ])
488fd4c3
LB
2653 AS_IF([test "x$with_cryptsetup" = xdlopen], [
2654 LIBS="-ldl $LIBS"
2655 AC_CHECK_LIB([dl], [dlsym], [
2656 AC_DEFINE([CRYPTSETUP_VIA_DLOPEN], [1], [Define if cryptsetup is to be loaded via dlopen])
2657 AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [true])
2658 ], [AC_MSG_ERROR([libdl required to build with cryptsetup support])])
2659 ], [
2660 AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false])
2661 ])
123b1a67
LB
2662 CFLAGS="$SAVE_CFLAGS"
2663 LIBS="$SAVE_LIBS"
e6a49887
LB
2664 have_cryptsetup=yes],
2665 [have_cryptsetup=no
488fd4c3
LB
2666 AM_CONDITIONAL([HAVE_CRYPTSETUP], [false])
2667 AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false])
2668 ])
e6a49887
LB
2669
2670 AS_CASE([$with_cryptsetup:$have_cryptsetup],
2671 [yes:no], [AC_MSG_WARN([cryptsetup selected but libcryptsetup not found])]
2672 )
2673])
2674AC_SUBST([CRYPTSETUP_LIBS])
2675AC_SUBST([CRYPTSETUP_LIBS_STATIC])
2676
2677
1f10890f
SK
2678AC_ARG_VAR([SUID_CFLAGS],
2679 [CFLAGS used for binaries which are usually with the suid bit])
2680AC_ARG_VAR([SUID_LDFLAGS],
2681 [LDFLAGS used for binaries which are usually with the suid bit])
06bcee19 2682
03d00d49
KZ
2683AC_ARG_VAR([DAEMON_CFLAGS],
2684 [CFLAGS used for binaries which are usually executed as daemons])
2685AC_ARG_VAR([DAEMON_LDFLAGS],
2686 [LDFLAGS used for binaries which are usually executed as daemons])
2687
2688AC_ARG_VAR([SOLIB_CFLAGS],
2689 [CFLAGS used for shared libraries])
2690AC_ARG_VAR([SOLIB_LDFLAGS],
2691 [LDFLAGS used for shared libraries])
2692
2ad21963
KZ
2693AC_ARG_VAR([ADJTIME_PATH],
2694 [Path to hwclock adjtime file, default /etc/adjtime])
2695AS_IF([test "x$ADJTIME_PATH" = x], [ADJTIME_PATH="/etc/adjtime"])
2696AC_DEFINE_UNQUOTED([CONFIG_ADJTIME_PATH], "$ADJTIME_PATH", [Path to hwclock adjtime file])
2697
2698
9cb68977 2699LIBS=""
48d7b13a 2700
48d7b13a 2701
034d378b 2702AC_CONFIG_HEADERS([config.h])
48d7b13a 2703
d4baf92e
KZ
2704#
2705# Don't use configure.ac to replace install paths! See Makefile PATHFILES for
2706# more details.
2707#
8eeb575c 2708AC_CONFIG_FILES([
f06b4328 2709Makefile
31a938ac 2710libblkid/docs/Makefile
8fb4efae 2711libblkid/docs/version.xml
8fb4efae 2712libblkid/src/blkid.h
705854f3
KZ
2713libfdisk/docs/Makefile
2714libfdisk/docs/version.xml
2715libfdisk/src/libfdisk.h
31a938ac 2716libmount/docs/Makefile
2aefc0a8 2717libmount/docs/version.xml
f06b4328 2718libmount/src/libmount.h
1d90bcb1
OO
2719libsmartcols/docs/Makefile
2720libsmartcols/docs/version.xml
1a4d989e 2721libsmartcols/src/libsmartcols.h
f06b4328 2722po/Makefile.in
8f5fff53 2723po-man/Makefile
8eeb575c 2724])
48d7b13a
KZ
2725
2726AC_OUTPUT
4e1073c2
KZ
2727
2728AC_MSG_RESULT([
a73035dc 2729 ${PACKAGE} ${VERSION}
4e1073c2 2730
a73035dc
KZ
2731 prefix: ${prefix}
2732 exec prefix: ${exec_prefix}
4e1073c2 2733
a73035dc
KZ
2734 bindir: ${bindir}
2735 sbindir: ${sbindir}
2736 libdir: ${libdir}
2737 usrbin_execdir: ${usrbin_execdir}
2738 usrsbin_execdir: ${usrsbin_execdir}
2739 usrlib_execdir: ${usrlib_execdir}
3d289965 2740
a73035dc
KZ
2741 localstatedir: ${localstatedir}
2742 runstatedir: ${runstatedir}
2743 includedir: ${includedir}
2744 sysconfdir: ${sysconfdir}
2745 sysconfstaticdir: ${sysconfstaticdir}
3d289965 2746
a73035dc 2747 vendordir: ${with_vendordir}
4e1073c2 2748
a73035dc
KZ
2749 Python: ${PYTHON}
2750 Python version: ${PYTHON_VERSION}
2751 Python libs: ${pyexecdir}
8e5c4675 2752
a73035dc
KZ
2753 Bash completions: ${with_bashcompletiondir}
2754 Systemd support: ${have_systemd}
2755 Systemd unitdir: ${with_systemdsystemunitdir}
2756 libeconf support: ${have_econf}
2757 Btrfs support: ${have_btrfs}
2758 Wide-char support: ${build_widechar}
034ca748 2759 libcryptsetup support: ${have_cryptsetup}
3745d4a9 2760
a73035dc
KZ
2761 Manual pages: ${build_asciidoc}
2762 Manual pages translated: ${build_poman}
4e1073c2 2763
8519f4dd 2764 compiler: ${CC} / ${CXX}
a73035dc
KZ
2765 suid cflags: ${SUID_CFLAGS}
2766 ldflags: ${LDFLAGS}
2767 suid ldflags: ${SUID_LDFLAGS}
2768 ASAN enabled: ${enable_asan}
22a900a9 2769
a73035dc
KZ
2770 cflags: ${CFLAGS}
2771
2772 warnings:
4e1073c2
KZ
2773
2774${WARN_CFLAGS}
b4b84389 2775
a73035dc 2776 Type 'make' or 'make <utilname>' to compile.
4e1073c2 2777])