2 m4_esyscmd([tools/git-version-gen .tarball-version]),
4 [http://www.kernel.org/pub/linux/utils/util-linux/])
8 AC_CONFIG_AUX_DIR([config])
9 AC_CONFIG_MACRO_DIR([m4])
10 dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
11 dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
12 AC_USE_SYSTEM_EXTENSIONS
13 AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects])
15 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
16 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
18 AC_CONFIG_SRCDIR([sys-utils/mount.c])
19 AC_PREFIX_DEFAULT([/usr])
21 dnl version details from <major>.<minor>[-<suffix>]
22 PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
23 PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
24 | awk -F- '{print $1}')
25 PACKAGE_VERSION_RELEASE=0
28 LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
29 LIBBLKID_DATE="21-Oct-2013"
33 LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR
36 LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
40 LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR
43 LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
47 LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR
49 dnl libsmartcols version
50 LIBSMARTCOLS_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
51 LIBSMARTCOLS_LT_MAJOR=1
52 LIBSMARTCOLS_LT_MINOR=1
53 LIBSMARTCOLS_LT_MICRO=0
54 LIBSMARTCOLS_VERSION_INFO=`expr $LIBSMARTCOLS_LT_MAJOR + $LIBSMARTCOLS_LT_MINOR`:$LIBSMARTCOLS_LT_MICRO:$LIBSMARTCOLS_LT_MINOR
56 # Check whether exec_prefix=/usr:
57 AS_CASE([$exec_prefix:$prefix],
58 [NONE:NONE | NONE:/usr | /usr:*],
59 [AC_MSG_NOTICE([Default --exec-prefix detected.])
60 AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ])
61 AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])])
62 AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ])
66 AS_CASE([$prefix:$localstatedir],
67 [NONE:'${prefix}/var' | /usr:'${prefix}/var'],
69 AC_MSG_NOTICE([ --localstatedir defaults to /run])
72 AC_SUBST([localstatedir])
75 # The original default values of {bin,sbin,lib}dir
76 usrbin_execdir='${exec_prefix}/bin'
77 AC_SUBST([usrbin_execdir])
79 usrsbin_execdir='${exec_prefix}/sbin'
80 AC_SUBST([usrsbin_execdir])
83 ['${exec_prefix}/'* | '${prefix}/'* | /usr/*],
84 [usrlib_execdir=$libdir],
85 [usrlib_execdir='${exec_prefix}'$libdir]
87 AC_SUBST([usrlib_execdir])
98 UL_WARN_ADD([-fno-common])
100 UL_WARN_ADD([-Werror=sequence-point])
101 UL_WARN_ADD([-Wextra])
102 UL_WARN_ADD([-Wmissing-declarations])
103 UL_WARN_ADD([-Wmissing-parameter-type])
104 UL_WARN_ADD([-Wmissing-prototypes])
105 UL_WARN_ADD([-Wno-missing-field-initializers])
106 UL_WARN_ADD([-Wredundant-decls])
107 UL_WARN_ADD([-Wsign-compare])
108 UL_WARN_ADD([-Wtype-limits])
109 UL_WARN_ADD([-Wuninitialized])
110 UL_WARN_ADD([-Wunused-but-set-parameter])
111 UL_WARN_ADD([-Wunused-but-set-variable])
112 UL_WARN_ADD([-Wunused-parameter])
113 UL_WARN_ADD([-Wunused-result])
114 UL_WARN_ADD([-Wunused-variable])
115 UL_WARN_ADD([-Wnested-externs])
116 UL_WARN_ADD([-Wpointer-arith])
117 UL_WARN_ADD([-Wstrict-prototypes])
118 UL_WARN_ADD([-Wformat-security])
119 AC_SUBST([WARN_CFLAGS])
121 UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS])
122 AC_SUBST([BSD_WARN_CFLAGS])
127 m4_ifndef([PKG_PROG_PKG_CONFIG],
128 [m4_fatal([Could not locate the pkg-config autoconf
129 macros. These are usually located in /usr/share/aclocal/pkg.m4.
130 If your macros are in a different location, try setting the
131 environment variable AL_OPTS="-I/other/macro/dir" before running
132 ./autogen.sh or autoreconf again.])])
135 GTK_DOC_CHECK([1.10])
136 AC_PATH_PROG([XSLTPROC], [xsltproc])
139 AS_CASE([${host_os}], [*linux*], [linux_os=yes])
140 AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes])
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 AM_GNU_GETTEXT_VERSION([0.18])
156 AM_GNU_GETTEXT([external])
158 AS_IF([test -d "$srcdir/po"], [
159 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
161 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"
164 AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
165 #ifdef HAVE_LINUX_COMPILER_H
166 #include <linux/compiler.h>
191 security/pam_misc.h \
220 AC_CHECK_HEADERS([langinfo.h],
221 [AM_CONDITIONAL([HAVE_LANGINFO], [true])],
222 [AM_CONDITIONAL([HAVE_LANGINFO], [false])])
224 dnl Convert some ac_cv_header_* variables to have_*
226 have_linux_raw_h=$ac_cv_header_linux_raw_h
227 have_linux_securebits_h=$ac_cv_header_linux_securebits_h
228 have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
229 have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
232 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
237 struct tm *tm = localtime(0);
238 if (a == -1) /* false */
239 sleep(tm->tm_gmtoff);
241 [AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
244 AC_CHECK_MEMBERS([struct termios.c_line],,,
245 [[#include <termios.h>]])
247 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
248 [#include <sys/stat.h>])
250 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
252 #ifdef HAVE_SYS_SWAP_H
253 # include <sys/swap.h>
257 [[swapon("/dev/null", 0);]])],
258 [AC_DEFINE([SWAPON_HAS_TWO_ARGS], [1], [Is swapon() declared with two parameters?])
260 [AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
264 AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
266 AC_CHECK_DECL([llseek],
267 [AC_DEFINE([HAVE_LLSEEK_PROTOTYPE], [1],
268 [Define to 1 if have llseek prototype])],
270 [#include <unistd.h>])
272 AC_CHECK_DECL([lseek64],
273 [AC_DEFINE([HAVE_LSEEK64_PROTOTYPE], [1],
274 [Define to 1 if have lseek64 prototype])],
276 [#define _LARGEFILE_SOURCE
277 #define _LARGEFILE64_SOURCE
278 #include <unistd.h>])
280 AC_CHECK_DECL([environ],
281 [AC_DEFINE([HAVE_ENVIRON_DECL], [1],
282 [Define to 1 if have **environ prototype])],
285 AC_CHECK_DECL([strsignal],
286 [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1],
287 [Define to 1 if have strsignal function prototype])],
333 AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
334 AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
336 AC_CHECK_MEMBER([struct sockaddr.sa_len],
337 AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
338 [#include <sys/types.h>
339 #include <sys/socket.h>])
342 AC_SEARCH_LIBS([socket], [socket],
343 [AS_IF([test x"$ac_cv_search_socket" != x"none required"],
344 [SOCKET_LIBS="$SOCKET_LIBS -lsocket"])
346 AC_SUBST([SOCKET_LIBS])
350 AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
351 AS_IF([test x"$have_dirfd" = xno], [
352 AC_CHECK_DECLS([dirfd],
353 [have_dirfd=yes], [have_dirfd=no],
354 [#include <sys/types.h>
355 #include <dirent.h>])
359 AS_IF([test x"$have_dirfd" = xno], [
360 AC_CHECK_MEMBERS([DIR.dd_fd],
361 [have_ddfd=yes], [have_ddfd=no],
362 [#include <sys/types.h>
363 #include <dirent.h>])
366 AS_CASE([$have_dirfd:$have_ddfd],
368 [AC_MSG_ERROR([cannot find a method to get filedescriptor of directory])]
372 AC_MSG_CHECKING([whether program_invocation_short_name is defined])
373 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
376 program_invocation_short_name = "test";
379 AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
380 [Define if program_invocation_short_name is defined])
386 AC_MSG_CHECKING([whether __progname is defined])
387 AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;],
388 [if (*__progname == 0) return;])],
389 AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined])
390 AC_MSG_RESULT([yes]),
393 dnl Static compilation
394 m4_define([UL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
396 AC_ARG_ENABLE([static-programs],
397 [AS_HELP_STRING([--enable-static-programs=LIST],
398 [link static the programs in LIST (comma-separated,
399 supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])])
401 AS_CASE([$enable_static_programs],
403 [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)],
405 [enable_static_programs=]
408 dnl Set all the individual AM_CONDITIONALs
409 m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
410 AS_CASE([,$enable_static_programs,],
411 [*,UL_PRG,*], [static_[]UL_PRG=yes]
413 AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])])
414 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG),
415 [test "x$static_[]UL_PRG" = xyes])
420 AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
426 i = sscanf("x", $1, &s);
432 AC_CACHE_VAL([scanf_cv_alloc_modifier],
433 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])],
434 [scanf_cv_alloc_modifier=ms],
435 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%as"])])],
436 [scanf_cv_alloc_modifier=as],
437 [scanf_cv_alloc_modifier=no]
441 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
447 #if !(__GLIBC_PREREQ(2, 7))
448 #error %m is not available
451 #elif defined(_POSIX_VERSION)
453 #if _POSIX_VERSION < 200809L
454 #error %m is not available
458 #error Your C-library is not supported.
461 [scanf_cv_alloc_modifier=ms],
462 [scanf_cv_alloc_modifier=no])]
466 AC_MSG_CHECKING([scanf string alloc modifiers])
467 AS_CASE([$scanf_cv_alloc_modifier],
469 [AC_MSG_RESULT([(%ms) yes])
470 AC_DEFINE([HAVE_SCANF_MS_MODIFIER], [1], [scanf %ms modifier])
471 have_scanf_alloc_modifier=yes],
473 [AC_MSG_RESULT([(%as) yes])
474 have_scanf_alloc_modifier=yes
475 AC_DEFINE([HAVE_SCANF_AS_MODIFIER], [1], [scanf %as modifier])],
477 have_scanf_alloc_modifier=no]
480 UL_CHECK_LIB([util], [openpty])
481 UL_CHECK_LIB([termcap], [tgetnum])
483 AC_CHECK_TYPES([union semun], [], [], [[
486 AC_CHECK_TYPES([loff_t])
488 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
496 if (w == WEOF) exit(1);
500 [AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?])
503 AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
507 AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes])
509 AC_CHECK_TYPES([sighandler_t], [], [], [[
513 AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
517 # on Solaris, you can't mix and match standards, since we use c99
518 # aparently at this stage, XOPEN_SOURCE will conflict. As workaround,
519 # check for crypt.h and use that without XOPEN_SOURCE.
520 AC_CHECK_HEADERS([crypt.h])
521 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
525 #define _XOPEN_SOURCE
529 char *c = crypt("abc","pw");
532 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
536 #define _XOPEN_SOURCE
540 char *c = crypt("abc","pw");
542 AC_DEFINE([HAVE_LIBCRYPT], [1], [Do we need -lcrypt?])
545 AC_MSG_ERROR([crypt() is not available])
548 AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
551 AC_ARG_WITH([selinux],
552 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
553 [], [with_selinux=no]
556 AS_IF([test "x$with_selinux" = xno], [
557 AM_CONDITIONAL([HAVE_SELINUX], [false])
559 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0],
560 [AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available])
561 UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
562 AM_CONDITIONAL([HAVE_SELINUX], [true])
566 AS_CASE([$with_selinux:$have_selinux],
567 [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])]
570 AS_IF([test "x$have_selinux" = xyes], [
571 UL_SET_FLAGS([], [], [$SELINUX_LIBS])
572 # This function is missing in old libselinux 1.xx versions
573 AC_CHECK_FUNCS([security_get_initial_context])
577 AC_SUBST([SELINUX_LIBS])
578 AC_SUBST([SELINUX_LIBS_STATIC])
581 AS_HELP_STRING([--with-audit], [compile with audit support]),
585 AS_IF([test "x$with_audit" = xno], [
586 AM_CONDITIONAL([HAVE_AUDIT], [false])
588 UL_CHECK_LIB([audit], [audit_log_user_message])
589 AS_CASE([$with_audit:$have_audit],
591 [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])]
595 AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]),
599 AS_IF([test "x$with_udev" = xno], [
600 AM_CONDITIONAL([HAVE_UDEV], [false])
602 UL_CHECK_LIB([udev], [udev_new])
603 AS_CASE([$with_udev:$have_udev],
605 [AC_MSG_ERROR([udev selected but libudev not found])]
609 AC_ARG_WITH([ncurses],
610 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
611 (--without-ncurses disables all ncurses(w) support)]),
612 [], [with_ncurses=auto]
614 AM_CONDITIONAL([HAVE_NCURSES], [false])
616 AS_IF([test "x$with_ncurses" != xno], [
619 dnl First try to find the pkg-config module.
620 PKG_CHECK_MODULES(NCURSESW, [ncursesw], [
622 NCURSES_LIBS=${NCURSESW_LIBS}
623 NCURSES_CFLAGS=${NCURSESW_CFLAGS}
624 AC_DEFINE([HAVE_LIBNCURSESW])
625 CURSES_LIB_NAME="ncursesw"
627 PKG_CHECK_MODULES(NCURSES, [ncurses], [
629 AC_DEFINE([HAVE_LIBNCURSES])
630 CURSES_LIB_NAME="ncursesw"
634 AS_IF([test "x$have_ncurses" = xyes], [
635 dnl If that worked, setup the defines that the code expects.
636 save_CPPFLAGS="$CPPFLAGS"
637 CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
638 AC_CHECK_HEADERS([ncurses.h])
639 CPPFLAGS="$save_CPPFLAGS"
641 dnl If that failed, fall back to classic searching.
642 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
643 AS_IF([test "x$with_ncurses" = xauto], [
644 UL_CHECK_LIB([ncursesw], [initscr], [ncurses])
645 AS_IF([test "x$have_ncurses" = xyes], [
646 AC_CHECK_HEADERS([ncursesw/ncurses.h])
647 NCURSES_LIBS="-lncursesw"
648 CURSES_LIB_NAME="ncursesw"
651 AS_IF([test "x$have_ncurses" = xno], [
652 UL_CHECK_LIB(ncurses, initscr)
653 AS_IF([test "x$have_ncurses" = xyes], [
654 NCURSES_LIBS="-lncurses"
655 CURSES_LIB_NAME="ncurses"
661 AS_IF([test "x$have_ncurses" = xno], [
662 AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
665 AC_SUBST([NCURSES_CFLAGS])
666 AC_SUBST([NCURSES_LIBS])
670 AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
674 AS_IF([test "x$with_slang" = xyes], [
675 AC_CHECK_HEADERS([slang.h slang/slang.h])
676 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
677 [have_slang=yes], [], [
680 #elif defined(HAVE_SLANG_SLANG_H)
681 #include <slang/slang.h>
684 AS_IF([test "x$have_slang" = xno], [
685 AC_MSG_ERROR([slang selected but slcurses.h not found])],
686 [CURSES_LIB_NAME=slang
689 AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes])
691 AM_CONDITIONAL([BUILD_CFDISK], [test "x$have_slang" = xyes -o "x$have_ncurses" = xyes])
693 AS_IF([test "x$have_slang" = xyes -o "x$have_ncurses" = xyes], [
694 AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [
695 AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1,
696 [Define if curses library has the use_default_colors command.])
701 dnl Try pkg-config for libtinfo
702 PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
703 dnl If that failed, fall back to classic searching.
704 AC_CHECK_LIB([tinfo], [tgetent], [
709 AC_SUBST([TINFO_LIBS])
710 AC_SUBST([TINFO_CFLAGS])
711 AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
714 AC_ARG_WITH([utempter],
715 AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
716 [], [with_utempter=no]
719 AS_IF([test "x$with_utempter" = xyes], [
720 UL_CHECK_LIB([utempter], [utempter_add_record])
721 AS_IF([test "x$have_utempter" = xno], [
722 AC_MSG_ERROR([utempter selected but libutempter not found])
725 AM_CONDITIONAL([HAVE_UTEMPTER], [false])
729 AC_ARG_ENABLE([most-builds],
730 AS_HELP_STRING([--enable-most-builds], [build everything other than experimental code]),
731 [], [enable_most_builds=no]
733 AS_IF([test "x$enable_most_builds" = xyes], [
739 enable_socket_activation=yes
750 AC_ARG_ENABLE([libuuid],
751 AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
752 [], [enable_libuuid=yes]
754 UL_BUILD_INIT([libuuid])
755 AC_SUBST([LIBUUID_VERSION])
756 AC_SUBST([LIBUUID_VERSION_INFO])
757 AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
759 AS_IF([test "x$enable_libuuid" = xyes], [
760 AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
762 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
768 AC_ARG_ENABLE([libblkid],
769 AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
770 [], [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 [], [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 [], [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], [spark*])
834 AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
837 AC_ARG_ENABLE([mount],
838 AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
839 [], [enable_mount=check]
841 UL_BUILD_INIT([mount])
842 UL_REQUIRES_BUILD([mount], [libmount])
843 AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
846 AC_ARG_ENABLE([losetup],
847 AS_HELP_STRING([--disable-losetup], [do not build losetup]),
848 [], [enable_losetup=check]
850 UL_BUILD_INIT([losetup])
851 UL_REQUIRES_LINUX([losetup])
852 AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes])
855 AC_ARG_ENABLE([fsck],
856 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
857 [], [enable_fsck=check]
859 UL_BUILD_INIT([fsck])
860 UL_REQUIRES_BUILD([fsck], [libmount])
861 AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes])
864 AC_ARG_ENABLE([partx],
865 AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
866 [], [enable_partx=check]
868 UL_BUILD_INIT([partx])
869 UL_REQUIRES_LINUX([partx])
870 UL_REQUIRES_BUILD([partx], [libblkid])
871 AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes])
874 AC_ARG_ENABLE([uuidd],
875 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
876 [], [enable_uuidd=check]
878 UL_BUILD_INIT([uuidd])
879 UL_REQUIRES_BUILD([uuidd], [libuuid])
880 AS_IF([test "x$build_uuidd" = xyes], [
881 AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])
883 AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes])
886 UL_BUILD_INIT([uuidgen], [check])
887 UL_REQUIRES_BUILD([uuidgen], [libuuid])
888 AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes])
890 UL_BUILD_INIT([blkid], [check])
891 UL_REQUIRES_BUILD([blkid], [libblkid])
892 AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes])
894 UL_BUILD_INIT([findfs], [check])
895 UL_REQUIRES_BUILD([findfs], [libblkid])
896 AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes])
898 UL_BUILD_INIT([wipefs], [check])
899 UL_REQUIRES_BUILD([wipefs], [libblkid])
900 AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes])
902 UL_BUILD_INIT([findmnt], [check])
903 UL_REQUIRES_BUILD([findmnt], [libmount])
904 UL_REQUIRES_BUILD([findmnt], [libsmartcols])
905 AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes])
908 AC_ARG_ENABLE([mountpoint],
909 AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
910 [], [enable_mountpoint=check]
912 UL_BUILD_INIT([mountpoint])
913 UL_REQUIRES_BUILD([mountpoint], [libmount])
914 AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes])
917 AC_ARG_ENABLE([fallocate],
918 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
919 [], [enable_fallocate=check]
921 UL_BUILD_INIT([fallocate])
922 UL_REQUIRES_LINUX([fallocate])
923 UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
924 AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes])
926 AS_IF([test "x$build_fallocate" = xyes], [
927 dnl check for valid fallocate() function
928 dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
929 dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
930 dnl and program can't be linked.
931 dnl AC_CHECK_FUNC can't catch such errors since it's redefining
932 dnl function prototype.
933 AC_MSG_CHECKING([for valid fallocate() function])
934 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
938 #ifdef HAVE_SYS_TYPES_H
939 # include <sys/types.h>
941 #ifdef HAVE_LINUX_FALLOC_H
942 # include <linux/falloc.h>
949 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
955 AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[
956 AC_MSG_RESULT([no])])
960 AC_ARG_ENABLE([unshare],
961 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
962 [], [enable_unshare=check]
964 UL_BUILD_INIT([unshare])
965 UL_REQUIRES_LINUX([unshare])
966 UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
967 AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes])
968 AC_CHECK_FUNCS([unshare])
970 AC_ARG_ENABLE([nsenter],
971 AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
972 [], [enable_nsenter=check]
974 UL_BUILD_INIT([nsenter])
975 UL_REQUIRES_LINUX([nsenter])
976 UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL_CHECK_SYSCALL([setns])], [setns])
977 AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
978 AC_CHECK_FUNCS([setns])
980 dnl setpriv depends on libcap-ng. It would be possible to build
981 dnl a version of setpriv with limited functionality without libcap-ng,
982 dnl but this isn't currently supported.
983 UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
984 AC_ARG_ENABLE([setpriv],
985 AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
986 [], [enable_setpriv=check]
988 UL_BUILD_INIT([setpriv])
989 UL_REQUIRES_LINUX([setpriv])
990 UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [securebits.h header file])
991 UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
992 AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
995 AC_ARG_ENABLE([eject],
996 AS_HELP_STRING([--disable-eject], [do not build eject]),
997 [], [enable_eject=check]
999 UL_BUILD_INIT([eject])
1000 UL_REQUIRES_LINUX([eject])
1001 UL_REQUIRES_BUILD([eject], [libmount])
1002 AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes])
1005 AC_ARG_ENABLE([agetty],
1006 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
1007 [], [enable_agetty=yes]
1009 UL_BUILD_INIT([agetty])
1010 AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
1013 AC_ARG_ENABLE([cramfs],
1014 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
1015 [], [enable_cramfs=check]
1017 UL_BUILD_INIT([cramfs])
1018 AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
1019 UL_REQUIRES_HAVE([cramfs], [z], [z library])
1020 AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])
1023 AC_ARG_ENABLE([bfs],
1024 AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]),
1025 [], [enable_bfs=yes]
1027 UL_BUILD_INIT([bfs])
1028 AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
1031 AC_ARG_ENABLE([minix],
1032 AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]),
1033 [], [enable_minix=yes]
1035 UL_BUILD_INIT([minix])
1036 AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes])
1039 AC_ARG_ENABLE([fdformat],
1040 AS_HELP_STRING([--disable-fdformat], [do not build fdformat]),
1041 [], [enable_fdformat=check]
1043 UL_BUILD_INIT([fdformat])
1044 UL_REQUIRES_LINUX([fdformat])
1045 AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes])
1048 AC_ARG_ENABLE([hwclock],
1049 AS_HELP_STRING([--disable-hwclock], [do not build hwclock]),
1050 [], [enable_hwclock=check]
1052 have_linuxdummy=$linux_os
1054 UL_BUILD_INIT([hwclock])
1055 UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux])
1056 AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes])
1059 UL_BUILD_INIT([mkfs], [yes])
1060 AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes])
1062 UL_BUILD_INIT([isosize], [yes])
1063 AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes])
1066 UL_BUILD_INIT([fstrim], [check])
1067 UL_REQUIRES_LINUX([fstrim])
1068 UL_REQUIRES_BUILD([fstrim], [libmount])
1069 AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes])
1072 UL_BUILD_INIT([swapon], [check])
1073 UL_REQUIRES_LINUX([swapon])
1074 UL_REQUIRES_BUILD([swapon], [libblkid])
1075 UL_REQUIRES_BUILD([swapon], [libmount])
1076 AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
1079 UL_BUILD_INIT([lsblk], [check])
1080 UL_REQUIRES_LINUX([lsblk])
1081 UL_REQUIRES_BUILD([lsblk], [libblkid])
1082 UL_REQUIRES_BUILD([lsblk], [libmount])
1083 AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes])
1086 UL_BUILD_INIT([lscpu], [check])
1087 UL_REQUIRES_LINUX([lscpu])
1088 UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
1089 AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes])
1092 UL_BUILD_INIT([lslogins], [check])
1093 UL_REQUIRES_BUILD([lslogins], [libsmartcols])
1094 AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes])
1097 UL_BUILD_INIT([chcpu], [check])
1098 UL_REQUIRES_LINUX([chcpu])
1099 UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
1100 AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes])
1103 AC_ARG_ENABLE([wdctl],
1104 AS_HELP_STRING([--disable-wdctl], [do not build wdctl]),
1105 [], [enable_wdctl=check]
1107 UL_BUILD_INIT([wdctl])
1108 UL_REQUIRES_LINUX([wdctl])
1109 UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
1110 AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes])
1113 UL_BUILD_INIT([swaplabel], [check])
1114 UL_REQUIRES_BUILD([swaplabel], [libblkid])
1115 AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
1118 UL_BUILD_INIT([mkswap], [yes])
1119 AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes])
1121 UL_BUILD_INIT([cal], [yes])
1122 AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes])
1124 UL_BUILD_INIT([logger], [yes])
1125 AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes])
1127 UL_BUILD_INIT([loop], [yes])
1128 AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes])
1130 UL_BUILD_INIT([mcookie], [yes])
1131 AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes])
1133 UL_BUILD_INIT([namei], [yes])
1134 AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes])
1136 UL_BUILD_INIT([whereis], [yes])
1137 AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes])
1139 UL_BUILD_INIT([getopt], [yes])
1140 AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes])
1143 UL_BUILD_INIT([blockdev], [check])
1144 UL_REQUIRES_LINUX([blockdev])
1145 AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes])
1148 UL_BUILD_INIT([prlimit], [check])
1149 UL_REQUIRES_LINUX([prlimit])
1150 UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
1151 AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes])
1152 AS_IF([test "x$build_prlimit" = xyes], [
1153 AC_CHECK_FUNCS([prlimit])
1157 UL_BUILD_INIT([lslocks], [check])
1158 UL_REQUIRES_LINUX([lslocks])
1159 UL_REQUIRES_BUILD([lslocks], [libmount])
1160 AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes])
1163 AC_ARG_ENABLE([switch_root],
1164 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
1165 [], [enable_switch_root=check]
1167 UL_BUILD_INIT([switch_root])
1168 UL_REQUIRES_LINUX([switch_root])
1169 UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
1170 AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
1173 AC_ARG_ENABLE([pivot_root],
1174 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
1175 [], [enable_pivot_root=check]
1177 UL_BUILD_INIT([pivot_root])
1178 UL_REQUIRES_LINUX([switch_root])
1179 UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
1180 AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes])
1183 UL_BUILD_INIT([flock], [yes])
1184 AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes])
1186 UL_BUILD_INIT([ipcmk], [yes])
1187 AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes])
1189 UL_BUILD_INIT([ipcrm], [yes])
1190 AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes])
1192 UL_BUILD_INIT([ipcs], [yes])
1193 AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes])
1195 UL_BUILD_INIT([renice], [yes])
1196 AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes])
1198 UL_BUILD_INIT([setsid], [yes])
1199 AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes])
1201 UL_BUILD_INIT([readprofile], [check])
1202 UL_REQUIRES_LINUX([readprofile])
1203 AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes])
1205 UL_BUILD_INIT([dmesg], [check])
1206 UL_REQUIRES_LINUX([dmesg])
1207 AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes])
1209 UL_BUILD_INIT([ctrlaltdel], [check])
1210 UL_REQUIRES_LINUX([ctrlaltdel])
1211 AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes])
1213 UL_BUILD_INIT([fsfreeze], [check])
1214 UL_REQUIRES_LINUX([fsfreeze])
1215 AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes])
1217 UL_BUILD_INIT([blkdiscard], [check])
1218 UL_REQUIRES_LINUX([blkdiscard])
1219 AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes])
1221 UL_BUILD_INIT([ldattach], [check])
1222 UL_REQUIRES_LINUX([ldattach])
1223 AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes])
1225 UL_BUILD_INIT([rtcwake], [check])
1226 UL_REQUIRES_LINUX([rtcwake])
1227 AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes])
1229 UL_BUILD_INIT([setarch], [check])
1230 UL_REQUIRES_LINUX([setarch])
1231 AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes])
1233 UL_BUILD_INIT([script], [yes])
1234 AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes])
1236 UL_BUILD_INIT([scriptreplay], [yes])
1237 AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes])
1240 AC_ARG_ENABLE([tunelp],
1241 AS_HELP_STRING([--enable-tunelp], [build tunelp]),
1242 [], [enable_tunelp=no]
1244 UL_BUILD_INIT([tunelp])
1245 UL_REQUIRES_LINUX([tunelp])
1246 AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes])
1249 AC_ARG_ENABLE([kill],
1250 AS_HELP_STRING([--disable-kill], [do not build kill]),
1251 [], [enable_kill=check]
1253 UL_BUILD_INIT([kill])
1254 UL_REQUIRES_LINUX([kill])
1255 AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])
1258 AC_ARG_ENABLE([deprecated-last],
1259 AS_HELP_STRING([--enable-deprecated-last], [build old deprecated last]),
1260 [], [enable_deprecated_last=no]
1262 UL_BUILD_INIT([deprecated_last])
1263 AM_CONDITIONAL([BUILD_DEPRECATED_LAST], [test "x$build_deprecated_last" = xyes])
1266 AC_ARG_ENABLE([last],
1267 AS_HELP_STRING([--disable-last], [do not build last]),
1268 [], [enable_last=check]
1270 UL_BUILD_INIT([last])
1271 UL_CONFLICTS_BUILD([last], [deprecated_last], [old deprecated last version])
1272 AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
1275 AC_ARG_ENABLE([utmpdump],
1276 AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]),
1277 [], [enable_utmpdump=yes]
1279 UL_BUILD_INIT([utmpdump])
1280 AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
1283 AC_ARG_ENABLE([line],
1284 AS_HELP_STRING([--enable-line], [build line]),
1285 [], [enable_line=no]
1287 UL_BUILD_INIT([line])
1288 AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
1291 AC_ARG_ENABLE([mesg],
1292 AS_HELP_STRING([--disable-mesg], [do not build mesg]),
1293 [], [enable_mesg=yes]
1295 UL_BUILD_INIT([mesg])
1296 AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
1299 AC_ARG_ENABLE([raw],
1300 AS_HELP_STRING([--disable-raw], [do not build raw]),
1301 [], [enable_raw=check]
1303 UL_BUILD_INIT([raw])
1304 UL_REQUIRES_LINUX([raw])
1305 UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
1306 AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes])
1309 AC_ARG_ENABLE([rename],
1310 AS_HELP_STRING([--disable-rename], [do not build rename]),
1311 [], [enable_rename=yes]
1313 UL_BUILD_INIT([rename])
1314 AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
1317 AC_ARG_ENABLE([reset],
1318 AS_HELP_STRING([--enable-reset], [build reset]),
1319 [], [enable_reset=no]
1321 UL_BUILD_INIT([reset])
1322 AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes])
1325 AC_ARG_ENABLE([vipw],
1326 AS_HELP_STRING([--enable-vipw], [build vipw]),
1327 [], [enable_vipw=no]
1329 UL_BUILD_INIT([vipw])
1330 AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
1333 AC_ARG_ENABLE([newgrp],
1334 AS_HELP_STRING([--enable-newgrp], [build newgrp]),
1335 [], [enable_newgrp=no]
1337 UL_BUILD_INIT([newgrp])
1338 AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes])
1341 AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]),
1342 [], [with_user=check]
1345 AS_IF([test "x$with_user" != xno], [
1346 PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no])
1347 AS_CASE([$with_user:$have_user],
1349 [AC_MSG_ERROR([user selected but libuser not found])],
1351 [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])]
1353 # temporary solution, libuser has stupid .pc where are exported all
1354 # private dependencies to Requires: instead of Requires.private:
1355 AS_IF([test "x$have_user" = xyes], [
1359 AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes])
1361 AC_ARG_ENABLE([chfn-chsh-password],
1362 AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]),
1363 [], [enable_chfn_chsh_password=yes]
1366 AC_ARG_ENABLE([chfn-chsh],
1367 AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
1368 [], [enable_chfn_chsh=no]
1370 UL_BUILD_INIT([chfn_chsh])
1372 AS_IF([test "x$enable_chfn_chsh_password" = xyes -o "x$have_user" = xyes], [
1373 UL_REQUIRES_HAVE([chfn_chsh], [security_pam_misc_h], [PAM header file])
1374 AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?])
1376 AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes])
1377 AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes])
1379 AC_ARG_ENABLE([chsh-only-listed],
1380 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
1381 [], enable_chsh_only_listed=yes
1384 AS_IF([test "x$enable_chsh_only_listed" = xyes], [
1385 AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?])
1389 AC_ARG_ENABLE([login],
1390 AS_HELP_STRING([--disable-login], [do not build login]),
1391 [], [enable_login=check]
1393 UL_BUILD_INIT([login])
1394 UL_REQUIRES_HAVE([login], [security_pam_misc_h], [PAM header file])
1395 AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes])
1397 AC_ARG_ENABLE([login-chown-vcs],
1398 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
1399 [], [enable_login_chown_vcs=no]
1402 AS_IF([test "x$enable_login_chown_vcs" = xyes], [
1403 AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?])
1406 AC_ARG_ENABLE([login-stat-mail],
1407 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
1408 [], [enable_login_stat_mail=no]
1411 AS_IF([test "x$enable_login_stat_mail" = xyes], [
1412 AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?])
1416 AC_ARG_ENABLE([nologin],
1417 AS_HELP_STRING([--disable-nologin], [do not build nologin]),
1418 [], [enable_nologin=yes]
1420 UL_BUILD_INIT([nologin])
1421 AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
1424 AC_ARG_ENABLE([sulogin],
1425 AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
1426 [], [enable_sulogin=yes]
1428 UL_BUILD_INIT([sulogin])
1429 AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
1433 AS_HELP_STRING([--disable-su], [do not build su]),
1434 [], [enable_su=check]
1437 UL_REQUIRES_HAVE([su], [security_pam_misc_h], [PAM header file])
1438 AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
1441 AC_ARG_ENABLE([runuser],
1442 AS_HELP_STRING([--disable-runuser], [do not build runuser]),
1443 [], [enable_runuser=check]
1445 UL_BUILD_INIT([runuser])
1446 UL_REQUIRES_HAVE([runuser], [security_pam_misc_h], [PAM header file])
1447 AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
1451 AS_HELP_STRING([--disable-ul], [do not build ul]),
1452 [], [enable_ul=check]
1455 UL_REQUIRES_HAVE([ul], [ncurses, tinfo], [ncurses or tinfo libraries])
1456 AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
1459 AC_ARG_ENABLE([more],
1460 AS_HELP_STRING([--disable-more], [do not build more]),
1461 [], [enable_more=check]
1463 UL_BUILD_INIT([more])
1464 UL_REQUIRES_HAVE([more], [ncurses, tinfo, termcap], [ncurses, tinfo or termcap libraries])
1465 AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])
1469 AS_HELP_STRING([--disable-pg], [do not build pg]),
1470 [], [enable_pg=check]
1473 UL_REQUIRES_HAVE([pg], [ncurses], [ncurses or ncursesw library])
1474 AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes])
1477 AC_ARG_ENABLE([setterm],
1478 AS_HELP_STRING([--disable-setterm], [do not build setterm]),
1479 [], [enable_setterm=check]
1481 UL_BUILD_INIT([setterm])
1482 UL_REQUIRES_LINUX([setterm])
1483 UL_REQUIRES_HAVE([setterm], [ncurses], [ncurses library])
1484 AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
1486 # build_schedutils= is just configure-only variable to control
1487 # ionice, taskset and chrt
1488 AC_ARG_ENABLE([schedutils],
1489 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
1490 [], [enable_schedutils=yes]
1492 UL_BUILD_INIT([schedutils])
1494 UL_BUILD_INIT([ionice], [check])
1495 UL_REQUIRES_BUILD([ionice], [schedutils])
1496 UL_REQUIRES_SYSCALL_CHECK([ionice],
1497 [UL_CHECK_SYSCALL([ioprio_set],
1508 UL_REQUIRES_SYSCALL_CHECK([ionice],
1509 [UL_CHECK_SYSCALL([ioprio_get],
1520 AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
1522 UL_BUILD_INIT([taskset], [check])
1523 UL_REQUIRES_BUILD([taskset], [schedutils])
1524 UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
1525 UL_REQUIRES_SYSCALL_CHECK([taskset],
1526 [UL_CHECK_SYSCALL([sched_getaffinity])],
1527 [sched_getaffinity])
1528 AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
1530 UL_BUILD_INIT([chrt], [check])
1531 UL_REQUIRES_BUILD([chrt], [schedutils])
1532 AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
1535 AC_ARG_ENABLE([wall],
1536 AS_HELP_STRING([--disable-wall], [do not build wall]),
1537 [], [enable_wall=yes]
1539 UL_BUILD_INIT([wall])
1540 AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
1543 AC_ARG_ENABLE([write],
1544 AS_HELP_STRING([--enable-write], [build write]),
1545 [], [enable_write=no]
1547 UL_BUILD_INIT([write])
1548 AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes])
1551 AC_ARG_WITH([systemd],
1552 AS_HELP_STRING([--with-systemd], [build with support for systemd]),
1553 [], [with_systemd=check]
1557 AS_IF([test "x$with_systemd" != xno], [
1558 # new version -- all libsystemd-* libs merged into libsystemd
1559 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
1561 AS_IF([test "x$have_systemd" != "xyes"], [
1562 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
1563 [have_systemd_daemon=yes], [have_systemd_daemon=no])
1564 PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal],
1565 [have_systemd_journal=yes], [have_systemd_journal=no])
1566 AS_IF([test "x$have_systemd_daemon" = "xyes" -a "x$have_systemd_journal" = "xyes" ],[
1569 AS_CASE([$with_systemd:$have_systemd],
1571 [AC_MSG_ERROR([systemd expected but libsystemd not found])],
1573 AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
1576 AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes])
1579 AC_ARG_WITH([systemdsystemunitdir],
1580 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd service files]),
1581 [], [with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`])
1583 AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
1584 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
1588 AC_ARG_WITH([smack],
1589 AS_HELP_STRING([--with-smack], [build with SMACK support]),
1592 AS_IF([test "x$with_smack" = xyes], [
1593 AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support])
1597 AC_ARG_WITH([bashcompletiondir],
1598 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1600 [AS_IF([`$PKG_CONFIG --exists bash-completion`], [
1601 with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`
1603 with_bashcompletiondir=${datadir}/bash-completion/completions
1606 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1608 AC_ARG_ENABLE([bash-completion],
1609 AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]),
1610 [], [enable_bash_completion=yes]
1613 AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
1616 AC_ARG_WITH([python],
1617 AS_HELP_STRING([--with-python], [generate python bindings, use --with-python={2,3} to force version]),
1618 [], [with_python=no]
1622 AS_IF([test "x$with_python" != xno], [
1623 # We follow distributions default and look for PKG module name "python"
1624 # (minimal version is 2) but if major version is explicitly specified by
1625 # --with-python=2 or --with-python=3 then we look for PKG module "python2" or
1627 AS_IF([test "x$withval" != xno -a "x$withval" != xyes],
1628 [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"])
1629 AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no])
1630 AS_CASE([$with_python:$have_python],
1632 [AC_MSG_ERROR([python selected but libpython not found])]
1634 PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION])
1636 UL_BUILD_INIT([pylibmount], [check])
1637 UL_REQUIRES_HAVE([pylibmount], [python], [libpython])
1638 UL_REQUIRES_BUILD([pylibmount], [libmount])
1641 AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"])
1644 AC_ARG_ENABLE([pg-bell],
1645 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
1646 [], [enable_pg_bell=yes]
1649 AS_IF([test "x$enable_pg_bell" = xyes], [
1650 AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?])
1654 AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
1655 AC_ARG_ENABLE([fs-paths-default],
1656 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
1657 [AS_CASE([$enableval],
1658 [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"],
1659 [no], [fs_paths_defaults=""],
1660 [fs_paths_defaults="$enableval"]
1662 [fs_paths_defaults="FS_PATHS_DEFAULT"]
1664 AC_ARG_ENABLE([fs-paths-extra],
1665 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
1666 [AS_CASE([$enableval],
1667 [yes|no], [fs_paths_extra=""],
1668 [fs_paths_extra="$enableval"]
1672 fs_paths="$fs_paths_defaults"
1673 AS_IF([test "x$fs_paths_extra" != "x"], [
1674 AS_IF([test "x$fs_paths" != "x"], [
1675 fs_paths="${fs_paths}:"
1677 fs_paths="${fs_paths}${fs_paths_extra}"
1679 AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
1682 AC_ARG_ENABLE([use-tty-group],
1683 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
1684 [], [enable_use_tty_group=yes]
1686 AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes])
1688 AS_IF([test "x$enable_use_tty_group" = xyes], [
1689 AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?])
1693 AC_ARG_ENABLE([sulogin-emergency-mount],
1694 AS_HELP_STRING([--enable-sulogin-emergency-mount],
1695 [use emergency mount of /dev and /proc for sulogin]),
1696 [], [enable_sulogin_emergency_mount=no]
1699 AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [
1700 AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1],
1701 [Should sulogin use a emergency mount of /dev and /proc?])
1705 AC_ARG_ENABLE([makeinstall-chown],
1706 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
1707 [], [enable_makeinstall_chown=yes]
1709 AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes])
1711 AC_ARG_ENABLE([makeinstall-setuid],
1712 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
1713 [], [enable_makeinstall_setuid=yes]
1715 AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes])
1718 AC_ARG_VAR([SUID_CFLAGS],
1719 [CFLAGS used for binaries which are usually with the suid bit])
1720 AC_ARG_VAR([SUID_LDFLAGS],
1721 [LDFLAGS used for binaries which are usually with the suid bit])
1723 AC_ARG_VAR([DAEMON_CFLAGS],
1724 [CFLAGS used for binaries which are usually executed as daemons])
1725 AC_ARG_VAR([DAEMON_LDFLAGS],
1726 [LDFLAGS used for binaries which are usually executed as daemons])
1728 AC_ARG_VAR([SOLIB_CFLAGS],
1729 [CFLAGS used for shared libraries])
1730 AC_ARG_VAR([SOLIB_LDFLAGS],
1731 [LDFLAGS used for shared libraries])
1736 AC_CONFIG_HEADERS([config.h])
1739 # Don't use configure.ac to replace install paths! See Makefile PATHFILES for
1744 libblkid/docs/Makefile
1745 libblkid/docs/version.xml
1746 libblkid/src/blkid.h
1747 libmount/docs/Makefile
1748 libmount/docs/version.xml
1749 libmount/src/libmount.h
1750 libsmartcols/docs/Makefile
1751 libsmartcols/docs/version.xml
1752 libsmartcols/src/libsmartcols.h
1759 ${PACKAGE} ${VERSION}
1762 exec prefix: ${exec_prefix}
1764 localstatedir: ${localstatedir}
1768 includedir: ${includedir}
1769 usrbin_execdir: ${usrbin_execdir}
1770 usrsbin_execdir: ${usrsbin_execdir}
1771 usrlib_execdir: ${usrlib_execdir}
1775 suid cflags: ${SUID_CFLAGS}
1777 suid ldflags: ${SUID_LDFLAGS}
1780 Python version: ${PYTHON_VERSION}
1781 Python libs: ${pyexecdir}
1783 Bash completions: ${with_bashcompletiondir}
1784 Systemd support: ${have_systemd}