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