]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
build-sys: add UL_CONFLICTS_BUILD m4 macro
[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])
333034f6 9AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects])
48d7b13a 10
eb35c251 11m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
f06b4328 12 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
eb35c251 13
d2feb47f 14AC_CONFIG_SRCDIR(sys-utils/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
434b07a0
KZ
723AC_ARG_ENABLE([deprecated-mount],
724 AS_HELP_STRING([--enable-deprecated-mount], [build old mount utilities]),
725 [], enable_deprecated_mount=no
1dbbde66 726)
434b07a0
KZ
727UL_BUILD_INIT([deprecated_mount])
728UL_REQUIRES_LINUX([deprecated_mount])
729UL_REQUIRES_BUILD([deprecated_mount], [libblkid])
730AM_CONDITIONAL(BUILD_DEPRECATED_MOUNT, test "x$build_deprecated_mount" = xyes)
1dbbde66
KZ
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
434b07a0
KZ
742AC_ARG_ENABLE([mount],
743 AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
744 [], enable_mount=check
ecdba5dd 745)
434b07a0
KZ
746UL_BUILD_INIT([mount])
747UL_REQUIRES_BUILD([mount], [libmount])
748if test "x$build_mount" = xyes; then
749 AM_CONDITIONAL(BUILD_DEPRECATED_MOUNT, [false])
ecdba5dd 750fi
434b07a0 751AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes)
ecdba5dd
KZ
752
753
1dbbde66
KZ
754AC_ARG_ENABLE([fsck],
755 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
1d12ed57 756 [], enable_fsck=check
1dbbde66 757)
61a074f7 758UL_BUILD_INIT([fsck])
a7b585ea 759UL_REQUIRES_BUILD([fsck], [libmount])
1d12ed57 760AM_CONDITIONAL(BUILD_FSCK, test "x$build_fsck" = xyes)
1dbbde66
KZ
761
762
763AC_ARG_ENABLE([partx],
764 AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
765 [], enable_partx=check
766)
61a074f7 767UL_BUILD_INIT([partx])
ecde2536
KZ
768UL_REQUIRES_LINUX([partx])
769UL_REQUIRES_BUILD([partx], [libblkid])
1dbbde66
KZ
770AM_CONDITIONAL(BUILD_PARTX, test "x$build_partx" = xyes)
771
772
1dbbde66
KZ
773AC_ARG_ENABLE([uuidd],
774 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
bcdab497 775 [], enable_uuidd=check
1dbbde66 776)
61a074f7 777UL_BUILD_INIT([uuidd])
bcdab497
KZ
778UL_REQUIRES_BUILD([uuidd], [libuuid])
779if test "x$build_uuidd" = xyes; then
1dbbde66
KZ
780 AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.])
781fi
bcdab497 782AM_CONDITIONAL(BUILD_UUIDD, test "x$build_uuidd" = xyes)
1dbbde66
KZ
783
784
0164c245 785AC_ARG_ENABLE([mountpoint],
2023ccc4 786 AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
3d92ed40 787 [], enable_mountpoint=check
0164c245 788)
61a074f7 789UL_BUILD_INIT([mountpoint])
a9127bc1 790UL_REQUIRES_BUILD([mountpoint], [libmount])
3d92ed40 791AM_CONDITIONAL(BUILD_MOUNTPOINT, test "x$build_mountpoint" = xyes)
0164c245
KZ
792
793
10e56b49
KZ
794AC_ARG_ENABLE([fallocate],
795 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
796 [], enable_fallocate=check
797)
61a074f7 798UL_BUILD_INIT([fallocate])
10e56b49
KZ
799UL_REQUIRES_LINUX([fallocate])
800UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
801AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = xyes)
802
803if test "x$build_fallocate" = xyes; then
804 dnl check for valid fallocate() function
805 dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
806 dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
807 dnl and program can't be linked.
808 dnl AC_CHECK_FUNC can't catch such errors since it's redefining
809 dnl function prototype.
810 AC_MSG_CHECKING([for valid fallocate() function])
811 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
b832c2fe
YD
812#ifdef HAVE_UNISTD_H
813# include <unistd.h>
814#endif
815#ifdef HAVE_SYS_TYPES_H
816# include <sys/types.h>
817#endif
818#ifdef HAVE_LINUX_FALLOC_H
819# include <linux/falloc.h>
820#endif
821#ifdef HAVE_FCNTL_H
822# include <fcntl.h>
823#endif
824]],[[
825 long ret;
b832c2fe 826 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
b832c2fe
YD
827 if (ret != 0) {
828 return 1;
829 }
830 ]])],[
10e56b49
KZ
831 AC_MSG_RESULT([yes])
832 AC_DEFINE(HAVE_FALLOCATE,1,[Have valid fallocate() function])],[
833 AC_MSG_RESULT([no])])
834fi
835
19a224ad 836
a2ea6670
KZ
837AC_ARG_ENABLE([unshare],
838 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
839 [], enable_unshare=check
840)
61a074f7 841UL_BUILD_INIT([unshare])
a2ea6670
KZ
842UL_REQUIRES_LINUX([unshare])
843UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
844AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
845if test "x$build_unshare" = xyes; then
846 AC_CHECK_FUNCS([unshare])
847fi
b3425806
SK
848
849
6a97809b
KZ
850AC_ARG_ENABLE([arch],
851 AS_HELP_STRING([--enable-arch], [do build arch]),
852 [], enable_arch=no
853)
61a074f7 854UL_BUILD_INIT([arch])
3c6e292c
KZ
855UL_REQUIRES_LINUX([arch])
856AM_CONDITIONAL(BUILD_ARCH, test "x$build_arch" = xyes)
857
48d7b13a 858
4a8962f3
KZ
859AC_ARG_ENABLE([ddate],
860 AS_HELP_STRING([--enable-ddate], [do build ddate]),
564cea2b 861 [], enable_ddate=no
4a8962f3 862)
61a074f7 863UL_BUILD_INIT([ddate])
0fc74be1 864AM_CONDITIONAL(BUILD_DDATE, test "x$build_ddate" = xyes)
dda92fe0
KZ
865ruman1dir='${mandir}/ru/man1'
866AC_SUBST([ruman1dir])
0fc74be1 867
4a8962f3 868
539feec1
ML
869AC_ARG_ENABLE([eject],
870 AS_HELP_STRING([--disable-eject], [do not build eject]),
57790046 871 [], enable_eject=check
539feec1
ML
872)
873UL_BUILD_INIT([eject])
874UL_REQUIRES_LINUX([eject])
88a3f049 875AM_CONDITIONAL(BUILD_EJECT, test "x$build_eject" = xyes)
539feec1
ML
876
877
48d7b13a 878AC_ARG_ENABLE([agetty],
7fa4f112 879 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
271d98e0 880 [], enable_agetty=yes
48d7b13a 881)
61a074f7 882UL_BUILD_INIT([agetty])
0fc74be1
KZ
883AM_CONDITIONAL(BUILD_AGETTY, test "x$build_agetty" = xyes)
884
48d7b13a 885
9cb68977 886AC_ARG_ENABLE([cramfs],
7fa4f112 887 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
271d98e0 888 [], enable_cramfs=check
9cb68977 889)
61a074f7 890UL_BUILD_INIT([cramfs])
d81b5a52
KZ
891AC_CHECK_LIB(z, crc32, [have_z=yes], [have_z=no])
892UL_REQUIRES_HAVE([cramfs], [z], [z library])
49ccbae6 893AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
9cb68977 894
a13cdb7a 895
e09ebf22
KZ
896if test "x$have_io" = xyes -o "x$linux_os" = xyes; then
897 build_hwclock=yes
898fi
899AM_CONDITIONAL(BUILD_HWCLOCK, test "x$build_hwclock" = xyes)
900
901
143635c9
KZ
902UL_BUILD_INIT([swapon], [check])
903UL_REQUIRES_LINUX([swapon])
904UL_REQUIRES_BUILD([swapon], [libblkid])
905AM_CONDITIONAL(BUILD_SWAPON, test "x$build_swapon" = xyes)
906
907
61a074f7 908UL_BUILD_INIT([lsblk], [check])
a13cdb7a
KZ
909UL_REQUIRES_LINUX([lsblk])
910UL_REQUIRES_BUILD([lsblk], [libblkid])
9554f7ab 911UL_REQUIRES_BUILD([lsblk], [libmount])
7f7126d7 912AM_CONDITIONAL(BUILD_LSBLK, test "x$build_lsblk" = xyes)
9cb68977 913
a3d3b770 914
61a074f7 915UL_BUILD_INIT([lscpu], [check])
da396d88
KZ
916UL_REQUIRES_LINUX([lscpu])
917UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
918AM_CONDITIONAL(BUILD_LSCPU, test "x$build_lscpu" = xyes)
919
a3d3b770 920
61a074f7 921UL_BUILD_INIT([chcpu], [check])
da396d88
KZ
922UL_REQUIRES_LINUX([chcpu])
923UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
924AM_CONDITIONAL(BUILD_CHCPU, test "x$build_chcpu" = xyes)
925
a13cdb7a 926
5b0289b9
KZ
927UL_BUILD_INIT([wdctl], [check])
928UL_REQUIRES_LINUX([wdctl])
929UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
930AM_CONDITIONAL(BUILD_WDCTL, test "x$build_wdctl" = xyes)
931
932
945ac250
KZ
933UL_BUILD_INIT([prlimit], [check])
934UL_REQUIRES_LINUX([prlimit])
935UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
936AM_CONDITIONAL(BUILD_PRLIMIT, test "x$build_prlimit" = xyes)
937if test "x$build_prlimit" = xyes; then
938 AC_CHECK_FUNCS([prlimit])
939fi
940
941
3dc02ef4
DB
942UL_BUILD_INIT([lslocks], [check])
943UL_REQUIRES_LINUX([lslocks])
944AM_CONDITIONAL(BUILD_LSLOCKS, test "x$build_lslocks" = xyes)
945
946
bd671347
KZ
947AC_ARG_ENABLE([switch_root],
948 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
940fd28c 949 [], enable_switch_root=check
bd671347 950)
61a074f7 951UL_BUILD_INIT([switch_root])
a3d3b770
KZ
952UL_REQUIRES_LINUX([switch_root])
953UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
940fd28c 954AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
bd671347
KZ
955
956
11125e7a
KZ
957AC_ARG_ENABLE([pivot_root],
958 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
959 [], enable_pivot_root=check
960)
61a074f7 961UL_BUILD_INIT([pivot_root])
9f632667
KZ
962UL_REQUIRES_LINUX([switch_root])
963UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
4a2ecf0a 964AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes)
11125e7a
KZ
965
966
48d7b13a 967AC_ARG_ENABLE([elvtune],
7fa4f112 968 AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
271d98e0 969 [], enable_elvtune=no
48d7b13a 970)
61a074f7 971UL_BUILD_INIT([elvtune])
b8d8c653
KZ
972UL_REQUIRES_LINUX([elvtune])
973AM_CONDITIONAL(BUILD_ELVTUNE, test "x$build_elvtune" = xyes)
974
48d7b13a 975
48d7b13a 976AC_ARG_ENABLE([kill],
4be753aa
KZ
977 AS_HELP_STRING([--disable-kill], [do not build kill]),
978 [], enable_kill=check
48d7b13a 979)
61a074f7 980UL_BUILD_INIT([kill])
4be753aa 981UL_REQUIRES_LINUX([kill])
626e8773 982AM_CONDITIONAL(BUILD_KILL, test "x$build_kill" = xyes)
48d7b13a
KZ
983
984
985AC_ARG_ENABLE([last],
7fa4f112 986 AS_HELP_STRING([--enable-last], [build last]),
271d98e0 987 [], enable_last=no
48d7b13a 988)
61a074f7 989UL_BUILD_INIT([last])
2dc68529
KZ
990AM_CONDITIONAL(BUILD_LAST, test "x$build_last" = xyes)
991
48d7b13a 992
c135a8bd
SK
993AC_ARG_ENABLE([line],
994 AS_HELP_STRING([--enable-line], [build line]),
995 [], enable_line=no
996)
61a074f7 997UL_BUILD_INIT([line])
2dc68529
KZ
998AM_CONDITIONAL(BUILD_LINE, test "x$build_line" = xyes)
999
48d7b13a
KZ
1000
1001AC_ARG_ENABLE([mesg],
7fa4f112 1002 AS_HELP_STRING([--enable-mesg], [build mesg]),
271d98e0 1003 [], enable_mesg=no
48d7b13a 1004)
61a074f7 1005UL_BUILD_INIT([mesg])
2dc68529 1006AM_CONDITIONAL(BUILD_MESG, test "x$build_mesg" = xyes)
48d7b13a
KZ
1007
1008
48d7b13a 1009AC_ARG_ENABLE([raw],
7fa4f112 1010 AS_HELP_STRING([--enable-raw], [build raw]),
16ba8d58 1011 [], enable_raw=check
48d7b13a 1012)
61a074f7 1013UL_BUILD_INIT([raw])
16ba8d58
KZ
1014UL_REQUIRES_LINUX([raw])
1015UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
1016AM_CONDITIONAL(BUILD_RAW, test "x$build_raw" = xyes)
48d7b13a
KZ
1017
1018
48d7b13a 1019AC_ARG_ENABLE([rename],
7fa4f112 1020 AS_HELP_STRING([--disable-rename], [do not build rename]),
271d98e0 1021 [], enable_rename=yes
48d7b13a 1022)
61a074f7 1023UL_BUILD_INIT([rename])
d1171542 1024AM_CONDITIONAL(BUILD_RENAME, test "x$build_rename" = xyes)
48d7b13a
KZ
1025
1026
1027AC_ARG_ENABLE([reset],
7fa4f112 1028 AS_HELP_STRING([--enable-reset], [build reset]),
271d98e0 1029 [], enable_reset=no
48d7b13a 1030)
61a074f7 1031UL_BUILD_INIT([reset])
d1171542 1032AM_CONDITIONAL(BUILD_RESET, test "x$build_reset" = xyes)
48d7b13a
KZ
1033
1034
cc76731e
KZ
1035AC_ARG_ENABLE([vipw],
1036 AS_HELP_STRING([--enable-vipw], [build vipw]),
1037 [], enable_vipw=no
48d7b13a 1038)
cc76731e
KZ
1039UL_BUILD_INIT([vipw])
1040AM_CONDITIONAL(BUILD_VIPW, test "x$build_vipw" = xyes)
9cb68977 1041
c94b3604 1042
aec9ecbd
KZ
1043AC_ARG_ENABLE([newgrp],
1044 AS_HELP_STRING([--enable-newgrp], [build newgrp]),
1045 [], enable_newgrp=no
1046)
1047UL_BUILD_INIT([newgrp])
1048AM_CONDITIONAL(BUILD_NEWGRP, test "x$build_newgrp" = xyes)
1049
1050
2c8a3e16
KZ
1051AC_ARG_ENABLE([chfn-chsh],
1052 AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
1053 [], enable_chfn_chsh=no
1054)
1055UL_BUILD_INIT([chfn_chsh])
1056UL_REQUIRES_HAVE([chfn_chsh], [security_pam_misc_h], [PAM header file])
1057AM_CONDITIONAL(BUILD_CHFN_CHSH, test "x$build_chfn_chsh" = xyes)
1058
71681ee5
KZ
1059AC_ARG_ENABLE([chsh-only-listed],
1060AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
1061[], enable_chsh_only_listed=yes
1062)
1063
1064if test "x$enable_chsh_only_listed" = xyes; then
1065AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
1066fi
1067
2c8a3e16 1068
e7614a07
KZ
1069AC_ARG_ENABLE([login],
1070 AS_HELP_STRING([--disable-login], [do not build login]),
1071 [], enable_login=yes
1072)
1073UL_BUILD_INIT([login])
1074UL_REQUIRES_HAVE([login], [security_pam_misc_h], [PAM header file])
1075AM_CONDITIONAL(BUILD_LOGIN, test "x$build_login" = xyes)
1076
71681ee5
KZ
1077AC_ARG_ENABLE([login-chown-vcs],
1078 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
1079 [], enable_login_chown_vcs=no
1080)
1081
1082if test "x$enable_login_chown_vcs" = xyes; then
1083 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
1084fi
1085
1086AC_ARG_ENABLE([login-stat-mail],
1087 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
1088 [], enable_login_stat_mail=no
1089)
1090
1091if test "x$enable_login_stat_mail" = xyes; then
1092 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
1093fi
1094
e7614a07
KZ
1095
1096AC_ARG_ENABLE([sulogin],
1097 AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
1098 [], enable_sulogin=yes
1099)
1100UL_BUILD_INIT([sulogin])
1101AM_CONDITIONAL(BUILD_SULOGIN, test "x$build_sulogin" = xyes)
1102
f17f5f48 1103
ff4c5555
KZ
1104AC_ARG_ENABLE([su],
1105 AS_HELP_STRING([--disable-su], [do not build su]),
1106 [], enable_su=yes
1107)
1108UL_BUILD_INIT([su])
1109UL_REQUIRES_HAVE([su], [security_pam_misc_h], [PAM header file])
1110AM_CONDITIONAL(BUILD_SU, test "x$build_su" = xyes)
1111
1112
48d7b13a 1113AC_ARG_ENABLE([schedutils],
7fa4f112 1114 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
271d98e0 1115 [], enable_schedutils=yes
48d7b13a 1116)
61a074f7 1117UL_BUILD_INIT([schedutils])
17d5e11b
KZ
1118AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$build_schedutils" = xyes)
1119
61a074f7 1120UL_BUILD_INIT([ionice], [check])
17d5e11b
KZ
1121UL_REQUIRES_BUILD([ionice], [schedutils])
1122UL_REQUIRES_SYSCALL_CHECK([ionice],
1123 [UL_CHECK_SYSCALL([ioprio_set],
f06b4328
SK
1124 [alpha], [442],
1125 [i*86], [289],
1126 [ia64*], [1274],
1127 [powerpc*], [273],
1128 [s390*], [282],
1129 [sparc*], [196],
1130 [sh*], [288],
1131 [x86_64*], [251])],
17d5e11b
KZ
1132 [ioprio_set])
1133
1134UL_REQUIRES_SYSCALL_CHECK([ionice],
1135 [UL_CHECK_SYSCALL([ioprio_get],
f06b4328
SK
1136 [alpha], [443],
1137 [i*86], [290],
1138 [ia64*], [1275],
1139 [powerpc*], [274],
1140 [s390*], [283],
1141 [sparc*], [218],
1142 [sh*], [289],
1143 [x86_64*], [252])],
17d5e11b
KZ
1144 [ioprio_get])
1145
1146AM_CONDITIONAL(BUILD_IONICE, test "x$build_ionice" = xyes)
1147
61a074f7 1148UL_BUILD_INIT([taskset], [check])
17d5e11b
KZ
1149UL_REQUIRES_BUILD([taskset], [schedutils])
1150UL_REQUIRES_SYSCALL_CHECK([taskset],
1151 [UL_CHECK_SYSCALL([sched_getaffinity])],
1152 [sched_getaffinity])
1153AM_CONDITIONAL(BUILD_TASKSET, test "x$build_taskset" = xyes)
48d7b13a
KZ
1154
1155
1156AC_ARG_ENABLE([wall],
7fa4f112 1157 AS_HELP_STRING([--disable-wall], [do not build wall]),
271d98e0 1158 [], enable_wall=yes
48d7b13a 1159)
8fc8888b 1160UL_BUILD_INIT([wall])
f0898116 1161AM_CONDITIONAL(BUILD_WALL, test "x$build_wall" = xyes)
48d7b13a
KZ
1162
1163
1164AC_ARG_ENABLE([write],
7fa4f112 1165 AS_HELP_STRING([--enable-write], [build write]),
271d98e0 1166 [], enable_write=no
48d7b13a 1167)
61a074f7 1168UL_BUILD_INIT([write])
f0898116 1169AM_CONDITIONAL(BUILD_WRITE, test "x$build_write" = xyes)
48d7b13a
KZ
1170
1171
4581bd9c
KZ
1172AC_ARG_ENABLE([chkdupexe],
1173 AS_HELP_STRING([--enable-chkdupexe], [build deprecated chkdupexe]),
1174 [], enable_chkdupexe=no
1175)
1176UL_BUILD_INIT([chkdupexe])
1177AM_CONDITIONAL(BUILD_CHKDUPEXE, test "x$build_chkdupexe" = xyes)
1178
1179if test "x$build_chkdupexe" = xyes; then
1180 AC_PATH_PROG(PERL, perl)
1181 AC_CONFIG_FILES([misc-utils/chkdupexe:misc-utils/chkdupexe.pl])
1182fi
1183
1184
bbe289c4
PU
1185AC_ARG_ENABLE([socket-activation],
1186 AS_HELP_STRING([--enable-socket-activation], [build uuidd with support for systemd socket activation]),
1187 [], enable_socket_activation=no
1188)
1189
1190AM_CONDITIONAL(USE_SOCKET_ACTIVATION, test "x$enable_socket_activation" = xyes)
1191
1192if test "x$enable_socket_activation" = xyes; then
1193 AC_DEFINE(USE_SOCKET_ACTIVATION, 1, [Should uuidd support socket activation?])
1194fi
1195
1b68c379
PU
1196AC_ARG_WITH([systemdsystemunitdir],
1197 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd service files]),
1198 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
1199
1200if test "x$with_systemdsystemunitdir" != "xno"; then
1201 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
1202fi
1203
1204AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
1205
bbe289c4 1206
48d7b13a 1207AC_ARG_ENABLE([pg-bell],
7fa4f112 1208 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
271d98e0 1209 [], enable_pg_bell=yes
48d7b13a
KZ
1210)
1211
49ccbae6 1212if test "x$enable_pg_bell" = xyes; then
48d7b13a
KZ
1213 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
1214fi
1215
1216
1217AC_ARG_ENABLE([require-password],
7fa4f112 1218 AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
271d98e0 1219 [], enable_require_password=yes
48d7b13a
KZ
1220)
1221
49ccbae6 1222if test "x$enable_require_password" = xyes; then
48d7b13a
KZ
1223 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
1224fi
1225
1226
bb4cb69d
MF
1227AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
1228AC_ARG_ENABLE([fs-paths-default],
1229 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
1230 [case "$enableval" in
1231 yes) fs_paths_defaults="FS_PATHS_DEFAULT" ;;
1232 no) fs_paths_defaults="" ;;
1233 *) fs_paths_defaults="$enableval" ;;
1234 esac],
1235 [fs_paths_defaults="FS_PATHS_DEFAULT"]
1236)
1237AC_ARG_ENABLE([fs-paths-extra],
1238 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
1239 [case "$enableval" in
1240 yes|no) fs_paths_extra="" ;;
f06b4328 1241 *) fs_paths_extra="$enableval" ;;
bb4cb69d
MF
1242 esac],
1243 [fs_paths_extra=""]
1244)
1245fs_paths="$fs_paths_defaults"
1246if test "x$fs_paths_extra" != "x"; then
1247 if test "x$fs_paths" != "x"; then
1248 fs_paths="${fs_paths}:"
1249 fi
1250 fs_paths="${fs_paths}${fs_paths_extra}"
1251fi
1252AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
1253
1254
48d7b13a 1255AC_ARG_ENABLE([use-tty-group],
7fa4f112 1256 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
271d98e0 1257 [], enable_use_tty_group=yes
48d7b13a 1258)
49ccbae6 1259AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes)
48d7b13a 1260
49ccbae6 1261if test "x$enable_use_tty_group" = xyes; then
48d7b13a
KZ
1262 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
1263fi
1264
f3831bbd
KZ
1265AC_ARG_ENABLE([makeinstall-chown],
1266 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
1267 [], enable_makeinstall_chown=yes
1268)
49ccbae6 1269AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes)
f3831bbd 1270
4c24a7ae
KZ
1271AC_ARG_ENABLE([makeinstall-setuid],
1272 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
1273 [], enable_makeinstall_setuid=yes
1274)
1275AM_CONDITIONAL(MAKEINSTALL_DO_SETUID, test "x$enable_makeinstall_setuid" = xyes)
1276
06bcee19 1277
1f10890f
SK
1278AC_ARG_VAR([SUID_CFLAGS],
1279 [CFLAGS used for binaries which are usually with the suid bit])
1280AC_ARG_VAR([SUID_LDFLAGS],
1281 [LDFLAGS used for binaries which are usually with the suid bit])
06bcee19 1282
9cb68977 1283LIBS=""
48d7b13a 1284
48d7b13a
KZ
1285
1286AC_CONFIG_HEADERS(config.h)
1287
8eeb575c 1288AC_CONFIG_FILES([
f06b4328 1289Makefile
8eeb575c 1290disk-utils/Makefile
562218e6 1291fdisk/Makefile
8eeb575c
KZ
1292getopt/Makefile
1293hwclock/Makefile
f06b4328 1294libblkid/blkid.pc
8fb4efae
KZ
1295libblkid/docs/Makefile
1296libblkid/docs/version.xml
8fb4efae 1297libblkid/src/blkid.h
2aefc0a8
KZ
1298libmount/docs/Makefile
1299libmount/docs/version.xml
f06b4328 1300libmount/mount.pc
f06b4328 1301libmount/src/libmount.h
f06b4328 1302libuuid/uuid.pc
f06b4328
SK
1303man/ru/Makefile
1304misc-utils/Makefile
1b68c379 1305misc-utils/uuidd.service
f06b4328
SK
1306partx/Makefile
1307po/Makefile.in
8eeb575c 1308sys-utils/Makefile
f06b4328 1309tests/Makefile
e83446da 1310tests/commands.sh
20ad4963 1311tests/helpers/Makefile
8eeb575c 1312])
48d7b13a 1313
996fb358 1314
48d7b13a 1315AC_OUTPUT