]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
include: add /proc/locks path to pathnames
[thirdparty/util-linux.git] / configure.ac
CommitLineData
38c75b59
SK
1AC_INIT(util-linux,
2 m4_esyscmd([tools/git-version-gen .tarball-version]),
3 kzak@redhat.com)
baf39af1 4
7fc9786b 5AC_PREREQ(2.60)
48d7b13a
KZ
6
7AC_CONFIG_AUX_DIR(config)
b12991dd 8AC_CONFIG_MACRO_DIR([m4])
df5f3c54 9AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability])
48d7b13a 10
eb35c251 11m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
f06b4328 12 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
eb35c251 13
48d7b13a 14AC_CONFIG_SRCDIR(mount/mount.c)
15a9b48c
SK
15AC_PREFIX_DEFAULT([/usr])
16
33b0be6d
KZ
17dnl version details from <major>.<minor>[-<suffix>]
18PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
19PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
f06b4328 20 | awk -F- '{print $1}')
33b0be6d 21PACKAGE_VERSION_RELEASE=0
a0948ffe 22
33b0be6d
KZ
23dnl libblkid version
24LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
6b7113bc 25LIBBLKID_DATE="24-Feb-2012"
dc2b8d87
KZ
26LIBBLKID_LT_MAJOR=1
27LIBBLKID_LT_MINOR=1
28LIBBLKID_LT_MICRO=0
29LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR
a0948ffe 30
f6076f55
KZ
31dnl libuuid version
32LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
dc2b8d87
KZ
33LIBUUID_LT_MAJOR=1
34LIBUUID_LT_MINOR=3
35LIBUUID_LT_MICRO=0
36LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR
f6076f55 37
f1cde479
KZ
38dnl libmount version
39LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
40LIBMOUNT_LT_MAJOR=1
41LIBMOUNT_LT_MINOR=1
42LIBMOUNT_LT_MICRO=0
43LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR
44
15a9b48c
SK
45# Check whether exec_prefix=/usr:
46case $exec_prefix:$prefix in
47NONE:NONE | NONE:/usr | /usr:*)
48 AC_MSG_NOTICE([Default --exec-prefix detected.])
49 case $bindir in
50 '${exec_prefix}/bin') bindir=/bin
51 AC_MSG_NOTICE([ --bindir defaults to /bin]) ;;
52 esac
53 case $sbindir in
54 '${exec_prefix}/sbin') sbindir=/sbin
55 AC_MSG_NOTICE([ --sbindir defaults to /sbin]) ;;
971f57f6
KZ
56 esac
57 case $libdir in
58 '${exec_prefix}/lib') libdir=/lib
59 AC_MSG_NOTICE([ --libdir defaults to /lib]) ;;
15a9b48c
SK
60 esac ;;
61esac
48d7b13a 62
cb5212e2 63libdirname=`basename "$libdir"`
b0a0d7d5
KZ
64AC_SUBST([libdirname])
65
996fb358 66# The original default values of {bin,sbin,lib}dir
aaf3e8f5 67usrbin_execdir='${exec_prefix}/bin'
30688dde 68AC_SUBST([usrbin_execdir])
996fb358 69
aaf3e8f5 70usrsbin_execdir='${exec_prefix}/sbin'
30688dde 71AC_SUBST([usrsbin_execdir])
996fb358 72
aaf3e8f5 73usrlib_execdir='${exec_prefix}/'$libdirname
30688dde 74AC_SUBST([usrlib_execdir])
996fb358 75
31c9c1c4 76AM_PROG_CC_C_O
48d7b13a 77AC_PROG_CC_STDC
240f7101 78AC_GNU_SOURCE
a6996860 79AC_CANONICAL_HOST
85b4c147 80AC_C_CONST
e79829db 81AC_C_VOLATILE
fbaec83b 82AC_C_BIGENDIAN
b12991dd
KZ
83
84dnl libtool-2
85LT_INIT
48d7b13a 86
fd0f4132
SK
87m4_ifndef([PKG_PROG_PKG_CONFIG],
88 [m4_fatal([Could not locate the pkg-config autoconf
89 macros. These are usually located in /usr/share/aclocal/pkg.m4.
90 If your macros are in a different location, try setting the
91 environment variable AL_OPTS="-I/other/macro/dir" before running
92 ./autogen.sh or autoreconf again.])])
d06d028a
KZ
93PKG_PROG_PKG_CONFIG
94
22aa5166
KZ
95GTK_DOC_CHECK([1.10])
96AC_PATH_PROG([XSLTPROC], [xsltproc])
97
8c182554
KZ
98linux_os=no
99case ${host_os} in
100 *linux*)
101 linux_os=yes
102 ;;
103esac
49ccbae6 104AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes)
8c182554 105
3c6e292c
KZ
106dnl define ARCH_<NAME> conditionals
107UL_SET_ARCH(I86, i?86-*)
108UL_SET_ARCH(86_64, x86_64*)
109UL_SET_ARCH(IA64, ia64*)
110UL_SET_ARCH(S390, s390*)
111UL_SET_ARCH(SPARC, sparc*)
112UL_SET_ARCH(PPC, ppc*|powerpc*)
113UL_SET_ARCH(M68K, m68*)
114UL_SET_ARCH(MIPS, mips*)
115UL_SET_ARCH(HPPA, hppa*)
116
48d7b13a
KZ
117AC_SYS_LARGEFILE
118
09734b00
KZ
119AM_GNU_GETTEXT_VERSION([0.14.1])
120AM_GNU_GETTEXT([external])
121if test -d "$srcdir/po"
122then
123 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
124else
125 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"
126fi
127
e460a5bf 128AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
48d7b13a
KZ
129#ifdef HAVE_LINUX_COMPILER_H
130#include <linux/compiler.h>
131#endif
132])
f06b4328
SK
133AC_CHECK_HEADERS([ \
134 asm/io.h \
135 err.h \
a0948ffe 136 errno.h \
f06b4328 137 fcntl.h \
a0948ffe 138 getopt.h \
f06b4328
SK
139 inttypes.h \
140 linux/cdrom.h \
141 linux/falloc.h \
a0948ffe 142 linux/fd.h \
f06b4328 143 linux/raw.h \
a0948ffe
KZ
144 linux/tiocl.h \
145 linux/version.h \
8b7f16fc 146 locale.h \
607c2a72 147 mntent.h \
f06b4328 148 net/if.h \
754fed0c 149 net/if_dl.h \
f06b4328
SK
150 netinet/in.h \
151 paths.h \
152 pty.h \
153 security/pam_misc.h \
154 stdint.h \
a0948ffe
KZ
155 stdlib.h \
156 sys/disk.h \
157 sys/disklabel.h \
f06b4328 158 sys/file.h \
bf962c0a 159 sys/io.h \
f06b4328
SK
160 sys/ioccom.h \
161 sys/ioctl.h \
a0948ffe
KZ
162 sys/mkdev.h \
163 sys/prctl.h \
164 sys/queue.h \
f06b4328 165 sys/resource.h \
2a7c1f70 166 sys/socket.h \
f06b4328 167 sys/sockio.h \
a0948ffe 168 sys/stat.h \
f06b4328
SK
169 sys/swap.h \
170 sys/syscall.h \
171 sys/time.h \
a0948ffe 172 sys/types.h \
754fed0c 173 sys/un.h \
f06b4328
SK
174 unistd.h \
175])
dc61d398 176
a67387b7
KZ
177AC_CHECK_HEADERS([langinfo.h],
178 [AM_CONDITIONAL([HAVE_LANGINFO], [true])],
179 [AM_CONDITIONAL([HAVE_LANGINFO], [false])])
180
16ba8d58
KZ
181dnl Convert some ac_cv_header_* variables to have_*
182dnl
183have_linux_raw_h=$ac_cv_header_linux_raw_h
ff0cb84d 184have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
48d7b13a 185
a67387b7
KZ
186
187AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
188#include <time.h>
189#include <unistd.h>
190]], [[
191 int a = 0;
192 struct tm *tm = localtime(0);
193 if (a == -1) /* false */
f06b4328 194 sleep(tm->tm_gmtoff);
a67387b7
KZ
195]])],
196[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
197])
198
199AC_CHECK_MEMBERS([struct termios.c_line],,,
200 [[#include <termios.h>]])
201
202AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
203 [#include <sys/stat.h>])
204
205AC_CHECK_DECLS([
206 UNAME26,
207 ADDR_NO_RANDOMIZE,
208 FDPIC_FUNCPTRS,
209 MMAP_PAGE_ZERO,
210 ADDR_COMPAT_LAYOUT,
211 READ_IMPLIES_EXEC,
212 ADDR_LIMIT_32BIT,
213 WHOLE_SECONDS,
214 STICKY_TIMEOUTS,
215 ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
216
217AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
218[[
219#ifdef HAVE_SYS_SWAP_H
220# include <sys/swap.h>
221#endif
222#include <unistd.h>
223]],
224[[swapon("/dev/null", 0);]])],
225[AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?])
226],
227[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
228])
dc61d398
KZ
229
230
a88057d9
TP
231AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
232
2a7c1f70
KZ
233AC_CHECK_DECL([llseek],
234 [AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
235 [Define to 1 if have llseek prototype])],
236 [],
237 [#include <unistd.h>])
238
239AC_CHECK_DECL([lseek64],
240 [AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
241 [Define to 1 if have lseek64 prototype])],
242 [],
243 [#define _LARGEFILE_SOURCE
244 #define _LARGEFILE64_SOURCE
245 #include <unistd.h>])
246
f06b4328
SK
247AC_CHECK_FUNCS([ \
248 __secure_getenv \
eb76ca98
FG
249 err \
250 errx \
bf962c0a 251 fsync \
f06b4328 252 futimens \
bf962c0a 253 getdomainname \
f06b4328
SK
254 getdtablesize \
255 getexecname \
256 getmntinfo \
257 getrlimit \
258 inotify_init \
3ac22f7a 259 jrand48 \
bf962c0a 260 lchown \
a0948ffe
KZ
261 llseek \
262 lseek64 \
f06b4328
SK
263 nanosleep \
264 personality \
265 posix_fadvise \
266 prctl \
267 rpmatch \
485a8bfa 268 scandirat \
69045d3d
KZ
269 setresgid \
270 setresuid \
f06b4328
SK
271 sigqueue \
272 srandom \
273 strnchr \
69b7e41e
KZ
274 strndup \
275 strnlen \
f06b4328
SK
276 strtoull \
277 sysconf \
278 updwtmp \
279 usleep \
eb76ca98
FG
280 warn \
281 warnx \
f06b4328 282])
48d7b13a 283AC_FUNC_FSEEKO
48d7b13a 284
940fd28c 285AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
465e9973 286AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
465e9973 287
754fed0c
KZ
288AC_CHECK_MEMBER(struct sockaddr.sa_len,
289 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
290 [#include <sys/types.h>
291 #include <sys/socket.h>])
292
60cc9f94
FG
293SOCKET_LIBS=
294AC_SEARCH_LIBS([gethostbyname], [nsl],
295 [if test x"$ac_cv_search_gethostbyname" != x"none required"; then
296 SOCKET_LIBS="$SOCKET_LIBS -lnsl";
297 fi])
298AC_SEARCH_LIBS([socket], [socket],
299 [if test x"$ac_cv_search_socket" != x"none required"; then
300 SOCKET_LIBS="$SOCKET_LIBS -lsocket";
301 fi])
302AC_SUBST([SOCKET_LIBS])
303
d58c47d9
FG
304
305have_dirfd=no
306AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
307if test x"$have_dirfd" = xno ; then
308 AC_CHECK_DECLS([dirfd],
309 [have_dirfd=yes], [have_dirfd=no],
310 [#include <sys/types.h>
311 #include <dirent.h>])
312fi
313
314have_ddfd=no
315if test x"$have_dirfd" = xno ; then
316 AC_CHECK_MEMBERS([DIR.dd_fd],
317 [have_ddfd=yes], [have_ddfd=no],
318 [#include <sys/types.h>
319 #include <dirent.h>])
320fi
321
322case "$have_dirfd:$have_ddfd" in
323no:no)
324 AC_MSG_ERROR([cannot find a method to get filedescriptor of directory]) ;;
325esac
326
327
a804f444
FG
328AC_MSG_CHECKING(whether program_invocation_short_name is defined)
329AC_TRY_COMPILE([#include <argp.h>],
f06b4328
SK
330 [program_invocation_short_name = "test";],
331 AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1,
332 [Define if program_invocation_short_name is defined])
333 AC_MSG_RESULT(yes),
334 AC_MSG_RESULT(no))
a804f444
FG
335
336AC_MSG_CHECKING([whether __progname is defined])
337AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;],
f06b4328
SK
338 [if (*__progname == 0) return;])],
339 AC_DEFINE(HAVE___PROGNAME, 1, [Define if __progname is defined])
340 AC_MSG_RESULT(yes),
341 AC_MSG_RESULT(no))
a804f444 342
8569410c 343dnl Static compilation
132ea941 344m4_define([UL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
8569410c
SK
345
346AC_ARG_ENABLE([static-programs],
347 [AS_HELP_STRING([--enable-static-programs=LIST],
348 [link static the programs in LIST (comma-separated,
132ea941 349 supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])])
8569410c
SK
350
351case $enable_static_programs in
132ea941 352yes) enable_static_programs=m4_quote(UL_STATIC_PROGRAMS) ;;
8569410c
SK
353no) enable_static_programs= ;;
354esac
355
8569410c 356dnl Set all the individual AM_CONDITIONALs
132ea941 357m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
8569410c 358 case ,$enable_static_programs, in
132ea941 359 *,UL_PRG,*) static_[]UL_PRG=yes ;;
8569410c 360 esac
132ea941
KZ
361 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG),
362 [test "x$static_[]UL_PRG" = xyes])
8569410c
SK
363])
364
d7a01582 365AX_CHECK_TLS
3ac22f7a 366
13f5473e
KZ
367AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
368# include <stdio.h>
369int main()
370{
371 int i;
372 char *s;
373 i = sscanf("x", $1, &s);
374 if (i == 1)
375 return 0;
376 return 1;
377}])
378
379AC_CACHE_VAL([scanf_cv_alloc_modifier],
380 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])],
381 [scanf_cv_alloc_modifier=ms],
382 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%as"])])],
383 [scanf_cv_alloc_modifier=as],
384 [scanf_cv_alloc_modifier=no]
385 )
b420e279
SAS
386 ,
387 [scanf_cv_alloc_modifier=no]
13f5473e
KZ
388 )
389)
390
391AC_MSG_CHECKING([scanf string alloc modifiers])
392case "$scanf_cv_alloc_modifier" in
393ms)
394 AC_MSG_RESULT([(%ms) yes])
395 AC_DEFINE([HAVE_SCANF_MS_MODIFIER], [1], [scanf %ms modifier])
396 have_scanf_alloc_modifier=yes
397 ;;
398as)
399 AC_MSG_RESULT([(%as) yes])
400 have_scanf_alloc_modifier=yes
401 AC_DEFINE([HAVE_SCANF_AS_MODIFIER], [1], [scanf %as modifier])
402 ;;
403*)
404 AC_MSG_RESULT([no])
405 have_scanf_alloc_modifier=no
406 ;;
407esac
408
3aecf79d
KZ
409UL_CHECK_LIB(util, openpty)
410UL_CHECK_LIB(termcap, tgetnum)
411
412AC_CHECK_TYPES([union semun], [], [], [[
413#include <sys/sem.h>
414]])
415AC_CHECK_TYPES(loff_t)
416
417AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
418#include <wchar.h>
419#include <wctype.h>
420#include <stdio.h>
421]], [[
422 wchar_t wc;
423 wint_t w;
424 w = fgetwc(stdin);
425 if (w == WEOF) exit(1);
426 wc = w;
427 fputwc(wc,stdout);
428]])],
429[AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?)
430])
431
432AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
433#include <sched.h>
434]])
435
436AM_CONDITIONAL(HAVE_CPU_SET_T, [test "x$have_cpu_set_t" = xyes])
437
438AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
439#include <sched.h>
440]])
441
8d35bdc9
KZ
442# on Solaris, you can't mix and match standards, since we use c99
443# aparently at this stage, XOPEN_SOURCE will conflict. As workaround,
444# check for crypt.h and use that without XOPEN_SOURCE.
445AC_CHECK_HEADERS([crypt.h])
446AC_LINK_IFELSE([AC_LANG_PROGRAM([[
447#ifdef HAVE_CRYPT_H
448#include <crypt.h>
449#else
450#define _XOPEN_SOURCE
451#include <unistd.h>
452#endif
453]], [[
454char *c = crypt("abc","pw");
455]])],[],[
456 LIBS="$LIBS -lcrypt"
457 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
458 #ifdef HAVE_CRYPT_H
459 #include <crypt.h>
460 #else
461 #define _XOPEN_SOURCE
462 #include <unistd.h>
463 #endif
464 ]], [[
465 char *c = crypt("abc","pw");
466 ]])],[
467 AC_DEFINE(HAVE_LIBCRYPT, 1, [Do we need -lcrypt?])
468 have_libcrypt=yes
469 ],[
470 AC_MSG_ERROR([crypt() is not available])
471 ])
472])
473AM_CONDITIONAL(HAVE_LIBCRYPT, test "x$have_libcrypt" = xyes)
474
13f5473e 475
75ad4910
KZ
476AC_ARG_WITH([selinux],
477 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
478 [], with_selinux=no
479)
480
481if test "x$with_selinux" = xno; then
482 AM_CONDITIONAL(HAVE_SELINUX, false)
483else
484 UL_CHECK_LIB(selinux, getprevcon)
485 case "$with_selinux:$have_selinux" in
486 yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
487 esac
488fi
489
490if test "x$have_selinux" = xyes; then
491 SELINUX_LIBS="-lselinux -lsepol"
492 SELINUX_LIBS_STATIC="-lselinux -lsepol"
493 old_LDFLAGS="$LDFLAGS"
494 LDFLAGS="$LDFLAGS $SELINUX_LIBS"
495 # This function is missing in old libselinux 1.xx versions
496 AC_CHECK_FUNCS([security_get_initial_context])
497 LDFLAGS="$old_LDFLAGS"
498fi
499AC_SUBST([SELINUX_LIBS])
500AC_SUBST([SELINUX_LIBS_STATIC])
501
502AC_ARG_WITH([audit],
503 AS_HELP_STRING([--with-audit], [compile with audit support]),
504 [], with_audit=no
505)
506
507if test "x$with_audit" = xno; then
508 AM_CONDITIONAL(HAVE_AUDIT, false)
509else
510 UL_CHECK_LIB(audit, audit_log_user_message)
511 case "$with_audit:$have_audit" in
512 yes:no)
513 AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])
514 ;;
515 esac
516fi
517
518AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]),
519 [], with_udev=auto
520)
521
522if test "x$with_udev" = xno; then
523 AM_CONDITIONAL(HAVE_UDEV, false)
524else
525 UL_CHECK_LIB(udev, udev_new)
526 case "$with_udev:$have_udev" in
527 yes:no)
528 AC_MSG_ERROR([udev selected but libudev not found])
529 ;;
530 esac
531fi
532
533AC_ARG_WITH([ncurses],
534 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
f06b4328 535 (--without-ncurses disables all ncurses(w) support)]),
75ad4910
KZ
536 [], with_ncurses=auto
537)
538AM_CONDITIONAL(HAVE_NCURSES, false)
539
540if test "x$with_ncurses" != xno; then
541 have_ncurses=no
542 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
543 if test "x$with_ncurses" = xauto; then
544 UL_CHECK_LIB(ncursesw, initscr, ncurses)
545 if test "x$have_ncurses" = xyes; then
f06b4328
SK
546 AC_CHECK_HEADERS([ncursesw/ncurses.h])
547 NCURSES_LIBS="-lncursesw"
75ad4910
KZ
548 fi
549 fi
550 if test "x$have_ncurses" = xno; then
551 UL_CHECK_LIB(ncurses, initscr)
552 if test "x$have_ncurses" = xyes; then
f06b4328 553 NCURSES_LIBS="-lncurses"
75ad4910
KZ
554 fi
555 fi
556 ])
557 if test "x$have_ncurses" = xno; then
558 AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
559 fi
560fi
561AC_SUBST([NCURSES_LIBS])
562
563
564AC_ARG_WITH([slang],
565 AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
566 [], with_slang=no
567)
568
569have_tinfo=no
570AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
571AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
572
573use_slang=no
574if test "x$with_slang" = xyes; then
575 AC_CHECK_HEADERS([slang.h slang/slang.h])
576 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
f06b4328 577 [use_slang=yes], [], [
75ad4910
KZ
578#ifdef HAVE_SLANG_H
579#include <slang.h>
580#elif defined(HAVE_SLANG_SLANG_H)
581#include <slang/slang.h>
582#endif
583])
584 if test "x$use_slang" = xno; then
585 AC_MSG_ERROR([slang selected but slcurses.h not found])
586 fi
587fi
588AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
589
590
591AC_ARG_WITH([utempter],
592 AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
593 [], with_utempter=no
594)
595
596if test "x$with_utempter" = xyes; then
597 UL_CHECK_LIB(utempter, utempter_add_record)
598 if test "x$have_utempter" = xno; then
599 AC_MSG_ERROR([utempter selected but libutempter not found])
600 fi
601else
602 AM_CONDITIONAL(HAVE_UTEMPTER, false)
603fi
604
605
d17584b6
SK
606AC_ARG_ENABLE([most-builds],
607 AS_HELP_STRING([--enable-most-builds], [build everthing other than experimental code]),
608 [], enable_most_builds=no
609)
610if test "x$enable_most_builds" = xyes; then
611 enable_arch=yes
612 enable_ddate=yes
613 enable_elvtune=yes
614 enable_kill=yes
615 enable_last=yes
616 enable_line=yes
617 enable_mesg=yes
618 enable_raw=yes
619 enable_rename=yes
620 enable_reset=yes
621 enable_login_utils=yes
622 enable_write=yes
623fi
624
1dbbde66
KZ
625dnl
626dnl libuuid
627dnl
17afb032
KZ
628AC_ARG_ENABLE([libuuid],
629 AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
630 [], enable_libuuid=yes
631)
fa7be20e 632UL_BUILD_INIT([libuuid])
dc2b8d87
KZ
633AC_SUBST([LIBUUID_VERSION])
634AC_SUBST([LIBUUID_VERSION_INFO])
fa7be20e 635AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
9dc801d2 636
403e2d0c 637if test "x$enable_libuuid" = xyes; then
17afb032
KZ
638 AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
639else
640 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
641fi
48d7b13a 642
1dbbde66
KZ
643dnl
644dnl libblkid
645dnl
f910b559 646AC_ARG_ENABLE([libblkid],
1d12ed57 647 AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
f910b559 648 [], enable_libblkid=yes
40f07ff7 649)
61a074f7 650UL_BUILD_INIT([libblkid])
033cf439 651AC_SUBST([LIBBLKID_DATE])
dc2b8d87
KZ
652AC_SUBST([LIBBLKID_VERSION])
653AC_SUBST([LIBBLKID_VERSION_INFO])
f910b559
KZ
654AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
655AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
4f3b364b 656if test "x$build_libblkid" = xyes; then
d06d028a 657 AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
64754af9 658fi
4f3b364b 659AM_CONDITIONAL(BUILD_LIBBLKID, test "x$build_libblkid" = xyes)
f910b559 660
1dbbde66
KZ
661dnl
662dnl libmount
663dnl
f1cde479
KZ
664AC_ARG_ENABLE([libmount],
665 AS_HELP_STRING([--disable-libmount], [do not build libmount]),
a2b3d040 666 [], enable_libmount=check
f1cde479 667)
61a074f7 668UL_BUILD_INIT([libmount])
13f5473e
KZ
669UL_REQUIRES_LINUX([libmount])
670UL_REQUIRES_BUILD([libmount], [libblkid])
671UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
672AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$build_libmount" = xyes)
8e368761 673
f1cde479
KZ
674AC_SUBST([LIBMOUNT_VERSION])
675AC_SUBST([LIBMOUNT_VERSION_INFO])
f4ab4ae8 676AC_DEFINE_UNQUOTED(LIBMOUNT_VERSION, "$LIBMOUNT_VERSION", [libmount version string])
13f5473e 677
f1cde479 678
1dbbde66
KZ
679AC_ARG_ENABLE([mount],
680 AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
681 [], enable_mount=check
682)
61a074f7 683UL_BUILD_INIT([mount])
9ead6701
KZ
684UL_REQUIRES_LINUX([mount])
685UL_REQUIRES_BUILD([mount], [libblkid])
1dbbde66
KZ
686AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes)
687
688
bd6d0d03
KZ
689AC_ARG_ENABLE([losetup],
690 AS_HELP_STRING([--disable-losetup], [do not build losetup]),
691 [], enable_losetup=check
692)
693UL_BUILD_INIT([losetup])
694UL_REQUIRES_LINUX([losetup])
695AM_CONDITIONAL(BUILD_LOSETUP, test "x$build_losetup" = xyes)
696
697
9ead6701 698AC_ARG_ENABLE([libmount-mount],
ecdba5dd 699 AS_HELP_STRING([--enable-libmount-mount], [link old mount(8) with libmount]),
9ead6701
KZ
700 [], enable_libmount_mount=no
701)
61a074f7 702UL_BUILD_INIT([libmount_mount])
9ead6701
KZ
703UL_REQUIRES_BUILD([libmount_mount], [mount])
704UL_REQUIRES_BUILD([libmount_mount], [libmount])
705if test "x$build_libmount_mount" = xyes; then
706 AC_DEFINE(HAVE_LIBMOUNT_MOUNT, 1, [use libmount for mount(8)])
707fi
708AM_CONDITIONAL(BUILD_LIBMOUNT_MOUNT, test "x$build_libmount_mount" = xyes)
709
710
ecdba5dd
KZ
711AC_ARG_ENABLE([new-mount],
712 AS_HELP_STRING([--enable-new-mount], [build new pure libmount based mount(8) (EXPERIMENTAL)]),
713 [], enable_new_mount=no
714)
715UL_BUILD_INIT([new_mount])
716UL_REQUIRES_BUILD([new_mount], [libmount])
717if test "x$build_new_mount" = xyes; then
718 AM_CONDITIONAL(BUILD_MOUNT, [false])
719fi
720AM_CONDITIONAL(BUILD_NEW_MOUNT, test "x$build_new_mount" = xyes)
721
722
1dbbde66
KZ
723AC_ARG_ENABLE([fsck],
724 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
1d12ed57 725 [], enable_fsck=check
1dbbde66 726)
61a074f7 727UL_BUILD_INIT([fsck])
1d12ed57
KZ
728UL_REQUIRES_BUILD([fsck], [libblkid])
729AM_CONDITIONAL(BUILD_FSCK, test "x$build_fsck" = xyes)
1dbbde66
KZ
730
731
732AC_ARG_ENABLE([partx],
733 AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
734 [], enable_partx=check
735)
61a074f7 736UL_BUILD_INIT([partx])
ecde2536
KZ
737UL_REQUIRES_LINUX([partx])
738UL_REQUIRES_BUILD([partx], [libblkid])
1dbbde66
KZ
739AM_CONDITIONAL(BUILD_PARTX, test "x$build_partx" = xyes)
740
741
1dbbde66
KZ
742AC_ARG_ENABLE([uuidd],
743 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
bcdab497 744 [], enable_uuidd=check
1dbbde66 745)
61a074f7 746UL_BUILD_INIT([uuidd])
bcdab497
KZ
747UL_REQUIRES_BUILD([uuidd], [libuuid])
748if test "x$build_uuidd" = xyes; then
1dbbde66
KZ
749 AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.])
750fi
bcdab497 751AM_CONDITIONAL(BUILD_UUIDD, test "x$build_uuidd" = xyes)
1dbbde66
KZ
752
753
0164c245 754AC_ARG_ENABLE([mountpoint],
2023ccc4 755 AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
3d92ed40 756 [], enable_mountpoint=check
0164c245 757)
61a074f7 758UL_BUILD_INIT([mountpoint])
a9127bc1 759UL_REQUIRES_BUILD([mountpoint], [libmount])
3d92ed40 760AM_CONDITIONAL(BUILD_MOUNTPOINT, test "x$build_mountpoint" = xyes)
0164c245
KZ
761
762
10e56b49
KZ
763AC_ARG_ENABLE([fallocate],
764 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
765 [], enable_fallocate=check
766)
61a074f7 767UL_BUILD_INIT([fallocate])
10e56b49
KZ
768UL_REQUIRES_LINUX([fallocate])
769UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
770AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = xyes)
771
772if test "x$build_fallocate" = xyes; then
773 dnl check for valid fallocate() function
774 dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
775 dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
776 dnl and program can't be linked.
777 dnl AC_CHECK_FUNC can't catch such errors since it's redefining
778 dnl function prototype.
779 AC_MSG_CHECKING([for valid fallocate() function])
780 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
b832c2fe
YD
781#ifdef HAVE_UNISTD_H
782# include <unistd.h>
783#endif
784#ifdef HAVE_SYS_TYPES_H
785# include <sys/types.h>
786#endif
787#ifdef HAVE_LINUX_FALLOC_H
788# include <linux/falloc.h>
789#endif
790#ifdef HAVE_FCNTL_H
791# include <fcntl.h>
792#endif
793]],[[
794 long ret;
b832c2fe 795 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
b832c2fe
YD
796 if (ret != 0) {
797 return 1;
798 }
799 ]])],[
10e56b49
KZ
800 AC_MSG_RESULT([yes])
801 AC_DEFINE(HAVE_FALLOCATE,1,[Have valid fallocate() function])],[
802 AC_MSG_RESULT([no])])
803fi
804
19a224ad 805
a2ea6670
KZ
806AC_ARG_ENABLE([unshare],
807 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
808 [], enable_unshare=check
809)
61a074f7 810UL_BUILD_INIT([unshare])
a2ea6670
KZ
811UL_REQUIRES_LINUX([unshare])
812UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
813AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
814if test "x$build_unshare" = xyes; then
815 AC_CHECK_FUNCS([unshare])
816fi
b3425806
SK
817
818
6a97809b
KZ
819AC_ARG_ENABLE([arch],
820 AS_HELP_STRING([--enable-arch], [do build arch]),
821 [], enable_arch=no
822)
61a074f7 823UL_BUILD_INIT([arch])
3c6e292c
KZ
824UL_REQUIRES_LINUX([arch])
825AM_CONDITIONAL(BUILD_ARCH, test "x$build_arch" = xyes)
826
48d7b13a 827
4a8962f3
KZ
828AC_ARG_ENABLE([ddate],
829 AS_HELP_STRING([--enable-ddate], [do build ddate]),
564cea2b 830 [], enable_ddate=no
4a8962f3 831)
61a074f7 832UL_BUILD_INIT([ddate])
0fc74be1 833AM_CONDITIONAL(BUILD_DDATE, test "x$build_ddate" = xyes)
dda92fe0
KZ
834ruman1dir='${mandir}/ru/man1'
835AC_SUBST([ruman1dir])
0fc74be1 836
4a8962f3 837
48d7b13a 838AC_ARG_ENABLE([agetty],
7fa4f112 839 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
271d98e0 840 [], enable_agetty=yes
48d7b13a 841)
61a074f7 842UL_BUILD_INIT([agetty])
0fc74be1
KZ
843AM_CONDITIONAL(BUILD_AGETTY, test "x$build_agetty" = xyes)
844
48d7b13a 845
9cb68977 846AC_ARG_ENABLE([cramfs],
7fa4f112 847 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
271d98e0 848 [], enable_cramfs=check
9cb68977 849)
61a074f7 850UL_BUILD_INIT([cramfs])
d81b5a52
KZ
851AC_CHECK_LIB(z, crc32, [have_z=yes], [have_z=no])
852UL_REQUIRES_HAVE([cramfs], [z], [z library])
49ccbae6 853AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
9cb68977 854
a13cdb7a 855
e09ebf22
KZ
856if test "x$have_io" = xyes -o "x$linux_os" = xyes; then
857 build_hwclock=yes
858fi
859AM_CONDITIONAL(BUILD_HWCLOCK, test "x$build_hwclock" = xyes)
860
861
143635c9
KZ
862UL_BUILD_INIT([swapon], [check])
863UL_REQUIRES_LINUX([swapon])
864UL_REQUIRES_BUILD([swapon], [libblkid])
865AM_CONDITIONAL(BUILD_SWAPON, test "x$build_swapon" = xyes)
866
867
61a074f7 868UL_BUILD_INIT([lsblk], [check])
a13cdb7a
KZ
869UL_REQUIRES_LINUX([lsblk])
870UL_REQUIRES_BUILD([lsblk], [libblkid])
7f7126d7 871AM_CONDITIONAL(BUILD_LSBLK, test "x$build_lsblk" = xyes)
9cb68977 872
a3d3b770 873
61a074f7 874UL_BUILD_INIT([lscpu], [check])
da396d88
KZ
875UL_REQUIRES_LINUX([lscpu])
876UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
877AM_CONDITIONAL(BUILD_LSCPU, test "x$build_lscpu" = xyes)
878
a3d3b770 879
61a074f7 880UL_BUILD_INIT([chcpu], [check])
da396d88
KZ
881UL_REQUIRES_LINUX([chcpu])
882UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
883AM_CONDITIONAL(BUILD_CHCPU, test "x$build_chcpu" = xyes)
884
a13cdb7a 885
945ac250
KZ
886UL_BUILD_INIT([prlimit], [check])
887UL_REQUIRES_LINUX([prlimit])
888UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
889AM_CONDITIONAL(BUILD_PRLIMIT, test "x$build_prlimit" = xyes)
890if test "x$build_prlimit" = xyes; then
891 AC_CHECK_FUNCS([prlimit])
892fi
893
894
bd671347
KZ
895AC_ARG_ENABLE([switch_root],
896 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
940fd28c 897 [], enable_switch_root=check
bd671347 898)
61a074f7 899UL_BUILD_INIT([switch_root])
a3d3b770
KZ
900UL_REQUIRES_LINUX([switch_root])
901UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
940fd28c 902AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
bd671347
KZ
903
904
11125e7a
KZ
905AC_ARG_ENABLE([pivot_root],
906 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
907 [], enable_pivot_root=check
908)
61a074f7 909UL_BUILD_INIT([pivot_root])
9f632667
KZ
910UL_REQUIRES_LINUX([switch_root])
911UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
4a2ecf0a 912AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes)
11125e7a
KZ
913
914
48d7b13a 915AC_ARG_ENABLE([elvtune],
7fa4f112 916 AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
271d98e0 917 [], enable_elvtune=no
48d7b13a 918)
61a074f7 919UL_BUILD_INIT([elvtune])
b8d8c653
KZ
920UL_REQUIRES_LINUX([elvtune])
921AM_CONDITIONAL(BUILD_ELVTUNE, test "x$build_elvtune" = xyes)
922
48d7b13a 923
48d7b13a 924AC_ARG_ENABLE([kill],
4be753aa
KZ
925 AS_HELP_STRING([--disable-kill], [do not build kill]),
926 [], enable_kill=check
48d7b13a 927)
61a074f7 928UL_BUILD_INIT([kill])
4be753aa 929UL_REQUIRES_LINUX([kill])
49ccbae6 930AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
48d7b13a
KZ
931
932
933AC_ARG_ENABLE([last],
7fa4f112 934 AS_HELP_STRING([--enable-last], [build last]),
271d98e0 935 [], enable_last=no
48d7b13a 936)
61a074f7 937UL_BUILD_INIT([last])
2dc68529
KZ
938AM_CONDITIONAL(BUILD_LAST, test "x$build_last" = xyes)
939
48d7b13a 940
c135a8bd
SK
941AC_ARG_ENABLE([line],
942 AS_HELP_STRING([--enable-line], [build line]),
943 [], enable_line=no
944)
61a074f7 945UL_BUILD_INIT([line])
2dc68529
KZ
946AM_CONDITIONAL(BUILD_LINE, test "x$build_line" = xyes)
947
48d7b13a
KZ
948
949AC_ARG_ENABLE([mesg],
7fa4f112 950 AS_HELP_STRING([--enable-mesg], [build mesg]),
271d98e0 951 [], enable_mesg=no
48d7b13a 952)
61a074f7 953UL_BUILD_INIT([mesg])
2dc68529 954AM_CONDITIONAL(BUILD_MESG, test "x$build_mesg" = xyes)
48d7b13a
KZ
955
956
48d7b13a 957AC_ARG_ENABLE([raw],
7fa4f112 958 AS_HELP_STRING([--enable-raw], [build raw]),
16ba8d58 959 [], enable_raw=check
48d7b13a 960)
61a074f7 961UL_BUILD_INIT([raw])
16ba8d58
KZ
962UL_REQUIRES_LINUX([raw])
963UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
964AM_CONDITIONAL(BUILD_RAW, test "x$build_raw" = xyes)
48d7b13a
KZ
965
966
48d7b13a 967AC_ARG_ENABLE([rename],
7fa4f112 968 AS_HELP_STRING([--disable-rename], [do not build rename]),
271d98e0 969 [], enable_rename=yes
48d7b13a 970)
61a074f7 971UL_BUILD_INIT([rename])
d1171542 972AM_CONDITIONAL(BUILD_RENAME, test "x$build_rename" = xyes)
48d7b13a
KZ
973
974
975AC_ARG_ENABLE([reset],
7fa4f112 976 AS_HELP_STRING([--enable-reset], [build reset]),
271d98e0 977 [], enable_reset=no
48d7b13a 978)
61a074f7 979UL_BUILD_INIT([reset])
d1171542 980AM_CONDITIONAL(BUILD_RESET, test "x$build_reset" = xyes)
48d7b13a
KZ
981
982
983AC_ARG_ENABLE([login-utils],
7fa4f112 984 AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
271d98e0 985 [], enable_login_utils=no
48d7b13a 986)
61a074f7 987UL_BUILD_INIT([login_utils])
ff0cb84d
KZ
988UL_REQUIRES_HAVE([login_utils], [security_pam_misc_h], [PAM header file])
989AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$build_login_utils" = xyes)
9cb68977 990
c94b3604 991
f17f5f48 992
48d7b13a 993AC_ARG_ENABLE([schedutils],
7fa4f112 994 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
271d98e0 995 [], enable_schedutils=yes
48d7b13a 996)
61a074f7 997UL_BUILD_INIT([schedutils])
17d5e11b
KZ
998AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$build_schedutils" = xyes)
999
61a074f7 1000UL_BUILD_INIT([ionice], [check])
17d5e11b
KZ
1001UL_REQUIRES_BUILD([ionice], [schedutils])
1002UL_REQUIRES_SYSCALL_CHECK([ionice],
1003 [UL_CHECK_SYSCALL([ioprio_set],
f06b4328
SK
1004 [alpha], [442],
1005 [i*86], [289],
1006 [ia64*], [1274],
1007 [powerpc*], [273],
1008 [s390*], [282],
1009 [sparc*], [196],
1010 [sh*], [288],
1011 [x86_64*], [251])],
17d5e11b
KZ
1012 [ioprio_set])
1013
1014UL_REQUIRES_SYSCALL_CHECK([ionice],
1015 [UL_CHECK_SYSCALL([ioprio_get],
f06b4328
SK
1016 [alpha], [443],
1017 [i*86], [290],
1018 [ia64*], [1275],
1019 [powerpc*], [274],
1020 [s390*], [283],
1021 [sparc*], [218],
1022 [sh*], [289],
1023 [x86_64*], [252])],
17d5e11b
KZ
1024 [ioprio_get])
1025
1026AM_CONDITIONAL(BUILD_IONICE, test "x$build_ionice" = xyes)
1027
61a074f7 1028UL_BUILD_INIT([taskset], [check])
17d5e11b
KZ
1029UL_REQUIRES_BUILD([taskset], [schedutils])
1030UL_REQUIRES_SYSCALL_CHECK([taskset],
1031 [UL_CHECK_SYSCALL([sched_getaffinity])],
1032 [sched_getaffinity])
1033AM_CONDITIONAL(BUILD_TASKSET, test "x$build_taskset" = xyes)
48d7b13a
KZ
1034
1035
1036AC_ARG_ENABLE([wall],
7fa4f112 1037 AS_HELP_STRING([--disable-wall], [do not build wall]),
271d98e0 1038 [], enable_wall=yes
48d7b13a 1039)
8fc8888b 1040UL_BUILD_INIT([wall])
f0898116 1041AM_CONDITIONAL(BUILD_WALL, test "x$build_wall" = xyes)
48d7b13a
KZ
1042
1043
1044AC_ARG_ENABLE([write],
7fa4f112 1045 AS_HELP_STRING([--enable-write], [build write]),
271d98e0 1046 [], enable_write=no
48d7b13a 1047)
61a074f7 1048UL_BUILD_INIT([write])
f0898116 1049AM_CONDITIONAL(BUILD_WRITE, test "x$build_write" = xyes)
48d7b13a
KZ
1050
1051
1052AC_ARG_ENABLE([chsh-only-listed],
7fa4f112 1053 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
271d98e0 1054 [], enable_chsh_only_listed=yes
48d7b13a
KZ
1055)
1056
49ccbae6 1057if test "x$enable_chsh_only_listed" = xyes; then
48d7b13a
KZ
1058 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
1059fi
1060
1061
1062AC_ARG_ENABLE([login-chown-vcs],
7fa4f112 1063 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
271d98e0 1064 [], enable_login_chown_vcs=no
48d7b13a
KZ
1065)
1066
49ccbae6 1067if test "x$enable_login_chown_vcs" = xyes; then
48d7b13a
KZ
1068 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
1069fi
1070
1071
1072AC_ARG_ENABLE([login-stat-mail],
7fa4f112 1073 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
271d98e0 1074 [], enable_login_stat_mail=no
48d7b13a
KZ
1075)
1076
49ccbae6 1077if test "x$enable_login_stat_mail" = xyes; then
48d7b13a
KZ
1078 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
1079fi
1080
1081
1082AC_ARG_ENABLE([pg-bell],
7fa4f112 1083 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
271d98e0 1084 [], enable_pg_bell=yes
48d7b13a
KZ
1085)
1086
49ccbae6 1087if test "x$enable_pg_bell" = xyes; then
48d7b13a
KZ
1088 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
1089fi
1090
1091
1092AC_ARG_ENABLE([require-password],
7fa4f112 1093 AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
271d98e0 1094 [], enable_require_password=yes
48d7b13a
KZ
1095)
1096
49ccbae6 1097if test "x$enable_require_password" = xyes; then
48d7b13a
KZ
1098 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
1099fi
1100
1101
bb4cb69d
MF
1102AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
1103AC_ARG_ENABLE([fs-paths-default],
1104 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
1105 [case "$enableval" in
1106 yes) fs_paths_defaults="FS_PATHS_DEFAULT" ;;
1107 no) fs_paths_defaults="" ;;
1108 *) fs_paths_defaults="$enableval" ;;
1109 esac],
1110 [fs_paths_defaults="FS_PATHS_DEFAULT"]
1111)
1112AC_ARG_ENABLE([fs-paths-extra],
1113 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
1114 [case "$enableval" in
1115 yes|no) fs_paths_extra="" ;;
f06b4328 1116 *) fs_paths_extra="$enableval" ;;
bb4cb69d
MF
1117 esac],
1118 [fs_paths_extra=""]
1119)
1120fs_paths="$fs_paths_defaults"
1121if test "x$fs_paths_extra" != "x"; then
1122 if test "x$fs_paths" != "x"; then
1123 fs_paths="${fs_paths}:"
1124 fi
1125 fs_paths="${fs_paths}${fs_paths_extra}"
1126fi
1127AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
1128
1129
48d7b13a 1130AC_ARG_ENABLE([use-tty-group],
7fa4f112 1131 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
271d98e0 1132 [], enable_use_tty_group=yes
48d7b13a 1133)
49ccbae6 1134AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes)
48d7b13a 1135
49ccbae6 1136if test "x$enable_use_tty_group" = xyes; then
48d7b13a
KZ
1137 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
1138fi
1139
f3831bbd
KZ
1140AC_ARG_ENABLE([makeinstall-chown],
1141 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
1142 [], enable_makeinstall_chown=yes
1143)
49ccbae6 1144AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes)
f3831bbd 1145
4c24a7ae
KZ
1146AC_ARG_ENABLE([makeinstall-setuid],
1147 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
1148 [], enable_makeinstall_setuid=yes
1149)
1150AM_CONDITIONAL(MAKEINSTALL_DO_SETUID, test "x$enable_makeinstall_setuid" = xyes)
1151
06bcee19 1152
1f10890f
SK
1153AC_ARG_VAR([SUID_CFLAGS],
1154 [CFLAGS used for binaries which are usually with the suid bit])
1155AC_ARG_VAR([SUID_LDFLAGS],
1156 [LDFLAGS used for binaries which are usually with the suid bit])
06bcee19 1157
9cb68977 1158LIBS=""
48d7b13a 1159
48d7b13a
KZ
1160
1161AC_CONFIG_HEADERS(config.h)
1162
8eeb575c 1163AC_CONFIG_FILES([
f06b4328 1164Makefile
8eeb575c 1165disk-utils/Makefile
562218e6 1166fdisk/Makefile
607c2a72 1167fsck/Makefile
8eeb575c
KZ
1168getopt/Makefile
1169hwclock/Makefile
562218e6 1170include/Makefile
d00ed891 1171lib/Makefile
8fb4efae 1172libblkid/Makefile
f06b4328 1173libblkid/blkid.pc
8fb4efae
KZ
1174libblkid/docs/Makefile
1175libblkid/docs/version.xml
f06b4328 1176libblkid/samples/Makefile
8fb4efae
KZ
1177libblkid/src/Makefile
1178libblkid/src/blkid.h
f06b4328 1179libblkid/src/partitions/Makefile
8fb4efae
KZ
1180libblkid/src/superblocks/Makefile
1181libblkid/src/topology/Makefile
2aefc0a8 1182libmount/Makefile
2aefc0a8
KZ
1183libmount/docs/Makefile
1184libmount/docs/version.xml
f06b4328
SK
1185libmount/mount.pc
1186libmount/src/Makefile
1187libmount/src/libmount.h
83d20837
KZ
1188libuuid/Makefile
1189libuuid/man/Makefile
1190libuuid/src/Makefile
f06b4328
SK
1191libuuid/uuid.pc
1192login-utils/Makefile
1193man/ru/Makefile
1194misc-utils/Makefile
1195misc-utils/chkdupexe:misc-utils/chkdupexe.pl
1196mount/Makefile
1197partx/Makefile
1198po/Makefile.in
1199schedutils/Makefile
8eeb575c 1200sys-utils/Makefile
c0f20acb 1201term-utils/Makefile
f06b4328 1202tests/Makefile
e83446da 1203tests/commands.sh
20ad4963 1204tests/helpers/Makefile
20ad4963 1205text-utils/Makefile
8eeb575c 1206])
48d7b13a 1207
996fb358 1208
48d7b13a 1209AC_OUTPUT