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