95
136
AC_PATH_PROG([XSLTPROC], [xsltproc])
103
AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes)
139
AS_CASE([${host_os}], [*linux*], [linux_os=yes])
140
AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes])
105
AC_PATH_PROG(PERL, perl)
142
dnl define ARCH_<NAME> conditionals
143
UL_SET_ARCH([I86], [i?86-*])
144
UL_SET_ARCH([86_64], [x86_64*])
145
UL_SET_ARCH([IA64], [ia64*])
146
UL_SET_ARCH([S390], [s390*])
147
UL_SET_ARCH([SPARC], [sparc*])
148
UL_SET_ARCH([PPC], [ppc*|powerpc*])
149
UL_SET_ARCH([M68K], [m68*])
150
UL_SET_ARCH([MIPS], [mips*])
151
UL_SET_ARCH([HPPA], [hppa*])
155
dnl Don't forget to maintain alternatively allowed versions in autogen.sh!
156
AM_GNU_GETTEXT_VERSION([0.18.3])
157
AM_GNU_GETTEXT([external])
159
AS_IF([test -d "$srcdir/po"], [
160
ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
162
ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu"
109
165
AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
110
166
#ifdef HAVE_LINUX_COMPILER_H
111
167
#include <linux/compiler.h>
120
183
linux/version.h \
192
security/pam_misc.h \
137
200
sys/disklabel.h \
157
AC_CHECK_HEADERS([linux/raw.h],
158
[AM_CONDITIONAL([HAVE_RAW], [true])],
159
[AM_CONDITIONAL([HAVE_RAW], [false])])
161
221
AC_CHECK_HEADERS([langinfo.h],
162
222
[AM_CONDITIONAL([HAVE_LANGINFO], [true])],
163
223
[AM_CONDITIONAL([HAVE_LANGINFO], [false])])
225
dnl Convert some ac_cv_header_* variables to have_*
227
have_linux_raw_h=$ac_cv_header_linux_raw_h
228
have_linux_securebits_h=$ac_cv_header_linux_securebits_h
229
have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
230
have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
233
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
238
struct tm *tm = localtime(0);
239
if (a == -1) /* false */
240
sleep(tm->tm_gmtoff);
242
[AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
245
AC_CHECK_MEMBERS([struct termios.c_line],,,
246
[[#include <termios.h>]])
248
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
249
[#include <sys/stat.h>])
251
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
253
#ifdef HAVE_SYS_SWAP_H
254
# include <sys/swap.h>
258
[[swapon("/dev/null", 0);]])],
259
[AC_DEFINE([SWAPON_HAS_TWO_ARGS], [1], [Is swapon() declared with two parameters?])
261
[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
166
265
AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
168
267
AC_CHECK_DECL([llseek],
169
[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
268
[AC_DEFINE([HAVE_LLSEEK_PROTOTYPE], [1],
170
269
[Define to 1 if have llseek prototype])],
172
271
[#include <unistd.h>])
174
273
AC_CHECK_DECL([lseek64],
175
[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
274
[AC_DEFINE([HAVE_LSEEK64_PROTOTYPE], [1],
176
275
[Define to 1 if have lseek64 prototype])],
178
277
[#define _LARGEFILE_SOURCE
179
278
#define _LARGEFILE64_SOURCE
180
279
#include <unistd.h>])
281
AC_CHECK_DECL([environ],
282
[AC_DEFINE([HAVE_ENVIRON_DECL], [1],
283
[Define to 1 if have **environ prototype])],
286
AC_CHECK_DECL([strsignal],
287
[AC_DEFINE([HAVE_STRSIGNAL_DECL], [1],
288
[Define to 1 if have strsignal function prototype])],
190
get_current_dir_name \
221
335
AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
223
336
AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
224
AM_CONDITIONAL([BUILD_HWCLOCK], test "x$have_io" = xyes -o "x$linux_os" = xyes)
226
AC_CHECK_MEMBER(struct sockaddr.sa_len,
227
AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
338
AC_CHECK_MEMBER([struct sockaddr.sa_len],
339
AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
228
340
[#include <sys/types.h>
229
341
#include <sys/socket.h>])
232
AC_SEARCH_LIBS([gethostbyname], [nsl],
233
[if test x"$ac_cv_search_gethostbyname" != x"none required"; then
234
SOCKET_LIBS="$SOCKET_LIBS -lnsl";
236
344
AC_SEARCH_LIBS([socket], [socket],
237
[if test x"$ac_cv_search_socket" != x"none required"; then
238
SOCKET_LIBS="$SOCKET_LIBS -lsocket";
345
[AS_IF([test x"$ac_cv_search_socket" != x"none required"],
346
[SOCKET_LIBS="$SOCKET_LIBS -lsocket"])
240
348
AC_SUBST([SOCKET_LIBS])
244
352
AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
245
if test x"$have_dirfd" = xno ; then
353
AS_IF([test x"$have_dirfd" = xno], [
246
354
AC_CHECK_DECLS([dirfd],
247
355
[have_dirfd=yes], [have_dirfd=no],
248
356
[#include <sys/types.h>
249
357
#include <dirent.h>])
253
if test x"$have_dirfd" = xno ; then
361
AS_IF([test x"$have_dirfd" = xno], [
254
362
AC_CHECK_MEMBERS([DIR.dd_fd],
255
363
[have_ddfd=yes], [have_ddfd=no],
256
364
[#include <sys/types.h>
257
365
#include <dirent.h>])
260
case "$have_dirfd:$have_ddfd" in
262
AC_MSG_ERROR([cannot find a method to get filedescriptor of directory]) ;;
266
AC_MSG_CHECKING(whether program_invocation_short_name is defined)
267
AC_TRY_COMPILE([#include <argp.h>],
268
[program_invocation_short_name = "test";],
269
AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1,
270
[Define if program_invocation_short_name is defined])
368
AS_CASE([$have_dirfd:$have_ddfd],
370
[AC_MSG_ERROR([cannot find a method to get filedescriptor of directory])]
374
AC_MSG_CHECKING([whether program_invocation_short_name is defined])
375
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
378
program_invocation_short_name = "test";
381
AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
382
[Define if program_invocation_short_name is defined])
274
388
AC_MSG_CHECKING([whether __progname is defined])
275
389
AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;],
276
[if (*__progname == 0) return;])],
277
AC_DEFINE(HAVE___PROGNAME, 1, [Define if __progname is defined])
390
[if (*__progname == 0) return;])],
391
AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined])
392
AC_MSG_RESULT([yes]),
281
395
dnl Static compilation
282
m4_define([UTIL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
396
m4_define([UL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
284
398
AC_ARG_ENABLE([static-programs],
285
399
[AS_HELP_STRING([--enable-static-programs=LIST],
286
400
[link static the programs in LIST (comma-separated,
287
supported for ]m4_defn([UTIL_STATIC_PROGRAMS])[)])])
401
supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])])
289
case $enable_static_programs in
290
yes) enable_static_programs=m4_quote(UTIL_STATIC_PROGRAMS) ;;
291
no) enable_static_programs= ;;
403
AS_CASE([$enable_static_programs],
405
[enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)],
407
[enable_static_programs=]
294
410
dnl Set all the individual AM_CONDITIONALs
295
m4_foreach([UTIL_PRG], m4_defn([UTIL_STATIC_PROGRAMS]), [
296
case ,$enable_static_programs, in
297
*,UTIL_PRG,*) static_[]UTIL_PRG=yes ;;
299
AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UTIL_PRG),
300
[test "x$static_[]UTIL_PRG" = xyes])
303
dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
304
dnl ----------------------------------
305
AC_DEFUN([UTIL_PKG_STATIC], [
306
if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
307
$1=`pkg-config --libs --static "$2"`
309
AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
313
dnl UTIL_CHECK_LIB(LIBRARY, FUNCTION, [VARSUFFIX = $1]))
314
dnl The VARSUFFIX is optional and overrides the default behaviour. For example:
315
dnl UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX
316
dnl UTIL_CHECK_LIB(yyy, func) generates have_yyy and HAVE_LIBYYY
317
dnl ---------------------------------
318
AC_DEFUN([UTIL_CHECK_LIB], [
319
m4_define([suffix], m4_default([$3],$1))
322
[AC_CHECK_LIB([$1], [$2], [AC_DEFINE(AS_TR_CPP([HAVE_LIB]suffix), 1)], [[have_]suffix=no])],
323
[AC_CHECK_LIB([$1], [$2], [], [[have_]suffix=no])])
324
AM_CONDITIONAL(AS_TR_CPP([HAVE_]suffix), [test [$have_]suffix = yes])
327
dnl UTIL_SET_FLAGS(CFLAGS, CPPFLAGS, LDFLAGS)
328
AC_DEFUN([UTIL_SET_FLAGS], [
330
old_CPPFLAGS="$CPPFLAGS"
331
old_LDFLAGS="$LDFLAGS"
333
CPPFLAGS="$CPPFLAGS $2"
334
LDFLAGS="$LDFLAGS $3"
337
dnl UTIL_RESTORE_FLAGS()
338
AC_DEFUN([UTIL_RESTORE_FLAGS], [
340
CPPFLAGS="$old_CPPFLAGS"
341
LDFLAGS="$old_LDFLAGS"
411
m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
412
AS_CASE([,$enable_static_programs,],
413
[*,UL_PRG,*], [static_[]UL_PRG=yes]
415
AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])])
416
AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG),
417
[test "x$static_[]UL_PRG" = xyes])
421
AC_ARG_ENABLE([all-programs],
422
AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]),
423
[], [enable_all_programs=undefined]
426
AS_CASE([$enable_all_programs],
427
[yes], [AC_MSG_WARN([force to build all programs by default])
428
ul_default_estate=check],
429
[no], [AC_MSG_WARN([disable all programs by default])
430
ul_default_estate=no]
347
AC_ARG_ENABLE([mount],
348
AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
349
[], enable_mount=check
352
if test "x$enable_mount" = xcheck; then
353
if test "x$linux_os" = xno; then
354
AC_MSG_WARN([non-linux system; do not build mount utilities])
357
elif test "x$enable_mount" = xno; then
360
AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes)
363
AC_ARG_ENABLE([fsck],
364
AS_HELP_STRING([--disable-fsck], [do not build fsck]),
367
AM_CONDITIONAL(BUILD_FSCK, test "x$enable_fsck" = xyes)
370
AC_ARG_ENABLE([partx],
371
AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
372
[], enable_partx=check
375
if test "x$enable_partx" = xcheck; then
376
if test "x$linux_os" = xno; then
377
AC_MSG_WARN([non-linux system; do not build partx utilities])
380
elif test "x$enable_partx" = xno; then
383
AM_CONDITIONAL(BUILD_PARTX, test "x$build_partx" = xyes)
386
AC_ARG_ENABLE([libuuid],
387
AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
388
[], enable_libuuid=yes
390
AC_SUBST([LIBUUID_VERSION])
391
AC_SUBST([LIBUUID_VERSION_INFO])
392
AM_CONDITIONAL(BUILD_LIBUUID, test "x$enable_libuuid" = xyes)
394
if test "x$enable_libuuid" = xyes; then
395
AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
397
AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
401
AC_ARG_ENABLE([uuidd],
402
AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
403
[], enable_uuidd=auto
406
case "$enable_uuidd:$enable_libuuid" in
408
AC_MSG_ERROR([cannot enable uuidd when libuuid is disabled]) ;;
410
enable_uuidd=$enable_libuuid ;;
412
if test "x$enable_uuidd" = xyes; then
413
AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.])
415
AM_CONDITIONAL(BUILD_UUIDD, test "x$enable_uuidd" = xyes)
418
AC_ARG_ENABLE([libblkid],
419
AS_HELP_STRING([--disable-libblkid], [do not build libblkid and blkid utilities]),
420
[], enable_libblkid=yes
422
AC_SUBST([LIBBLKID_DATE])
423
AC_SUBST([LIBBLKID_VERSION])
424
AC_SUBST([LIBBLKID_VERSION_INFO])
425
AM_CONDITIONAL(BUILD_LIBBLKID, test "x$enable_libblkid" = xyes)
426
AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
427
AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
429
if test "x$enable_libblkid" = xyes; then
430
AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
432
if test "x$build_mount" = xyes; then
433
AC_MSG_ERROR([libblkid is needed to build util-linux mount])
435
if test "x$enable_fsck" = xyes; then
436
AC_MSG_ERROR([libblkid is needed to build util-linux fsck])
438
if test "x$build_partx" = xyes; then
439
AC_MSG_ERROR([libblkid is needed to build util-linux partx])
444
AC_ARG_ENABLE([libmount],
445
AS_HELP_STRING([--disable-libmount], [do not build libmount]),
446
[], enable_libmount=check
449
if test "x$enable_libmount" = xcheck; then
450
if test "x$linux_os" = xno; then
451
AC_MSG_WARN([non-linux system; do not build libmount])
454
elif test "x$enable_libmount" = xno; then
458
AC_DEFUN([UTIL_SCANF_TYPE_MODIFIER], [dnl
436
AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
459
437
# include <stdio.h>
650
556
char *c = crypt("abc","pw");
652
AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
558
AC_DEFINE([HAVE_LIBCRYPT], [1], [Do we need -lcrypt?])
655
561
AC_MSG_ERROR([crypt() is not available])
659
AM_CONDITIONAL(NEED_LIBCRYPT, test "x$need_libcrypt" = xyes)
661
AC_CHECK_TYPES([union semun], [], [], [[
664
AC_CHECK_TYPES(loff_t)
667
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
675
if (w == WEOF) exit(1);
679
[AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?)
683
dnl UTIL_CHECK_SYSCALL(SYSCALL, FALLBACK, ...)
684
dnl Only specify FALLBACK if the SYSCALL
685
dnl you're checking for is a "newish" one
686
dnl -------------------------------------
687
AC_DEFUN([UTIL_CHECK_SYSCALL], [
688
dnl This macro uses host_cpu.
689
AC_REQUIRE([AC_CANONICAL_HOST])
690
AC_CACHE_CHECK([for syscall $1],
691
[util_cv_syscall_$1],
692
[_UTIL_SYSCALL_CHECK_DECL([SYS_$1],
694
[dnl Our libc failed use, so see if we can get the kernel
695
dnl headers to play ball ...
696
_UTIL_SYSCALL_CHECK_DECL([_NR_$1],
700
if test "x$linux_os" = xyes; then
702
_UTIL_CHECK_SYSCALL_FALLBACK(m4_shift($@))
707
util_cv_syscall_$1=$syscall
564
AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
567
AC_ARG_WITH([selinux],
568
AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
569
[], [with_selinux=no]
572
AS_IF([test "x$with_selinux" = xno], [
573
AM_CONDITIONAL([HAVE_SELINUX], [false])
575
PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0],
576
[AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available])
577
UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
578
AM_CONDITIONAL([HAVE_SELINUX], [true])
582
AS_CASE([$with_selinux:$have_selinux],
583
[yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])]
586
AS_IF([test "x$have_selinux" = xyes], [
587
UL_SET_FLAGS([], [], [$SELINUX_LIBS])
588
# This function is missing in old libselinux 1.xx versions
589
AC_CHECK_FUNCS([security_get_initial_context])
593
AC_SUBST([SELINUX_LIBS])
594
AC_SUBST([SELINUX_LIBS_STATIC])
597
AS_HELP_STRING([--with-audit], [compile with audit support]),
601
AS_IF([test "x$with_audit" = xno], [
602
AM_CONDITIONAL([HAVE_AUDIT], [false])
604
UL_CHECK_LIB([audit], [audit_log_user_message])
605
AS_CASE([$with_audit:$have_audit],
607
[AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])]
611
AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]),
615
AS_IF([test "x$with_udev" = xno], [
616
AM_CONDITIONAL([HAVE_UDEV], [false])
618
UL_CHECK_LIB([udev], [udev_new])
619
AS_CASE([$with_udev:$have_udev],
621
[AC_MSG_ERROR([udev selected but libudev not found])]
625
AC_ARG_WITH([ncurses],
626
AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
627
(--without-ncurses disables all ncurses(w) support)]),
628
[], [with_ncurses=auto]
630
AM_CONDITIONAL([HAVE_NCURSES], [false])
632
AS_IF([test "x$with_ncurses" != xno], [
635
dnl First try to find the pkg-config module.
636
PKG_CHECK_MODULES(NCURSESW, [ncursesw], [
638
NCURSES_LIBS=${NCURSESW_LIBS}
639
NCURSES_CFLAGS=${NCURSESW_CFLAGS}
640
AC_DEFINE([HAVE_LIBNCURSESW])
641
CURSES_LIB_NAME="ncursesw"
643
PKG_CHECK_MODULES(NCURSES, [ncurses], [
645
AC_DEFINE([HAVE_LIBNCURSES])
646
CURSES_LIB_NAME="ncursesw"
650
AS_IF([test "x$have_ncurses" = xyes], [
651
dnl If that worked, setup the defines that the code expects.
652
save_CPPFLAGS="$CPPFLAGS"
653
CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
654
AC_CHECK_HEADERS([ncurses.h])
655
CPPFLAGS="$save_CPPFLAGS"
657
dnl If that failed, fall back to classic searching.
658
AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
659
AS_IF([test "x$with_ncurses" = xauto], [
660
UL_CHECK_LIB([ncursesw], [initscr], [ncurses])
661
AS_IF([test "x$have_ncurses" = xyes], [
662
AC_CHECK_HEADERS([ncursesw/ncurses.h])
663
NCURSES_LIBS="-lncursesw"
664
CURSES_LIB_NAME="ncursesw"
667
AS_IF([test "x$have_ncurses" = xno], [
668
UL_CHECK_LIB(ncurses, initscr)
669
AS_IF([test "x$have_ncurses" = xyes], [
670
NCURSES_LIBS="-lncurses"
671
CURSES_LIB_NAME="ncurses"
709
AM_CONDITIONAL([HAVE_]m4_toupper($1), [test "x$util_cv_syscall_$1" != xno])
710
case $util_cv_syscall_$1 in #(
711
no) AC_MSG_WARN([Unable to detect syscall $1.]) ;;
713
*) AC_DEFINE_UNQUOTED([SYS_$1], [$util_cv_syscall_$1],
714
[Fallback syscall number for $1]) ;;
718
dnl _UTIL_SYSCALL_CHECK_DECL(SYMBOL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
719
dnl Check if SYMBOL is declared, using the headers needed for syscall checks.
720
dnl -------------------------------------
721
m4_define([_UTIL_SYSCALL_CHECK_DECL],
722
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
723
#include <sys/syscall.h>
725
]], [[int test = $1;]])],
729
dnl _UTIL_CHECK_SYSCALL_FALLBACK(PATTERN, VALUE, ...)
730
dnl Helper macro to create the body for the above `case'.
731
dnl -------------------------------------
732
m4_define([_UTIL_CHECK_SYSCALL_FALLBACK],
735
$1) syscall="$2" ;;dnl
736
_UTIL_CHECK_SYSCALL_FALLBACK(m4_shiftn(2, $@))])dnl
740
UTIL_CHECK_SYSCALL([pivot_root])
741
UTIL_CHECK_SYSCALL([sched_getaffinity])
742
UTIL_CHECK_SYSCALL([ioprio_set],
751
UTIL_CHECK_SYSCALL([ioprio_get],
761
dnl fallocate could be available as libc function or as syscall only
762
UTIL_CHECK_SYSCALL([fallocate])
764
dnl check for valid fallocate() function
765
dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
766
dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
767
dnl and program can't be linked.
768
dnl AC_CHECK_FUNC can't catch such errors since it's redefining
769
dnl function prototype.
770
AC_MSG_CHECKING([for valid fallocate() function])
677
AS_IF([test "x$have_ncurses" = xno], [
678
AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
681
AC_SUBST([NCURSES_CFLAGS])
682
AC_SUBST([NCURSES_LIBS])
686
AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
690
AS_IF([test "x$with_slang" = xyes], [
691
AC_CHECK_HEADERS([slang.h slang/slang.h])
692
AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
693
[have_slang=yes], [], [
696
#elif defined(HAVE_SLANG_SLANG_H)
697
#include <slang/slang.h>
700
AS_IF([test "x$have_slang" = xno], [
701
AC_MSG_ERROR([slang selected but slcurses.h not found])],
702
[CURSES_LIB_NAME=slang
705
AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes])
708
AS_IF([test "x$have_slang" = xyes -o "x$have_ncurses" = xyes], [
709
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [
710
AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1,
711
[Define if curses library has the use_default_colors().])
713
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [
714
AC_DEFINE(HAVE_RESIZETERM, 1,
715
[Define if curses library has the resizeterm().])
720
dnl Try pkg-config for libtinfo
721
PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
722
dnl If that failed, fall back to classic searching.
723
AC_CHECK_LIB([tinfo], [tgetent], [
728
AC_SUBST([TINFO_LIBS])
729
AC_SUBST([TINFO_CFLAGS])
730
AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
733
AC_ARG_WITH([utempter],
734
AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
735
[], [with_utempter=no]
738
AS_IF([test "x$with_utempter" = xyes], [
739
UL_CHECK_LIB([utempter], [utempter_add_record])
740
AS_IF([test "x$have_utempter" = xno], [
741
AC_MSG_ERROR([utempter selected but libutempter not found])
744
AM_CONDITIONAL([HAVE_UTEMPTER], [false])
752
AC_ARG_ENABLE([libuuid],
753
AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
754
[], [UL_DEFAULT_ENABLE([libuuid], [yes])]
756
UL_BUILD_INIT([libuuid])
757
AC_SUBST([LIBUUID_VERSION])
758
AC_SUBST([LIBUUID_VERSION_INFO])
759
AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
761
AS_IF([test "x$build_libuuid" = xyes], [
762
AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
768
AC_ARG_ENABLE([libblkid],
769
AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
770
[], [UL_DEFAULT_ENABLE([libblkid], [yes])]
772
UL_BUILD_INIT([libblkid])
773
AC_SUBST([LIBBLKID_DATE])
774
AC_SUBST([LIBBLKID_VERSION])
775
AC_SUBST([LIBBLKID_VERSION_INFO])
776
AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string])
777
AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string])
778
AS_IF([test "x$build_libblkid" = xyes], [
779
AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.])
781
AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes])
782
AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes -a "x$enable_static" = xyes])
787
AC_ARG_ENABLE([libmount],
788
AS_HELP_STRING([--disable-libmount], [do not build libmount]),
789
[], [UL_DEFAULT_ENABLE([libmount], [check])]
791
UL_BUILD_INIT([libmount])
792
UL_REQUIRES_LINUX([libmount])
793
UL_REQUIRES_BUILD([libmount], [libblkid])
794
UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
795
AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
796
AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
798
AC_SUBST([LIBMOUNT_VERSION])
799
AC_SUBST([LIBMOUNT_VERSION_INFO])
800
AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])
806
AC_ARG_ENABLE([libsmartcols],
807
AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]),
808
[], [UL_DEFAULT_ENABLE([libsmartcols], [yes])]
810
UL_BUILD_INIT([libsmartcols])
811
AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes])
812
AM_CONDITIONAL([BUILD_LIBSMARTCOLS_TESTS], [test "x$build_libsmartcols" = xyes -a "x$enable_static" = xyes])
814
AC_SUBST([LIBSMARTCOLS_VERSION])
815
AC_SUBST([LIBSMARTCOLS_VERSION_INFO])
816
AC_DEFINE_UNQUOTED([LIBSMARTCOLS_VERSION], ["$LIBSMARTCOLS_VERSION"], [libsmartcols version string])
820
dnl libfdisk is enabled at all times if possible
822
UL_BUILD_INIT([libfdisk], [check])
823
UL_REQUIRES_BUILD([libfdisk], [libuuid])
824
UL_REQUIRES_BUILD([libfdisk], [libsmartcols])
825
AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes])
827
UL_BUILD_INIT([fdisk], [check])
828
UL_REQUIRES_BUILD([fdisk], [libfdisk])
829
AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes])
832
UL_BUILD_INIT([sfdisk], [check])
833
UL_EXCLUDE_ARCH([sfdisk], [sparc*])
834
AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
837
UL_BUILD_INIT([cfdisk], [check])
838
UL_REQUIRES_BUILD([cfdisk], [libfdisk])
839
UL_REQUIRES_BUILD([cfdisk], [libsmartcols])
840
UL_REQUIRES_HAVE([cfdisk], [ncurses,slang], [ncurses or slang library])
841
AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes])
844
AC_ARG_ENABLE([mount],
845
AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
846
[], [UL_DEFAULT_ENABLE([mount], [check])]
848
UL_BUILD_INIT([mount])
849
UL_REQUIRES_BUILD([mount], [libmount])
850
AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
853
AC_ARG_ENABLE([losetup],
854
AS_HELP_STRING([--disable-losetup], [do not build losetup]),
855
[], [UL_DEFAULT_ENABLE([losetup], [check])]
857
UL_BUILD_INIT([losetup])
858
UL_REQUIRES_LINUX([losetup])
859
UL_REQUIRES_BUILD([losetup], [libsmartcols])
860
AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes])
863
AC_ARG_ENABLE([fsck],
864
AS_HELP_STRING([--disable-fsck], [do not build fsck]),
865
[], [UL_DEFAULT_ENABLE([fsck], [check])]
867
UL_BUILD_INIT([fsck])
868
UL_REQUIRES_BUILD([fsck], [libmount])
869
AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes])
872
AC_ARG_ENABLE([partx],
873
AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
874
[], [UL_DEFAULT_ENABLE([partx], [check])]
876
UL_BUILD_INIT([partx])
877
UL_REQUIRES_LINUX([partx])
878
UL_REQUIRES_BUILD([partx], [libblkid])
879
UL_REQUIRES_BUILD([partx], [libsmartcols])
880
AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes])
883
AC_ARG_ENABLE([uuidd],
884
AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
885
[], [UL_DEFAULT_ENABLE([uuidd], [check])]
887
UL_BUILD_INIT([uuidd])
888
UL_REQUIRES_BUILD([uuidd], [libuuid])
889
AS_IF([test "x$build_uuidd" = xyes], [
890
AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])
892
AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes])
895
UL_BUILD_INIT([uuidgen], [check])
896
UL_REQUIRES_BUILD([uuidgen], [libuuid])
897
AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes])
899
UL_BUILD_INIT([blkid], [check])
900
UL_REQUIRES_BUILD([blkid], [libblkid])
901
AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes])
903
UL_BUILD_INIT([findfs], [check])
904
UL_REQUIRES_BUILD([findfs], [libblkid])
905
AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes])
907
UL_BUILD_INIT([wipefs], [check])
908
UL_REQUIRES_BUILD([wipefs], [libblkid])
909
AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes])
911
UL_BUILD_INIT([findmnt], [check])
912
UL_REQUIRES_BUILD([findmnt], [libmount])
913
UL_REQUIRES_BUILD([findmnt], [libsmartcols])
914
AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes])
917
AC_ARG_ENABLE([mountpoint],
918
AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
919
[], [UL_DEFAULT_ENABLE([mountpoint], [check])]
921
UL_BUILD_INIT([mountpoint])
922
UL_REQUIRES_BUILD([mountpoint], [libmount])
923
AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes])
926
AC_ARG_ENABLE([fallocate],
927
AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
928
[], [UL_DEFAULT_ENABLE([fallocate], [check])]
930
UL_BUILD_INIT([fallocate])
931
UL_REQUIRES_LINUX([fallocate])
932
UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
933
AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes])
935
AS_IF([test "x$build_fallocate" = xyes], [
936
dnl check for valid fallocate() function
937
dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
938
dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
939
dnl and program can't be linked.
940
dnl AC_CHECK_FUNC can't catch such errors since it's redefining
941
dnl function prototype.
942
AC_MSG_CHECKING([for valid fallocate() function])
943
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
773
944
#ifdef HAVE_UNISTD_H
774
945
# include <unistd.h>
788
958
ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
795
AC_DEFINE(HAVE_FALLOCATE,1,[Have valid fallocate() function])],[
796
AC_MSG_RESULT([no])])
798
dnl unshare could be available as libc function or as syscall only
799
UTIL_CHECK_SYSCALL([unshare])
964
AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[
965
AC_MSG_RESULT([no])])
969
AC_ARG_ENABLE([unshare],
970
AS_HELP_STRING([--disable-unshare], [do not build unshare]),
971
[], [UL_DEFAULT_ENABLE([unshare], [check])]
973
UL_BUILD_INIT([unshare])
974
UL_REQUIRES_LINUX([unshare])
975
UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
976
AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes])
800
977
AC_CHECK_FUNCS([unshare])
802
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
807
struct tm *tm = localtime(0);
808
if (a == -1) /* false */
809
sleep(tm->tm_gmtoff);
811
[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
814
AC_CHECK_MEMBERS([struct termios.c_line],,,
815
[[#include <termios.h>]])
817
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
818
[#include <sys/stat.h>])
830
ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
832
AC_CHECK_HEADERS([sys/swap.h])
834
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
836
#ifdef HAVE_SYS_SWAP_H
837
# include <sys/swap.h>
841
[[swapon("/dev/null", 0);]])],
842
[AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?])
844
[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
848
AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
852
AM_CONDITIONAL(HAVE_CPU_SET_T, [test "x$have_cpu_set_t" = xyes])
854
AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
859
dnl UTIL_SET_ARCH(ARCHNAME, PATTERN)
860
dnl ---------------------------------
861
AC_DEFUN([UTIL_SET_ARCH], [
866
AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test "x$cpu_$1" = xtrue])
869
UTIL_SET_ARCH(I86, i?86-*)
870
UTIL_SET_ARCH(86_64, x86_64*)
871
UTIL_SET_ARCH(IA64, ia64*)
872
UTIL_SET_ARCH(S390, s390*)
873
UTIL_SET_ARCH(SPARC, sparc*)
874
UTIL_SET_ARCH(PPC, ppc*|powerpc*)
875
UTIL_SET_ARCH(M68K, m68*)
876
UTIL_SET_ARCH(MIPS, mips*)
877
UTIL_SET_ARCH(HPPA, hppa*)
879
AC_ARG_ENABLE([arch],
880
AS_HELP_STRING([--enable-arch], [do build arch]),
883
AM_CONDITIONAL(BUILD_ARCH, test "x$enable_arch" = xyes)
885
AC_ARG_ENABLE([ddate],
886
AS_HELP_STRING([--enable-ddate], [do build ddate]),
889
AM_CONDITIONAL(BUILD_DDATE, test "x$enable_ddate" = xyes)
979
AC_ARG_ENABLE([nsenter],
980
AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
981
[], [UL_DEFAULT_ENABLE([nsenter], [check])]
983
UL_BUILD_INIT([nsenter])
984
UL_REQUIRES_LINUX([nsenter])
985
UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL_CHECK_SYSCALL([setns])], [setns])
986
AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
987
AC_CHECK_FUNCS([setns])
989
dnl setpriv depends on libcap-ng. It would be possible to build
990
dnl a version of setpriv with limited functionality without libcap-ng,
991
dnl but this isn't currently supported.
992
UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
993
AC_ARG_ENABLE([setpriv],
994
AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
995
[], [UL_DEFAULT_ENABLE([setpriv], [check])]
997
UL_BUILD_INIT([setpriv])
998
UL_REQUIRES_LINUX([setpriv])
999
UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [securebits.h header file])
1000
UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
1001
AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
1004
AC_ARG_ENABLE([eject],
1005
AS_HELP_STRING([--disable-eject], [do not build eject]),
1006
[], [UL_DEFAULT_ENABLE([eject], [check])]
1008
UL_BUILD_INIT([eject])
1009
UL_REQUIRES_LINUX([eject])
1010
UL_REQUIRES_BUILD([eject], [libmount])
1011
AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes])
891
1014
AC_ARG_ENABLE([agetty],
892
1015
AS_HELP_STRING([--disable-agetty], [do not build agetty]),
893
[], enable_agetty=yes
1016
[], [UL_DEFAULT_ENABLE([agetty], [yes])]
895
AM_CONDITIONAL(BUILD_AGETTY, test "x$enable_agetty" = xyes)
1018
UL_BUILD_INIT([agetty])
1019
AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
897
1022
AC_ARG_ENABLE([cramfs],
898
1023
AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
899
[], enable_cramfs=check
902
if test "x$enable_cramfs" = xno; then
906
dnl Trick: leave the third parameter empty to get the default action.
907
AC_CHECK_LIB(z, crc32, [], build_cramfs=no)
908
case $enable_cramfs:$build_cramfs in
909
yes:no) AC_MSG_ERROR([cramfs selected but libz not found]);;
912
AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
915
if test "x$have_openat" = xno; then
916
AC_MSG_WARN([openat() function not found; do not build lsblk])
918
elif test "x$linux_os" = xno; then
919
AC_MSG_WARN([non-linux system; do not build lsblk])
922
AM_CONDITIONAL(BUILD_LSBLK, test "x$build_lsblk" = xyes)
1024
[], [UL_DEFAULT_ENABLE([cramfs], [check])]
1026
UL_BUILD_INIT([cramfs])
1027
AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
1028
UL_REQUIRES_HAVE([cramfs], [z], [z library])
1029
AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])
1032
AC_ARG_ENABLE([bfs],
1033
AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]),
1034
[], [UL_DEFAULT_ENABLE([bfs], [yes])]
1036
UL_BUILD_INIT([bfs])
1037
AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
1040
AC_ARG_ENABLE([minix],
1041
AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]),
1042
[], [UL_DEFAULT_ENABLE([minix], [yes])]
1044
UL_BUILD_INIT([minix])
1045
AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes])
1048
AC_ARG_ENABLE([fdformat],
1049
AS_HELP_STRING([--disable-fdformat], [do not build fdformat]),
1050
[], [UL_DEFAULT_ENABLE([fdformat], [check])]
1052
UL_BUILD_INIT([fdformat])
1053
UL_REQUIRES_LINUX([fdformat])
1054
AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes])
1057
AC_ARG_ENABLE([hwclock],
1058
AS_HELP_STRING([--disable-hwclock], [do not build hwclock]),
1059
[], [UL_DEFAULT_ENABLE([hwclock], [check])]
1061
have_linuxdummy=$linux_os
1063
UL_BUILD_INIT([hwclock])
1064
UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux])
1065
AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes])
1068
UL_BUILD_INIT([mkfs], [yes])
1069
AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes])
1071
UL_BUILD_INIT([isosize], [yes])
1072
AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes])
1075
UL_BUILD_INIT([fstrim], [check])
1076
UL_REQUIRES_LINUX([fstrim])
1077
UL_REQUIRES_BUILD([fstrim], [libmount])
1078
AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes])
1081
UL_BUILD_INIT([swapon], [check])
1082
UL_REQUIRES_LINUX([swapon])
1083
UL_REQUIRES_BUILD([swapon], [libblkid])
1084
UL_REQUIRES_BUILD([swapon], [libmount])
1085
UL_REQUIRES_BUILD([swapon], [libsmartcols])
1086
AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
1089
UL_BUILD_INIT([lsblk], [check])
1090
UL_REQUIRES_LINUX([lsblk])
1091
UL_REQUIRES_BUILD([lsblk], [libblkid])
1092
UL_REQUIRES_BUILD([lsblk], [libmount])
1093
UL_REQUIRES_BUILD([lsblk], [libsmartcols])
1094
AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes])
1097
UL_BUILD_INIT([lscpu], [check])
1098
UL_REQUIRES_LINUX([lscpu])
1099
UL_REQUIRES_BUILD([lscpu], [libsmartcols])
1100
UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
1101
AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes])
1104
UL_BUILD_INIT([lslogins], [check])
1105
UL_REQUIRES_BUILD([lslogins], [libsmartcols])
1106
AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes])
1109
UL_BUILD_INIT([chcpu], [check])
1110
UL_REQUIRES_LINUX([chcpu])
1111
UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
1112
AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes])
1115
AC_ARG_ENABLE([wdctl],
1116
AS_HELP_STRING([--disable-wdctl], [do not build wdctl]),
1117
[], [UL_DEFAULT_ENABLE([wdctl], [check])]
1119
UL_BUILD_INIT([wdctl])
1120
UL_REQUIRES_LINUX([wdctl])
1121
UL_REQUIRES_BUILD([wdctl], [libsmartcols])
1122
UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
1123
AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes])
1126
UL_BUILD_INIT([swaplabel], [check])
1127
UL_REQUIRES_BUILD([swaplabel], [libblkid])
1128
AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
1131
UL_BUILD_INIT([mkswap], [yes])
1132
AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes])
1133
AS_IF([test "x$build_mkswap" = xyes -a "x$build_libuuid" != xyes], [
1134
AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
1137
UL_BUILD_INIT([cal], [yes])
1138
AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes])
1140
UL_BUILD_INIT([logger], [yes])
1141
AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes])
1143
UL_BUILD_INIT([look], [yes])
1144
AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes])
1146
UL_BUILD_INIT([mcookie], [yes])
1147
AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes])
1149
UL_BUILD_INIT([namei], [yes])
1150
AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes])
1152
UL_BUILD_INIT([whereis], [yes])
1153
AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes])
1155
UL_BUILD_INIT([getopt], [yes])
1156
AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes])
1159
UL_BUILD_INIT([blockdev], [check])
1160
UL_REQUIRES_LINUX([blockdev])
1161
AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes])
1164
UL_BUILD_INIT([prlimit], [check])
1165
UL_REQUIRES_LINUX([prlimit])
1166
UL_REQUIRES_BUILD([prlimit], [libsmartcols])
1167
UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
1168
AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes])
1169
AS_IF([test "x$build_prlimit" = xyes], [
1170
AC_CHECK_FUNCS([prlimit])
1174
UL_BUILD_INIT([lslocks], [check])
1175
UL_REQUIRES_LINUX([lslocks])
1176
UL_REQUIRES_BUILD([lslocks], [libmount])
1177
UL_REQUIRES_BUILD([lslocks], [libsmartcols])
1178
AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes])
924
1181
AC_ARG_ENABLE([switch_root],
925
1182
AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
926
[], enable_switch_root=check
1183
[], [UL_DEFAULT_ENABLE([switch_root], [check])]
928
if test "x$enable_switch_root" = xno; then
931
build_switch_root=yes
932
case $enable_switch_root:$linux_os in
933
yes:no) AC_MSG_ERROR([switch_root selected for non-linux system]);;
934
check:no) AC_MSG_WARN([non-linux system; do not build switch_root])
935
build_switch_root=no;;
937
if test "x$build_switch_root" = xyes; then
938
case $enable_switch_root:$have_openat in
939
yes:no) AC_MSG_ERROR([switch_root selected but openat() function not found]);;
940
check:no) AC_MSG_WARN([openat() function not found; do not build switch_root])
941
build_switch_root=no;;
945
AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
1185
UL_BUILD_INIT([switch_root])
1186
UL_REQUIRES_LINUX([switch_root])
1187
UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
1188
AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
948
1191
AC_ARG_ENABLE([pivot_root],
949
1192
AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
950
[], enable_pivot_root=check
952
if test "x$enable_pivot_root" = xno; then
956
case $enable_pivot_root:$linux_os in
957
yes:no) AC_MSG_ERROR([pivot_root selected for non-linux system]);;
958
check:no) AC_MSG_WARN([non-linux system; do not build pivot_root])
959
build_pivot_root=no;;
961
if test "x$build_pivot_root" = xyes; then
962
case $enable_pivot_root:$util_cv_syscall_pivot_root in
963
yes:no) AC_MSG_ERROR([pivot_root selected but pivot_root syscall not found]);;
964
check:no) AC_MSG_WARN([pivot_root syscall not found; do not build pivot_root])
965
build_pivot_root=no;;
969
AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes)
972
AC_ARG_ENABLE([fallocate],
973
AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
974
[], enable_fallocate=check
976
if test "x$enable_fallocate" = xno; then
980
case $enable_fallocate:$linux_os in
981
yes:no) AC_MSG_ERROR([fallocate selected for non-linux system]);;
982
check:no) AC_MSG_WARN([non-linux system; do not build fallocate])
985
if test "x$build_fallocate" = xyes; then
986
case $enable_fallocate:$util_cv_syscall_fallocate in
987
yes:no) AC_MSG_ERROR([fallocate selected but fallocate syscall not found]);;
988
check:no) AC_MSG_WARN([fallocate syscall not found; do not build fallocate])
993
AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = xyes)
996
AC_ARG_ENABLE([unshare],
997
AS_HELP_STRING([--disable-unshare], [do not build unshare]),
998
[], enable_unshare=check
1000
if test "x$enable_unshare" = xno; then
1004
case $enable_unshare:$linux_os in
1005
yes:no) AC_MSG_ERROR([unshare selected for non-linux system]);;
1006
check:no) AC_MSG_WARN([non-linux system; do not build unshare])
1009
if test "x$build_unshare" = xyes; then
1010
case $enable_unshare:$util_cv_syscall_unshare in
1011
yes:no) AC_MSG_ERROR([unshare selected but unshare syscall not found]);;
1012
check:no) AC_MSG_WARN([unshare syscall not found; do not build unshare])
1017
AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
1021
AC_ARG_ENABLE([elvtune],
1022
AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
1023
[], enable_elvtune=no
1025
AM_CONDITIONAL(BUILD_ELVTUNE, test "x$enable_elvtune" = xyes)
1193
[], [UL_DEFAULT_ENABLE([pivot_root], [check])]
1195
UL_BUILD_INIT([pivot_root])
1196
UL_REQUIRES_LINUX([switch_root])
1197
UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
1198
AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes])
1201
UL_BUILD_INIT([flock], [yes])
1202
AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes])
1204
UL_BUILD_INIT([ipcmk], [yes])
1205
AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes])
1207
UL_BUILD_INIT([ipcrm], [yes])
1208
AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes])
1210
UL_BUILD_INIT([ipcs], [yes])
1211
AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes])
1213
UL_BUILD_INIT([renice], [yes])
1214
AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes])
1216
UL_BUILD_INIT([setsid], [yes])
1217
AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes])
1219
UL_BUILD_INIT([readprofile], [check])
1220
UL_REQUIRES_LINUX([readprofile])
1221
AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes])
1223
UL_BUILD_INIT([dmesg], [check])
1224
UL_REQUIRES_LINUX([dmesg])
1225
AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes])
1227
UL_BUILD_INIT([ctrlaltdel], [check])
1228
UL_REQUIRES_LINUX([ctrlaltdel])
1229
AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes])
1231
UL_BUILD_INIT([fsfreeze], [check])
1232
UL_REQUIRES_LINUX([fsfreeze])
1233
AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes])
1235
UL_BUILD_INIT([blkdiscard], [check])
1236
UL_REQUIRES_LINUX([blkdiscard])
1237
AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes])
1239
UL_BUILD_INIT([ldattach], [check])
1240
UL_REQUIRES_LINUX([ldattach])
1241
AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes])
1243
UL_BUILD_INIT([rtcwake], [check])
1244
UL_REQUIRES_LINUX([rtcwake])
1245
AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes])
1247
UL_BUILD_INIT([setarch], [check])
1248
UL_REQUIRES_LINUX([setarch])
1249
AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes])
1251
UL_BUILD_INIT([script], [yes])
1252
AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes])
1254
UL_BUILD_INIT([scriptreplay], [yes])
1255
AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes])
1257
UL_BUILD_INIT([col], [yes])
1258
AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes])
1260
UL_BUILD_INIT([colcrt], [yes])
1261
AM_CONDITIONAL([BUILD_COLCRT], [test "x$build_colcrt" = xyes])
1263
UL_BUILD_INIT([colrm], [yes])
1264
AM_CONDITIONAL([BUILD_COLRM], [test "x$build_colrm" = xyes])
1266
UL_BUILD_INIT([column], [yes])
1267
AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes])
1269
UL_BUILD_INIT([hexdump], [yes])
1270
AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes])
1272
UL_BUILD_INIT([rev], [yes])
1273
AM_CONDITIONAL([BUILD_REV], [test "x$build_rev" = xyes])
1275
UL_BUILD_INIT([tailf], [yes])
1276
AM_CONDITIONAL([BUILD_TAILF], [test "x$build_tailf" = xyes])
1279
AC_ARG_ENABLE([tunelp],
1280
AS_HELP_STRING([--enable-tunelp], [build tunelp]),
1281
[], [UL_DEFAULT_ENABLE([tunelp], [no])]
1283
UL_BUILD_INIT([tunelp])
1284
UL_REQUIRES_LINUX([tunelp])
1285
AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes])
1027
1288
AC_ARG_ENABLE([kill],
1028
AS_HELP_STRING([--enable-kill], [build kill]),
1031
AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
1289
AS_HELP_STRING([--disable-kill], [do not build kill]),
1290
[], [UL_DEFAULT_ENABLE([kill], [check])]
1292
UL_BUILD_INIT([kill])
1293
UL_REQUIRES_LINUX([kill])
1294
AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])
1296
dnl Don't use UL_DEFAULT_ENABLE() here, deprecated stuff has to be insensitive
1297
dnl to --enable-all-programs.
1298
AC_ARG_ENABLE([deprecated-last],
1299
AS_HELP_STRING([--enable-deprecated-last], [build old deprecated last]),
1300
[], [enable_deprecated_last=no]
1302
UL_BUILD_INIT([deprecated_last])
1303
AM_CONDITIONAL([BUILD_DEPRECATED_LAST], [test "x$build_deprecated_last" = xyes])
1034
1306
AC_ARG_ENABLE([last],
1035
AS_HELP_STRING([--enable-last], [build last]),
1038
AM_CONDITIONAL(BUILD_LAST, test "x$enable_last" = xyes)
1307
AS_HELP_STRING([--disable-last], [do not build last]),
1308
[], [UL_DEFAULT_ENABLE([last], [check])]
1310
UL_BUILD_INIT([last])
1311
UL_CONFLICTS_BUILD([last], [deprecated_last], [old deprecated last version])
1312
AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
1315
AC_ARG_ENABLE([utmpdump],
1316
AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]),
1317
[], [UL_DEFAULT_ENABLE([utmpdump], [yes])]
1319
UL_BUILD_INIT([utmpdump])
1320
AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
1040
1323
AC_ARG_ENABLE([line],
1041
1324
AS_HELP_STRING([--enable-line], [build line]),
1325
[], [UL_DEFAULT_ENABLE([line], [no])]
1044
AM_CONDITIONAL(BUILD_LINE, test "x$enable_line" = xyes)
1327
UL_BUILD_INIT([line])
1328
AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
1046
1331
AC_ARG_ENABLE([mesg],
1047
AS_HELP_STRING([--enable-mesg], [build mesg]),
1332
AS_HELP_STRING([--disable-mesg], [do not build mesg]),
1333
[], [UL_DEFAULT_ENABLE([mesg], [yes])]
1050
AM_CONDITIONAL(BUILD_MESG, test "x$enable_mesg" = xyes)
1335
UL_BUILD_INIT([mesg])
1336
AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
1053
1339
AC_ARG_ENABLE([raw],
1054
AS_HELP_STRING([--enable-raw], [build raw]),
1340
AS_HELP_STRING([--disable-raw], [do not build raw]),
1341
[], [UL_DEFAULT_ENABLE([raw], [check])]
1057
AM_CONDITIONAL(BUILD_RAW, test "x$enable_raw" = xyes)
1343
UL_BUILD_INIT([raw])
1344
UL_REQUIRES_LINUX([raw])
1345
UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
1346
AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes])
1060
1349
AC_ARG_ENABLE([rename],
1061
1350
AS_HELP_STRING([--disable-rename], [do not build rename]),
1062
[], enable_rename=yes
1351
[], [UL_DEFAULT_ENABLE([rename], [yes])]
1064
AM_CONDITIONAL(BUILD_RENAME, test "x$enable_rename" = xyes)
1353
UL_BUILD_INIT([rename])
1354
AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
1067
1357
AC_ARG_ENABLE([reset],
1068
1358
AS_HELP_STRING([--enable-reset], [build reset]),
1071
AM_CONDITIONAL(BUILD_RESET, test "x$enable_reset" = xyes)
1074
AC_ARG_ENABLE([login-utils],
1075
AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
1076
[], enable_login_utils=no
1078
AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$enable_login_utils" = xyes)
1081
[AS_HELP_STRING([--without-pam], [compile login-utils without PAM support])])
1083
AM_CONDITIONAL(HAVE_PAM, false)
1084
if test "x$enable_login_utils" = xyes && test "x$with_pam" != xno; then
1085
AC_CHECK_HEADERS([security/pam_misc.h],
1086
[AM_CONDITIONAL(HAVE_PAM, true)],
1087
[if test "x$with_pam" = xyes; then
1088
AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
1093
AC_ARG_WITH([selinux],
1094
AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
1098
if test "x$with_selinux" = xno; then
1099
AM_CONDITIONAL(HAVE_SELINUX, false)
1101
UTIL_CHECK_LIB(selinux, getprevcon)
1102
case "$with_selinux:$have_selinux" in
1103
yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
1107
if test "x$have_selinux" = xyes; then
1108
SELINUX_LIBS="-lselinux -lsepol"
1109
SELINUX_LIBS_STATIC="-lselinux -lsepol"
1110
old_LDFLAGS="$LDFLAGS"
1111
LDFLAGS="$LDFLAGS $SELINUX_LIBS"
1112
# This function is missing in old libselinux 1.xx versions
1113
AC_CHECK_FUNCS([security_get_initial_context])
1114
LDFLAGS="$old_LDFLAGS"
1116
AC_SUBST([SELINUX_LIBS])
1117
AC_SUBST([SELINUX_LIBS_STATIC])
1119
AC_ARG_WITH([audit],
1120
AS_HELP_STRING([--with-audit], [compile with audit support]),
1124
if test "x$with_audit" = xno; then
1125
AM_CONDITIONAL(HAVE_AUDIT, false)
1127
UTIL_CHECK_LIB(audit, audit_log_user_message)
1128
case "$with_audit:$have_audit" in
1130
AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
1135
AC_ARG_ENABLE([schedutils],
1136
AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
1137
[], enable_schedutils=yes
1139
AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$enable_schedutils" = xyes)
1142
AC_ARG_ENABLE([wall],
1143
AS_HELP_STRING([--disable-wall], [do not build wall]),
1146
AM_CONDITIONAL(BUILD_WALL, test "x$enable_wall" = xyes)
1149
AC_ARG_ENABLE([write],
1150
AS_HELP_STRING([--enable-write], [build write]),
1153
AM_CONDITIONAL(BUILD_WRITE, test "x$enable_write" = xyes)
1359
[], [UL_DEFAULT_ENABLE([reset], [no])]
1361
UL_BUILD_INIT([reset])
1362
AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes])
1365
AC_ARG_ENABLE([vipw],
1366
AS_HELP_STRING([--enable-vipw], [build vipw]),
1367
[], [UL_DEFAULT_ENABLE([vipw], [no])]
1369
UL_BUILD_INIT([vipw])
1370
AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
1373
AC_ARG_ENABLE([newgrp],
1374
AS_HELP_STRING([--enable-newgrp], [build newgrp]),
1375
[], [UL_DEFAULT_ENABLE([newgrp], [no])]
1377
UL_BUILD_INIT([newgrp])
1378
AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes])
1381
AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]),
1382
[], [with_user=check]
1385
AS_IF([test "x$with_user" != xno], [
1386
PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no])
1387
AS_CASE([$with_user:$have_user],
1389
[AC_MSG_ERROR([user selected but libuser not found])],
1391
[AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])]
1393
# temporary solution, libuser has stupid .pc where are exported all
1394
# private dependencies to Requires: instead of Requires.private:
1395
AS_IF([test "x$have_user" = xyes], [
1399
AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes])
1401
AC_ARG_ENABLE([chfn-chsh-password],
1402
AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]),
1403
[], [enable_chfn_chsh_password=yes]
1406
AC_ARG_ENABLE([chfn-chsh],
1407
AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
1408
[], [UL_DEFAULT_ENABLE([chfn_chsh], [check])]
1410
UL_BUILD_INIT([chfn_chsh])
1412
AS_IF([test "x$enable_chfn_chsh_password" = xyes -o "x$have_user" = xyes], [
1413
UL_REQUIRES_HAVE([chfn_chsh], [security_pam_misc_h], [PAM header file])
1414
AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?])
1416
AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes])
1417
AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes])
1156
1419
AC_ARG_ENABLE([chsh-only-listed],
1157
1420
AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
1158
1421
[], enable_chsh_only_listed=yes
1161
if test "x$enable_chsh_only_listed" = xyes; then
1162
AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
1424
AS_IF([test "x$enable_chsh_only_listed" = xyes], [
1425
AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?])
1429
AC_ARG_ENABLE([login],
1430
AS_HELP_STRING([--disable-login], [do not build login]),
1431
[], [UL_DEFAULT_ENABLE([login], [check])]
1433
UL_BUILD_INIT([login])
1434
UL_REQUIRES_HAVE([login], [security_pam_misc_h], [PAM header file])
1435
AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes])
1166
1437
AC_ARG_ENABLE([login-chown-vcs],
1167
1438
AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
1168
[], enable_login_chown_vcs=no
1439
[], [enable_login_chown_vcs=no]
1171
if test "x$enable_login_chown_vcs" = xyes; then
1172
AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
1442
AS_IF([test "x$enable_login_chown_vcs" = xyes], [
1443
AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?])
1176
1446
AC_ARG_ENABLE([login-stat-mail],
1177
1447
AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
1178
[], enable_login_stat_mail=no
1181
if test "x$enable_login_stat_mail" = xyes; then
1182
AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
1448
[], [enable_login_stat_mail=no]
1451
AS_IF([test "x$enable_login_stat_mail" = xyes], [
1452
AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?])
1456
AC_ARG_ENABLE([nologin],
1457
AS_HELP_STRING([--disable-nologin], [do not build nologin]),
1458
[], [UL_DEFAULT_ENABLE([nologin], [yes])]
1460
UL_BUILD_INIT([nologin])
1461
AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
1464
AC_ARG_ENABLE([sulogin],
1465
AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
1466
[], [UL_DEFAULT_ENABLE([sulogin], [yes])]
1468
UL_BUILD_INIT([sulogin])
1469
AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
1473
AS_HELP_STRING([--disable-su], [do not build su]),
1474
[], [UL_DEFAULT_ENABLE([su], [check])]
1477
UL_REQUIRES_HAVE([su], [security_pam_misc_h], [PAM header file])
1478
AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
1481
AC_ARG_ENABLE([runuser],
1482
AS_HELP_STRING([--disable-runuser], [do not build runuser]),
1483
[], [UL_DEFAULT_ENABLE([runuser], [check])]
1485
UL_BUILD_INIT([runuser])
1486
UL_REQUIRES_HAVE([runuser], [security_pam_misc_h], [PAM header file])
1487
AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
1491
AS_HELP_STRING([--disable-ul], [do not build ul]),
1492
[], [UL_DEFAULT_ENABLE([ul], [check])]
1495
UL_REQUIRES_HAVE([ul], [ncurses, tinfo], [ncurses or tinfo libraries])
1496
AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
1499
AC_ARG_ENABLE([more],
1500
AS_HELP_STRING([--disable-more], [do not build more]),
1501
[], [UL_DEFAULT_ENABLE([more], [check])]
1503
UL_BUILD_INIT([more])
1504
UL_REQUIRES_HAVE([more], [ncurses, tinfo, termcap], [ncurses, tinfo or termcap libraries])
1505
AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])
1509
AS_HELP_STRING([--disable-pg], [do not build pg]),
1510
[], [UL_DEFAULT_ENABLE([pg], [check])]
1513
UL_REQUIRES_HAVE([pg], [ncurses], [ncurses or ncursesw library])
1514
AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes])
1517
AC_ARG_ENABLE([setterm],
1518
AS_HELP_STRING([--disable-setterm], [do not build setterm]),
1519
[], [UL_DEFAULT_ENABLE([setterm], [check])]
1521
UL_BUILD_INIT([setterm])
1522
UL_REQUIRES_LINUX([setterm])
1523
UL_REQUIRES_HAVE([setterm], [ncurses], [ncurses library])
1524
AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
1526
# build_schedutils= is just configure-only variable to control
1527
# ionice, taskset and chrt
1528
AC_ARG_ENABLE([schedutils],
1529
AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
1530
[], [UL_DEFAULT_ENABLE([schedutils], [yes])]
1532
UL_BUILD_INIT([schedutils])
1534
UL_BUILD_INIT([ionice], [check])
1535
UL_REQUIRES_BUILD([ionice], [schedutils])
1536
UL_REQUIRES_SYSCALL_CHECK([ionice],
1537
[UL_CHECK_SYSCALL([ioprio_set],
1548
UL_REQUIRES_SYSCALL_CHECK([ionice],
1549
[UL_CHECK_SYSCALL([ioprio_get],
1560
AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
1562
UL_BUILD_INIT([taskset], [check])
1563
UL_REQUIRES_BUILD([taskset], [schedutils])
1564
UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
1565
UL_REQUIRES_SYSCALL_CHECK([taskset],
1566
[UL_CHECK_SYSCALL([sched_getaffinity])],
1567
[sched_getaffinity])
1568
AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
1570
UL_BUILD_INIT([chrt], [check])
1571
UL_REQUIRES_BUILD([chrt], [schedutils])
1572
AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
1575
AC_ARG_ENABLE([wall],
1576
AS_HELP_STRING([--disable-wall], [do not build wall]),
1577
[], [UL_DEFAULT_ENABLE([wall], [yes])]
1579
UL_BUILD_INIT([wall])
1580
AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
1583
AC_ARG_ENABLE([write],
1584
AS_HELP_STRING([--enable-write], [build write]),
1585
[], [UL_DEFAULT_ENABLE([write], [no])]
1587
UL_BUILD_INIT([write])
1588
AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes])
1591
AC_ARG_WITH([systemd],
1592
AS_HELP_STRING([--with-systemd], [build with support for systemd]),
1593
[], [with_systemd=check]
1597
AS_IF([test "x$with_systemd" != xno], [
1598
# new version -- all libsystemd-* libs merged into libsystemd
1599
PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
1601
AS_IF([test "x$have_systemd" != "xyes"], [
1602
PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
1603
[have_systemd_daemon=yes], [have_systemd_daemon=no])
1604
PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal],
1605
[have_systemd_journal=yes], [have_systemd_journal=no])
1606
AS_IF([test "x$have_systemd_daemon" = "xyes" -a "x$have_systemd_journal" = "xyes" ],[
1609
AS_CASE([$with_systemd:$have_systemd],
1611
[AC_MSG_ERROR([systemd expected but libsystemd not found])],
1613
AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
1616
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes])
1619
AC_ARG_WITH([systemdsystemunitdir],
1620
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd service files]),
1621
[], [with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`])
1623
AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
1624
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
1628
AC_ARG_WITH([smack],
1629
AS_HELP_STRING([--with-smack], [build with SMACK support]),
1632
AS_IF([test "x$with_smack" = xyes], [
1633
AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support])
1637
AC_ARG_WITH([bashcompletiondir],
1638
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1640
[AS_IF([`$PKG_CONFIG --exists bash-completion`], [
1641
with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`
1643
with_bashcompletiondir=${datadir}/bash-completion/completions
1646
AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1648
AC_ARG_ENABLE([bash-completion],
1649
AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]),
1650
[], [enable_bash_completion=yes]
1653
AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
1656
AC_ARG_WITH([python],
1657
AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]),
1658
[], [with_python=check withval=check]
1662
AS_IF([test "x$with_python" != xno], [
1663
# We follow distributions default and look for PKG module name "python"
1664
# (minimal version is 2) but if major version is explicitly specified by
1665
# --with-python=2 or --with-python=3 then we look for PKG module "python2" or
1667
AS_IF([test "x$withval" != xno -a "x$withval" != xyes -a "x$withval" != xcheck],
1668
[pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"])
1669
AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no])
1670
AS_CASE([$with_python:$have_python],
1672
[AC_MSG_ERROR([python selected but libpython not found])],
1674
[AC_MSG_WARN([libpython not found, do not build python bindings])],
1676
[PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION])]
1681
AC_ARG_ENABLE([pylibmount],
1682
AS_HELP_STRING([--disable-pylibmount], [do not build pylibmount]),
1683
[], [UL_DEFAULT_ENABLE([pylibmount], [check])]
1685
UL_BUILD_INIT([pylibmount])
1686
UL_REQUIRES_HAVE([pylibmount], [python], [libpython])
1687
UL_REQUIRES_BUILD([pylibmount], [libmount])
1688
AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"])
1186
1691
AC_ARG_ENABLE([pg-bell],
1187
1692
AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
1188
[], enable_pg_bell=yes
1191
if test "x$enable_pg_bell" = xyes; then
1192
AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
1196
AC_ARG_ENABLE([require-password],
1197
AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
1198
[], enable_require_password=yes
1201
if test "x$enable_require_password" = xyes; then
1202
AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
1693
[], [enable_pg_bell=yes]
1696
AS_IF([test "x$enable_pg_bell" = xyes], [
1697
AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?])
1206
1701
AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
1207
1702
AC_ARG_ENABLE([fs-paths-default],
1208
1703
AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
1209
[case "$enableval" in
1210
yes) fs_paths_defaults="FS_PATHS_DEFAULT" ;;
1211
no) fs_paths_defaults="" ;;
1212
*) fs_paths_defaults="$enableval" ;;
1704
[AS_CASE([$enableval],
1705
[yes], [fs_paths_defaults="FS_PATHS_DEFAULT"],
1706
[no], [fs_paths_defaults=""],
1707
[fs_paths_defaults="$enableval"]
1214
1709
[fs_paths_defaults="FS_PATHS_DEFAULT"]
1216
1711
AC_ARG_ENABLE([fs-paths-extra],
1217
1712
AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
1218
[case "$enableval" in
1219
yes|no) fs_paths_extra="" ;;
1220
*) fs_paths_extra="$enableval" ;;
1713
[AS_CASE([$enableval],
1714
[yes|no], [fs_paths_extra=""],
1715
[fs_paths_extra="$enableval"]
1222
1717
[fs_paths_extra=""]
1224
1719
fs_paths="$fs_paths_defaults"
1225
if test "x$fs_paths_extra" != "x"; then
1226
if test "x$fs_paths" != "x"; then
1720
AS_IF([test "x$fs_paths_extra" != "x"], [
1721
AS_IF([test "x$fs_paths" != "x"], [
1227
1722
fs_paths="${fs_paths}:"
1229
1724
fs_paths="${fs_paths}${fs_paths_extra}"
1231
1726
AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
1234
1729
AC_ARG_ENABLE([use-tty-group],
1235
1730
AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
1236
[], enable_use_tty_group=yes
1238
AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes)
1240
if test "x$enable_use_tty_group" = xyes; then
1241
AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
1731
[], [enable_use_tty_group=yes]
1733
AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes])
1735
AS_IF([test "x$enable_use_tty_group" = xyes], [
1736
AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?])
1740
AC_ARG_ENABLE([sulogin-emergency-mount],
1741
AS_HELP_STRING([--enable-sulogin-emergency-mount],
1742
[use emergency mount of /dev and /proc for sulogin]),
1743
[], [enable_sulogin_emergency_mount=no]
1746
AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [
1747
AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1],
1748
[Should sulogin use a emergency mount of /dev and /proc?])
1244
1752
AC_ARG_ENABLE([makeinstall-chown],
1245
1753
AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
1246
[], enable_makeinstall_chown=yes
1754
[], [enable_makeinstall_chown=yes]
1248
AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes)
1756
AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes])
1250
1758
AC_ARG_ENABLE([makeinstall-setuid],
1251
1759
AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
1252
[], enable_makeinstall_setuid=yes
1760
[], [enable_makeinstall_setuid=yes]
1254
AM_CONDITIONAL(MAKEINSTALL_DO_SETUID, test "x$enable_makeinstall_setuid" = xyes)
1762
AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes])
1257
1765
AC_ARG_VAR([SUID_CFLAGS],