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