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