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