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 # Check whether exec_prefix=/usr:
50 AS_CASE([$exec_prefix:$prefix],
51 [NONE:NONE | NONE:/usr | /usr:*],
52 [AC_MSG_NOTICE([Default --exec-prefix detected.])
53 AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ])
54 AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])])
55 AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ])
59 AS_CASE([$prefix:$localstatedir],
60 [NONE:'${prefix}/var' | /usr:'${prefix}/var'],
62 AC_MSG_NOTICE([ --localstatedir defaults to /run])
65 AC_SUBST([localstatedir])
68 # The original default values of {bin,sbin,lib}dir
69 usrbin_execdir='${exec_prefix}/bin'
70 AC_SUBST([usrbin_execdir])
72 usrsbin_execdir='${exec_prefix}/sbin'
73 AC_SUBST([usrsbin_execdir])
76 ['${exec_prefix}/'* | '${prefix}/'* | /usr/*],
77 [usrlib_execdir=$libdir],
78 [usrlib_execdir='${exec_prefix}'$libdir]
80 AC_SUBST([usrlib_execdir])
91 UL_WARN_ADD([-fno-common])
93 UL_WARN_ADD([-Werror=sequence-point])
94 UL_WARN_ADD([-Wextra])
95 UL_WARN_ADD([-Wmissing-declarations])
96 UL_WARN_ADD([-Wmissing-parameter-type])
97 UL_WARN_ADD([-Wmissing-prototypes])
98 UL_WARN_ADD([-Wno-missing-field-initializers])
99 UL_WARN_ADD([-Wredundant-decls])
100 UL_WARN_ADD([-Wsign-compare])
101 UL_WARN_ADD([-Wtype-limits])
102 UL_WARN_ADD([-Wuninitialized])
103 UL_WARN_ADD([-Wunused-but-set-parameter])
104 UL_WARN_ADD([-Wunused-but-set-variable])
105 UL_WARN_ADD([-Wunused-parameter])
106 UL_WARN_ADD([-Wunused-result])
107 UL_WARN_ADD([-Wunused-variable])
108 UL_WARN_ADD([-Wnested-externs])
109 UL_WARN_ADD([-Wpointer-arith])
110 UL_WARN_ADD([-Wstrict-prototypes])
111 UL_WARN_ADD([-Wformat-security])
112 AC_SUBST([WARN_CFLAGS])
114 UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS])
115 AC_SUBST([BSD_WARN_CFLAGS])
120 m4_ifndef([PKG_PROG_PKG_CONFIG],
121 [m4_fatal([Could not locate the pkg-config autoconf
122 macros. These are usually located in /usr/share/aclocal/pkg.m4.
123 If your macros are in a different location, try setting the
124 environment variable AL_OPTS="-I/other/macro/dir" before running
125 ./autogen.sh or autoreconf again.])])
128 GTK_DOC_CHECK([1.10])
129 AC_PATH_PROG([XSLTPROC], [xsltproc])
132 AS_CASE([${host_os}], [*linux*], [linux_os=yes])
133 AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes])
135 dnl define ARCH_<NAME> conditionals
136 UL_SET_ARCH([I86], [i?86-*])
137 UL_SET_ARCH([86_64], [x86_64*])
138 UL_SET_ARCH([IA64], [ia64*])
139 UL_SET_ARCH([S390], [s390*])
140 UL_SET_ARCH([SPARC], [sparc*])
141 UL_SET_ARCH([PPC], [ppc*|powerpc*])
142 UL_SET_ARCH([M68K], [m68*])
143 UL_SET_ARCH([MIPS], [mips*])
144 UL_SET_ARCH([HPPA], [hppa*])
148 AM_GNU_GETTEXT_VERSION([0.18.2])
149 AM_GNU_GETTEXT([external])
151 AS_IF([test -d "$srcdir/po"], [
152 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
154 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"
157 AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
158 #ifdef HAVE_LINUX_COMPILER_H
159 #include <linux/compiler.h>
184 security/pam_misc.h \
213 AC_CHECK_HEADERS([langinfo.h],
214 [AM_CONDITIONAL([HAVE_LANGINFO], [true])],
215 [AM_CONDITIONAL([HAVE_LANGINFO], [false])])
217 dnl Convert some ac_cv_header_* variables to have_*
219 have_linux_raw_h=$ac_cv_header_linux_raw_h
220 have_linux_securebits_h=$ac_cv_header_linux_securebits_h
221 have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
222 have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
225 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
230 struct tm *tm = localtime(0);
231 if (a == -1) /* false */
232 sleep(tm->tm_gmtoff);
234 [AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
237 AC_CHECK_MEMBERS([struct termios.c_line],,,
238 [[#include <termios.h>]])
240 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
241 [#include <sys/stat.h>])
243 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
245 #ifdef HAVE_SYS_SWAP_H
246 # include <sys/swap.h>
250 [[swapon("/dev/null", 0);]])],
251 [AC_DEFINE([SWAPON_HAS_TWO_ARGS], [1], [Is swapon() declared with two parameters?])
253 [AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
257 AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
259 AC_CHECK_DECL([llseek],
260 [AC_DEFINE([HAVE_LLSEEK_PROTOTYPE], [1],
261 [Define to 1 if have llseek prototype])],
263 [#include <unistd.h>])
265 AC_CHECK_DECL([lseek64],
266 [AC_DEFINE([HAVE_LSEEK64_PROTOTYPE], [1],
267 [Define to 1 if have lseek64 prototype])],
269 [#define _LARGEFILE_SOURCE
270 #define _LARGEFILE64_SOURCE
271 #include <unistd.h>])
273 AC_CHECK_DECL([environ],
274 [AC_DEFINE([HAVE_ENVIRON_DECL], [1],
275 [Define to 1 if have **environ prototype])],
278 AC_CHECK_DECL([strsignal],
279 [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1],
280 [Define to 1 if have strsignal function prototype])],
324 AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
325 AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
327 AC_CHECK_MEMBER([struct sockaddr.sa_len],
328 AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
329 [#include <sys/types.h>
330 #include <sys/socket.h>])
333 AC_SEARCH_LIBS([socket], [socket],
334 [AS_IF([test x"$ac_cv_search_socket" != x"none required"],
335 [SOCKET_LIBS="$SOCKET_LIBS -lsocket"])
337 AC_SUBST([SOCKET_LIBS])
341 AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
342 AS_IF([test x"$have_dirfd" = xno], [
343 AC_CHECK_DECLS([dirfd],
344 [have_dirfd=yes], [have_dirfd=no],
345 [#include <sys/types.h>
346 #include <dirent.h>])
350 AS_IF([test x"$have_dirfd" = xno], [
351 AC_CHECK_MEMBERS([DIR.dd_fd],
352 [have_ddfd=yes], [have_ddfd=no],
353 [#include <sys/types.h>
354 #include <dirent.h>])
357 AS_CASE([$have_dirfd:$have_ddfd],
359 [AC_MSG_ERROR([cannot find a method to get filedescriptor of directory])]
363 AC_MSG_CHECKING([whether program_invocation_short_name is defined])
364 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
367 program_invocation_short_name = "test";
370 AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
371 [Define if program_invocation_short_name is defined])
377 AC_MSG_CHECKING([whether __progname is defined])
378 AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;],
379 [if (*__progname == 0) return;])],
380 AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined])
381 AC_MSG_RESULT([yes]),
384 dnl Static compilation
385 m4_define([UL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
387 AC_ARG_ENABLE([static-programs],
388 [AS_HELP_STRING([--enable-static-programs=LIST],
389 [link static the programs in LIST (comma-separated,
390 supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])])
392 AS_CASE([$enable_static_programs],
394 [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)],
396 [enable_static_programs=]
399 dnl Set all the individual AM_CONDITIONALs
400 m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
401 AS_CASE([,$enable_static_programs,],
402 [*,UL_PRG,*], [static_[]UL_PRG=yes]
404 AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])])
405 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG),
406 [test "x$static_[]UL_PRG" = xyes])
411 AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
417 i = sscanf("x", $1, &s);
423 AC_CACHE_VAL([scanf_cv_alloc_modifier],
424 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])],
425 [scanf_cv_alloc_modifier=ms],
426 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%as"])])],
427 [scanf_cv_alloc_modifier=as],
428 [scanf_cv_alloc_modifier=no]
432 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
438 #if !(__GLIBC_PREREQ(2, 7))
439 #error %m is not available
442 #elif defined(_POSIX_VERSION)
444 #if _POSIX_VERSION < 200809L
445 #error %m is not available
449 #error Your C-library is not supported.
452 [scanf_cv_alloc_modifier=ms],
453 [scanf_cv_alloc_modifier=no])]
457 AC_MSG_CHECKING([scanf string alloc modifiers])
458 AS_CASE([$scanf_cv_alloc_modifier],
460 [AC_MSG_RESULT([(%ms) yes])
461 AC_DEFINE([HAVE_SCANF_MS_MODIFIER], [1], [scanf %ms modifier])
462 have_scanf_alloc_modifier=yes],
464 [AC_MSG_RESULT([(%as) yes])
465 have_scanf_alloc_modifier=yes
466 AC_DEFINE([HAVE_SCANF_AS_MODIFIER], [1], [scanf %as modifier])],
468 have_scanf_alloc_modifier=no]
471 UL_CHECK_LIB([util], [openpty])
472 UL_CHECK_LIB([termcap], [tgetnum])
474 AC_CHECK_TYPES([union semun], [], [], [[
477 AC_CHECK_TYPES([loff_t])
479 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
487 if (w == WEOF) exit(1);
491 [AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?])
494 AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
498 AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes])
500 AC_CHECK_TYPES([sighandler_t], [], [], [[
504 AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
508 # on Solaris, you can't mix and match standards, since we use c99
509 # aparently at this stage, XOPEN_SOURCE will conflict. As workaround,
510 # check for crypt.h and use that without XOPEN_SOURCE.
511 AC_CHECK_HEADERS([crypt.h])
512 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
516 #define _XOPEN_SOURCE
520 char *c = crypt("abc","pw");
523 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
527 #define _XOPEN_SOURCE
531 char *c = crypt("abc","pw");
533 AC_DEFINE([HAVE_LIBCRYPT], [1], [Do we need -lcrypt?])
536 AC_MSG_ERROR([crypt() is not available])
539 AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
542 AC_ARG_WITH([selinux],
543 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
544 [], [with_selinux=no]
547 AS_IF([test "x$with_selinux" = xno], [
548 AM_CONDITIONAL([HAVE_SELINUX], [false])
550 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0],
551 [AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available])
552 UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
553 AM_CONDITIONAL([HAVE_SELINUX], [true])
557 AS_CASE([$with_selinux:$have_selinux],
558 [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])]
561 AS_IF([test "x$have_selinux" = xyes], [
562 UL_SET_FLAGS([], [], [$SELINUX_LIBS])
563 # This function is missing in old libselinux 1.xx versions
564 AC_CHECK_FUNCS([security_get_initial_context])
568 AC_SUBST([SELINUX_LIBS])
569 AC_SUBST([SELINUX_LIBS_STATIC])
572 AS_HELP_STRING([--with-audit], [compile with audit support]),
576 AS_IF([test "x$with_audit" = xno], [
577 AM_CONDITIONAL([HAVE_AUDIT], [false])
579 UL_CHECK_LIB([audit], [audit_log_user_message])
580 AS_CASE([$with_audit:$have_audit],
582 [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])]
586 AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]),
590 AS_IF([test "x$with_udev" = xno], [
591 AM_CONDITIONAL([HAVE_UDEV], [false])
593 UL_CHECK_LIB([udev], [udev_new])
594 AS_CASE([$with_udev:$have_udev],
596 [AC_MSG_ERROR([udev selected but libudev not found])]
600 AC_ARG_WITH([ncurses],
601 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
602 (--without-ncurses disables all ncurses(w) support)]),
603 [], [with_ncurses=auto]
605 AM_CONDITIONAL([HAVE_NCURSES], [false])
607 AS_IF([test "x$with_ncurses" != xno], [
610 dnl First try to find the pkg-config module.
611 PKG_CHECK_MODULES(NCURSESW, [ncursesw], [
613 NCURSES_LIBS=${NCURSESW_LIBS}
614 NCURSES_CFLAGS=${NCURSESW_CFLAGS}
615 AC_DEFINE([HAVE_LIBNCURSESW])
616 CURSES_LIB_NAME="ncursesw"
618 PKG_CHECK_MODULES(NCURSES, [ncurses], [
620 AC_DEFINE([HAVE_LIBNCURSES])
621 CURSES_LIB_NAME="ncursesw"
625 AS_IF([test "x$have_ncurses" = xyes], [
626 dnl If that worked, setup the defines that the code expects.
627 save_CPPFLAGS="$CPPFLAGS"
628 CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
629 AC_CHECK_HEADERS([ncurses.h])
630 CPPFLAGS="$save_CPPFLAGS"
632 dnl If that failed, fall back to classic searching.
633 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
634 AS_IF([test "x$with_ncurses" = xauto], [
635 UL_CHECK_LIB([ncursesw], [initscr], [ncurses])
636 AS_IF([test "x$have_ncurses" = xyes], [
637 AC_CHECK_HEADERS([ncursesw/ncurses.h])
638 NCURSES_LIBS="-lncursesw"
639 CURSES_LIB_NAME="ncursesw"
642 AS_IF([test "x$have_ncurses" = xno], [
643 UL_CHECK_LIB(ncurses, initscr)
644 AS_IF([test "x$have_ncurses" = xyes], [
645 NCURSES_LIBS="-lncurses"
646 CURSES_LIB_NAME="ncurses"
652 AS_IF([test "x$have_ncurses" = xno], [
653 AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
656 AC_SUBST([NCURSES_CFLAGS])
657 AC_SUBST([NCURSES_LIBS])
661 AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
665 AS_IF([test "x$with_slang" = xyes], [
666 AC_CHECK_HEADERS([slang.h slang/slang.h])
667 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
668 [have_slang=yes], [], [
671 #elif defined(HAVE_SLANG_SLANG_H)
672 #include <slang/slang.h>
675 AS_IF([test "x$have_slang" = xno], [
676 AC_MSG_ERROR([slang selected but slcurses.h not found])],
677 [CURSES_LIB_NAME=slang
680 AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes])
682 AM_CONDITIONAL([BUILD_CFDISK], [test "x$have_slang" = xyes -o "x$have_ncurses" = xyes])
684 AS_IF([test "x$have_slang" = xyes -o "x$have_ncurses" = xyes], [
685 AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [
686 AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1,
687 [Define if curses library has the use_default_colors command.])
692 dnl Try pkg-config for libtinfo
693 PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
694 dnl If that failed, fall back to classic searching.
695 AC_CHECK_LIB([tinfo], [tgetent], [
700 AC_SUBST([TINFO_LIBS])
701 AC_SUBST([TINFO_CFLAGS])
702 AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
705 AC_ARG_WITH([utempter],
706 AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
707 [], [with_utempter=no]
710 AS_IF([test "x$with_utempter" = xyes], [
711 UL_CHECK_LIB([utempter], [utempter_add_record])
712 AS_IF([test "x$have_utempter" = xno], [
713 AC_MSG_ERROR([utempter selected but libutempter not found])
716 AM_CONDITIONAL([HAVE_UTEMPTER], [false])
720 AC_ARG_ENABLE([most-builds],
721 AS_HELP_STRING([--enable-most-builds], [build everything other than experimental code]),
722 [], [enable_most_builds=no]
724 AS_IF([test "x$enable_most_builds" = xyes], [
730 enable_socket_activation=yes
741 AC_ARG_ENABLE([libuuid],
742 AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
743 [], [enable_libuuid=yes]
745 UL_BUILD_INIT([libuuid])
746 AC_SUBST([LIBUUID_VERSION])
747 AC_SUBST([LIBUUID_VERSION_INFO])
748 AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
750 AS_IF([test "x$enable_libuuid" = xyes], [
751 AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
753 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
759 AC_ARG_ENABLE([libblkid],
760 AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
761 [], [enable_libblkid=yes]
763 UL_BUILD_INIT([libblkid])
764 AC_SUBST([LIBBLKID_DATE])
765 AC_SUBST([LIBBLKID_VERSION])
766 AC_SUBST([LIBBLKID_VERSION_INFO])
767 AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string])
768 AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string])
769 AS_IF([test "x$build_libblkid" = xyes], [
770 AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.])
772 AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes])
773 AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes -a "x$enable_static" = xyes])
778 AC_ARG_ENABLE([libmount],
779 AS_HELP_STRING([--disable-libmount], [do not build libmount]),
780 [], [enable_libmount=check]
782 UL_BUILD_INIT([libmount])
783 UL_REQUIRES_LINUX([libmount])
784 UL_REQUIRES_BUILD([libmount], [libblkid])
785 UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
786 AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
787 AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
789 AC_SUBST([LIBMOUNT_VERSION])
790 AC_SUBST([LIBMOUNT_VERSION_INFO])
791 AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])
795 dnl libfdisk is enabled all time if possible
797 UL_BUILD_INIT([libfdisk], [check])
798 UL_REQUIRES_BUILD([libfdisk], [libuuid])
799 AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes])
801 UL_BUILD_INIT([fdisk], [check])
802 UL_REQUIRES_BUILD([fdisk], [libfdisk])
803 AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes])
806 AC_ARG_ENABLE([mount],
807 AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
808 [], [enable_mount=check]
810 UL_BUILD_INIT([mount])
811 UL_REQUIRES_BUILD([mount], [libmount])
812 AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
815 AC_ARG_ENABLE([losetup],
816 AS_HELP_STRING([--disable-losetup], [do not build losetup]),
817 [], [enable_losetup=check]
819 UL_BUILD_INIT([losetup])
820 UL_REQUIRES_LINUX([losetup])
821 AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes])
824 AC_ARG_ENABLE([cytune],
825 AS_HELP_STRING([--disable-cytune], [do not build cytune]),
826 [], [enable_cytune=check]
828 UL_BUILD_INIT([cytune])
829 UL_REQUIRES_LINUX([cytune])
830 AM_CONDITIONAL([BUILD_CYTUNE], [test "x$build_cytune" = xyes])
833 AC_ARG_ENABLE([fsck],
834 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
835 [], [enable_fsck=check]
837 UL_BUILD_INIT([fsck])
838 UL_REQUIRES_BUILD([fsck], [libmount])
839 AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes])
842 AC_ARG_ENABLE([partx],
843 AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
844 [], [enable_partx=check]
846 UL_BUILD_INIT([partx])
847 UL_REQUIRES_LINUX([partx])
848 UL_REQUIRES_BUILD([partx], [libblkid])
849 AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes])
852 AC_ARG_ENABLE([uuidd],
853 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
854 [], [enable_uuidd=check]
856 UL_BUILD_INIT([uuidd])
857 UL_REQUIRES_BUILD([uuidd], [libuuid])
858 AS_IF([test "x$build_uuidd" = xyes], [
859 AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])
861 AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes])
864 AC_ARG_ENABLE([mountpoint],
865 AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
866 [], [enable_mountpoint=check]
868 UL_BUILD_INIT([mountpoint])
869 UL_REQUIRES_BUILD([mountpoint], [libmount])
870 AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes])
873 AC_ARG_ENABLE([fallocate],
874 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
875 [], [enable_fallocate=check]
877 UL_BUILD_INIT([fallocate])
878 UL_REQUIRES_LINUX([fallocate])
879 UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
880 AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes])
882 AS_IF([test "x$build_fallocate" = xyes], [
883 dnl check for valid fallocate() function
884 dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
885 dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
886 dnl and program can't be linked.
887 dnl AC_CHECK_FUNC can't catch such errors since it's redefining
888 dnl function prototype.
889 AC_MSG_CHECKING([for valid fallocate() function])
890 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
894 #ifdef HAVE_SYS_TYPES_H
895 # include <sys/types.h>
897 #ifdef HAVE_LINUX_FALLOC_H
898 # include <linux/falloc.h>
905 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
911 AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[
912 AC_MSG_RESULT([no])])
916 AC_ARG_ENABLE([unshare],
917 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
918 [], [enable_unshare=check]
920 UL_BUILD_INIT([unshare])
921 UL_REQUIRES_LINUX([unshare])
922 UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
923 AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes])
924 AC_CHECK_FUNCS([unshare])
926 AC_ARG_ENABLE([nsenter],
927 AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
928 [], [enable_nsenter=check]
930 UL_BUILD_INIT([nsenter])
931 UL_REQUIRES_LINUX([nsenter])
932 UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL_CHECK_SYSCALL([setns])], [setns])
933 AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
934 AC_CHECK_FUNCS([setns])
936 dnl setpriv depends on libcap-ng. It would be possible to build
937 dnl a version of setpriv with limited functionality without libcap-ng,
938 dnl but this isn't currently supported.
939 UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
940 AC_ARG_ENABLE([setpriv],
941 AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
942 [], [enable_setpriv=check]
944 UL_BUILD_INIT([setpriv])
945 UL_REQUIRES_LINUX([setpriv])
946 UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [securebits.h header file])
947 UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
948 AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
951 AC_ARG_ENABLE([eject],
952 AS_HELP_STRING([--disable-eject], [do not build eject]),
953 [], [enable_eject=check]
955 UL_BUILD_INIT([eject])
956 UL_REQUIRES_LINUX([eject])
957 UL_REQUIRES_BUILD([eject], [libmount])
958 AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes])
961 AC_ARG_ENABLE([agetty],
962 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
963 [], [enable_agetty=yes]
965 UL_BUILD_INIT([agetty])
966 AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
969 AC_ARG_ENABLE([cramfs],
970 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
971 [], [enable_cramfs=check]
973 UL_BUILD_INIT([cramfs])
974 AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
975 UL_REQUIRES_HAVE([cramfs], [z], [z library])
976 AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])
980 AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]),
984 AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
987 AC_ARG_ENABLE([fdformat],
988 AS_HELP_STRING([--disable-fdformat], [do not build fdformat]),
989 [], [enable_fdformat=check]
991 UL_BUILD_INIT([fdformat])
992 UL_REQUIRES_LINUX([fdformat])
993 AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes])
996 AC_ARG_ENABLE([hwclock],
997 AS_HELP_STRING([--disable-hwclock], [do not build hwclock]),
998 [], [enable_hwclock=check]
1000 have_linuxdummy=$linux_os
1002 UL_BUILD_INIT([hwclock])
1003 UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux])
1004 AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes])
1007 UL_BUILD_INIT([fstrim], [check])
1008 UL_REQUIRES_LINUX([fstrim])
1009 UL_REQUIRES_BUILD([fstrim], [libmount])
1010 AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes])
1013 UL_BUILD_INIT([swapon], [check])
1014 UL_REQUIRES_LINUX([swapon])
1015 UL_REQUIRES_BUILD([swapon], [libblkid])
1016 UL_REQUIRES_BUILD([swapon], [libmount])
1017 AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
1020 UL_BUILD_INIT([lsblk], [check])
1021 UL_REQUIRES_LINUX([lsblk])
1022 UL_REQUIRES_BUILD([lsblk], [libblkid])
1023 UL_REQUIRES_BUILD([lsblk], [libmount])
1024 AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes])
1027 UL_BUILD_INIT([lscpu], [check])
1028 UL_REQUIRES_LINUX([lscpu])
1029 UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
1030 AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes])
1033 UL_BUILD_INIT([chcpu], [check])
1034 UL_REQUIRES_LINUX([chcpu])
1035 UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
1036 AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes])
1039 AC_ARG_ENABLE([wdctl],
1040 AS_HELP_STRING([--disable-wdctl], [do not build wdctl]),
1041 [], [enable_wdctl=check]
1043 UL_BUILD_INIT([wdctl])
1044 UL_REQUIRES_LINUX([wdctl])
1045 UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
1046 AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes])
1049 UL_BUILD_INIT([swaplabel], [check])
1050 UL_REQUIRES_BUILD([swaplabel], [libblkid])
1051 AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
1054 UL_BUILD_INIT([prlimit], [check])
1055 UL_REQUIRES_LINUX([prlimit])
1056 UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
1057 AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes])
1058 AS_IF([test "x$build_prlimit" = xyes], [
1059 AC_CHECK_FUNCS([prlimit])
1063 UL_BUILD_INIT([lslocks], [check])
1064 UL_REQUIRES_LINUX([lslocks])
1065 UL_REQUIRES_BUILD([lslocks], [libmount])
1066 AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes])
1069 AC_ARG_ENABLE([switch_root],
1070 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
1071 [], [enable_switch_root=check]
1073 UL_BUILD_INIT([switch_root])
1074 UL_REQUIRES_LINUX([switch_root])
1075 UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
1076 AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
1079 AC_ARG_ENABLE([pivot_root],
1080 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
1081 [], [enable_pivot_root=check]
1083 UL_BUILD_INIT([pivot_root])
1084 UL_REQUIRES_LINUX([switch_root])
1085 UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
1086 AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes])
1089 AC_ARG_ENABLE([tunelp],
1090 AS_HELP_STRING([--enable-tunelp], [build tunelp]),
1091 [], [enable_tunelp=no]
1093 UL_BUILD_INIT([tunelp])
1094 UL_REQUIRES_LINUX([tunelp])
1095 AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes])
1098 AC_ARG_ENABLE([kill],
1099 AS_HELP_STRING([--disable-kill], [do not build kill]),
1100 [], [enable_kill=check]
1102 UL_BUILD_INIT([kill])
1103 UL_REQUIRES_LINUX([kill])
1104 AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])
1107 AC_ARG_ENABLE([deprecated-last],
1108 AS_HELP_STRING([--enable-deprecated-last], [build old deprecated last]),
1109 [], [enable_deprecated_last=no]
1111 UL_BUILD_INIT([deprecated_last])
1112 AM_CONDITIONAL([BUILD_DEPRECATED_LAST], [test "x$build_deprecated_last" = xyes])
1115 AC_ARG_ENABLE([last],
1116 AS_HELP_STRING([--disable-last], [do not build last]),
1117 [], [enable_last=check]
1119 UL_BUILD_INIT([last])
1120 UL_CONFLICTS_BUILD([last], [deprecated_last], [old deprecated last version])
1121 AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
1124 AC_ARG_ENABLE([utmpdump],
1125 AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]),
1126 [], [enable_utmpdump=yes]
1128 UL_BUILD_INIT([utmpdump])
1129 AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
1132 AC_ARG_ENABLE([line],
1133 AS_HELP_STRING([--enable-line], [build line]),
1134 [], [enable_line=no]
1136 UL_BUILD_INIT([line])
1137 AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
1140 AC_ARG_ENABLE([mesg],
1141 AS_HELP_STRING([--disable-mesg], [do not build mesg]),
1142 [], [enable_mesg=yes]
1144 UL_BUILD_INIT([mesg])
1145 AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
1148 AC_ARG_ENABLE([raw],
1149 AS_HELP_STRING([--disable-raw], [do not build raw]),
1150 [], [enable_raw=check]
1152 UL_BUILD_INIT([raw])
1153 UL_REQUIRES_LINUX([raw])
1154 UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
1155 AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes])
1158 AC_ARG_ENABLE([rename],
1159 AS_HELP_STRING([--disable-rename], [do not build rename]),
1160 [], [enable_rename=yes]
1162 UL_BUILD_INIT([rename])
1163 AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
1166 AC_ARG_ENABLE([reset],
1167 AS_HELP_STRING([--enable-reset], [build reset]),
1168 [], [enable_reset=no]
1170 UL_BUILD_INIT([reset])
1171 AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes])
1174 AC_ARG_ENABLE([vipw],
1175 AS_HELP_STRING([--enable-vipw], [build vipw]),
1176 [], [enable_vipw=no]
1178 UL_BUILD_INIT([vipw])
1179 AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
1182 AC_ARG_ENABLE([newgrp],
1183 AS_HELP_STRING([--enable-newgrp], [build newgrp]),
1184 [], [enable_newgrp=no]
1186 UL_BUILD_INIT([newgrp])
1187 AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes])
1190 AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]),
1191 [], [with_user=check]
1194 AS_IF([test "x$with_user" != xno], [
1195 PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no])
1196 AS_CASE([$with_user:$have_user],
1198 [AC_MSG_ERROR([user selected but libuser not found])],
1200 [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])]
1202 # temporary solution, libuser has stupid .pc where are exported all
1203 # private dependencies to Requires: instead of Requires.private:
1204 AS_IF([test "x$have_user" = xyes], [
1208 AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes])
1210 AC_ARG_ENABLE([chfn-chsh-password],
1211 AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]),
1212 [], [enable_chfn_chsh_password=yes]
1215 AC_ARG_ENABLE([chfn-chsh],
1216 AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
1217 [], [enable_chfn_chsh=no]
1219 UL_BUILD_INIT([chfn_chsh])
1221 AS_IF([test "x$enable_chfn_chsh_password" = xyes -o "x$have_user" = xyes], [
1222 UL_REQUIRES_HAVE([chfn_chsh], [security_pam_misc_h], [PAM header file])
1223 AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?])
1225 AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes])
1226 AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes])
1228 AC_ARG_ENABLE([chsh-only-listed],
1229 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
1230 [], enable_chsh_only_listed=yes
1233 AS_IF([test "x$enable_chsh_only_listed" = xyes], [
1234 AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?])
1238 AC_ARG_ENABLE([login],
1239 AS_HELP_STRING([--disable-login], [do not build login]),
1240 [], [enable_login=check]
1242 UL_BUILD_INIT([login])
1243 UL_REQUIRES_HAVE([login], [security_pam_misc_h], [PAM header file])
1244 AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes])
1246 AC_ARG_ENABLE([login-chown-vcs],
1247 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
1248 [], [enable_login_chown_vcs=no]
1251 AS_IF([test "x$enable_login_chown_vcs" = xyes], [
1252 AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?])
1255 AC_ARG_ENABLE([login-stat-mail],
1256 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
1257 [], [enable_login_stat_mail=no]
1260 AS_IF([test "x$enable_login_stat_mail" = xyes], [
1261 AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?])
1265 AC_ARG_ENABLE([nologin],
1266 AS_HELP_STRING([--disable-nologin], [do not build nologin]),
1267 [], [enable_nologin=yes]
1269 UL_BUILD_INIT([nologin])
1270 AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
1273 AC_ARG_ENABLE([sulogin],
1274 AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
1275 [], [enable_sulogin=yes]
1277 UL_BUILD_INIT([sulogin])
1278 AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
1282 AS_HELP_STRING([--disable-su], [do not build su]),
1283 [], [enable_su=check]
1286 UL_REQUIRES_HAVE([su], [security_pam_misc_h], [PAM header file])
1287 AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
1290 AC_ARG_ENABLE([runuser],
1291 AS_HELP_STRING([--disable-runuser], [do not build runuser]),
1292 [], [enable_runuser=check]
1294 UL_BUILD_INIT([runuser])
1295 UL_REQUIRES_HAVE([runuser], [security_pam_misc_h], [PAM header file])
1296 AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
1300 AS_HELP_STRING([--disable-ul], [do not build ul]),
1301 [], [enable_ul=check]
1304 UL_REQUIRES_HAVE([ul], [ncurses, tinfo], [ncurses or tinfo libraries])
1305 AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
1308 AC_ARG_ENABLE([more],
1309 AS_HELP_STRING([--disable-more], [do not build more]),
1310 [], [enable_more=check]
1312 UL_BUILD_INIT([more])
1313 UL_REQUIRES_HAVE([more], [ncurses, tinfo, termcap], [ncurses, tinfo or termcap libraries])
1314 AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])
1318 AS_HELP_STRING([--disable-pg], [do not build pg]),
1319 [], [enable_pg=check]
1322 UL_REQUIRES_HAVE([pg], [ncurses], [ncurses or ncursesw library])
1323 AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes])
1326 AC_ARG_ENABLE([setterm],
1327 AS_HELP_STRING([--disable-setterm], [do not build setterm]),
1328 [], [enable_setterm=check]
1330 UL_BUILD_INIT([setterm])
1331 UL_REQUIRES_LINUX([setterm])
1332 UL_REQUIRES_HAVE([setterm], [ncurses], [ncurses library])
1333 AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
1336 AC_ARG_ENABLE([schedutils],
1337 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
1338 [], [enable_schedutils=yes]
1340 UL_BUILD_INIT([schedutils])
1341 AM_CONDITIONAL([BUILD_SCHEDUTILS], [test "x$build_schedutils" = xyes])
1343 UL_BUILD_INIT([ionice], [check])
1344 UL_REQUIRES_BUILD([ionice], [schedutils])
1345 UL_REQUIRES_SYSCALL_CHECK([ionice],
1346 [UL_CHECK_SYSCALL([ioprio_set],
1357 UL_REQUIRES_SYSCALL_CHECK([ionice],
1358 [UL_CHECK_SYSCALL([ioprio_get],
1369 AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
1371 UL_BUILD_INIT([taskset], [check])
1372 UL_REQUIRES_BUILD([taskset], [schedutils])
1373 UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
1374 UL_REQUIRES_SYSCALL_CHECK([taskset],
1375 [UL_CHECK_SYSCALL([sched_getaffinity])],
1376 [sched_getaffinity])
1377 AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
1380 AC_ARG_ENABLE([wall],
1381 AS_HELP_STRING([--disable-wall], [do not build wall]),
1382 [], [enable_wall=yes]
1384 UL_BUILD_INIT([wall])
1385 AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
1388 AC_ARG_ENABLE([write],
1389 AS_HELP_STRING([--enable-write], [build write]),
1390 [], [enable_write=no]
1392 UL_BUILD_INIT([write])
1393 AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes])
1396 AC_ARG_ENABLE([socket-activation],
1397 AS_HELP_STRING([--enable-socket-activation], [build uuidd with support for systemd socket activation]),
1398 [], [enable_socket_activation=no]
1400 have_systemd_daemon=no
1401 AS_IF([test "x$enable_socket_activation" = xyes], [
1402 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], [], [
1403 AC_MSG_ERROR([cannot find libsystemd-daemon support])
1405 have_systemd_daemon=yes
1406 AC_DEFINE([HAVE_LIBSYSTEMD_DAEMON], [1], [Define if libsystemd-daemon is available])
1408 AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$have_systemd_daemon" = xyes])
1410 AC_ARG_WITH([systemdsystemunitdir],
1411 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd service files]),
1412 [], [with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`])
1414 AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
1415 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
1419 AC_ARG_ENABLE([journald],
1420 AS_HELP_STRING([--enable-journald], [add journald support to logger]),
1421 [], [enable_journald=no]
1424 AS_IF([test "x$enable_journald" = xyes], [
1425 PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal], [], [
1426 AC_MSG_ERROR([cannot find libsystemd-journal support])
1429 AC_DEFINE([HAVE_JOURNALD], [1], [Define if journald is available])
1431 AM_CONDITIONAL([HAVE_JOURNALD], [test "x$have_journald" = xyes])
1434 AC_ARG_WITH([smack],
1435 AS_HELP_STRING([--with-smack], [build with SMACK support]),
1438 AS_IF([test "x$with_smack" = xyes], [
1439 AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support])
1443 AC_ARG_WITH([bashcompletiondir],
1444 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1446 [AS_IF([`$PKG_CONFIG --exists bash-completion`], [
1447 with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`
1449 with_bashcompletiondir=${datadir}/bash-completion/completions
1452 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1454 AC_ARG_ENABLE([bash-completion],
1455 AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]),
1456 [], [enable_bash_completion=yes]
1459 AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
1462 AC_ARG_WITH([python],
1463 AS_HELP_STRING([--with-python], [generate python bindings, use --with-python={2,3} to force version]),
1464 [], [with_python=no]
1468 AS_IF([test "x$with_python" != xno], [
1469 # We follow distributions default and look for PKG module name "python"
1470 # (minimal version is 2) but if major version is explicitly specified by
1471 # --with-python=2 or --with-python=3 then we look for PKG module "python2" or
1473 AS_IF([test "x$withval" != xno -a "x$withval" != xyes],
1474 [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"])
1475 AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no])
1476 AS_CASE([$with_python:$have_python],
1478 [AC_MSG_ERROR([python selected but libpython not found])]
1480 PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION])
1482 UL_BUILD_INIT([pylibmount], [check])
1483 UL_REQUIRES_HAVE([pylibmount], [python], [libpython])
1484 UL_REQUIRES_BUILD([pylibmount], [libmount])
1487 AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"])
1490 AC_ARG_ENABLE([pg-bell],
1491 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
1492 [], [enable_pg_bell=yes]
1495 AS_IF([test "x$enable_pg_bell" = xyes], [
1496 AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?])
1500 AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
1501 AC_ARG_ENABLE([fs-paths-default],
1502 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
1503 [AS_CASE([$enableval],
1504 [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"],
1505 [no], [fs_paths_defaults=""],
1506 [fs_paths_defaults="$enableval"]
1508 [fs_paths_defaults="FS_PATHS_DEFAULT"]
1510 AC_ARG_ENABLE([fs-paths-extra],
1511 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
1512 [AS_CASE([$enableval],
1513 [yes|no], [fs_paths_extra=""],
1514 [fs_paths_extra="$enableval"]
1518 fs_paths="$fs_paths_defaults"
1519 AS_IF([test "x$fs_paths_extra" != "x"], [
1520 AS_IF([test "x$fs_paths" != "x"], [
1521 fs_paths="${fs_paths}:"
1523 fs_paths="${fs_paths}${fs_paths_extra}"
1525 AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
1528 AC_ARG_ENABLE([use-tty-group],
1529 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
1530 [], [enable_use_tty_group=yes]
1532 AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes])
1534 AS_IF([test "x$enable_use_tty_group" = xyes], [
1535 AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?])
1539 AC_ARG_ENABLE([sulogin-emergency-mount],
1540 AS_HELP_STRING([--enable-sulogin-emergency-mount],
1541 [use emergency mount of /dev and /proc for sulogin]),
1542 [], [enable_sulogin_emergency_mount=no]
1545 AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [
1546 AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1],
1547 [Should sulogin use a emergency mount of /dev and /proc?])
1551 AC_ARG_ENABLE([makeinstall-chown],
1552 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
1553 [], [enable_makeinstall_chown=yes]
1555 AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes])
1557 AC_ARG_ENABLE([makeinstall-setuid],
1558 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
1559 [], [enable_makeinstall_setuid=yes]
1561 AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes])
1564 AC_ARG_VAR([SUID_CFLAGS],
1565 [CFLAGS used for binaries which are usually with the suid bit])
1566 AC_ARG_VAR([SUID_LDFLAGS],
1567 [LDFLAGS used for binaries which are usually with the suid bit])
1569 AC_ARG_VAR([DAEMON_CFLAGS],
1570 [CFLAGS used for binaries which are usually executed as daemons])
1571 AC_ARG_VAR([DAEMON_LDFLAGS],
1572 [LDFLAGS used for binaries which are usually executed as daemons])
1574 AC_ARG_VAR([SOLIB_CFLAGS],
1575 [CFLAGS used for shared libraries])
1576 AC_ARG_VAR([SOLIB_LDFLAGS],
1577 [LDFLAGS used for shared libraries])
1582 AC_CONFIG_HEADERS([config.h])
1585 # Don't use configure.ac to replace install paths! See Makefile PATHFILES for
1590 libblkid/docs/Makefile
1591 libblkid/docs/version.xml
1592 libblkid/src/blkid.h
1593 libmount/docs/Makefile
1594 libmount/docs/version.xml
1595 libmount/src/libmount.h
1602 ${PACKAGE} ${VERSION}
1605 exec prefix: ${exec_prefix}
1607 localstatedir: ${localstatedir}
1611 includedir: ${includedir}
1612 usrbin_execdir: ${usrbin_execdir}
1613 usrsbin_execdir: ${usrsbin_execdir}
1614 usrlib_execdir: ${usrlib_execdir}
1618 suid cflags: ${SUID_CFLAGS}
1620 suid ldflags: ${SUID_LDFLAGS}
1623 Python version: ${PYTHON_VERSION}
1624 Python libs: ${pyexecdir}
1626 Bash completions: ${with_bashcompletiondir}