]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
build-sys: update package release number during development
[thirdparty/util-linux.git] / configure.ac
CommitLineData
034d378b 1AC_INIT([util-linux],
38c75b59 2 m4_esyscmd([tools/git-version-gen .tarball-version]),
5564a8c7
SK
3 [kzak@redhat.com],,
4 [http://www.kernel.org/pub/linux/utils/util-linux/])
baf39af1 5
b0e6b25e 6
034d378b 7AC_PREREQ([2.60])
48d7b13a 8
034d378b 9AC_CONFIG_AUX_DIR([config])
b12991dd 10AC_CONFIG_MACRO_DIR([m4])
eaf70198
SK
11dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
12dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
13AC_USE_SYSTEM_EXTENSIONS
333034f6 14AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects])
48d7b13a 15
eb35c251 16m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
f06b4328 17 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
eb35c251 18
034d378b 19AC_CONFIG_SRCDIR([sys-utils/mount.c])
15a9b48c
SK
20AC_PREFIX_DEFAULT([/usr])
21
33b0be6d
KZ
22dnl version details from <major>.<minor>[-<suffix>]
23PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
24PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
f06b4328 25 | awk -F- '{print $1}')
c42a6d4d 26PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
b5511797 27 sub("-.*","",$3); print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
a0948ffe 28
33b0be6d
KZ
29dnl libblkid version
30LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
5bd2b14d 31LIBBLKID_DATE="08-Nov-2016"
dc2b8d87
KZ
32LIBBLKID_LT_MAJOR=1
33LIBBLKID_LT_MINOR=1
34LIBBLKID_LT_MICRO=0
35LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR
a0948ffe 36
f6076f55
KZ
37dnl libuuid version
38LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
dc2b8d87
KZ
39LIBUUID_LT_MAJOR=1
40LIBUUID_LT_MINOR=3
41LIBUUID_LT_MICRO=0
42LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR
f6076f55 43
f1cde479
KZ
44dnl libmount version
45LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
46LIBMOUNT_LT_MAJOR=1
47LIBMOUNT_LT_MINOR=1
48LIBMOUNT_LT_MICRO=0
49LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR
50
1a4d989e
OO
51dnl libsmartcols version
52LIBSMARTCOLS_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
53LIBSMARTCOLS_LT_MAJOR=1
54LIBSMARTCOLS_LT_MINOR=1
55LIBSMARTCOLS_LT_MICRO=0
56LIBSMARTCOLS_VERSION_INFO=`expr $LIBSMARTCOLS_LT_MAJOR + $LIBSMARTCOLS_LT_MINOR`:$LIBSMARTCOLS_LT_MICRO:$LIBSMARTCOLS_LT_MINOR
57
0bb4c979
KZ
58dnl libfdisk version
59LIBFDISK_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
60LIBFDISK_LT_MAJOR=1
61LIBFDISK_LT_MINOR=1
62LIBFDISK_LT_MICRO=0
63LIBFDISK_VERSION_INFO=`expr $LIBFDISK_LT_MAJOR + $LIBFDISK_LT_MINOR`:$LIBFDISK_LT_MICRO:$LIBFDISK_LT_MINOR
64
15a9b48c 65# Check whether exec_prefix=/usr:
9f57e6e8
SK
66AS_CASE([$exec_prefix:$prefix],
67[NONE:NONE | NONE:/usr | /usr:*],
68 [AC_MSG_NOTICE([Default --exec-prefix detected.])
17794746
KZ
69 AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ])
70 AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])])
71 AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ])
9f57e6e8
SK
72 ]
73)
74
75AS_CASE([$prefix:$localstatedir],
3745d4a9 76 [NONE:'${prefix}/var' | /usr:'${prefix}/var'],
9f57e6e8
SK
77 [localstatedir=/run
78 AC_MSG_NOTICE([ --localstatedir defaults to /run])
79 ]
80)
11935cd3 81AC_SUBST([localstatedir])
07a16b9d 82
b0a0d7d5 83
996fb358 84# The original default values of {bin,sbin,lib}dir
aaf3e8f5 85usrbin_execdir='${exec_prefix}/bin'
30688dde 86AC_SUBST([usrbin_execdir])
996fb358 87
aaf3e8f5 88usrsbin_execdir='${exec_prefix}/sbin'
30688dde 89AC_SUBST([usrsbin_execdir])
996fb358 90
9f57e6e8 91AS_CASE([$libdir],
b2b61efc 92 ['${exec_prefix}/'* | '${prefix}/'* | /usr/* | "${prefix}"/* ],
9f57e6e8
SK
93 [usrlib_execdir=$libdir],
94 [usrlib_execdir='${exec_prefix}'$libdir]
95)
30688dde 96AC_SUBST([usrlib_execdir])
996fb358 97
bdf5f542 98
31c9c1c4 99AM_PROG_CC_C_O
18336d16 100AC_PROG_MKDIR_P
48d7b13a 101AC_PROG_CC_STDC
a6996860 102AC_CANONICAL_HOST
85b4c147 103AC_C_CONST
e79829db 104AC_C_VOLATILE
fbaec83b 105AC_C_BIGENDIAN
b12991dd 106
0e60bc9b 107dnl Compiler warnings
b1b54edf 108UL_WARN_ADD([-fno-common])
9dc72d0b 109UL_WARN_ADD([-Wall])
b1b54edf 110UL_WARN_ADD([-Werror=sequence-point])
0e60bc9b 111UL_WARN_ADD([-Wextra])
4230d576
KZ
112UL_WARN_ADD([-Wextra-semi])
113UL_WARN_ADD([-Wembedded-directive])
b1b54edf
KZ
114UL_WARN_ADD([-Wmissing-declarations])
115UL_WARN_ADD([-Wmissing-parameter-type])
116UL_WARN_ADD([-Wmissing-prototypes])
0e60bc9b 117UL_WARN_ADD([-Wno-missing-field-initializers])
b1b54edf 118UL_WARN_ADD([-Wredundant-decls])
0e60bc9b
KZ
119UL_WARN_ADD([-Wsign-compare])
120UL_WARN_ADD([-Wtype-limits])
121UL_WARN_ADD([-Wuninitialized])
b1b54edf
KZ
122UL_WARN_ADD([-Wunused-but-set-parameter])
123UL_WARN_ADD([-Wunused-but-set-variable])
0e60bc9b 124UL_WARN_ADD([-Wunused-parameter])
0e60bc9b 125UL_WARN_ADD([-Wunused-result])
bec5c9db 126UL_WARN_ADD([-Wunused-variable])
dcd33c3e
KZ
127UL_WARN_ADD([-Wnested-externs])
128UL_WARN_ADD([-Wpointer-arith])
129UL_WARN_ADD([-Wstrict-prototypes])
130UL_WARN_ADD([-Wformat-security])
d79654f4 131UL_WARN_ADD([-Wimplicit-function-declaration])
0e60bc9b
KZ
132AC_SUBST([WARN_CFLAGS])
133
034d378b 134UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS])
7697771d 135AC_SUBST([BSD_WARN_CFLAGS])
2013b33f
RM
136UL_WARN_ADD([-Wno-unused-parameter], [NO_UNUSED_WARN_CFLAGS])
137AC_SUBST([NO_UNUSED_WARN_CFLAGS])
7697771d 138
b12991dd
KZ
139dnl libtool-2
140LT_INIT
48d7b13a 141
3719bf8d
RM
142dnl check supported linker flags
143AX_CHECK_VSCRIPT
144
fd0f4132
SK
145m4_ifndef([PKG_PROG_PKG_CONFIG],
146 [m4_fatal([Could not locate the pkg-config autoconf
147 macros. These are usually located in /usr/share/aclocal/pkg.m4.
148 If your macros are in a different location, try setting the
149 environment variable AL_OPTS="-I/other/macro/dir" before running
150 ./autogen.sh or autoreconf again.])])
d06d028a
KZ
151PKG_PROG_PKG_CONFIG
152
22aa5166
KZ
153GTK_DOC_CHECK([1.10])
154AC_PATH_PROG([XSLTPROC], [xsltproc])
155
8026fa9b 156
8c182554 157linux_os=no
8026fa9b
KZ
158bsd_os=no
159AS_CASE([${host_os}],
160 [*linux*],
161 [linux_os=yes],
40733239
RM
162 [*darwin*],
163 [darwin_os=yes],
8026fa9b
KZ
164 [*bsd*],
165 [bsd_os=yes])
034d378b 166AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes])
40733239 167AM_CONDITIONAL([DARWIN], [test "x$darwin_os" = xyes])
8026fa9b
KZ
168AM_CONDITIONAL([BSD], [test "x$bsd_os" = xyes])
169
40733239
RM
170AS_IF([test "x$darwin_os" = xyes], [
171 AC_DEFINE([_DARWIN_C_SOURCE], [1], [Enable MAP_ANON in sys/mman.h on Mac OS X])
172])
8c182554 173
3c6e292c 174dnl define ARCH_<NAME> conditionals
034d378b
SK
175UL_SET_ARCH([I86], [i?86-*])
176UL_SET_ARCH([86_64], [x86_64*])
177UL_SET_ARCH([IA64], [ia64*])
178UL_SET_ARCH([S390], [s390*])
179UL_SET_ARCH([SPARC], [sparc*])
180UL_SET_ARCH([PPC], [ppc*|powerpc*])
181UL_SET_ARCH([M68K], [m68*])
182UL_SET_ARCH([MIPS], [mips*])
f319e301 183UL_SET_ARCH([HPPA], [hppa*|parisc*])
3c6e292c 184
48d7b13a 185AC_SYS_LARGEFILE
2c656779 186AC_HEADER_ASSERT
48d7b13a 187
f8d75a66 188dnl Don't forget to maintain alternatively allowed versions in autogen.sh!
91c520bc 189AM_GNU_GETTEXT_VERSION([0.18.3])
09734b00 190AM_GNU_GETTEXT([external])
3013eb9d
SK
191
192AS_IF([test -d "$srcdir/po"], [
193 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
194], [
195 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"
196])
09734b00 197
e460a5bf 198AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
48d7b13a
KZ
199#ifdef HAVE_LINUX_COMPILER_H
200#include <linux/compiler.h>
201#endif
202])
f06b4328
SK
203AC_CHECK_HEADERS([ \
204 asm/io.h \
205 err.h \
a0948ffe 206 errno.h \
f06b4328 207 fcntl.h \
a0948ffe 208 getopt.h \
f06b4328 209 inttypes.h \
5a971329 210 linux/btrfs.h \
f06b4328
SK
211 linux/cdrom.h \
212 linux/falloc.h \
5b0289b9 213 linux/watchdog.h \
a0948ffe 214 linux/fd.h \
f06b4328 215 linux/raw.h \
a0948ffe
KZ
216 linux/tiocl.h \
217 linux/version.h \
48469f90 218 linux/securebits.h \
8b7f16fc 219 locale.h \
607c2a72 220 mntent.h \
f06b4328 221 net/if.h \
754fed0c 222 net/if_dl.h \
f06b4328
SK
223 netinet/in.h \
224 paths.h \
225 pty.h \
fe2c9909 226 security/pam_appl.h \
f06b4328 227 stdint.h \
78288764 228 stdio_ext.h \
a0948ffe 229 stdlib.h \
1a1eb4e1
KZ
230 endian.h \
231 byteswap.h \
232 sys/endian.h \
a0948ffe
KZ
233 sys/disk.h \
234 sys/disklabel.h \
f06b4328 235 sys/file.h \
bf962c0a 236 sys/io.h \
f06b4328
SK
237 sys/ioccom.h \
238 sys/ioctl.h \
a0948ffe 239 sys/mkdev.h \
ac1c53e4 240 sys/mount.h \
4ebac79f 241 sys/param.h \
a0948ffe 242 sys/prctl.h \
f06b4328 243 sys/resource.h \
651b25cd 244 sys/signalfd.h \
2a7c1f70 245 sys/socket.h \
f06b4328 246 sys/sockio.h \
a0948ffe 247 sys/stat.h \
66daee07 248 sys/sysmacros.h \
f06b4328
SK
249 sys/swap.h \
250 sys/syscall.h \
251 sys/time.h \
87ee2658 252 sys/timex.h \
00c505d9 253 sys/ttydefaults.h \
a0948ffe 254 sys/types.h \
ac1c53e4 255 sys/ucred.h \
754fed0c 256 sys/un.h \
f06b4328 257 unistd.h \
d00c10ed
RM
258 shadow.h \
259 utmp.h \
f06b4328 260])
dc61d398 261
db4e2645
KZ
262AC_CHECK_HEADERS([linux/gsmmux.h ], [], [],
263 [#ifdef LINUX_GSMMUX_H
264 # include <linux/gsmmux.h>
265 #endif
266])
267
fe2c9909
WJ
268AC_CHECK_HEADERS([security/pam_misc.h],
269 [AM_CONDITIONAL([HAVE_LINUXPAM], [true])],
270 [AM_CONDITIONAL([HAVE_LINUXPAM], [false])], [
271#ifdef HAVE_SECURITY_PAM_APPL_H
272#include <security/pam_appl.h>
273#endif
274])
275
276AC_CHECK_HEADERS([security/openpam.h], [], [], [
277#ifdef HAVE_SECURITY_PAM_APPL_H
278#include <security/pam_appl.h>
279#endif
280])
281
a67387b7
KZ
282AC_CHECK_HEADERS([langinfo.h],
283 [AM_CONDITIONAL([HAVE_LANGINFO], [true])],
284 [AM_CONDITIONAL([HAVE_LANGINFO], [false])])
285
16ba8d58
KZ
286dnl Convert some ac_cv_header_* variables to have_*
287dnl
5a971329 288have_linux_btrfs_h=$ac_cv_header_linux_btrfs_h
16ba8d58 289have_linux_raw_h=$ac_cv_header_linux_raw_h
48469f90 290have_linux_securebits_h=$ac_cv_header_linux_securebits_h
5b0289b9 291have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
fe2c9909 292have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h
ff0cb84d 293have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
fe2c9909 294have_security_openpam_h=$ac_cv_header_security_openpam_h
d00c10ed 295have_shadow_h=$ac_cv_header_shadow_h
651b25cd 296have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h
d00c10ed 297have_utmp_h=$ac_cv_header_utmp_h
a67387b7
KZ
298
299AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
300#include <time.h>
301#include <unistd.h>
302]], [[
303 int a = 0;
304 struct tm *tm = localtime(0);
305 if (a == -1) /* false */
f06b4328 306 sleep(tm->tm_gmtoff);
a67387b7 307]])],
034d378b 308[AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?])
a67387b7
KZ
309])
310
311AC_CHECK_MEMBERS([struct termios.c_line],,,
312 [[#include <termios.h>]])
313
314AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
315 [#include <sys/stat.h>])
316
a67387b7
KZ
317AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
318[[
319#ifdef HAVE_SYS_SWAP_H
320# include <sys/swap.h>
321#endif
322#include <unistd.h>
323]],
324[[swapon("/dev/null", 0);]])],
034d378b 325[AC_DEFINE([SWAPON_HAS_TWO_ARGS], [1], [Is swapon() declared with two parameters?])
a67387b7
KZ
326],
327[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
328])
dc61d398
KZ
329
330
a88057d9
TP
331AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
332
2a7c1f70 333AC_CHECK_DECL([llseek],
034d378b 334 [AC_DEFINE([HAVE_LLSEEK_PROTOTYPE], [1],
2a7c1f70
KZ
335 [Define to 1 if have llseek prototype])],
336 [],
337 [#include <unistd.h>])
338
339AC_CHECK_DECL([lseek64],
034d378b 340 [AC_DEFINE([HAVE_LSEEK64_PROTOTYPE], [1],
2a7c1f70
KZ
341 [Define to 1 if have lseek64 prototype])],
342 [],
343 [#define _LARGEFILE_SOURCE
344 #define _LARGEFILE64_SOURCE
345 #include <unistd.h>])
346
0e9b73d3 347AC_CHECK_DECL([environ],
034d378b 348 [AC_DEFINE([HAVE_ENVIRON_DECL], [1],
0e9b73d3
SK
349 [Define to 1 if have **environ prototype])],
350)
351
352AC_CHECK_DECL([strsignal],
034d378b 353 [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1],
0e9b73d3
SK
354 [Define to 1 if have strsignal function prototype])],
355)
356
1eb16fd7
KZ
357AC_CHECK_DECL([TIOCGLCKTRMIOS],
358 [have_tiocglcktrmios=yes], [have_tiocglcktrmios=no],
359 [#include <sys/ioctl.h>])
360AC_CHECK_DECL([SOCK_CLOEXEC],
361 [have_sock_cloexec=yes], [have_sock_cloexec=no],
362 [#include <sys/types.h>
363 #include <sys/socket.h>])
364AC_CHECK_DECL([SOCK_NONBLOCK],
365 [have_sock_nonblock=yes], [have_sock_nonblock=no],
366 [#include <sys/types.h>
367 #include <sys/socket.h>])
368AC_CHECK_DECL([SO_PASSCRED],
369 [have_so_passcred=yes], [have_so_passcred=no],
370 [#include <sys/types.h>
371 #include <sys/socket.h>])
372
f06b4328 373AC_CHECK_FUNCS([ \
78288764 374 __fpending \
075f4bfd 375 secure_getenv \
f06b4328 376 __secure_getenv \
eb76ca98
FG
377 err \
378 errx \
bf962c0a 379 fsync \
473c5fb8 380 utimensat \
bf962c0a 381 getdomainname \
f06b4328
SK
382 getdtablesize \
383 getexecname \
384 getmntinfo \
385 getrlimit \
c829aebc 386 getsgnam \
f06b4328 387 inotify_init \
3ac22f7a 388 jrand48 \
bf962c0a 389 lchown \
a0948ffe
KZ
390 llseek \
391 lseek64 \
02887b73 392 mempcpy \
4d751c00 393 mkostemp \
f06b4328 394 nanosleep \
7d3a07d8 395 ntp_gettime \
f06b4328
SK
396 personality \
397 posix_fadvise \
398 prctl \
9c7955da 399 qsort_r \
f06b4328 400 rpmatch \
485a8bfa 401 scandirat \
30fbf2f6 402 setprogname \
69045d3d
KZ
403 setresgid \
404 setresuid \
15167589 405 sched_setattr \
ee20c303 406 sched_setscheduler \
f06b4328
SK
407 sigqueue \
408 srandom \
409 strnchr \
69b7e41e
KZ
410 strndup \
411 strnlen \
f06b4328 412 sysconf \
88e0f3df 413 sysinfo \
f06b4328
SK
414 updwtmp \
415 usleep \
eb76ca98
FG
416 warn \
417 warnx \
f06b4328 418])
48d7b13a 419AC_FUNC_FSEEKO
48d7b13a 420
940fd28c 421AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
465e9973 422AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
90d5285d
KZ
423AC_CHECK_FUNCS([futimens], [have_futimens=yes])
424AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes])
f9c4d138 425AC_CHECK_FUNCS([open_memstream], [have_open_memstream=yes],[have_open_memstream=no])
e52b58e6 426AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no])
465e9973 427
dc049516
RM
428AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes])
429
378543e1 430dnl lib/mononotic.c may require -lrt
254743e4
KZ
431AC_CHECK_FUNCS([clock_gettime], [],
432 [AC_CHECK_LIB([rt], [clock_gettime], [REALTIME_LIBS="-lrt"])]
433)
bd9b94d1 434
254743e4 435have_timer="no"
f07a82c9 436AC_CHECK_FUNCS([timer_create],
7944a03c 437 [have_timer="yes"],
254743e4
KZ
438 [AC_CHECK_LIB([rt], [timer_create], [
439 have_timer="yes"
440 REALTIME_LIBS="-lrt"
bf6be9f5
LT
441 ],[
442 AC_SEARCH_LIBS([timer_create], [rt], [
443 AC_MSG_RESULT(yes)
444 have_timer="yes"
445 REALTIME_LIBS="-lrt -lpthread"
446 ],[], [-lpthread]
447 )
448 ])]
254743e4 449)
8fc4a886 450
f07a82c9
KZ
451AC_SUBST([REALTIME_LIBS])
452
453
454AC_CHECK_LIB([rtas], [rtas_get_sysparm], [
455 RTAS_LIBS="-lrtas"
456 AC_DEFINE_UNQUOTED([HAVE_LIBRTAS], [1], [Define if librtas exists]), [],
457])
458AC_SUBST([RTAS_LIBS])
459
8fc4a886 460
034d378b
SK
461AC_CHECK_MEMBER([struct sockaddr.sa_len],
462 AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
754fed0c
KZ
463 [#include <sys/types.h>
464 #include <sys/socket.h>])
465
60cc9f94 466SOCKET_LIBS=
60cc9f94 467AC_SEARCH_LIBS([socket], [socket],
3013eb9d
SK
468 [AS_IF([test x"$ac_cv_search_socket" != x"none required"],
469 [SOCKET_LIBS="$SOCKET_LIBS -lsocket"])
470])
60cc9f94
FG
471AC_SUBST([SOCKET_LIBS])
472
d58c47d9
FG
473
474have_dirfd=no
475AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
3013eb9d 476AS_IF([test x"$have_dirfd" = xno], [
d58c47d9
FG
477 AC_CHECK_DECLS([dirfd],
478 [have_dirfd=yes], [have_dirfd=no],
479 [#include <sys/types.h>
480 #include <dirent.h>])
3013eb9d 481])
d58c47d9
FG
482
483have_ddfd=no
3013eb9d 484AS_IF([test x"$have_dirfd" = xno], [
d58c47d9
FG
485 AC_CHECK_MEMBERS([DIR.dd_fd],
486 [have_ddfd=yes], [have_ddfd=no],
487 [#include <sys/types.h>
488 #include <dirent.h>])
3013eb9d 489])
d58c47d9 490
9f57e6e8
SK
491AS_CASE([$have_dirfd:$have_ddfd],
492 [no:no],
493 [AC_MSG_ERROR([cannot find a method to get filedescriptor of directory])]
494)
d58c47d9
FG
495
496
d6abf168
SK
497AC_MSG_CHECKING([whether program_invocation_short_name is defined])
498AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
37edac9a 499 #include <errno.h>
d6abf168
SK
500]], [[
501 program_invocation_short_name = "test";
502]])], [
503 AC_MSG_RESULT([yes])
504 AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
505 [Define if program_invocation_short_name is defined])
506], [
507 AC_MSG_RESULT([no])
508])
509
a804f444
FG
510
511AC_MSG_CHECKING([whether __progname is defined])
512AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;],
cf582a2e 513 [if (*__progname == 0) return 1;])],
034d378b
SK
514 AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined])
515 AC_MSG_RESULT([yes]),
516 AC_MSG_RESULT([no]))
a804f444 517
8569410c 518dnl Static compilation
fddfd4e0 519m4_define([UL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid, nsenter, unshare])
8569410c
SK
520
521AC_ARG_ENABLE([static-programs],
522 [AS_HELP_STRING([--enable-static-programs=LIST],
523 [link static the programs in LIST (comma-separated,
132ea941 524 supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])])
8569410c 525
9f57e6e8
SK
526AS_CASE([$enable_static_programs],
527 [yes],
d924b10b 528 [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)],
9f57e6e8
SK
529 [no],
530 [enable_static_programs=]
531)
8569410c 532
8569410c 533dnl Set all the individual AM_CONDITIONALs
132ea941 534m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
9f57e6e8
SK
535 AS_CASE([,$enable_static_programs,],
536 [*,UL_PRG,*], [static_[]UL_PRG=yes]
537 )
d924b10b 538 AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])])
132ea941
KZ
539 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG),
540 [test "x$static_[]UL_PRG" = xyes])
8569410c
SK
541])
542
08b1c219
KZ
543
544AC_ARG_ENABLE([all-programs],
545 AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]),
546 [], [enable_all_programs=undefined]
547)
548
549AS_CASE([$enable_all_programs],
7477f356
KZ
550 [yes], [AC_MSG_WARN([force to build all programs by default])
551 ul_default_estate=check],
08b1c219 552 [no], [AC_MSG_WARN([disable all programs by default])
7477f356 553 ul_default_estate=no]
08b1c219
KZ
554)
555
556
d7a01582 557AX_CHECK_TLS
3ac22f7a 558
13f5473e
KZ
559AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
560# include <stdio.h>
3eeb5808 561# include <stdlib.h>
13f5473e
KZ
562int main()
563{
564 int i;
544d4069 565 int rc = 1;
13f5473e
KZ
566 char *s;
567 i = sscanf("x", $1, &s);
544d4069
RM
568 if (i == 1 && *s == 'x')
569 rc = 0;
4f310fae 570 free(s);
544d4069 571 return rc;
13f5473e
KZ
572}])
573
574AC_CACHE_VAL([scanf_cv_alloc_modifier],
575 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])],
576 [scanf_cv_alloc_modifier=ms],
577 AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%as"])])],
578 [scanf_cv_alloc_modifier=as],
579 [scanf_cv_alloc_modifier=no]
580 )
b420e279 581 ,
d0202f1c
SAS
582
583 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
584 #include <stdio.h>
695e4e1a 585 #include <unistd.h>
d0202f1c 586
bac7fbdb 587 #if defined(__GLIBC__) && !defined(__UCLIBC__)
d0202f1c
SAS
588
589 #if !(__GLIBC_PREREQ(2, 7))
590 #error %m is not available
591 #endif
592
695e4e1a 593 #elif defined(_POSIX_VERSION)
d0202f1c 594
695e4e1a
MF
595 #if _POSIX_VERSION < 200809L
596 #error %m is not available
597 #endif
598
599 #else
d0202f1c
SAS
600 #error Your C-library is not supported.
601 #endif
602 ])],
603 [scanf_cv_alloc_modifier=ms],
604 [scanf_cv_alloc_modifier=no])]
13f5473e
KZ
605 )
606)
607
608AC_MSG_CHECKING([scanf string alloc modifiers])
9f57e6e8
SK
609AS_CASE([$scanf_cv_alloc_modifier],
610 [ms],
611 [AC_MSG_RESULT([(%ms) yes])
612 AC_DEFINE([HAVE_SCANF_MS_MODIFIER], [1], [scanf %ms modifier])
613 have_scanf_alloc_modifier=yes],
614 [as],
615 [AC_MSG_RESULT([(%as) yes])
616 have_scanf_alloc_modifier=yes
617 AC_DEFINE([HAVE_SCANF_AS_MODIFIER], [1], [scanf %as modifier])],
618 [AC_MSG_RESULT([no])
619 have_scanf_alloc_modifier=no]
620)
13f5473e 621
17d71034
KZ
622
623AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]),
624 [], [with_util=auto]
625)
626AS_IF([test "x$with_util" = xno], [
627 AM_CONDITIONAL([HAVE_UTIL], [false])
628 have_util=no
629], [
630 UL_CHECK_LIB([util], [openpty])
631])
632
633
3aecf79d
KZ
634AC_CHECK_TYPES([union semun], [], [], [[
635#include <sys/sem.h>
636]])
034d378b 637AC_CHECK_TYPES([loff_t])
3aecf79d 638
4cb6fea5
KZ
639
640AC_ARG_ENABLE([widechar],
641 AS_HELP_STRING([--disable-widechar], [do not compile wide character support]),
642 [], [enable_widechar=check]
643)
644UL_BUILD_INIT([widechar])
645UL_REQUIRES_COMPILE([widechar], [[
646 #include <wchar.h>
647 #include <wctype.h>
648 #include <stdio.h>
649 ]], [[
650 wchar_t wc;
651 wint_t w;
652 w = fgetwc(stdin);
653 if (w == WEOF) exit(1);
654 wc = w;
655 fputwc(wc,stdout);
656 ]],
657 [wchar_t support])
658
659AS_IF([test "x$build_widechar" = xyes ], [
660 AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?])
3aecf79d
KZ
661])
662
4cb6fea5 663
3aecf79d
KZ
664AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
665#include <sched.h>
666]])
667
034d378b 668AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes])
3aecf79d 669
b09bc508
MF
670AC_CHECK_TYPES([sighandler_t], [], [], [[
671#include <signal.h>
672]])
673
3aecf79d
KZ
674AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
675#include <sched.h>
676]])
677
8d35bdc9
KZ
678# on Solaris, you can't mix and match standards, since we use c99
679# aparently at this stage, XOPEN_SOURCE will conflict. As workaround,
680# check for crypt.h and use that without XOPEN_SOURCE.
681AC_CHECK_HEADERS([crypt.h])
682AC_LINK_IFELSE([AC_LANG_PROGRAM([[
683#ifdef HAVE_CRYPT_H
684#include <crypt.h>
685#else
686#define _XOPEN_SOURCE
687#include <unistd.h>
688#endif
689]], [[
690char *c = crypt("abc","pw");
691]])],[],[
692 LIBS="$LIBS -lcrypt"
693 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
694 #ifdef HAVE_CRYPT_H
695 #include <crypt.h>
696 #else
697 #define _XOPEN_SOURCE
698 #include <unistd.h>
699 #endif
700 ]], [[
701 char *c = crypt("abc","pw");
702 ]])],[
034d378b 703 AC_DEFINE([HAVE_LIBCRYPT], [1], [Do we need -lcrypt?])
8d35bdc9
KZ
704 have_libcrypt=yes
705 ],[
706 AC_MSG_ERROR([crypt() is not available])
707 ])
708])
034d378b 709AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
8d35bdc9 710
13f5473e 711
75ad4910
KZ
712AC_ARG_WITH([selinux],
713 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
034d378b 714 [], [with_selinux=no]
75ad4910
KZ
715)
716
3013eb9d 717AS_IF([test "x$with_selinux" = xno], [
034d378b 718 AM_CONDITIONAL([HAVE_SELINUX], [false])
3013eb9d 719], [
7e34c79f 720 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0],
034d378b 721 [AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available])
7e34c79f 722 UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
034d378b 723 AM_CONDITIONAL([HAVE_SELINUX], [true])
7e34c79f
KZ
724 have_selinux=yes],
725 [have_selinux=no])
726
9f57e6e8
SK
727 AS_CASE([$with_selinux:$have_selinux],
728 [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])]
729 )
312f04f4 730
3013eb9d 731 AS_IF([test "x$have_selinux" = xyes], [
312f04f4
KZ
732 UL_SET_FLAGS([], [], [$SELINUX_LIBS])
733 # This function is missing in old libselinux 1.xx versions
734 AC_CHECK_FUNCS([security_get_initial_context])
735 UL_RESTORE_FLAGS
3013eb9d
SK
736 ])
737])
75ad4910
KZ
738AC_SUBST([SELINUX_LIBS])
739AC_SUBST([SELINUX_LIBS_STATIC])
740
0273afda 741
75ad4910
KZ
742AC_ARG_WITH([audit],
743 AS_HELP_STRING([--with-audit], [compile with audit support]),
034d378b 744 [], [with_audit=no]
75ad4910
KZ
745)
746
3013eb9d 747AS_IF([test "x$with_audit" = xno], [
034d378b 748 AM_CONDITIONAL([HAVE_AUDIT], [false])
3013eb9d 749], [
034d378b 750 UL_CHECK_LIB([audit], [audit_log_user_message])
9f57e6e8
SK
751 AS_CASE([$with_audit:$have_audit],
752 [yes:no],
753 [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])]
754 )
3013eb9d 755])
75ad4910
KZ
756
757AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]),
034d378b 758 [], [with_udev=auto]
75ad4910
KZ
759)
760
3013eb9d 761AS_IF([test "x$with_udev" = xno], [
034d378b 762 AM_CONDITIONAL([HAVE_UDEV], [false])
3013eb9d 763], [
034d378b 764 UL_CHECK_LIB([udev], [udev_new])
9f57e6e8
SK
765 AS_CASE([$with_udev:$have_udev],
766 [yes:no],
767 [AC_MSG_ERROR([udev selected but libudev not found])]
768 )
3013eb9d 769])
75ad4910 770
2b8f22bd 771
4ffcc7a9
KZ
772dnl wide-char ncurses
773AC_ARG_WITH([ncursesw],
774 AS_HELP_STRING([--with-ncursesw], [build with wide-char ncurses, enabled by default]),
775 [], [with_ncursesw=auto]
776)
777have_ncursesw=no
778AS_IF([test "x$with_ncursesw" != xno], [
e5cc93b5
KZ
779 UL_NCURSES_CHECK([ncursesw])
780 AS_IF([test "x$have_ncursesw" = xyes], [
4ffcc7a9 781 AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available])
f1512be8 782 CURSES_LIB_NAME="ncursesw"
4ffcc7a9 783 AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses.h])
e5cc93b5 784 ])
4ffcc7a9
KZ
785])
786AS_CASE([$with_ncursesw:$have_ncursesw],
787 [yes:no], [AC_MSG_ERROR([ncursesw selected, but library not found])])
2b8f22bd 788
43cc76e2 789
4ffcc7a9
KZ
790dnl non-wide ncurses
791AC_ARG_WITH([ncurses],
792 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, disabled by default]),
793 [], [with_ncurses=auto]
794)
795have_ncurses=no
18dae5d8
KZ
796
797AS_CASE([$with_ncurses:$build_widechar],
798 [yes:yes], [AC_MSG_ERROR([wide-char support enabled, but non-wide ncurses selects])])
799
4ffcc7a9 800AS_IF([test "x$have_ncursesw" = xno -a "x$with_ncurses" != xno ], [
e5cc93b5
KZ
801 UL_NCURSES_CHECK([ncurses])
802 AS_IF([test "x$have_ncurses" = xyes], [
4ffcc7a9
KZ
803 AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available])
804 CURSES_LIB_NAME="ncurses"
805 AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h])
e5cc93b5 806 ])
3013eb9d 807])
4ffcc7a9
KZ
808AS_CASE([$with_ncurses:$have_ncurses],
809 [yes:no], [AC_MSG_ERROR([ncurses selected, but library not found])])
810
2b8f22bd 811AC_SUBST([NCURSES_CFLAGS])
75ad4910 812AC_SUBST([NCURSES_LIBS])
4ffcc7a9 813AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncursesw" = xyes -o "x$have_ncurses" = xyes])
75ad4910
KZ
814
815
816AC_ARG_WITH([slang],
4ffcc7a9 817 AS_HELP_STRING([--with-slang], [compile cfdisk with slang rather than ncurses]),
034d378b 818 [], [with_slang=no]
75ad4910 819)
50ea6795 820have_slang=no
3013eb9d 821AS_IF([test "x$with_slang" = xyes], [
75ad4910
KZ
822 AC_CHECK_HEADERS([slang.h slang/slang.h])
823 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
50ea6795 824 [have_slang=yes], [], [
75ad4910
KZ
825#ifdef HAVE_SLANG_H
826#include <slang.h>
827#elif defined(HAVE_SLANG_SLANG_H)
828#include <slang/slang.h>
829#endif
830])
3013eb9d 831 AS_IF([test "x$have_slang" = xno], [
f1512be8
KZ
832 AC_MSG_ERROR([slang selected but slcurses.h not found])],
833 [CURSES_LIB_NAME=slang
3013eb9d
SK
834 ])
835])
034d378b 836AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes])
50ea6795 837
50ea6795 838
4ffcc7a9 839AS_IF([test "x$have_slang" = xyes -o "x$have_ncursesw" = xyes -o "x$have_ncurses" = xyes], [
f1512be8
KZ
840 AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [
841 AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1,
7556c944
KZ
842 [Define if curses library has the use_default_colors().])
843 ])
844 AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [
845 AC_DEFINE(HAVE_RESIZETERM, 1,
846 [Define if curses library has the resizeterm().])
f1512be8
KZ
847 ])
848])
849
50ea6795 850
17d71034
KZ
851AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]),
852 [], [with_tinfo=auto]
853)
854have_tinfo=no
855AS_IF([test "x$with_tinfo" != xno], [
856 dnl Try pkg-config for libtinfo
857 PKG_CHECK_MODULES(TINFO, [tinfo], [
858 dnl pkg-config success
859 have_tinfo=yes
860 UL_PKG_STATIC([TINFO_LIBS_STATIC], [tinfo])], [
861
862 dnl If pkg-config failed, fall back to classic searching.
863 AC_CHECK_LIB([tinfo], [tgetent], [
ccf92e6d
KZ
864 have_tinfo=yes
865 TINFO_LIBS="-ltinfo"
587652b4 866 TINFO_LIBS_STATIC="-ltinfo"
ccf92e6d 867 TINFO_CFLAGS=""])
17d71034 868 ])
2b8f22bd
MF
869])
870AC_SUBST([TINFO_LIBS])
0b28c2ec 871AC_SUBST([TINFO_LIBS_STATIC])
ccf92e6d 872AC_SUBST([TINFO_CFLAGS])
b88e6b02 873AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
254743e4 874AS_IF([test "x$have_tinfo" = xyes], [
17d71034 875 AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo available.])
4310faf9 876])
75ad4910
KZ
877
878
0b28c2ec
KZ
879AC_ARG_WITH([readline],
880 AS_HELP_STRING([--with-readline], [compile with GNU Readline support]),
881 [], [with_readline=auto]
882)
883
884AS_IF([test "x$with_readline" = xno], [
885 AM_CONDITIONAL([HAVE_READLINE], [false])
886], [
887 UL_CHECK_LIB([readline], [readline])
888 AS_CASE([$with_readline:$have_readline],
889 [yes:no],
890 [AC_MSG_ERROR([readline selected but libreadline not found ])],
891 [*:yes],
892 [READLINE_LIBS="-lreadline"
893 READLINE_LIBS_STATIC="-lreadline $TINFO_LIBS_STATIC"]
894 )
895])
896AC_SUBST([READLINE_LIBS])
897AC_SUBST([READLINE_LIBS_STATIC])
898
899
75ad4910
KZ
900AC_ARG_WITH([utempter],
901 AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
034d378b 902 [], [with_utempter=no]
75ad4910
KZ
903)
904
3013eb9d 905AS_IF([test "x$with_utempter" = xyes], [
034d378b 906 UL_CHECK_LIB([utempter], [utempter_add_record])
3013eb9d 907 AS_IF([test "x$have_utempter" = xno], [
75ad4910 908 AC_MSG_ERROR([utempter selected but libutempter not found])
3013eb9d
SK
909 ])
910], [
034d378b 911 AM_CONDITIONAL([HAVE_UTEMPTER], [false])
3013eb9d 912])
75ad4910
KZ
913
914
1dbbde66
KZ
915dnl
916dnl libuuid
917dnl
17afb032
KZ
918AC_ARG_ENABLE([libuuid],
919 AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
08b1c219 920 [], [UL_DEFAULT_ENABLE([libuuid], [yes])]
17afb032 921)
fa7be20e 922UL_BUILD_INIT([libuuid])
dc2b8d87
KZ
923AC_SUBST([LIBUUID_VERSION])
924AC_SUBST([LIBUUID_VERSION_INFO])
fa7be20e 925AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
9dc801d2 926
3e584e85
RM
927AC_ARG_ENABLE([libuuid-force-uuidd],
928 AS_HELP_STRING([--enable-libuuid-force-uuidd], [support uuidd even though the daemon is not built]),
929 [], [enable_libuuid_force_uuidd=no]
930)
931
13985252 932AS_IF([test "x$build_libuuid" = xyes], [
17afb032 933 AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
3013eb9d 934])
48d7b13a 935
1dbbde66
KZ
936dnl
937dnl libblkid
938dnl
f910b559 939AC_ARG_ENABLE([libblkid],
1d12ed57 940 AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
dc049516 941 [], [UL_DEFAULT_ENABLE([libblkid], [check])]
40f07ff7 942)
61a074f7 943UL_BUILD_INIT([libblkid])
dc049516 944UL_REQUIRES_HAVE([libblkid], [openat], [openat functions])
033cf439 945AC_SUBST([LIBBLKID_DATE])
dc2b8d87
KZ
946AC_SUBST([LIBBLKID_VERSION])
947AC_SUBST([LIBBLKID_VERSION_INFO])
034d378b
SK
948AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string])
949AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string])
3013eb9d 950AS_IF([test "x$build_libblkid" = xyes], [
034d378b 951 AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.])
3013eb9d 952])
034d378b
SK
953AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes])
954AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes -a "x$enable_static" = xyes])
f910b559 955
1dbbde66
KZ
956dnl
957dnl libmount
958dnl
f1cde479
KZ
959AC_ARG_ENABLE([libmount],
960 AS_HELP_STRING([--disable-libmount], [do not build libmount]),
08b1c219 961 [], [UL_DEFAULT_ENABLE([libmount], [check])]
f1cde479 962)
61a074f7 963UL_BUILD_INIT([libmount])
13f5473e
KZ
964UL_REQUIRES_BUILD([libmount], [libblkid])
965UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
034d378b
SK
966AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
967AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
30c34afb
KZ
968AS_IF([test "x$build_libmount" = xyes], [
969 AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount available.])
970])
8e368761 971
f1cde479 972AC_SUBST([LIBMOUNT_VERSION])
10e1d2e5
SH
973AC_SUBST([LIBMOUNT_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR)
974AC_SUBST([LIBMOUNT_MINOR_VERSION], $PACKAGE_VERSION_MINOR)
975AC_SUBST([LIBMOUNT_PATCH_VERSION], $PACKAGE_VERSION_RELEASE)
f1cde479 976AC_SUBST([LIBMOUNT_VERSION_INFO])
034d378b 977AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])
13f5473e 978
e778642a
KZ
979AC_ARG_ENABLE([libmount-support-mtab],
980 AS_HELP_STRING([--enable-libmount-support-mtab], [support /etc/mtab (default is use /proc/self/mountinfo)]),
981 [], [enable_libmount_support_mtab=no]
e3f72275
KZ
982)
983
e778642a
KZ
984AS_IF([test "x$enable_libmount_support_mtab" == xyes], [
985 AC_DEFINE([USE_LIBMOUNT_SUPPORT_MTAB], [1], [Define to 1 if want to support mtab.])
e3f72275
KZ
986])
987
f1cde479 988
1a4d989e
OO
989dnl
990dnl libsmartcols
991dnl
992AC_ARG_ENABLE([libsmartcols],
993 AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]),
08b1c219 994 [], [UL_DEFAULT_ENABLE([libsmartcols], [yes])]
1a4d989e
OO
995)
996UL_BUILD_INIT([libsmartcols])
1a4d989e 997AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes])
1a4d989e
OO
998
999AC_SUBST([LIBSMARTCOLS_VERSION])
1000AC_SUBST([LIBSMARTCOLS_VERSION_INFO])
1001AC_DEFINE_UNQUOTED([LIBSMARTCOLS_VERSION], ["$LIBSMARTCOLS_VERSION"], [libsmartcols version string])
1002
1003
eb6a03f3 1004dnl
0bb4c979 1005dnl libfdisk
eb6a03f3 1006dnl
0bb4c979
KZ
1007AC_ARG_ENABLE([libfdisk],
1008 AS_HELP_STRING([--disable-libfdisk], [do not build libfdisk]),
1009 [], [UL_DEFAULT_ENABLE([libfdisk], [check])]
1010)
1011UL_BUILD_INIT([libfdisk])
eb6a03f3 1012UL_REQUIRES_BUILD([libfdisk], [libuuid])
034d378b 1013AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes])
0bb4c979
KZ
1014AM_CONDITIONAL([BUILD_LIBFDISK_TESTS], [test "x$build_libfdisk" = xyes -a "x$enable_static" = xyes])
1015
ed79557e
KZ
1016AS_IF([test "x$build_libblkid" = xyes],
1017 [LIBFDISK_PC_REQUIRES="uuid blkid"],[LIBFDISK_PC_REQUIRES="uuid"])
1018AC_SUBST([LIBFDISK_PC_REQUIRES])
1019
0bb4c979 1020AC_SUBST([LIBFDISK_VERSION])
791da22d
KZ
1021AC_SUBST([LIBFDISK_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR)
1022AC_SUBST([LIBFDISK_MINOR_VERSION], $PACKAGE_VERSION_MINOR)
1023AC_SUBST([LIBFDISK_PATCH_VERSION], $PACKAGE_VERSION_RELEASE)
0bb4c979
KZ
1024AC_SUBST([LIBFDISK_VERSION_INFO])
1025AC_DEFINE_UNQUOTED([LIBFDISK_VERSION], ["$LIBFDISK_VERSION"], [libfdisk version string])
1026
eb6a03f3
KZ
1027
1028UL_BUILD_INIT([fdisk], [check])
dc049516 1029UL_REQUIRES_HAVE([fdisk], [openat], [openat functions])
eb6a03f3 1030UL_REQUIRES_BUILD([fdisk], [libfdisk])
d44115f3 1031UL_REQUIRES_BUILD([fdisk], [libsmartcols])
034d378b 1032AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes])
eb6a03f3
KZ
1033
1034
62b2c024 1035UL_BUILD_INIT([sfdisk], [check])
dc049516 1036UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions])
9c1f9dd3
KZ
1037UL_REQUIRES_BUILD([sfdisk], [libfdisk])
1038UL_REQUIRES_BUILD([sfdisk], [libsmartcols])
ecc6047e
KZ
1039AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
1040
1041
08b1c219
KZ
1042UL_BUILD_INIT([cfdisk], [check])
1043UL_REQUIRES_BUILD([cfdisk], [libfdisk])
1044UL_REQUIRES_BUILD([cfdisk], [libsmartcols])
9dd55a04 1045UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function])
4ffcc7a9 1046UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library])
08b1c219
KZ
1047AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes])
1048
1049
434b07a0
KZ
1050AC_ARG_ENABLE([mount],
1051 AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
08b1c219 1052 [], [UL_DEFAULT_ENABLE([mount], [check])]
ecdba5dd 1053)
434b07a0 1054UL_BUILD_INIT([mount])
53e8c16e 1055UL_REQUIRES_LINUX([mount])
434b07a0 1056UL_REQUIRES_BUILD([mount], [libmount])
034d378b 1057AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
ecdba5dd
KZ
1058
1059
bafe1a75
KZ
1060AC_ARG_ENABLE([losetup],
1061 AS_HELP_STRING([--disable-losetup], [do not build losetup]),
08b1c219 1062 [], [UL_DEFAULT_ENABLE([losetup], [check])]
bafe1a75
KZ
1063)
1064UL_BUILD_INIT([losetup])
1065UL_REQUIRES_LINUX([losetup])
7477f356 1066UL_REQUIRES_BUILD([losetup], [libsmartcols])
034d378b 1067AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes])
bafe1a75 1068
0624d840
KZ
1069AC_ARG_ENABLE([zramctl],
1070 AS_HELP_STRING([--disable-zramctl], [do not build zramctl]),
1071 [], [UL_DEFAULT_ENABLE([zramctl], [check])]
1072)
1073UL_BUILD_INIT([zramctl])
1074UL_REQUIRES_LINUX([zramctl])
1075UL_REQUIRES_BUILD([zramctl], [libsmartcols])
1076AM_CONDITIONAL([BUILD_ZRAMCTL], [test "x$build_zramctl" = xyes])
bafe1a75 1077
1dbbde66
KZ
1078AC_ARG_ENABLE([fsck],
1079 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
08b1c219 1080 [], [UL_DEFAULT_ENABLE([fsck], [check])]
1dbbde66 1081)
61a074f7 1082UL_BUILD_INIT([fsck])
a7b585ea 1083UL_REQUIRES_BUILD([fsck], [libmount])
034d378b 1084AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes])
1dbbde66
KZ
1085
1086
1087AC_ARG_ENABLE([partx],
1088 AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
08b1c219 1089 [], [UL_DEFAULT_ENABLE([partx], [check])]
1dbbde66 1090)
61a074f7 1091UL_BUILD_INIT([partx])
ecde2536
KZ
1092UL_REQUIRES_LINUX([partx])
1093UL_REQUIRES_BUILD([partx], [libblkid])
08b1c219 1094UL_REQUIRES_BUILD([partx], [libsmartcols])
034d378b 1095AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes])
1dbbde66
KZ
1096
1097
1dbbde66
KZ
1098AC_ARG_ENABLE([uuidd],
1099 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
08b1c219 1100 [], [UL_DEFAULT_ENABLE([uuidd], [check])]
1dbbde66 1101)
61a074f7 1102UL_BUILD_INIT([uuidd])
bcdab497 1103UL_REQUIRES_BUILD([uuidd], [libuuid])
651b25cd
RM
1104UL_REQUIRES_HAVE([uuidd], [timer], [timer_create function])
1105UL_REQUIRES_HAVE([uuidd], [sys_signalfd_h], [sys/signalfd.h header])
3e584e85 1106AS_IF([test "x$build_uuidd" = xyes || test "x$enable_libuuid_force_uuidd" == xyes ], [
034d378b 1107 AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.])
3013eb9d 1108])
034d378b 1109AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes])
1dbbde66
KZ
1110
1111
1b15cbd1
KZ
1112UL_BUILD_INIT([uuidgen], [check])
1113UL_REQUIRES_BUILD([uuidgen], [libuuid])
1114AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes])
1115
15a2c741
KZ
1116UL_BUILD_INIT([blkid], [check])
1117UL_REQUIRES_BUILD([blkid], [libblkid])
1118AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes])
1119
1120UL_BUILD_INIT([findfs], [check])
1121UL_REQUIRES_BUILD([findfs], [libblkid])
1122AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes])
1123
1124UL_BUILD_INIT([wipefs], [check])
1125UL_REQUIRES_BUILD([wipefs], [libblkid])
1126AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes])
1127
1128UL_BUILD_INIT([findmnt], [check])
1129UL_REQUIRES_BUILD([findmnt], [libmount])
169b4a8c 1130UL_REQUIRES_BUILD([findmnt], [libblkid])
15a2c741
KZ
1131UL_REQUIRES_BUILD([findmnt], [libsmartcols])
1132AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes])
1133
1b15cbd1 1134
0164c245 1135AC_ARG_ENABLE([mountpoint],
2023ccc4 1136 AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
08b1c219 1137 [], [UL_DEFAULT_ENABLE([mountpoint], [check])]
0164c245 1138)
61a074f7 1139UL_BUILD_INIT([mountpoint])
a9127bc1 1140UL_REQUIRES_BUILD([mountpoint], [libmount])
034d378b 1141AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes])
0164c245
KZ
1142
1143
10e56b49
KZ
1144AC_ARG_ENABLE([fallocate],
1145 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
08b1c219 1146 [], [UL_DEFAULT_ENABLE([fallocate], [check])]
10e56b49 1147)
61a074f7 1148UL_BUILD_INIT([fallocate])
10e56b49
KZ
1149UL_REQUIRES_LINUX([fallocate])
1150UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])])
034d378b 1151AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes])
10e56b49 1152
3013eb9d 1153AS_IF([test "x$build_fallocate" = xyes], [
10e56b49
KZ
1154 dnl check for valid fallocate() function
1155 dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
1156 dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
1157 dnl and program can't be linked.
1158 dnl AC_CHECK_FUNC can't catch such errors since it's redefining
1159 dnl function prototype.
1160 AC_MSG_CHECKING([for valid fallocate() function])
1161 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
b832c2fe
YD
1162#ifdef HAVE_UNISTD_H
1163# include <unistd.h>
1164#endif
1165#ifdef HAVE_SYS_TYPES_H
1166# include <sys/types.h>
1167#endif
1168#ifdef HAVE_LINUX_FALLOC_H
1169# include <linux/falloc.h>
1170#endif
1171#ifdef HAVE_FCNTL_H
1172# include <fcntl.h>
1173#endif
1174]],[[
1175 long ret;
b832c2fe 1176 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
b832c2fe
YD
1177 if (ret != 0) {
1178 return 1;
1179 }
1180 ]])],[
10e56b49 1181 AC_MSG_RESULT([yes])
034d378b 1182 AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[
10e56b49 1183 AC_MSG_RESULT([no])])
3013eb9d 1184])
10e56b49 1185
19a224ad 1186
a2ea6670
KZ
1187AC_ARG_ENABLE([unshare],
1188 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
08b1c219 1189 [], [UL_DEFAULT_ENABLE([unshare], [check])]
a2ea6670 1190)
61a074f7 1191UL_BUILD_INIT([unshare])
a2ea6670
KZ
1192UL_REQUIRES_LINUX([unshare])
1193UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
034d378b 1194AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes])
bdd384d1 1195AC_CHECK_FUNCS([unshare])
b3425806 1196
f8aa8e94
EB
1197AC_ARG_ENABLE([nsenter],
1198 AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
08b1c219 1199 [], [UL_DEFAULT_ENABLE([nsenter], [check])]
f8aa8e94
EB
1200)
1201UL_BUILD_INIT([nsenter])
1202UL_REQUIRES_LINUX([nsenter])
6cd4beac 1203UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL_CHECK_SYSCALL([setns])], [setns])
034d378b 1204AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
bdd384d1 1205AC_CHECK_FUNCS([setns])
b3425806 1206
17d71034
KZ
1207
1208AC_ARG_WITH([cap_ng],
801afcb0 1209 AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]),
17d71034
KZ
1210 [], [with_cap_ng=auto]
1211)
801afcb0
MF
1212AS_IF([test "x$with_cap_ng" = xno], [
1213 AM_CONDITIONAL([HAVE_CAP_NG], [false])
1214 have_cap_ng=no
1215],[
17d71034
KZ
1216 UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
1217])
1218
1219
5600c405
AL
1220AC_ARG_ENABLE([setpriv],
1221 AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
08b1c219 1222 [], [UL_DEFAULT_ENABLE([setpriv], [check])]
5600c405
AL
1223)
1224UL_BUILD_INIT([setpriv])
1225UL_REQUIRES_LINUX([setpriv])
48469f90 1226UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [securebits.h header file])
e1b8ba20 1227UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
034d378b 1228AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
5600c405
AL
1229
1230
539feec1
ML
1231AC_ARG_ENABLE([eject],
1232 AS_HELP_STRING([--disable-eject], [do not build eject]),
08b1c219 1233 [], [UL_DEFAULT_ENABLE([eject], [check])]
539feec1
ML
1234)
1235UL_BUILD_INIT([eject])
1236UL_REQUIRES_LINUX([eject])
7770e7df 1237UL_REQUIRES_BUILD([eject], [libmount])
034d378b 1238AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes])
539feec1
ML
1239
1240
48d7b13a 1241AC_ARG_ENABLE([agetty],
7fa4f112 1242 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
d00c10ed 1243 [], [UL_DEFAULT_ENABLE([agetty], [check])]
48d7b13a 1244)
61a074f7 1245UL_BUILD_INIT([agetty])
d00c10ed 1246UL_REQUIRES_HAVE([agetty], [utmp_h], [utmp.h header])
034d378b 1247AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
90d5285d
KZ
1248AS_IF([test "x$have_futimens" = xyes -a "x$have_inotify_init1" = xyes ], [
1249 AC_DEFINE([AGETTY_RELOAD], [1], [Enable agetty --reload feature])
1250],[
1251 AC_MSG_WARN([futimens or inotify_init1 not found; agetty(8) will not provide ---reload functionality])
1252])
0fc74be1 1253
48d7b13a 1254
1eb16fd7
KZ
1255AC_ARG_ENABLE([plymouth_support],
1256 AS_HELP_STRING([--disable-plymouth_support], [don not care about plymouth in sylogin(8) and agetty(8)]),
d67f61c0 1257 [], [enable_plymouth_support=check]
1eb16fd7
KZ
1258)
1259UL_BUILD_INIT([plymouth_support])
1260UL_REQUIRES_HAVE([plymouth_support], [tiocglcktrmios], [TIOCGLCKTRMIOS flag])
1261UL_REQUIRES_HAVE([plymouth_support], [sock_cloexec], [SOCK_CLOEXEC flag])
1262UL_REQUIRES_HAVE([plymouth_support], [sock_nonblock], [SOCK_NONBLOCK flag])
1263UL_REQUIRES_HAVE([plymouth_support], [so_passcred], [SO_PASSCRED flag])
1264AM_CONDITIONAL([USE_PLYMOUTH_SUPPORT], [test "x$build_plymouth_support" = xyes])
1265AS_IF([test "x$build_plymouth_support" = xyes ], [
1266 AC_DEFINE([USE_PLYMOUTH_SUPPORT], [1], [Enable plymouth support feature for sulogin and aggety])
1267])
1268
1269
17d71034
KZ
1270AC_ARG_WITH([libz],
1271 AS_HELP_STRING([--without-libz], [compile without libz]),
1272 [], [with_libz=auto]
1273)
1274AS_IF([test "x$with_libz" = xno], [have_z=no], [
1275 AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
1276])
1277
1278
9cb68977 1279AC_ARG_ENABLE([cramfs],
7fa4f112 1280 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
08b1c219 1281 [], [UL_DEFAULT_ENABLE([cramfs], [check])]
9cb68977 1282)
61a074f7 1283UL_BUILD_INIT([cramfs])
d81b5a52 1284UL_REQUIRES_HAVE([cramfs], [z], [z library])
034d378b 1285AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])
9cb68977 1286
a13cdb7a 1287
8d6f0bae 1288AC_ARG_ENABLE([bfs],
834fc88c 1289 AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]),
08b1c219 1290 [], [UL_DEFAULT_ENABLE([bfs], [yes])]
834fc88c
KZ
1291)
1292UL_BUILD_INIT([bfs])
034d378b 1293AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
834fc88c
KZ
1294
1295
3d9fdac5
KZ
1296AC_ARG_ENABLE([minix],
1297 AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]),
08b1c219 1298 [], [UL_DEFAULT_ENABLE([minix], [yes])]
3d9fdac5
KZ
1299)
1300UL_BUILD_INIT([minix])
1301AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes])
1302
1303
8d6f0bae
KZ
1304AC_ARG_ENABLE([fdformat],
1305 AS_HELP_STRING([--disable-fdformat], [do not build fdformat]),
08b1c219 1306 [], [UL_DEFAULT_ENABLE([fdformat], [check])]
8d6f0bae
KZ
1307)
1308UL_BUILD_INIT([fdformat])
1309UL_REQUIRES_LINUX([fdformat])
034d378b 1310AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes])
8d6f0bae
KZ
1311
1312
6acf31ac
KZ
1313AC_ARG_ENABLE([hwclock],
1314 AS_HELP_STRING([--disable-hwclock], [do not build hwclock]),
08b1c219 1315 [], [UL_DEFAULT_ENABLE([hwclock], [check])]
6acf31ac
KZ
1316)
1317have_linuxdummy=$linux_os
1318
1319UL_BUILD_INIT([hwclock])
1320UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux])
034d378b 1321AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes])
e09ebf22
KZ
1322
1323
ecc6047e
KZ
1324UL_BUILD_INIT([mkfs], [yes])
1325AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes])
1326
1327UL_BUILD_INIT([isosize], [yes])
1328AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes])
1329
3d9fdac5 1330
7b040214
KZ
1331UL_BUILD_INIT([fstrim], [check])
1332UL_REQUIRES_LINUX([fstrim])
1333UL_REQUIRES_BUILD([fstrim], [libmount])
1334AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes])
1335
1336
143635c9
KZ
1337UL_BUILD_INIT([swapon], [check])
1338UL_REQUIRES_LINUX([swapon])
1339UL_REQUIRES_BUILD([swapon], [libblkid])
7770e7df 1340UL_REQUIRES_BUILD([swapon], [libmount])
7477f356 1341UL_REQUIRES_BUILD([swapon], [libsmartcols])
034d378b 1342AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
143635c9
KZ
1343
1344
61a074f7 1345UL_BUILD_INIT([lsblk], [check])
a13cdb7a
KZ
1346UL_REQUIRES_LINUX([lsblk])
1347UL_REQUIRES_BUILD([lsblk], [libblkid])
9554f7ab 1348UL_REQUIRES_BUILD([lsblk], [libmount])
7477f356 1349UL_REQUIRES_BUILD([lsblk], [libsmartcols])
034d378b 1350AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes])
9cb68977 1351
a3d3b770 1352
61a074f7 1353UL_BUILD_INIT([lscpu], [check])
da396d88 1354UL_REQUIRES_LINUX([lscpu])
7477f356 1355UL_REQUIRES_BUILD([lscpu], [libsmartcols])
da396d88 1356UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
034d378b 1357AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes])
da396d88 1358
a3d3b770 1359
50e6f15b
RM
1360AC_ARG_ENABLE([lslogins],
1361 AS_HELP_STRING([--disable-lslogins], [do not build lslogins]),
1362 [], [UL_DEFAULT_ENABLE([lslogins], [check])]
1363)
1364UL_BUILD_INIT([lslogins])
ab1cfad5 1365UL_REQUIRES_BUILD([lslogins], [libsmartcols])
d00c10ed
RM
1366UL_REQUIRES_HAVE([lslogins], [shadow_h], [shadow.h header])
1367UL_REQUIRES_HAVE([lslogins], [utmp_h], [utmp.h header])
ab1cfad5
OO
1368AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes])
1369
1370
61a074f7 1371UL_BUILD_INIT([chcpu], [check])
da396d88
KZ
1372UL_REQUIRES_LINUX([chcpu])
1373UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type])
034d378b 1374AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes])
da396d88 1375
a13cdb7a 1376
7fcccbdf
KZ
1377AC_ARG_ENABLE([wdctl],
1378 AS_HELP_STRING([--disable-wdctl], [do not build wdctl]),
08b1c219 1379 [], [UL_DEFAULT_ENABLE([wdctl], [check])]
7fcccbdf
KZ
1380)
1381UL_BUILD_INIT([wdctl])
5b0289b9 1382UL_REQUIRES_LINUX([wdctl])
7477f356 1383UL_REQUIRES_BUILD([wdctl], [libsmartcols])
5b0289b9 1384UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
034d378b 1385AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes])
5b0289b9
KZ
1386
1387
54dbc8cf
KZ
1388UL_BUILD_INIT([swaplabel], [check])
1389UL_REQUIRES_BUILD([swaplabel], [libblkid])
034d378b 1390AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
54dbc8cf
KZ
1391
1392
ecc6047e
KZ
1393UL_BUILD_INIT([mkswap], [yes])
1394AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes])
08b1c219
KZ
1395AS_IF([test "x$build_mkswap" = xyes -a "x$build_libuuid" != xyes], [
1396 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
1397])
ecc6047e 1398
328eb445
KZ
1399
1400AC_ARG_ENABLE([cal],
1401 AS_HELP_STRING([--disable-cal], [do not build cal]),
1402 [], [UL_DEFAULT_ENABLE([cal], [check])]
1403)
1404UL_BUILD_INIT([cal])
1b15cbd1
KZ
1405AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes])
1406
50e6f15b
RM
1407AC_ARG_ENABLE([logger],
1408 AS_HELP_STRING([--disable-logger], [do not build logger]),
1409 [], [UL_DEFAULT_ENABLE([logger], [check])]
1410)
1411UL_BUILD_INIT([logger])
1b15cbd1
KZ
1412AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes])
1413
4c838e6c 1414UL_BUILD_INIT([look], [yes])
1b15cbd1
KZ
1415AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes])
1416
1417UL_BUILD_INIT([mcookie], [yes])
1418AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes])
1419
1420UL_BUILD_INIT([namei], [yes])
1421AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes])
1422
1423UL_BUILD_INIT([whereis], [yes])
1424AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes])
1425
3adaaa15
KZ
1426UL_BUILD_INIT([getopt], [yes])
1427AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes])
1428
ecc6047e
KZ
1429
1430UL_BUILD_INIT([blockdev], [check])
1431UL_REQUIRES_LINUX([blockdev])
1432AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes])
1433
1434
945ac250
KZ
1435UL_BUILD_INIT([prlimit], [check])
1436UL_REQUIRES_LINUX([prlimit])
7477f356 1437UL_REQUIRES_BUILD([prlimit], [libsmartcols])
945ac250 1438UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
034d378b 1439AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes])
3013eb9d 1440AS_IF([test "x$build_prlimit" = xyes], [
945ac250 1441 AC_CHECK_FUNCS([prlimit])
3013eb9d 1442])
945ac250
KZ
1443
1444
3dc02ef4
DB
1445UL_BUILD_INIT([lslocks], [check])
1446UL_REQUIRES_LINUX([lslocks])
ec1204dc 1447UL_REQUIRES_BUILD([lslocks], [libmount])
7477f356 1448UL_REQUIRES_BUILD([lslocks], [libsmartcols])
034d378b 1449AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes])
3dc02ef4
DB
1450
1451
bd671347
KZ
1452AC_ARG_ENABLE([switch_root],
1453 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
08b1c219 1454 [], [UL_DEFAULT_ENABLE([switch_root], [check])]
bd671347 1455)
61a074f7 1456UL_BUILD_INIT([switch_root])
a3d3b770
KZ
1457UL_REQUIRES_LINUX([switch_root])
1458UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
034d378b 1459AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
bd671347
KZ
1460
1461
11125e7a
KZ
1462AC_ARG_ENABLE([pivot_root],
1463 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
08b1c219 1464 [], [UL_DEFAULT_ENABLE([pivot_root], [check])]
11125e7a 1465)
61a074f7 1466UL_BUILD_INIT([pivot_root])
5cbbdfbf 1467UL_REQUIRES_LINUX([pivot_root])
9f632667 1468UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])])
034d378b 1469AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes])
11125e7a
KZ
1470
1471
c12fc5e1 1472UL_BUILD_INIT([flock], [check])
254743e4 1473UL_REQUIRES_HAVE([flock], [timer], [timer_create function])
205dbb7a
KZ
1474AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes])
1475
bdfe4601 1476
cad2d1ac
HC
1477AC_ARG_ENABLE([lsmem],
1478 AS_HELP_STRING([--disable-lsmem], [do not build lsmem]),
bdfe4601 1479 [], [UL_DEFAULT_ENABLE([lsmem], [check])]
cad2d1ac
HC
1480)
1481UL_BUILD_INIT([lsmem])
bdfe4601 1482UL_REQUIRES_LINUX([lsmem])
cad2d1ac
HC
1483AM_CONDITIONAL([BUILD_LSMEM], [test "x$build_lsmem" = xyes])
1484
bdfe4601 1485
30e1ea8b
HC
1486AC_ARG_ENABLE([chmem],
1487 AS_HELP_STRING([--disable-chmem], [do not build chmem]),
bdfe4601 1488 [], [UL_DEFAULT_ENABLE([chmem], [check])]
30e1ea8b
HC
1489)
1490UL_BUILD_INIT([chmem])
bdfe4601 1491UL_REQUIRES_LINUX([chmem])
30e1ea8b
HC
1492AM_CONDITIONAL([BUILD_CHMEM], [test "x$build_chmem" = xyes])
1493
205dbb7a
KZ
1494UL_BUILD_INIT([ipcmk], [yes])
1495AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes])
1496
bdfe4601 1497
42a4a152
RM
1498AC_ARG_ENABLE([ipcrm],
1499 AS_HELP_STRING([--disable-ipcrm], [do not build ipcrm]),
1500 [], [UL_DEFAULT_ENABLE([ipcrm], [yes])]
1501)
1502UL_BUILD_INIT([ipcrm])
205dbb7a
KZ
1503AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes])
1504
42a4a152
RM
1505AC_ARG_ENABLE([ipcs],
1506 AS_HELP_STRING([--disable-ipcs], [do not build ipcs]),
1507 [], [UL_DEFAULT_ENABLE([ipcs], [yes])]
1508)
1509UL_BUILD_INIT([ipcs])
205dbb7a
KZ
1510AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes])
1511
9d20ffda
KZ
1512UL_BUILD_INIT([lsipc], [check])
1513UL_REQUIRES_LINUX([lsipc])
1514UL_REQUIRES_BUILD([lsipc], [libsmartcols])
1515AM_CONDITIONAL([BUILD_LSIPC], [test "x$build_lsipc" = xyes])
1516
8a204562
KZ
1517UL_BUILD_INIT([lsns], [check])
1518UL_REQUIRES_LINUX([lsns])
1519UL_REQUIRES_BUILD([lsns], [libsmartcols])
1520AM_CONDITIONAL([BUILD_LSNS], [test "x$build_lsns" = xyes])
1521
205dbb7a
KZ
1522UL_BUILD_INIT([renice], [yes])
1523AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes])
1524
1525UL_BUILD_INIT([setsid], [yes])
1526AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes])
1527
1528UL_BUILD_INIT([readprofile], [check])
1529UL_REQUIRES_LINUX([readprofile])
1530AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes])
1531
1532UL_BUILD_INIT([dmesg], [check])
1533UL_REQUIRES_LINUX([dmesg])
1534AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes])
1535
1536UL_BUILD_INIT([ctrlaltdel], [check])
1537UL_REQUIRES_LINUX([ctrlaltdel])
e52b58e6
CTV
1538dnl we assume reboot() to be the 1-argument variant, because even considering
1539dnl widely used alternative C libraries like uclibc, dietlibc and musl,
1540dnl reboot() with multiple arguments is yet only found in glibc versions
1541dnl earlier than 2.x.
9dd55a04 1542UL_REQUIRES_HAVE([ctrlaltdel], [reboot], [reboot function])
205dbb7a
KZ
1543AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes])
1544
1545UL_BUILD_INIT([fsfreeze], [check])
1546UL_REQUIRES_LINUX([fsfreeze])
1547AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes])
1548
1549UL_BUILD_INIT([blkdiscard], [check])
1550UL_REQUIRES_LINUX([blkdiscard])
1551AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes])
1552
1553UL_BUILD_INIT([ldattach], [check])
1554UL_REQUIRES_LINUX([ldattach])
1555AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes])
1556
1557UL_BUILD_INIT([rtcwake], [check])
1558UL_REQUIRES_LINUX([rtcwake])
1559AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes])
1560
1561UL_BUILD_INIT([setarch], [check])
1562UL_REQUIRES_LINUX([setarch])
1563AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes])
1564
d3a1e3bf 1565UL_BUILD_INIT([script], [check])
651b25cd 1566UL_REQUIRES_HAVE([script], [sys_signalfd_h], [sys/signalfd.h header])
3f91b990
KZ
1567AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes])
1568
1569UL_BUILD_INIT([scriptreplay], [yes])
1570AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes])
1571
cb45354e
KZ
1572UL_BUILD_INIT([col], [yes])
1573AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes])
1574
1575UL_BUILD_INIT([colcrt], [yes])
1576AM_CONDITIONAL([BUILD_COLCRT], [test "x$build_colcrt" = xyes])
1577
1578UL_BUILD_INIT([colrm], [yes])
1579AM_CONDITIONAL([BUILD_COLRM], [test "x$build_colrm" = xyes])
1580
1581UL_BUILD_INIT([column], [yes])
1582AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes])
1583
1584UL_BUILD_INIT([hexdump], [yes])
1585AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes])
1586
1587UL_BUILD_INIT([rev], [yes])
1588AM_CONDITIONAL([BUILD_REV], [test "x$build_rev" = xyes])
1589
1590UL_BUILD_INIT([tailf], [yes])
1591AM_CONDITIONAL([BUILD_TAILF], [test "x$build_tailf" = xyes])
1592
3f91b990 1593
1342ffcb
SK
1594AC_ARG_ENABLE([tunelp],
1595 AS_HELP_STRING([--enable-tunelp], [build tunelp]),
08b1c219 1596 [], [UL_DEFAULT_ENABLE([tunelp], [no])]
1342ffcb
SK
1597)
1598UL_BUILD_INIT([tunelp])
1599UL_REQUIRES_LINUX([tunelp])
034d378b 1600AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes])
1342ffcb
SK
1601
1602
48d7b13a 1603AC_ARG_ENABLE([kill],
4be753aa 1604 AS_HELP_STRING([--disable-kill], [do not build kill]),
08b1c219 1605 [], [UL_DEFAULT_ENABLE([kill], [check])]
48d7b13a 1606)
61a074f7 1607UL_BUILD_INIT([kill])
4be753aa 1608UL_REQUIRES_LINUX([kill])
034d378b 1609AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])
48d7b13a 1610
ce602720 1611
48d7b13a 1612AC_ARG_ENABLE([last],
ce602720 1613 AS_HELP_STRING([--disable-last], [do not build last]),
08b1c219 1614 [], [UL_DEFAULT_ENABLE([last], [check])]
48d7b13a 1615)
61a074f7 1616UL_BUILD_INIT([last])
d00c10ed 1617UL_REQUIRES_HAVE([last], [utmp_h], [utmp.h header])
034d378b 1618AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
2dc68529 1619
48d7b13a 1620
78d5ceac 1621AC_ARG_ENABLE([utmpdump],
c9b53461 1622 AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]),
d00c10ed 1623 [], [UL_DEFAULT_ENABLE([utmpdump], [check])]
78d5ceac
KZ
1624)
1625UL_BUILD_INIT([utmpdump])
d00c10ed 1626UL_REQUIRES_HAVE([utmpdump], [utmp_h], [utmp.h header])
034d378b 1627AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
78d5ceac
KZ
1628
1629
c135a8bd
SK
1630AC_ARG_ENABLE([line],
1631 AS_HELP_STRING([--enable-line], [build line]),
08b1c219 1632 [], [UL_DEFAULT_ENABLE([line], [no])]
c135a8bd 1633)
61a074f7 1634UL_BUILD_INIT([line])
034d378b 1635AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
2dc68529 1636
48d7b13a
KZ
1637
1638AC_ARG_ENABLE([mesg],
5c0b406d 1639 AS_HELP_STRING([--disable-mesg], [do not build mesg]),
08b1c219 1640 [], [UL_DEFAULT_ENABLE([mesg], [yes])]
48d7b13a 1641)
61a074f7 1642UL_BUILD_INIT([mesg])
034d378b 1643AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
48d7b13a
KZ
1644
1645
48d7b13a 1646AC_ARG_ENABLE([raw],
5c0b406d 1647 AS_HELP_STRING([--disable-raw], [do not build raw]),
08b1c219 1648 [], [UL_DEFAULT_ENABLE([raw], [check])]
48d7b13a 1649)
61a074f7 1650UL_BUILD_INIT([raw])
16ba8d58
KZ
1651UL_REQUIRES_LINUX([raw])
1652UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file])
034d378b 1653AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes])
48d7b13a
KZ
1654
1655
48d7b13a 1656AC_ARG_ENABLE([rename],
7fa4f112 1657 AS_HELP_STRING([--disable-rename], [do not build rename]),
08b1c219 1658 [], [UL_DEFAULT_ENABLE([rename], [yes])]
48d7b13a 1659)
61a074f7 1660UL_BUILD_INIT([rename])
034d378b 1661AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
48d7b13a
KZ
1662
1663
1664AC_ARG_ENABLE([reset],
7fa4f112 1665 AS_HELP_STRING([--enable-reset], [build reset]),
08b1c219 1666 [], [UL_DEFAULT_ENABLE([reset], [no])]
48d7b13a 1667)
61a074f7 1668UL_BUILD_INIT([reset])
034d378b 1669AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes])
48d7b13a
KZ
1670
1671
cc76731e
KZ
1672AC_ARG_ENABLE([vipw],
1673 AS_HELP_STRING([--enable-vipw], [build vipw]),
08b1c219 1674 [], [UL_DEFAULT_ENABLE([vipw], [no])]
48d7b13a 1675)
cc76731e 1676UL_BUILD_INIT([vipw])
d00c10ed 1677UL_REQUIRES_HAVE([vipw], [shadow_h], [shadow.h header])
034d378b 1678AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
9cb68977 1679
c94b3604 1680
aec9ecbd
KZ
1681AC_ARG_ENABLE([newgrp],
1682 AS_HELP_STRING([--enable-newgrp], [build newgrp]),
08b1c219 1683 [], [UL_DEFAULT_ENABLE([newgrp], [no])]
aec9ecbd
KZ
1684)
1685UL_BUILD_INIT([newgrp])
034d378b 1686AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes])
aec9ecbd
KZ
1687
1688
d86918b6 1689AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]),
034d378b 1690 [], [with_user=check]
7e4714f2 1691)
6e93c52f 1692have_user=no
3013eb9d 1693AS_IF([test "x$with_user" != xno], [
2771954b 1694 PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no])
9f57e6e8
SK
1695 AS_CASE([$with_user:$have_user],
1696 [yes:no],
1697 [AC_MSG_ERROR([user selected but libuser not found])],
1698 [*:yes],
1699 [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])]
1700 )
1f6ec24c
KZ
1701 # temporary solution, libuser has stupid .pc where are exported all
1702 # private dependencies to Requires: instead of Requires.private:
3013eb9d 1703 AS_IF([test "x$have_user" = xyes], [
1f6ec24c 1704 LIBUSER_LIBS=-luser
3013eb9d
SK
1705 ])
1706])
034d378b 1707AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes])
7e4714f2 1708
d86918b6
KZ
1709AC_ARG_ENABLE([chfn-chsh-password],
1710 AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]),
034d378b 1711 [], [enable_chfn_chsh_password=yes]
d86918b6
KZ
1712)
1713
1714AC_ARG_ENABLE([chfn-chsh],
1715 AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
9a4e9c9d 1716 [], [UL_DEFAULT_ENABLE([chfn_chsh], [check])]
d86918b6
KZ
1717)
1718UL_BUILD_INIT([chfn_chsh])
d00c10ed 1719UL_REQUIRES_HAVE([chfn_chsh], [shadow_h], [shadow.h header])
d86918b6 1720
3013eb9d 1721AS_IF([test "x$enable_chfn_chsh_password" = xyes -o "x$have_user" = xyes], [
fe2c9909 1722 UL_REQUIRES_HAVE([chfn_chsh], [security_pam_appl_h], [PAM header file])
034d378b 1723 AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?])
3013eb9d 1724])
034d378b
SK
1725AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes])
1726AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes])
d86918b6
KZ
1727
1728AC_ARG_ENABLE([chsh-only-listed],
5c0b406d
BS
1729 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
1730 [], enable_chsh_only_listed=yes
d86918b6 1731)
7e4714f2 1732
3013eb9d
SK
1733AS_IF([test "x$enable_chsh_only_listed" = xyes], [
1734 AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?])
1735])
71681ee5 1736
2c8a3e16 1737
e7614a07
KZ
1738AC_ARG_ENABLE([login],
1739 AS_HELP_STRING([--disable-login], [do not build login]),
08b1c219 1740 [], [UL_DEFAULT_ENABLE([login], [check])]
e7614a07
KZ
1741)
1742UL_BUILD_INIT([login])
fe2c9909
WJ
1743UL_REQUIRES_HAVE([login], [security_pam_appl_h], [PAM header file])
1744UL_REQUIRES_HAVE([login], [security_pam_misc_h, security_openpam_h], [PAM conversation functions])
d00c10ed 1745UL_REQUIRES_HAVE([login], [utmp_h], [utmp.h header])
034d378b 1746AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes])
e7614a07 1747
71681ee5
KZ
1748AC_ARG_ENABLE([login-chown-vcs],
1749 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
034d378b 1750 [], [enable_login_chown_vcs=no]
71681ee5
KZ
1751)
1752
3013eb9d 1753AS_IF([test "x$enable_login_chown_vcs" = xyes], [
034d378b 1754 AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?])
3013eb9d 1755])
71681ee5
KZ
1756
1757AC_ARG_ENABLE([login-stat-mail],
1758 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
034d378b 1759 [], [enable_login_stat_mail=no]
71681ee5
KZ
1760)
1761
3013eb9d 1762AS_IF([test "x$enable_login_stat_mail" = xyes], [
034d378b 1763 AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?])
3013eb9d 1764])
71681ee5 1765
e7614a07 1766
88407b93
KZ
1767AC_ARG_ENABLE([nologin],
1768 AS_HELP_STRING([--disable-nologin], [do not build nologin]),
08b1c219 1769 [], [UL_DEFAULT_ENABLE([nologin], [yes])]
88407b93
KZ
1770)
1771UL_BUILD_INIT([nologin])
1772AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
1773
1774
e7614a07
KZ
1775AC_ARG_ENABLE([sulogin],
1776 AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
d00c10ed 1777 [], [UL_DEFAULT_ENABLE([sulogin], [check])]
e7614a07
KZ
1778)
1779UL_BUILD_INIT([sulogin])
d00c10ed 1780UL_REQUIRES_HAVE([sulogin], [shadow_h], [shadow.h header])
034d378b 1781AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
e7614a07 1782
f17f5f48 1783
ff4c5555
KZ
1784AC_ARG_ENABLE([su],
1785 AS_HELP_STRING([--disable-su], [do not build su]),
08b1c219 1786 [], [UL_DEFAULT_ENABLE([su], [check])]
ff4c5555
KZ
1787)
1788UL_BUILD_INIT([su])
fe2c9909 1789UL_REQUIRES_HAVE([su], [security_pam_appl_h], [PAM header file])
d00c10ed 1790UL_REQUIRES_HAVE([su], [utmp_h], [utmp.h header])
034d378b 1791AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
ff4c5555
KZ
1792
1793
7ec6adb1
KZ
1794AC_ARG_ENABLE([runuser],
1795 AS_HELP_STRING([--disable-runuser], [do not build runuser]),
08b1c219 1796 [], [UL_DEFAULT_ENABLE([runuser], [check])]
7ec6adb1
KZ
1797)
1798UL_BUILD_INIT([runuser])
fe2c9909 1799UL_REQUIRES_HAVE([runuser], [security_pam_appl_h], [PAM header file])
d00c10ed 1800UL_REQUIRES_HAVE([runuser], [utmp_h], [utmp.h header])
034d378b 1801AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
7ec6adb1
KZ
1802
1803
53b22add
KZ
1804AC_ARG_ENABLE([ul],
1805 AS_HELP_STRING([--disable-ul], [do not build ul]),
08b1c219 1806 [], [UL_DEFAULT_ENABLE([ul], [check])]
53b22add
KZ
1807)
1808UL_BUILD_INIT([ul])
4ffcc7a9 1809UL_REQUIRES_HAVE([ul], [ncursesw, tinfo, ncurses], [ncursesw, ncurses or tinfo libraries])
034d378b 1810AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
53b22add
KZ
1811
1812
1813AC_ARG_ENABLE([more],
1814 AS_HELP_STRING([--disable-more], [do not build more]),
08b1c219 1815 [], [UL_DEFAULT_ENABLE([more], [check])]
53b22add
KZ
1816)
1817UL_BUILD_INIT([more])
4ffcc7a9 1818UL_REQUIRES_HAVE([more], [ncursesw, tinfo, ncurses, termcap], [ncursesw, ncurses, tinfo or termcap libraries])
034d378b 1819AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])
53b22add
KZ
1820
1821
1822AC_ARG_ENABLE([pg],
00971cca
SK
1823 AS_HELP_STRING([--enable-pg], [build pg]),
1824 [], [UL_DEFAULT_ENABLE([pg], [no])]
53b22add
KZ
1825)
1826UL_BUILD_INIT([pg])
4b439e2d 1827UL_REQUIRES_HAVE([pg], [ncursesw, ncurses], [ncursesw or ncurses library])
034d378b 1828AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes])
53b22add
KZ
1829
1830
d78d0409
KZ
1831AC_ARG_ENABLE([setterm],
1832 AS_HELP_STRING([--disable-setterm], [do not build setterm]),
08b1c219 1833 [], [UL_DEFAULT_ENABLE([setterm], [check])]
d78d0409
KZ
1834)
1835UL_BUILD_INIT([setterm])
1836UL_REQUIRES_LINUX([setterm])
4b439e2d 1837UL_REQUIRES_HAVE([setterm], [ncursesw, ncurses], [ncursesw or ncurses library])
034d378b 1838AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
d78d0409 1839
d6ace0b8
KZ
1840# build_schedutils= is just configure-only variable to control
1841# ionice, taskset and chrt
48d7b13a 1842AC_ARG_ENABLE([schedutils],
34228e69 1843 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
08b1c219 1844 [], [UL_DEFAULT_ENABLE([schedutils], [yes])]
48d7b13a 1845)
61a074f7 1846UL_BUILD_INIT([schedutils])
17d5e11b 1847
61a074f7 1848UL_BUILD_INIT([ionice], [check])
17d5e11b
KZ
1849UL_REQUIRES_BUILD([ionice], [schedutils])
1850UL_REQUIRES_SYSCALL_CHECK([ionice],
1851 [UL_CHECK_SYSCALL([ioprio_set],
f06b4328
SK
1852 [alpha], [442],
1853 [i*86], [289],
1854 [ia64*], [1274],
1855 [powerpc*], [273],
1856 [s390*], [282],
1857 [sparc*], [196],
1858 [sh*], [288],
1859 [x86_64*], [251])],
17d5e11b
KZ
1860 [ioprio_set])
1861
1862UL_REQUIRES_SYSCALL_CHECK([ionice],
1863 [UL_CHECK_SYSCALL([ioprio_get],
f06b4328
SK
1864 [alpha], [443],
1865 [i*86], [290],
1866 [ia64*], [1275],
1867 [powerpc*], [274],
1868 [s390*], [283],
1869 [sparc*], [218],
1870 [sh*], [289],
1871 [x86_64*], [252])],
17d5e11b
KZ
1872 [ioprio_get])
1873
034d378b 1874AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
17d5e11b 1875
61a074f7 1876UL_BUILD_INIT([taskset], [check])
17d5e11b 1877UL_REQUIRES_BUILD([taskset], [schedutils])
e21e6d26 1878UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
17d5e11b
KZ
1879UL_REQUIRES_SYSCALL_CHECK([taskset],
1880 [UL_CHECK_SYSCALL([sched_getaffinity])],
1881 [sched_getaffinity])
034d378b 1882AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
48d7b13a 1883
ee20c303
RM
1884
1885have_schedsetter=no
1886AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes],
1887 [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes])
1888
d6ace0b8
KZ
1889UL_BUILD_INIT([chrt], [check])
1890UL_REQUIRES_BUILD([chrt], [schedutils])
ee20c303 1891UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions])
d6ace0b8
KZ
1892AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
1893
15167589
KZ
1894AS_IF([test "x$build_chrt" = xyes], [
1895 UL_CHECK_SYSCALL([sched_setattr])
1896])
1897
48d7b13a
KZ
1898
1899AC_ARG_ENABLE([wall],
7fa4f112 1900 AS_HELP_STRING([--disable-wall], [do not build wall]),
d00c10ed 1901 [], [UL_DEFAULT_ENABLE([wall], [check])]
48d7b13a 1902)
8fc8888b 1903UL_BUILD_INIT([wall])
d00c10ed 1904UL_REQUIRES_HAVE([wall], [utmp_h], [utmp.h header])
034d378b 1905AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
48d7b13a
KZ
1906
1907
1908AC_ARG_ENABLE([write],
7fa4f112 1909 AS_HELP_STRING([--enable-write], [build write]),
08b1c219 1910 [], [UL_DEFAULT_ENABLE([write], [no])]
48d7b13a 1911)
61a074f7 1912UL_BUILD_INIT([write])
d00c10ed 1913UL_REQUIRES_HAVE([write], [utmp_h], [utmp.h header])
034d378b 1914AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes])
48d7b13a
KZ
1915
1916
5a971329
KZ
1917AC_ARG_WITH([btrfs],
1918 AS_HELP_STRING([--with-btrfs], [build with support for btrfs]),
1919 [], [with_btrfs=check]
1920)
1921have_btrfs=no
1922AS_IF([test "x$with_btrfs" != xno], [
1923 AS_CASE([$with_btrfs:$have_linux_btrfs_h],
1924 [yes:no],
1925 [AC_MSG_ERROR([btrfs selected but linux/btrfs.h not found])],
1926 [check:no],
1927 [AC_MSG_WARN([linux/btrfs.h not found, do not build with btrfs support])],
1928 [*:yes],
1929 [have_btrfs=yes
1930 AC_DEFINE([HAVE_BTRFS_SUPPORT], [1], [Define if btrfs stuff is available])]
1931 )
1932])
1933AM_CONDITIONAL([HAVE_BTRFS], [test "x$have_btrfs" = xyes])
1934
1935
ebff016a
KZ
1936AC_ARG_WITH([systemd],
1937 AS_HELP_STRING([--with-systemd], [build with support for systemd]),
1938 [], [with_systemd=check]
1939)
1940
1941have_systemd=no
1942AS_IF([test "x$with_systemd" != xno], [
1943 # new version -- all libsystemd-* libs merged into libsystemd
1944 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
1945 # old versions
1946 AS_IF([test "x$have_systemd" != "xyes"], [
1947 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
1948 [have_systemd_daemon=yes], [have_systemd_daemon=no])
1949 PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal],
1950 [have_systemd_journal=yes], [have_systemd_journal=no])
1951 AS_IF([test "x$have_systemd_daemon" = "xyes" -a "x$have_systemd_journal" = "xyes" ],[
1952 have_systemd=yes])
ea45d34c 1953 ])
ebff016a
KZ
1954 AS_CASE([$with_systemd:$have_systemd],
1955 [yes:no],
1956 [AC_MSG_ERROR([systemd expected but libsystemd not found])],
1957 [*:yes],
1958 AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
1959 )
3013eb9d 1960])
ebff016a
KZ
1961AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes])
1962
bbe289c4 1963
1b68c379
PU
1964AC_ARG_WITH([systemdsystemunitdir],
1965 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd service files]),
c8498f2f 1966 [], [with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`])
1b68c379 1967
3013eb9d 1968AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
1b68c379 1969 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
3013eb9d 1970])
1b68c379 1971
bbe289c4 1972
b8095d25
KZ
1973AC_ARG_WITH([smack],
1974 AS_HELP_STRING([--with-smack], [build with SMACK support]),
1975 [], [with_smack=no]
1976)
1977AS_IF([test "x$with_smack" = xyes], [
1978 AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support])
1979])
1980
1981
9cc36e9f
SK
1982AC_ARG_WITH([bashcompletiondir],
1983 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1984 [],
c8498f2f
SK
1985 [AS_IF([`$PKG_CONFIG --exists bash-completion`], [
1986 with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`
9cc36e9f
SK
1987 ], [
1988 with_bashcompletiondir=${datadir}/bash-completion/completions
1989 ])
1990])
1991AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1992
ece777e9
KZ
1993AC_ARG_ENABLE([bash-completion],
1994 AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]),
034d378b 1995 [], [enable_bash_completion=yes]
ece777e9
KZ
1996)
1997
034d378b 1998AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
ece777e9 1999
9cc36e9f 2000
d78df0ac 2001AC_ARG_WITH([python],
4c54effb
KZ
2002 AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]),
2003 [], [with_python=check withval=check]
d78df0ac 2004)
8e5c4675 2005
d78df0ac 2006have_python=no
b2ae8c57 2007have_libpython=no
8e5c4675
KZ
2008AS_IF([test "x$with_python" != xno], [
2009 # We follow distributions default and look for PKG module name "python"
2010 # (minimal version is 2) but if major version is explicitly specified by
2011 # --with-python=2 or --with-python=3 then we look for PKG module "python2" or
2012 # "python3".
4c54effb 2013 AS_IF([test "x$withval" != xno -a "x$withval" != xyes -a "x$withval" != xcheck],
0b567ae5 2014 [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"])
b2ae8c57
KZ
2015
2016 # check for python interpreter
0b567ae5 2017 AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no])
8e5c4675
KZ
2018 AS_CASE([$with_python:$have_python],
2019 [yes:no],
b2ae8c57 2020 [AC_MSG_ERROR([python selected but python interpreter not found])],
4c54effb 2021 [check:no],
b2ae8c57 2022 [AC_MSG_WARN([python interpreter not found, do not build python bindings])],
4c54effb 2023 [*:yes],
b2ae8c57
KZ
2024 # check for python development stuff
2025 [PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION],
2026 [have_libpython=yes], [have_libpython=no])]
8e5c4675 2027 )
d78df0ac
KZ
2028])
2029
da0ec90b
KZ
2030
2031AC_ARG_ENABLE([pylibmount],
2032 AS_HELP_STRING([--disable-pylibmount], [do not build pylibmount]),
2033 [], [UL_DEFAULT_ENABLE([pylibmount], [check])]
2034)
2035UL_BUILD_INIT([pylibmount])
b2ae8c57 2036UL_REQUIRES_HAVE([pylibmount], [libpython], [libpython])
da0ec90b 2037UL_REQUIRES_BUILD([pylibmount], [libmount])
d78df0ac
KZ
2038AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"])
2039
324330ac
FB
2040# We need to introduce a verbatim dependency into the Makefile, without automake
2041# trying to interpret it, so push it as a AM_SUBST_NOTMAKE variable.
2042verbatim_pylibmount_dependency='
2043
2044# pylibmountexec module must be installed after usrlib_exec libraries,
2045# otherwise the libtool relink step will fail to find libmount.la and
2046# will try -lmount which is possibly not available.
2047install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES
2048
2049'
2050AC_SUBST([verbatim_pylibmount_dependency])
2051AM_SUBST_NOTMAKE([verbatim_pylibmount_dependency])
d78df0ac 2052
48d7b13a 2053AC_ARG_ENABLE([pg-bell],
7fa4f112 2054 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
034d378b 2055 [], [enable_pg_bell=yes]
48d7b13a
KZ
2056)
2057
3013eb9d 2058AS_IF([test "x$enable_pg_bell" = xyes], [
034d378b 2059 AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?])
3013eb9d 2060])
48d7b13a
KZ
2061
2062
bb4cb69d
MF
2063AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
2064AC_ARG_ENABLE([fs-paths-default],
2065 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
9f57e6e8
SK
2066 [AS_CASE([$enableval],
2067 [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"],
2068 [no], [fs_paths_defaults=""],
2069 [fs_paths_defaults="$enableval"]
2070 )],
bb4cb69d
MF
2071 [fs_paths_defaults="FS_PATHS_DEFAULT"]
2072)
2073AC_ARG_ENABLE([fs-paths-extra],
2074 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
9f57e6e8
SK
2075 [AS_CASE([$enableval],
2076 [yes|no], [fs_paths_extra=""],
2077 [fs_paths_extra="$enableval"]
2078 )],
bb4cb69d
MF
2079 [fs_paths_extra=""]
2080)
2081fs_paths="$fs_paths_defaults"
3013eb9d
SK
2082AS_IF([test "x$fs_paths_extra" != "x"], [
2083 AS_IF([test "x$fs_paths" != "x"], [
bb4cb69d 2084 fs_paths="${fs_paths}:"
3013eb9d 2085 ])
bb4cb69d 2086 fs_paths="${fs_paths}${fs_paths_extra}"
3013eb9d 2087])
bb4cb69d
MF
2088AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
2089
2090
48d7b13a 2091AC_ARG_ENABLE([use-tty-group],
7fa4f112 2092 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
034d378b 2093 [], [enable_use_tty_group=yes]
48d7b13a 2094)
034d378b 2095AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes])
48d7b13a 2096
3013eb9d 2097AS_IF([test "x$enable_use_tty_group" = xyes], [
034d378b 2098 AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?])
3013eb9d 2099])
48d7b13a 2100
ab6478ef
WF
2101
2102AC_ARG_ENABLE([sulogin-emergency-mount],
479d50bd
DR
2103 AS_HELP_STRING([--enable-sulogin-emergency-mount],
2104 [use emergency mount of /dev and /proc for sulogin]),
034d378b 2105 [], [enable_sulogin_emergency_mount=no]
ab6478ef
WF
2106)
2107
3013eb9d 2108AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [
034d378b 2109 AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1],
ab6478ef 2110 [Should sulogin use a emergency mount of /dev and /proc?])
3013eb9d 2111])
ab6478ef
WF
2112
2113
f71d1104
KZ
2114AC_ARG_ENABLE([usrdir-path],
2115 AS_HELP_STRING([--enable-usrdir-path], [use only /usr paths in PATH env. variable (recommended on systems with /bin -> /usr/bin symlinks)]),
2116 [], [enable_usrdir_path=no]
2117)
2118
2119AS_IF([test "x$enable_usrdir_path" == xyes], [
2120 AC_DEFINE([USE_USRDIR_PATHS_ONLY], [1], [Define to 1 to remove /bin and /sbin from PATH env.variable])
2121])
2122
2123
f3831bbd
KZ
2124AC_ARG_ENABLE([makeinstall-chown],
2125 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
034d378b 2126 [], [enable_makeinstall_chown=yes]
f3831bbd 2127)
034d378b 2128AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes])
f3831bbd 2129
81f55ab9 2130
4c24a7ae
KZ
2131AC_ARG_ENABLE([makeinstall-setuid],
2132 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
034d378b 2133 [], [enable_makeinstall_setuid=yes]
4c24a7ae 2134)
034d378b 2135AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes])
4c24a7ae 2136
06bcee19 2137
81f55ab9
KZ
2138AC_ARG_ENABLE([colors-default],
2139 AS_HELP_STRING([--disable-colors-default], [do not colorize output from utils by default]),
2140 [], [enable_colors_default=yes]
2141)
2142AS_IF([test "x$enable_colors_default" = xyes], [
2143 AC_DEFINE([USE_COLORS_BY_DEFAULT], [1], [Enables colorized output from utils by default])
2144])
2145
2146
1f10890f
SK
2147AC_ARG_VAR([SUID_CFLAGS],
2148 [CFLAGS used for binaries which are usually with the suid bit])
2149AC_ARG_VAR([SUID_LDFLAGS],
2150 [LDFLAGS used for binaries which are usually with the suid bit])
06bcee19 2151
03d00d49
KZ
2152AC_ARG_VAR([DAEMON_CFLAGS],
2153 [CFLAGS used for binaries which are usually executed as daemons])
2154AC_ARG_VAR([DAEMON_LDFLAGS],
2155 [LDFLAGS used for binaries which are usually executed as daemons])
2156
2157AC_ARG_VAR([SOLIB_CFLAGS],
2158 [CFLAGS used for shared libraries])
2159AC_ARG_VAR([SOLIB_LDFLAGS],
2160 [LDFLAGS used for shared libraries])
2161
2ad21963
KZ
2162AC_ARG_VAR([ADJTIME_PATH],
2163 [Path to hwclock adjtime file, default /etc/adjtime])
2164AS_IF([test "x$ADJTIME_PATH" = x], [ADJTIME_PATH="/etc/adjtime"])
2165AC_DEFINE_UNQUOTED([CONFIG_ADJTIME_PATH], "$ADJTIME_PATH", [Path to hwclock adjtime file])
2166
2167
9cb68977 2168LIBS=""
48d7b13a 2169
48d7b13a 2170
034d378b 2171AC_CONFIG_HEADERS([config.h])
48d7b13a 2172
d4baf92e
KZ
2173#
2174# Don't use configure.ac to replace install paths! See Makefile PATHFILES for
2175# more details.
2176#
8eeb575c 2177AC_CONFIG_FILES([
f06b4328 2178Makefile
31a938ac 2179libblkid/docs/Makefile
8fb4efae 2180libblkid/docs/version.xml
8fb4efae 2181libblkid/src/blkid.h
705854f3
KZ
2182libfdisk/docs/Makefile
2183libfdisk/docs/version.xml
2184libfdisk/src/libfdisk.h
31a938ac 2185libmount/docs/Makefile
2aefc0a8 2186libmount/docs/version.xml
f06b4328 2187libmount/src/libmount.h
1d90bcb1
OO
2188libsmartcols/docs/Makefile
2189libsmartcols/docs/version.xml
1a4d989e 2190libsmartcols/src/libsmartcols.h
f06b4328 2191po/Makefile.in
8eeb575c 2192])
48d7b13a
KZ
2193
2194AC_OUTPUT
4e1073c2
KZ
2195
2196AC_MSG_RESULT([
2197 ${PACKAGE} ${VERSION}
2198
2199 prefix: ${prefix}
2200 exec prefix: ${exec_prefix}
2201
5c0b406d
BS
2202 localstatedir: ${localstatedir}
2203 bindir: ${bindir}
4e1073c2
KZ
2204 sbindir: ${sbindir}
2205 libdir: ${libdir}
2206 includedir: ${includedir}
5c0b406d
BS
2207 usrbin_execdir: ${usrbin_execdir}
2208 usrsbin_execdir: ${usrsbin_execdir}
2209 usrlib_execdir: ${usrlib_execdir}
4e1073c2
KZ
2210
2211 compiler: ${CC}
2212 cflags: ${CFLAGS}
2213 suid cflags: ${SUID_CFLAGS}
2214 ldflags: ${LDFLAGS}
2215 suid ldflags: ${SUID_LDFLAGS}
8e5c4675 2216
0b567ae5
SK
2217 Python: ${PYTHON}
2218 Python version: ${PYTHON_VERSION}
3745d4a9
KZ
2219 Python libs: ${pyexecdir}
2220
8e5c4675 2221 Bash completions: ${with_bashcompletiondir}
ebff016a 2222 Systemd support: ${have_systemd}
5a971329 2223 Btrfs support: ${have_btrfs}
18dae5d8 2224 Wide-char support: ${build_widechar}
4e1073c2
KZ
2225
2226 warnings:
2227
2228${WARN_CFLAGS}
b4b84389
KZ
2229
2230 Type 'make' or 'make <utilname>' to compile.
4e1073c2 2231])