]> git.ipfire.org Git - thirdparty/util-linux.git/blob - configure.ac
29f189a46abbbb3ed9b7fc092214a799c7e1bbeb
[thirdparty/util-linux.git] / configure.ac
1 AC_INIT(util-linux-ng, 2.14-rc2, kzak@redhat.com)
2
3 AC_PREREQ(2.60)
4
5 AC_CONFIG_AUX_DIR(config)
6
7 AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9 dist-bzip2])
8
9 AC_CONFIG_SRCDIR(mount/mount.c)
10
11 AC_PREFIX_DEFAULT([/usr])
12
13 # Check whether exec_prefix=/usr:
14 case $exec_prefix:$prefix in
15 NONE:NONE | NONE:/usr | /usr:*)
16 AC_MSG_NOTICE([Default --exec-prefix detected.])
17 case $bindir in
18 '${exec_prefix}/bin') bindir=/bin
19 AC_MSG_NOTICE([ --bindir defaults to /bin]) ;;
20 esac
21 case $sbindir in
22 '${exec_prefix}/sbin') sbindir=/sbin
23 AC_MSG_NOTICE([ --sbindir defaults to /sbin]) ;;
24 esac ;;
25 esac
26
27 AC_PROG_CC_STDC
28 AC_GNU_SOURCE
29 AC_CANONICAL_HOST
30
31 linux_os=no
32 case ${host_os} in
33 *linux*)
34 linux_os=yes
35 ;;
36 esac
37 AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes)
38
39 AC_PATH_PROG(PERL, perl)
40 AC_PATH_PROG(BLKID, blkid, [], [$PATH:/sbin])
41 AC_PATH_PROG(VOLID, vol_id, [], [$PATH:/lib/udev])
42
43 AC_SYS_LARGEFILE
44
45 AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
46 #ifdef HAVE_LINUX_COMPILER_H
47 #include <linux/compiler.h>
48 #endif
49 ])
50 AC_CHECK_HEADERS(
51 [scsi/scsi.h \
52 langinfo.h \
53 locale.h \
54 sys/user.h \
55 rpcsvc/nfs_prot.h \
56 sys/io.h \
57 pty.h \
58 err.h \
59 linux/tiocl.h \
60 linux/version.h])
61 AC_CHECK_HEADERS([linux/raw.h],
62 [AM_CONDITIONAL([HAVE_RAW], [true])],
63 [AM_CONDITIONAL([HAVE_RAW], [false])])
64
65 AC_CHECK_FUNCS(
66 [inet_aton \
67 fsync \
68 getdomainname \
69 get_current_dir_name \
70 nanosleep \
71 personality \
72 updwtmp \
73 lchown \
74 inotify_init \
75 rpmatch])
76 AC_FUNC_FSEEKO
77
78 dnl Static compilation
79 m4_define([UTIL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk])
80
81 AC_ARG_ENABLE([static-programs],
82 [AS_HELP_STRING([--enable-static-programs=LIST],
83 [link static the programs in LIST (comma-separated,
84 supported for ]m4_defn([UTIL_STATIC_PROGRAMS])[)])])
85
86 case $enable_static_programs in
87 yes) enable_static_programs=m4_quote(UTIL_STATIC_PROGRAMS) ;;
88 no) enable_static_programs= ;;
89 esac
90
91 if test "$enable_static_programs" != ""; then
92 AC_CACHE_CHECK([whether linker accepts -static],
93 [static_cv_option],
94 [SAVE_LDFLAGS="$LDFLAGS"
95 LDFLAGS="$LDFLAGS -static"
96 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
97 #include <stdio.h>
98 ]], [[
99 fflush(stdout);
100 ]])], [static_cv_option=yes],[static_cv_option=no])
101 LDFLAGS="$SAVE_LDFLAGS"
102 ])
103 if test "x$static_cv_option" = xno; then
104 AC_MSG_ERROR([the linker does not accept option -static])
105 fi
106 fi
107 AC_SUBST([LDFLAGS_STATIC], [-static])
108
109 dnl Set all the individual AM_CONDITIONALs
110 m4_foreach([UTIL_PRG], m4_defn([UTIL_STATIC_PROGRAMS]), [
111 case ,$enable_static_programs, in
112 *,UTIL_PRG,*) static_[]UTIL_PRG=yes ;;
113 esac
114 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UTIL_PRG),
115 [test "x$static_[]UTIL_PRG" = xyes])
116 ])
117
118
119
120 dnl UTIL_CHECK_LIB(LIBRARY, FUNCTION, [VARSUFFIX = $1]))
121 dnl The VARSUFFIX is optional and overrides the default behaviour. For example:
122 dnl UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX
123 dnl UTIL_CHECK_LIB(yyy, func) generates have_yyy and HAVE_LIBYYY
124 dnl ---------------------------------
125 AC_DEFUN([UTIL_CHECK_LIB], [
126 m4_define([suffix], m4_default([$3],$1))
127 [have_]suffix=yes
128 m4_ifdef([$3],
129 [AC_CHECK_LIB([$1], [$2], [AC_DEFINE(AS_TR_CPP([HAVE_LIB]suffix), 1)], [[have_]suffix=no])],
130 [AC_CHECK_LIB([$1], [$2], [], [[have_]suffix=no])])
131 AM_CONDITIONAL(AS_TR_CPP([HAVE_]suffix), [test [$have_]suffix = yes])
132 ])
133
134 UTIL_CHECK_LIB(uuid, uuid_is_null)
135 if test "x$have_uuid" = xno; then
136 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
137 fi
138
139 UTIL_CHECK_LIB(util, openpty)
140 UTIL_CHECK_LIB(termcap, tgetnum)
141
142 AC_ARG_WITH([fsprobe],
143 [AS_HELP_STRING([--with-fsprobe], [library to guess filesystems (blkid|volume_id), default is blkid])],
144 [], [with_fsprobe=blkid]
145 )
146
147 AM_CONDITIONAL(HAVE_BLKID, false)
148 AM_CONDITIONAL(HAVE_VOLUME_ID, false)
149
150 have_blkid=no
151 have_volume_id=no
152 if test "x$with_fsprobe" = xblkid; then
153 UTIL_CHECK_LIB(blkid, blkid_known_fstype)
154 elif test "x$with_fsprobe" = xvolume_id; then
155 UTIL_CHECK_LIB(volume_id, volume_id_encode_string)
156 fi
157
158 if test "x$have_blkid" = xno && test "x$have_volume_id" = xno; then
159 AC_MSG_ERROR([blkid or volume_id is needed to build util-linux-ng.])
160 fi
161
162 dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
163 dnl ----------------------------------
164 AC_DEFUN([UTIL_PKG_STATIC], [
165 if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
166 $1=`pkg-config --libs --static "$2"`
167 else
168 AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
169 fi
170 ])
171
172 # These default values should work in most cases:
173 : ${BLKID_LIBS='-lblkid'}
174 : ${VOLUMEID_LIBS='-lvolume_id'}
175
176 # ... but for static build, we need to consult pkg-config:
177 if test -n "$enable_static_programs"; then
178 case $with_fsprobe in
179 blkid) UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid]) ;;
180 volume_id) UTIL_PKG_STATIC([VOLUMEID_LIBS_STATIC], [libvolume_id]) ;;
181 esac
182 fi
183
184 AC_ARG_VAR([BLKID_LIBS], [-l options for linking dynamically with blkid])
185 AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
186 AC_ARG_VAR([VOLUMEID_LIBS], [-l options for linking dynamically with volume_id])
187 AC_ARG_VAR([VOLUMEID_LIBS_STATIC], [-l options for linking statically with volume_id])
188
189
190 AM_GNU_GETTEXT_VERSION([0.14.1])
191 AM_GNU_GETTEXT([external])
192 if test -d "$srcdir/po"
193 then
194 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
195 else
196 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"
197 fi
198
199 AC_ARG_WITH([ncurses],
200 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
201 (--without-ncurses disables all ncurses(w) support)]),
202 [], with_ncurses=auto
203 )
204 AM_CONDITIONAL(HAVE_NCURSES, false)
205
206 if test "x$with_ncurses" != xno; then
207 have_ncurses=no
208 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
209 if test "x$with_ncurses" = xauto; then
210 UTIL_CHECK_LIB(ncursesw, tputs, ncurses)
211 if test "x$have_ncurses" = xyes; then
212 NCURSES_LIBS="-lncursesw"
213 fi
214 fi
215 if test "x$have_ncurses" = xno; then
216 UTIL_CHECK_LIB(ncurses, tputs)
217 if test "x$have_ncurses" = xyes; then
218 NCURSES_LIBS="-lncurses"
219 fi
220 fi
221 ])
222 if test "x$have_ncurses" = xno; then
223 AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
224 fi
225 fi
226 AC_SUBST([NCURSES_LIBS])
227
228
229 AC_ARG_WITH([slang],
230 AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
231 [], with_slang=no
232 )
233
234 have_tinfo=no
235 AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
236 AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
237
238 use_slang=no
239 if test "x$with_slang" = xyes; then
240 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], [use_slang=yes])
241 if test "x$use_slang" = xno; then
242 AC_MSG_ERROR([slang selected but slcurses.h not found])
243 fi
244 fi
245 AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
246
247
248 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
249 #define _XOPEN_SOURCE
250 #include <unistd.h>
251 ]], [[
252 char *c = crypt("abc","pw");
253 ]])],[],[
254 LIBS="$LIBS -lcrypt"
255 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
256 #define _XOPEN_SOURCE
257 #include <unistd.h>
258 ]], [[
259 char *c = crypt("abc","pw");
260 ]])],[
261 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
262 need_libcrypt=yes
263 ],[
264 AC_MSG_ERROR([crypt() is not available])
265 ])
266 ])
267
268 AM_CONDITIONAL(NEED_LIBCRYPT, test "x$need_libcrypt" = xyes)
269
270 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
271 #include <stdio.h>
272 ]], [[
273 printf(__progname);
274 ]])],
275 [AC_DEFINE(HAVE___PROGNAME, 1, Do we have __progname?)
276 ])
277
278
279 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
280 #include <wchar.h>
281 #include <wctype.h>
282 #include <stdio.h>
283 ]], [[
284 wchar_t wc;
285 wint_t w;
286 w = fgetwc(stdin);
287 if (w == WEOF) exit(1);
288 wc = w;
289 fputwc(wc,stdout);
290 ]])],
291 [AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?)
292 ])
293
294
295 dnl UTIL_CHECK_SYSCALL(SYSCALL, FALLBACK, ...)
296 dnl Only specify FALLBACK if the SYSCALL
297 dnl you're checking for is a "newish" one
298 dnl -------------------------------------
299 AC_DEFUN([UTIL_CHECK_SYSCALL], [
300 dnl This macro uses host_cpu.
301 AC_REQUIRE([AC_CANONICAL_HOST])
302 AC_CACHE_CHECK([for syscall $1],
303 [util_cv_syscall_$1],
304 [_UTIL_SYSCALL_CHECK_DECL([SYS_$1],
305 [syscall=SYS_$1],
306 [dnl Our libc failed use, so see if we can get the kernel
307 dnl headers to play ball ...
308 _UTIL_SYSCALL_CHECK_DECL([_NR_$1],
309 [syscall=_NR_$1],
310 [
311 syscall=no
312 if test "x$linux_os" = xyes; then
313 case $host_cpu in
314 _UTIL_CHECK_SYSCALL_FALLBACK(m4_shift($@))
315 esac
316 fi
317 ])
318 ])
319 util_cv_syscall_$1=$syscall
320 ])
321 AM_CONDITIONAL([HAVE_]m4_toupper($1), [test "x$util_cv_syscall_$1" != xno])
322 case $util_cv_syscall_$1 in #(
323 no) AC_MSG_WARN([Unable to detect syscall $1.]) ;;
324 SYS_*) ;;
325 *) AC_DEFINE_UNQUOTED([SYS_$1], [$util_cv_syscall_$1],
326 [Fallback syscall number for $1]) ;;
327 esac
328 ])
329
330 dnl _UTIL_SYSCALL_CHECK_DECL(SYMBOL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
331 dnl Check if SYMBOL is declared, using the headers needed for syscall checks.
332 dnl -------------------------------------
333 m4_define([_UTIL_SYSCALL_CHECK_DECL],
334 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
335 #include <sys/syscall.h>
336 #include <unistd.h>
337 ]], [[int test = $1;]])],
338 [$2], [$3])
339 ])
340
341 dnl _UTIL_CHECK_SYSCALL_FALLBACK(PATTERN, VALUE, ...)
342 dnl Helper macro to create the body for the above `case'.
343 dnl -------------------------------------
344 m4_define([_UTIL_CHECK_SYSCALL_FALLBACK],
345 [m4_ifval([$1],
346 [#(
347 $1) syscall="$2" ;;dnl
348 _UTIL_CHECK_SYSCALL_FALLBACK(m4_shiftn(2, $@))])dnl
349 ])
350
351
352 UTIL_CHECK_SYSCALL([pivot_root])
353 UTIL_CHECK_SYSCALL([sched_getaffinity])
354 UTIL_CHECK_SYSCALL([ioprio_set],
355 [alpha], [442],
356 [i*86], [289],
357 [ia64*], [1274],
358 [powerpc*], [273],
359 [s390*], [282],
360 [sparc*], [196],
361 [sh*], [288],
362 [x86_64*], [251])
363 UTIL_CHECK_SYSCALL([ioprio_get],
364 [alpha], [443],
365 [i*86], [290],
366 [ia64*], [1275],
367 [powerpc*], [274],
368 [s390*], [283],
369 [sparc*], [218],
370 [sh*], [289],
371 [x86_64*], [252])
372
373
374 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
375 #include <time.h>
376 #include <unistd.h>
377 ]], [[
378 int a = 0;
379 struct tm *tm = localtime(0);
380 if (a == -1) /* false */
381 sleep(tm->tm_gmtoff);
382 ]])],
383 [AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
384 ])
385
386 AC_CHECK_DECLS([
387 ADDR_NO_RANDOMIZE,
388 FDPIC_FUNCPTRS,
389 MMAP_PAGE_ZERO,
390 ADDR_COMPAT_LAYOUT,
391 READ_IMPLIES_EXEC,
392 ADDR_LIMIT_32BIT,
393 WHOLE_SECONDS,
394 STICKY_TIMEOUTS,
395 ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
396
397 AC_CHECK_HEADERS([sys/swap.h])
398
399 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
400 [[
401 #ifdef HAVE_SYS_SWAP_H
402 # include <sys/swap.h>
403 #endif
404 #include <unistd.h>
405 ]],
406 [[swapon("/dev/null", 0);]])],
407 [AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?])
408 ],
409 [AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
410 ])
411
412
413 dnl UTIL_SET_ARCH(ARCHNAME, PATTERN)
414 dnl ---------------------------------
415 AC_DEFUN([UTIL_SET_ARCH], [
416 cpu_$1=false
417 case "$host" in
418 $2) cpu_$1=true ;;
419 esac
420 AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test "x$cpu_$1" = xtrue])
421 ])
422
423 UTIL_SET_ARCH(I86, i?86-*)
424 UTIL_SET_ARCH(86_64, x86_64*)
425 UTIL_SET_ARCH(IA64, ia64*)
426 UTIL_SET_ARCH(S390, s390*)
427 UTIL_SET_ARCH(SPARC, sparc*)
428 UTIL_SET_ARCH(PPC, ppc*|powerpc*)
429 UTIL_SET_ARCH(M68K, m68*)
430 UTIL_SET_ARCH(MIPS, mips*)
431 UTIL_SET_ARCH(HPPA, hppa*)
432
433 AC_ARG_ENABLE([arch],
434 AS_HELP_STRING([--enable-arch], [do build arch]),
435 [], enable_arch=no
436 )
437 AM_CONDITIONAL(BUILD_ARCH, test "x$enable_arch" = xyes)
438
439 AC_ARG_ENABLE([agetty],
440 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
441 [], enable_agetty=yes
442 )
443 AM_CONDITIONAL(BUILD_AGETTY, test "x$enable_agetty" = xyes)
444
445 AC_ARG_ENABLE([cramfs],
446 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
447 [], enable_cramfs=check
448 )
449
450 if test "x$enable_cramfs" = xno; then
451 build_cramfs=no
452 else
453 build_cramfs=yes
454 dnl Trick: leave the third parameter empty to get the default action.
455 AC_CHECK_LIB(z, crc32, [], build_cramfs=no)
456 case $enable_cramfs:$build_cramfs in
457 yes:no) AC_MSG_ERROR([cramfs selected but libz not found]);;
458 esac
459 fi
460 AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
461
462
463 AC_ARG_ENABLE([elvtune],
464 AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
465 [], enable_elvtune=no
466 )
467 AM_CONDITIONAL(BUILD_ELVTUNE, test "x$enable_elvtune" = xyes)
468
469
470 AC_ARG_ENABLE([init],
471 AS_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
472 [], enable_init=no
473 )
474 AM_CONDITIONAL(BUILD_INIT, test "x$enable_init" = xyes)
475
476
477 AC_ARG_ENABLE([kill],
478 AS_HELP_STRING([--enable-kill], [build kill]),
479 [], enable_kill=no
480 )
481 AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
482
483
484 AC_ARG_ENABLE([last],
485 AS_HELP_STRING([--enable-last], [build last]),
486 [], enable_last=no
487 )
488 AM_CONDITIONAL(BUILD_LAST, test "x$enable_last" = xyes)
489
490
491 AC_ARG_ENABLE([mesg],
492 AS_HELP_STRING([--enable-mesg], [build mesg]),
493 [], enable_mesg=no
494 )
495 AM_CONDITIONAL(BUILD_MESG, test "x$enable_mesg" = xyes)
496
497
498 AC_ARG_ENABLE([partx],
499 AS_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
500 [], enable_partx=no
501 )
502 AM_CONDITIONAL(BUILD_PARTX, test "x$enable_partx" = xyes)
503
504
505 AC_ARG_ENABLE([raw],
506 AS_HELP_STRING([--enable-raw], [build raw]),
507 [], enable_raw=no
508 )
509 AM_CONDITIONAL(BUILD_RAW, test "x$enable_raw" = xyes)
510
511
512 AC_ARG_ENABLE([rdev],
513 AS_HELP_STRING([--enable-rdev], [build rdev on i386]),
514 [], enable_rdev=no
515 )
516 AM_CONDITIONAL(BUILD_RDEV, test "x$enable_rdev" = xyes)
517
518
519 AC_ARG_ENABLE([rename],
520 AS_HELP_STRING([--disable-rename], [do not build rename]),
521 [], enable_rename=yes
522 )
523 AM_CONDITIONAL(BUILD_RENAME, test "x$enable_rename" = xyes)
524
525
526 AC_ARG_ENABLE([reset],
527 AS_HELP_STRING([--enable-reset], [build reset]),
528 [], enable_reset=no
529 )
530 AM_CONDITIONAL(BUILD_RESET, test "x$enable_reset" = xyes)
531
532
533 AC_ARG_ENABLE([login-utils],
534 AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
535 [], enable_login_utils=no
536 )
537 AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$enable_login_utils" = xyes)
538
539 AC_ARG_WITH([pam],
540 [AS_HELP_STRING([--without-pam], [compile login-utils without PAM support])])
541
542 AM_CONDITIONAL(HAVE_PAM, false)
543 if test "x$enable_login_utils" = xyes && test "x$with_pam" != xno; then
544 AC_CHECK_HEADERS([security/pam_misc.h],
545 [AM_CONDITIONAL(HAVE_PAM, true)],
546 [if test "x$with_pam" = xyes; then
547 AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
548 fi
549 ])
550 fi
551
552 AC_ARG_WITH([selinux],
553 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
554 [], with_selinux=no
555 )
556
557 if test "x$with_selinux" = xno; then
558 AM_CONDITIONAL(HAVE_SELINUX, false)
559 else
560 UTIL_CHECK_LIB(selinux, getprevcon)
561 case "$with_selinux:$have_selinux" in
562 yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
563 esac
564 fi
565
566 if test "x$have_selinux" = xyes; then
567 SELINUX_LIBS="-lselinux -lsepol"
568 SELINUX_LIBS_STATIC="-lselinux -lsepol"
569 fi
570 AC_SUBST([SELINUX_LIBS])
571 AC_SUBST([SELINUX_LIBS_STATIC])
572
573 AC_ARG_WITH([audit],
574 AS_HELP_STRING([--with-audit], [compile with audit support]),
575 [], with_audit=no
576 )
577
578 if test "x$with_audit" = xno; then
579 AM_CONDITIONAL(HAVE_AUDIT, false)
580 else
581 UTIL_CHECK_LIB(audit, audit_log_user_message)
582 case "$with_audit:$have_audit" in
583 yes:no)
584 AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
585 ;;
586 esac
587 fi
588
589
590 AC_ARG_ENABLE([schedutils],
591 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
592 [], enable_schedutils=yes
593 )
594 AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$enable_schedutils" = xyes)
595
596
597 AC_ARG_ENABLE([wall],
598 AS_HELP_STRING([--disable-wall], [do not build wall]),
599 [], enable_wall=yes
600 )
601 AM_CONDITIONAL(BUILD_WALL, test "x$enable_wall" = xyes)
602
603
604 AC_ARG_ENABLE([write],
605 AS_HELP_STRING([--enable-write], [build write]),
606 [], enable_write=no
607 )
608 AM_CONDITIONAL(BUILD_WRITE, test "x$enable_write" = xyes)
609
610
611 AC_ARG_ENABLE([chsh-only-listed],
612 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
613 [], enable_chsh_only_listed=yes
614 )
615
616 if test "x$enable_chsh_only_listed" = xyes; then
617 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
618 fi
619
620
621 AC_ARG_ENABLE([login-chown-vcs],
622 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
623 [], enable_login_chown_vcs=no
624 )
625
626 if test "x$enable_login_chown_vcs" = xyes; then
627 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
628 fi
629
630
631 AC_ARG_ENABLE([login-stat-mail],
632 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
633 [], enable_login_stat_mail=no
634 )
635
636 if test "x$enable_login_stat_mail" = xyes; then
637 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
638 fi
639
640
641 AC_ARG_ENABLE([pg-bell],
642 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
643 [], enable_pg_bell=yes
644 )
645
646 if test "x$enable_pg_bell" = xyes; then
647 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
648 fi
649
650
651 AC_ARG_ENABLE([require-password],
652 AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
653 [], enable_require_password=yes
654 )
655
656 if test "x$enable_require_password" = xyes; then
657 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
658 fi
659
660
661 AC_ARG_ENABLE([use-tty-group],
662 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
663 [], enable_use_tty_group=yes
664 )
665 AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes)
666
667 if test "x$enable_use_tty_group" = xyes; then
668 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
669 fi
670
671 AC_ARG_ENABLE([makeinstall-chown],
672 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
673 [], enable_makeinstall_chown=yes
674 )
675 AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes)
676
677
678 AC_ARG_VAR([SUID_CFLAGS],
679 [CFLAGS used for binaries which are usually with the suid bit])
680 AC_ARG_VAR([SUID_LDFLAGS],
681 [LDFLAGS used for binaries which are usually with the suid bit])
682
683 LIBS=""
684
685
686 AC_CONFIG_HEADERS(config.h)
687
688 AC_CONFIG_FILES([
689 Makefile
690 disk-utils/Makefile
691 fdisk/Makefile
692 getopt/Makefile
693 hwclock/Makefile
694 include/Makefile
695 lib/Makefile
696 login-utils/Makefile
697 misc-utils/Makefile
698 mount/Makefile
699 partx/Makefile
700 po/Makefile.in
701 schedutils/Makefile
702 sys-utils/Makefile
703 text-utils/Makefile
704 tests/Makefile
705 tests/helpers/Makefile
706 tests/commands.sh
707 misc-utils/chkdupexe:misc-utils/chkdupexe.pl
708 ])
709
710 AC_OUTPUT