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