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