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