]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
build-sys: release++ (v2.18-rc1)
[thirdparty/util-linux.git] / configure.ac
CommitLineData
eae4075f 1AC_INIT(util-linux-ng, 2.18-rc1, 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 9
eb35c251
GJ
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
12
48d7b13a
KZ
13AC_CONFIG_SRCDIR(mount/mount.c)
14
15a9b48c
SK
15AC_PREFIX_DEFAULT([/usr])
16
33b0be6d
KZ
17dnl version details from <major>.<minor>[-<suffix>]
18PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
19PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
20 | awk -F- '{print $1}')
21PACKAGE_VERSION_RELEASE=0
a0948ffe 22
33b0be6d
KZ
23dnl libblkid version
24LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
eae4075f 25LIBBLKID_DATE="07-Jun-2010"
dc2b8d87
KZ
26LIBBLKID_LT_MAJOR=1
27LIBBLKID_LT_MINOR=1
28LIBBLKID_LT_MICRO=0
29LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR
a0948ffe 30
f6076f55
KZ
31dnl libuuid version
32LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
dc2b8d87
KZ
33LIBUUID_LT_MAJOR=1
34LIBUUID_LT_MINOR=3
35LIBUUID_LT_MICRO=0
36LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR
f6076f55 37
f1cde479
KZ
38dnl libmount version
39LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
40LIBMOUNT_LT_MAJOR=1
41LIBMOUNT_LT_MINOR=1
42LIBMOUNT_LT_MICRO=0
43LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR
44
15a9b48c
SK
45# Check whether exec_prefix=/usr:
46case $exec_prefix:$prefix in
47NONE:NONE | NONE:/usr | /usr:*)
48 AC_MSG_NOTICE([Default --exec-prefix detected.])
49 case $bindir in
50 '${exec_prefix}/bin') bindir=/bin
51 AC_MSG_NOTICE([ --bindir defaults to /bin]) ;;
52 esac
53 case $sbindir in
54 '${exec_prefix}/sbin') sbindir=/sbin
55 AC_MSG_NOTICE([ --sbindir defaults to /sbin]) ;;
971f57f6
KZ
56 esac
57 case $libdir in
58 '${exec_prefix}/lib') libdir=/lib
59 AC_MSG_NOTICE([ --libdir defaults to /lib]) ;;
15a9b48c
SK
60 esac ;;
61esac
48d7b13a 62
cb5212e2 63libdirname=`basename "$libdir"`
b0a0d7d5
KZ
64AC_SUBST([libdirname])
65
996fb358 66# The original default values of {bin,sbin,lib}dir
aaf3e8f5 67usrbin_execdir='${exec_prefix}/bin'
30688dde 68AC_SUBST([usrbin_execdir])
996fb358 69
aaf3e8f5 70usrsbin_execdir='${exec_prefix}/sbin'
30688dde 71AC_SUBST([usrsbin_execdir])
996fb358 72
aaf3e8f5 73usrlib_execdir='${exec_prefix}/'$libdirname
30688dde 74AC_SUBST([usrlib_execdir])
996fb358
KZ
75
76
48d7b13a 77AC_PROG_CC_STDC
240f7101 78AC_GNU_SOURCE
a6996860 79AC_CANONICAL_HOST
85b4c147 80AC_C_CONST
e79829db 81AC_C_VOLATILE
fbaec83b 82AC_C_BIGENDIAN
b12991dd
KZ
83
84dnl libtool-2
85LT_INIT
48d7b13a 86
d06d028a
KZ
87PKG_PROG_PKG_CONFIG
88
22aa5166
KZ
89GTK_DOC_CHECK([1.10])
90AC_PATH_PROG([XSLTPROC], [xsltproc])
91
8c182554
KZ
92linux_os=no
93case ${host_os} in
94 *linux*)
95 linux_os=yes
96 ;;
97esac
49ccbae6 98AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes)
8c182554 99
48d7b13a
KZ
100AC_PATH_PROG(PERL, perl)
101
102AC_SYS_LARGEFILE
103
e460a5bf 104AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
48d7b13a
KZ
105#ifdef HAVE_LINUX_COMPILER_H
106#include <linux/compiler.h>
107#endif
108])
bf962c0a 109AC_CHECK_HEADERS(
a0948ffe
KZ
110 [err.h \
111 errno.h \
112 getopt.h \
bf962c0a 113 langinfo.h \
a0948ffe
KZ
114 linux/fd.h \
115 linux/tiocl.h \
116 linux/version.h \
b832c2fe 117 linux/falloc.h \
55113b15 118 linux/cdrom.h \
b832c2fe 119 fcntl.h \
8b7f16fc 120 locale.h \
754fed0c
KZ
121 stdint.h \
122 inttypes.h \
a0948ffe 123 pty.h \
607c2a72 124 mntent.h \
754fed0c
KZ
125 net/if.h \
126 net/if_dl.h \
127 netinet/in.h \
bf962c0a 128 rpcsvc/nfs_prot.h \
a0948ffe
KZ
129 stdlib.h \
130 sys/disk.h \
131 sys/disklabel.h \
132 sys/ioctl.h \
bf962c0a 133 sys/io.h \
754fed0c 134 sys/time.h \
a0948ffe
KZ
135 sys/mkdev.h \
136 sys/prctl.h \
137 sys/queue.h \
754fed0c 138 sys/sockio.h \
2a7c1f70
KZ
139 sys/socket.h \
140 sys/syscall.h \
754fed0c
KZ
141 sys/file.h \
142 sys/ioctl.h \
a0948ffe
KZ
143 sys/stat.h \
144 sys/types.h \
754fed0c 145 sys/un.h \
a0948ffe 146 sys/user.h \
754fed0c 147 sys/resource.h \
a0948ffe 148 unistd.h ])
fd67be31
SK
149AC_CHECK_HEADERS([linux/raw.h],
150 [AM_CONDITIONAL([HAVE_RAW], [true])],
151 [AM_CONDITIONAL([HAVE_RAW], [false])])
48d7b13a 152
a88057d9
TP
153AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
154
2a7c1f70
KZ
155AC_CHECK_DECL([llseek],
156 [AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
157 [Define to 1 if have llseek prototype])],
158 [],
159 [#include <unistd.h>])
160
161AC_CHECK_DECL([lseek64],
162 [AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
163 [Define to 1 if have lseek64 prototype])],
164 [],
165 [#define _LARGEFILE_SOURCE
166 #define _LARGEFILE64_SOURCE
167 #include <unistd.h>])
168
bf962c0a
SK
169AC_CHECK_FUNCS(
170 [inet_aton \
b7ce600d 171 futimens \
2a7c1f70 172 fstat64 \
bf962c0a
SK
173 fsync \
174 getdomainname \
e27a08ab 175 get_current_dir_name \
437fa54f 176 usleep \
bf962c0a
SK
177 nanosleep \
178 personality \
179 updwtmp \
3ac22f7a 180 jrand48 \
bf962c0a 181 lchown \
a0948ffe
KZ
182 llseek \
183 lseek64 \
184 strtoull \
754fed0c
KZ
185 sysconf \
186 getdtablesize \
187 getrlimit \
188 srandom \
69045d3d
KZ
189 setresgid \
190 setresuid \
69b7e41e
KZ
191 strndup \
192 strnlen \
193 strnchr \
fc7aeb09 194 inotify_init \
a0948ffe 195 prctl \
a67bb3bf 196 posix_fadvise \
acf6ab6f 197 getmntinfo \
a0948ffe 198 __secure_getenv \
bf962c0a 199 rpmatch])
48d7b13a 200AC_FUNC_FSEEKO
48d7b13a 201
940fd28c
KZ
202AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
203
754fed0c
KZ
204AC_CHECK_MEMBER(struct sockaddr.sa_len,
205 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
206 [#include <sys/types.h>
207 #include <sys/socket.h>])
208
8569410c 209dnl Static compilation
642f01a3 210m4_define([UTIL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
8569410c
SK
211
212AC_ARG_ENABLE([static-programs],
213 [AS_HELP_STRING([--enable-static-programs=LIST],
214 [link static the programs in LIST (comma-separated,
215 supported for ]m4_defn([UTIL_STATIC_PROGRAMS])[)])])
216
217case $enable_static_programs in
218yes) enable_static_programs=m4_quote(UTIL_STATIC_PROGRAMS) ;;
219no) enable_static_programs= ;;
220esac
221
8569410c
SK
222dnl Set all the individual AM_CONDITIONALs
223m4_foreach([UTIL_PRG], m4_defn([UTIL_STATIC_PROGRAMS]), [
224 case ,$enable_static_programs, in
225 *,UTIL_PRG,*) static_[]UTIL_PRG=yes ;;
226 esac
227 AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UTIL_PRG),
49ccbae6 228 [test "x$static_[]UTIL_PRG" = xyes])
8569410c
SK
229])
230
f910b559
KZ
231dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
232dnl ----------------------------------
233AC_DEFUN([UTIL_PKG_STATIC], [
234 if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
235 $1=`pkg-config --libs --static "$2"`
236 else
237 AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
238 fi
239])
240
40cc242e
KZ
241dnl UTIL_CHECK_LIB(LIBRARY, FUNCTION, [VARSUFFIX = $1]))
242dnl The VARSUFFIX is optional and overrides the default behaviour. For example:
243dnl UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX
244dnl UTIL_CHECK_LIB(yyy, func) generates have_yyy and HAVE_LIBYYY
fd67be31
SK
245dnl ---------------------------------
246AC_DEFUN([UTIL_CHECK_LIB], [
40cc242e
KZ
247 m4_define([suffix], m4_default([$3],$1))
248 [have_]suffix=yes
249 m4_ifdef([$3],
250 [AC_CHECK_LIB([$1], [$2], [AC_DEFINE(AS_TR_CPP([HAVE_LIB]suffix), 1)], [[have_]suffix=no])],
251 [AC_CHECK_LIB([$1], [$2], [], [[have_]suffix=no])])
252 AM_CONDITIONAL(AS_TR_CPP([HAVE_]suffix), [test [$have_]suffix = yes])
fd67be31 253])
9dc801d2 254
6fed18f2
KZ
255dnl UTIL_SET_FLAGS(CFLAGS, CPPFLAGS, LDFLAGS)
256AC_DEFUN([UTIL_SET_FLAGS], [
257 old_CFLAGS="$CFLAGS"
258 old_CPPFLAGS="$CPPFLAGS"
259 old_LDFLAGS="$LDFLAGS"
260 CFLAGS="$CFLAGS $1"
261 CPPFLAGS="$CPPFLAGS $2"
262 LDFLAGS="$LDFLAGS $3"
263])
264
265dnl UTIL_RESTORE_FLAGS()
266AC_DEFUN([UTIL_RESTORE_FLAGS], [
267 CFLAGS="$old_CFLAGS"
268 CPPFLAGS="$old_CPPFLAGS"
269 LDFLAGS="$old_LDFLAGS"
270])
271
272
d7a01582 273AX_CHECK_TLS
3ac22f7a 274
f910b559
KZ
275AC_ARG_ENABLE([mount],
276 AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
277 [], enable_mount=check
278)
279build_mount=yes
280if test "x$enable_mount" = xcheck; then
281 if test "x$linux_os" = xno; then
282 AC_MSG_WARN([non-linux system; do not build mount utilities])
283 build_mount=no
284 fi
285elif test "x$enable_mount" = xno; then
286 build_mount=no
287fi
288AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes)
289
290
291AC_ARG_ENABLE([fsck],
6c2a09b3
KZ
292 AS_HELP_STRING([--disable-fsck], [do not build fsck]),
293 [], enable_fsck=yes
f910b559
KZ
294)
295AM_CONDITIONAL(BUILD_FSCK, test "x$enable_fsck" = xyes)
296
297
17afb032
KZ
298AC_ARG_ENABLE([libuuid],
299 AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
300 [], enable_libuuid=yes
301)
dc2b8d87
KZ
302AC_SUBST([LIBUUID_VERSION])
303AC_SUBST([LIBUUID_VERSION_INFO])
17afb032
KZ
304AM_CONDITIONAL(BUILD_LIBUUID, test "x$enable_libuuid" = xyes)
305have_uuid=yes
306
307if test "x$enable_libuuid" = xno; then
308 # Check for external (e2fsprogs) libuuid
309 PKG_CHECK_MODULES(UUID, uuid, [have_uuid=yes], [have_uuid=no])
310 if test "x$have_uuid" = xno; then
311 # system without pkg-config or so, try classic check
312 AC_CHECK_LIB(uuid, uuid_is_null, [have_uuid=yes], [have_uuid=no])
313 fi
314 if test "x$have_uuid" = xyes; then
315 UTIL_SET_FLAGS($UUID_CFLAGS, $UUID_CFLAGS, $UUID_LIBS)
316 AC_CHECK_HEADERS([uuid.h uuid/uuid.h], [break], [])
317 UTIL_RESTORE_FLAGS
318 fi
319else
f910b559 320 # internal library
17afb032 321 AC_DEFINE(HAVE_UUID_H, 1, [Define to 1 if you have the <uuid.h> header file.])
9dc801d2
KZ
322fi
323
17afb032
KZ
324if test "x$have_uuid" = xyes; then
325 AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
326else
327 AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
328fi
329AM_CONDITIONAL(HAVE_UUID, test "x$have_uuid" = xyes)
330# default
331: ${UUID_LIBS='-luuid'}
48d7b13a 332
d06d028a 333
2ec884ac
KZ
334AC_ARG_ENABLE([uuidd],
335 AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
336 [], enable_uuidd=auto
337)
338
339case "$enable_uuidd:$have_uuid" in
340yes:no)
341 AC_MSG_ERROR([cannot enable uuidd when libuuid is disabled]) ;;
342auto:*)
343 enable_uuidd=$have_uuid ;;
344esac
345if test "x$enable_uuidd" = xyes; then
346 AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.])
347fi
348AM_CONDITIONAL(BUILD_UUIDD, test "x$enable_uuidd" = xyes)
349
350
f910b559
KZ
351AC_ARG_ENABLE([libblkid],
352 AS_HELP_STRING([--disable-libblkid], [do not build libblkid and blkid utilities]),
353 [], enable_libblkid=yes
40f07ff7 354)
033cf439 355AC_SUBST([LIBBLKID_DATE])
dc2b8d87
KZ
356AC_SUBST([LIBBLKID_VERSION])
357AC_SUBST([LIBBLKID_VERSION_INFO])
f910b559
KZ
358AM_CONDITIONAL(BUILD_LIBBLKID, test "x$enable_libblkid" = xyes)
359AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
360AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
361have_blkid=yes
362
363if test "x$enable_libblkid" = xno; then
364 if test "x$build_mount" = xyes || test "x$enable_fsck" = xyes; then
365 # Check for external (e2fsprogs) libblkid
366 PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [have_blkid=no])
367 if test "x$have_blkid" = xno; then
368 # system without pkg-config or so, try classic check
369 AC_CHECK_LIB(blkid, blkid_get_cache, [have_blkid=yes], [have_blkid=no])
370 fi
371 if test "x$have_blkid" = xyes; then
372 UTIL_SET_FLAGS($BLKID_CFLAGS, $BLKID_CFLAGS, $BLKID_LIBS)
373 AC_CHECK_HEADERS([blkid.h blkid/blkid.h], [break], [])
374 UTIL_RESTORE_FLAGS
375 fi
376 if test -n "$enable_static_programs"; then
377 # TODO check only when mount of fsck are requested
378 UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid])
379 fi
7c950efa 380 fi
f910b559
KZ
381else
382 # internal library
383 AC_DEFINE(HAVE_BLKID_H, 1, [Define to 1 if you have the <blkid.h> header file.])
1a70e0cb 384 AC_DEFINE(HAVE_LIBBLKID_INTERNAL, 1, [Define to 1 if you have the in-tree libblkid.])
b446754d
KZ
385fi
386
f910b559 387if test "x$have_blkid" = xyes; then
d06d028a 388 AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
7177d32e 389else
f910b559
KZ
390 if test "x$build_mount" = xyes; then
391 AC_MSG_ERROR([libblkid is needed to build util-linux-ng mount])
607c2a72 392 fi
f910b559
KZ
393 if test "x$enable_fsck" = xyes; then
394 AC_MSG_ERROR([libblkid is needed to build util-linux-ng fsck])
64754af9 395 fi
64754af9 396fi
f910b559
KZ
397AM_CONDITIONAL(HAVE_BLKID, test "x$have_blkid" = xyes)
398# default
399: ${BLKID_LIBS='-lblkid -luuid'}
8569410c 400
8569410c 401AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
f910b559 402
f1cde479
KZ
403
404AC_ARG_ENABLE([libmount],
405 AS_HELP_STRING([--disable-libmount], [do not build libmount]),
406 [], enable_libmount=yes
407)
8e368761
KZ
408
409case "$enable_libblkid:$enable_libmount" in
410no:yes)
411 AC_MSG_ERROR([cannot enable libmount when libblkid is disabled]) ;;
412esac
413
f1cde479
KZ
414AC_SUBST([LIBMOUNT_VERSION])
415AC_SUBST([LIBMOUNT_VERSION_INFO])
f4ab4ae8 416AC_DEFINE_UNQUOTED(LIBMOUNT_VERSION, "$LIBMOUNT_VERSION", [libmount version string])
f1cde479
KZ
417AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$enable_libmount" = xyes)
418
419
17afb032
KZ
420UTIL_CHECK_LIB(util, openpty)
421UTIL_CHECK_LIB(termcap, tgetnum)
8569410c 422
8eeb575c 423AM_GNU_GETTEXT_VERSION([0.14.1])
48d7b13a 424AM_GNU_GETTEXT([external])
49ccbae6 425if test -d "$srcdir/po"
8eeb575c 426then
1b4a3d89 427 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
8eeb575c
KZ
428else
429 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"
430fi
48d7b13a 431
08d64aa2
KZ
432AC_ARG_WITH([ncurses],
433 AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
434 (--without-ncurses disables all ncurses(w) support)]),
435 [], with_ncurses=auto
436)
437AM_CONDITIONAL(HAVE_NCURSES, false)
438
439if test "x$with_ncurses" != xno; then
440 have_ncurses=no
441 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
442 if test "x$with_ncurses" = xauto; then
9ea8ac37 443 UTIL_CHECK_LIB(ncursesw, initscr, ncurses)
08d64aa2
KZ
444 if test "x$have_ncurses" = xyes; then
445 NCURSES_LIBS="-lncursesw"
446 fi
447 fi
49ccbae6 448 if test "x$have_ncurses" = xno; then
9ea8ac37 449 UTIL_CHECK_LIB(ncurses, initscr)
49ccbae6 450 if test "x$have_ncurses" = xyes; then
08d64aa2
KZ
451 NCURSES_LIBS="-lncurses"
452 fi
453 fi
454 ])
49ccbae6 455 if test "x$have_ncurses" = xno; then
08d64aa2
KZ
456 AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
457 fi
458fi
459AC_SUBST([NCURSES_LIBS])
460
48d7b13a 461
48d7b13a 462AC_ARG_WITH([slang],
7fa4f112 463 AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
271d98e0 464 [], with_slang=no
48d7b13a
KZ
465)
466
46e71118
AM
467have_tinfo=no
468AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
49ccbae6 469AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
46e71118 470
fd67be31 471use_slang=no
49ccbae6 472if test "x$with_slang" = xyes; then
fd67be31 473 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], [use_slang=yes])
49ccbae6 474 if test "x$use_slang" = xno; then
48d7b13a
KZ
475 AC_MSG_ERROR([slang selected but slcurses.h not found])
476 fi
477fi
49ccbae6 478AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
48d7b13a
KZ
479
480
f0bc3fa0
KZ
481AC_ARG_WITH([utempter],
482 AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]),
483 [], with_utempter=no
484)
485
486if test "x$with_utempter" = xyes; then
487 UTIL_CHECK_LIB(utempter, utempter_add_record)
488 if test "x$have_utempter" = xno; then
489 AC_MSG_ERROR([utempter selected but libutempter not found])
490 fi
491else
492 AM_CONDITIONAL(HAVE_UTEMPTER, false)
493fi
494
495
cf002530 496AC_LINK_IFELSE([AC_LANG_PROGRAM([[
48d7b13a
KZ
497#define _XOPEN_SOURCE
498#include <unistd.h>
cf002530 499]], [[
48d7b13a 500char *c = crypt("abc","pw");
cf002530 501]])],[],[
48d7b13a 502 LIBS="$LIBS -lcrypt"
cf002530 503 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48d7b13a
KZ
504 #define _XOPEN_SOURCE
505 #include <unistd.h>
cf002530 506 ]], [[
48d7b13a 507 char *c = crypt("abc","pw");
cf002530 508 ]])],[
48d7b13a
KZ
509 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
510 need_libcrypt=yes
511 ],[
512 AC_MSG_ERROR([crypt() is not available])
513 ])
48d7b13a
KZ
514])
515
49ccbae6 516AM_CONDITIONAL(NEED_LIBCRYPT, test "x$need_libcrypt" = xyes)
48d7b13a 517
cf002530 518AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48d7b13a 519#include <stdio.h>
cf002530 520]], [[
48d7b13a 521printf(__progname);
cf002530
SK
522]])],
523[AC_DEFINE(HAVE___PROGNAME, 1, Do we have __progname?)
524])
48d7b13a
KZ
525
526
869829e4
GJ
527AC_CHECK_TYPES([union semun], [], [], [[
528#include <sys/sem.h>
529]])
530
531
cf002530 532AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48d7b13a
KZ
533#include <wchar.h>
534#include <wctype.h>
535#include <stdio.h>
cf002530 536]], [[
48d7b13a
KZ
537 wchar_t wc;
538 wint_t w;
539 w = fgetwc(stdin);
540 if (w == WEOF) exit(1);
541 wc = w;
542 fputwc(wc,stdout);
cf002530
SK
543]])],
544[AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?)
545])
48d7b13a
KZ
546
547
72065909
MF
548dnl UTIL_CHECK_SYSCALL(SYSCALL, FALLBACK, ...)
549dnl Only specify FALLBACK if the SYSCALL
550dnl you're checking for is a "newish" one
551dnl -------------------------------------
552AC_DEFUN([UTIL_CHECK_SYSCALL], [
553 dnl This macro uses host_cpu.
554 AC_REQUIRE([AC_CANONICAL_HOST])
555 AC_CACHE_CHECK([for syscall $1],
556 [util_cv_syscall_$1],
557 [_UTIL_SYSCALL_CHECK_DECL([SYS_$1],
558 [syscall=SYS_$1],
559 [dnl Our libc failed use, so see if we can get the kernel
560 dnl headers to play ball ...
561 _UTIL_SYSCALL_CHECK_DECL([_NR_$1],
562 [syscall=_NR_$1],
563 [
564 syscall=no
49ccbae6 565 if test "x$linux_os" = xyes; then
8c182554
KZ
566 case $host_cpu in
567 _UTIL_CHECK_SYSCALL_FALLBACK(m4_shift($@))
568 esac
569 fi
72065909
MF
570 ])
571 ])
572 util_cv_syscall_$1=$syscall
573 ])
49ccbae6 574 AM_CONDITIONAL([HAVE_]m4_toupper($1), [test "x$util_cv_syscall_$1" != xno])
72065909
MF
575 case $util_cv_syscall_$1 in #(
576 no) AC_MSG_WARN([Unable to detect syscall $1.]) ;;
577 SYS_*) ;;
578 *) AC_DEFINE_UNQUOTED([SYS_$1], [$util_cv_syscall_$1],
579 [Fallback syscall number for $1]) ;;
580 esac
581])
582
583dnl _UTIL_SYSCALL_CHECK_DECL(SYMBOL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
584dnl Check if SYMBOL is declared, using the headers needed for syscall checks.
585dnl -------------------------------------
586m4_define([_UTIL_SYSCALL_CHECK_DECL],
587[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48d7b13a
KZ
588#include <sys/syscall.h>
589#include <unistd.h>
72065909
MF
590]], [[int test = $1;]])],
591[$2], [$3])
592])
48d7b13a 593
72065909
MF
594dnl _UTIL_CHECK_SYSCALL_FALLBACK(PATTERN, VALUE, ...)
595dnl Helper macro to create the body for the above `case'.
596dnl -------------------------------------
597m4_define([_UTIL_CHECK_SYSCALL_FALLBACK],
598[m4_ifval([$1],
599 [#(
600 $1) syscall="$2" ;;dnl
601 _UTIL_CHECK_SYSCALL_FALLBACK(m4_shiftn(2, $@))])dnl
602])
48d7b13a 603
72065909
MF
604
605UTIL_CHECK_SYSCALL([pivot_root])
606UTIL_CHECK_SYSCALL([sched_getaffinity])
607UTIL_CHECK_SYSCALL([ioprio_set],
608 [alpha], [442],
609 [i*86], [289],
610 [ia64*], [1274],
611 [powerpc*], [273],
612 [s390*], [282],
613 [sparc*], [196],
447ae7b8 614 [sh*], [288],
72065909
MF
615 [x86_64*], [251])
616UTIL_CHECK_SYSCALL([ioprio_get],
617 [alpha], [443],
618 [i*86], [290],
619 [ia64*], [1275],
620 [powerpc*], [274],
621 [s390*], [283],
622 [sparc*], [218],
447ae7b8 623 [sh*], [289],
72065909 624 [x86_64*], [252])
19a224ad 625
d46a5499
KZ
626dnl fallocate could be available as libc function or as syscall only
627UTIL_CHECK_SYSCALL([fallocate])
b832c2fe
YD
628
629dnl check for valid fallocate() function
630dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
631dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
632dnl and program can't be linked.
633dnl AC_CHECK_FUNC can't catch such errors since it's redefining
634dnl function prototype.
635AC_MSG_CHECKING([for valid fallocate() function])
636AC_LINK_IFELSE([
637AC_LANG_PROGRAM([[
638#ifdef HAVE_UNISTD_H
639# include <unistd.h>
640#endif
641#ifdef HAVE_SYS_TYPES_H
642# include <sys/types.h>
643#endif
644#ifdef HAVE_LINUX_FALLOC_H
645# include <linux/falloc.h>
646#endif
647#ifdef HAVE_FCNTL_H
648# include <fcntl.h>
649#endif
650]],[[
651 long ret;
652
653 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
654
655 if (ret != 0) {
656 return 1;
657 }
658 ]])],[
659AC_MSG_RESULT([yes])
660AC_DEFINE(HAVE_FALLOCATE,1,[Have valid fallocate() function])],[
661AC_MSG_RESULT([no])])
19a224ad 662
4205f1fd
MG
663dnl unshare could be available as libc function or as syscall only
664UTIL_CHECK_SYSCALL([unshare])
665AC_CHECK_FUNCS([unshare])
666
cf002530 667AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48d7b13a
KZ
668#include <time.h>
669#include <unistd.h>
cf002530 670]], [[
48d7b13a
KZ
671 int a = 0;
672 struct tm *tm = localtime(0);
673 if (a == -1) /* false */
674 sleep(tm->tm_gmtoff);
cf002530
SK
675]])],
676[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
677])
48d7b13a 678
30e8b186
KZ
679AC_CHECK_MEMBERS([struct termios.c_line],,,
680 [[#include <termios.h>]])
681
6c2f2b9d
KZ
682AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
683 [#include <sys/stat.h>])
684
2d281745
KZ
685AC_CHECK_DECLS([
686 ADDR_NO_RANDOMIZE,
687 FDPIC_FUNCPTRS,
688 MMAP_PAGE_ZERO,
689 ADDR_COMPAT_LAYOUT,
690 READ_IMPLIES_EXEC,
691 ADDR_LIMIT_32BIT,
692 WHOLE_SECONDS,
693 STICKY_TIMEOUTS,
694 ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
48d7b13a 695
22d36665 696AC_CHECK_HEADERS([sys/swap.h])
b3425806
SK
697
698AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
699[[
b3425806
SK
700#ifdef HAVE_SYS_SWAP_H
701# include <sys/swap.h>
702#endif
703#include <unistd.h>
704]],
705[[swapon("/dev/null", 0);]])],
706[AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?])
707],
708[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
709])
710
711
ee32c514
KZ
712AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
713#include <sched.h>
714]])
715
716AM_CONDITIONAL(HAVE_CPU_SET_T, [test "x$have_cpu_set_t" = xyes])
717
718AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
719#include <sched.h>
720]])
721
722
e782f1d4
KZ
723dnl UTIL_SET_ARCH(ARCHNAME, PATTERN)
724dnl ---------------------------------
725AC_DEFUN([UTIL_SET_ARCH], [
726 cpu_$1=false
727 case "$host" in
728 $2) cpu_$1=true ;;
729 esac
49ccbae6 730 AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test "x$cpu_$1" = xtrue])
e782f1d4 731])
48d7b13a 732
e782f1d4
KZ
733UTIL_SET_ARCH(I86, i?86-*)
734UTIL_SET_ARCH(86_64, x86_64*)
735UTIL_SET_ARCH(IA64, ia64*)
736UTIL_SET_ARCH(S390, s390*)
737UTIL_SET_ARCH(SPARC, sparc*)
738UTIL_SET_ARCH(PPC, ppc*|powerpc*)
739UTIL_SET_ARCH(M68K, m68*)
740UTIL_SET_ARCH(MIPS, mips*)
eeadb4f4 741UTIL_SET_ARCH(HPPA, hppa*)
48d7b13a 742
6a97809b
KZ
743AC_ARG_ENABLE([arch],
744 AS_HELP_STRING([--enable-arch], [do build arch]),
745 [], enable_arch=no
746)
49ccbae6 747AM_CONDITIONAL(BUILD_ARCH, test "x$enable_arch" = xyes)
48d7b13a
KZ
748
749AC_ARG_ENABLE([agetty],
7fa4f112 750 AS_HELP_STRING([--disable-agetty], [do not build agetty]),
271d98e0 751 [], enable_agetty=yes
48d7b13a 752)
49ccbae6 753AM_CONDITIONAL(BUILD_AGETTY, test "x$enable_agetty" = xyes)
48d7b13a 754
9cb68977 755AC_ARG_ENABLE([cramfs],
7fa4f112 756 AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
271d98e0 757 [], enable_cramfs=check
9cb68977
KZ
758)
759
49ccbae6 760if test "x$enable_cramfs" = xno; then
fd67be31
SK
761 build_cramfs=no
762else
763 build_cramfs=yes
764 dnl Trick: leave the third parameter empty to get the default action.
765 AC_CHECK_LIB(z, crc32, [], build_cramfs=no)
766 case $enable_cramfs:$build_cramfs in
767 yes:no) AC_MSG_ERROR([cramfs selected but libz not found]);;
768 esac
9cb68977 769fi
49ccbae6 770AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
9cb68977
KZ
771
772
bd671347
KZ
773AC_ARG_ENABLE([switch_root],
774 AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
940fd28c 775 [], enable_switch_root=check
bd671347 776)
940fd28c
KZ
777if test "x$enable_switch_root" = xno; then
778 build_switch_root=no
779else
780 build_switch_root=yes
781 case $enable_switch_root:$linux_os in
782 yes:no) AC_MSG_ERROR([switch_root selected for non-linux system]);;
783 check:no) AC_MSG_WARN([non-linux system; do not build switch_root])
784 build_switch_root=no;;
785 esac
786 if test "x$build_switch_root" = xyes; then
787 case $enable_switch_root:$have_openat in
788 yes:no) AC_MSG_ERROR([switch_root selected but openat() function not found]);;
789 check:no) AC_MSG_WARN([openat() function not found; do not build switch_root])
790 build_switch_root=no;;
791 esac
792 fi
793fi
794AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
bd671347
KZ
795
796
11125e7a
KZ
797AC_ARG_ENABLE([pivot_root],
798 AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
799 [], enable_pivot_root=check
800)
801if test "x$enable_pivot_root" = xno; then
802 build_pivot_root=no
803else
804 build_pivot_root=yes
805 case $enable_pivot_root:$linux_os in
806 yes:no) AC_MSG_ERROR([pivot_root selected for non-linux system]);;
807 check:no) AC_MSG_WARN([non-linux system; do not build pivot_root])
808 build_pivot_root=no;;
809 esac
810 if test "x$build_pivot_root" = xyes; then
811 case $enable_pivot_root:$util_cv_syscall_pivot_root in
812 yes:no) AC_MSG_ERROR([pivot_root selected but pivot_root syscall not found]);;
813 check:no) AC_MSG_WARN([pivot_root syscall not found; do not build pivot_root])
814 build_pivot_root=no;;
815 esac
816 fi
817fi
4a2ecf0a 818AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes)
11125e7a
KZ
819
820
821AC_ARG_ENABLE([fallocate],
822 AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
823 [], enable_fallocate=check
824)
825if test "x$enable_fallocate" = xno; then
826 build_fallocate=no
827else
828 build_fallocate=yes
829 case $enable_fallocate:$linux_os in
830 yes:no) AC_MSG_ERROR([fallocate selected for non-linux system]);;
831 check:no) AC_MSG_WARN([non-linux system; do not build fallocate])
832 build_fallocate=no;;
833 esac
834 if test "x$build_fallocate" = xyes; then
835 case $enable_fallocate:$util_cv_syscall_fallocate in
836 yes:no) AC_MSG_ERROR([fallocate selected but fallocate syscall not found]);;
837 check:no) AC_MSG_WARN([fallocate syscall not found; do not build fallocate])
838 build_fallocate=no;;
839 esac
840 fi
841fi
842AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = xyes)
843
844
845AC_ARG_ENABLE([unshare],
846 AS_HELP_STRING([--disable-unshare], [do not build unshare]),
847 [], enable_unshare=check
848)
849if test "x$enable_unshare" = xno; then
850 build_unshare=no
851else
852 build_unshare=yes
853 case $enable_unshare:$linux_os in
854 yes:no) AC_MSG_ERROR([unshare selected for non-linux system]);;
855 check:no) AC_MSG_WARN([non-linux system; do not build unshare])
856 build_unshare=no;;
857 esac
858 if test "x$build_unshare" = xyes; then
859 case $enable_unshare:$util_cv_syscall_unshare in
860 yes:no) AC_MSG_ERROR([unshare selected but unshare syscall not found]);;
861 check:no) AC_MSG_WARN([unshare syscall not found; do not build unshare])
862 build_unshare=no;;
863 esac
864 fi
865fi
866AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
867
868
869
48d7b13a 870AC_ARG_ENABLE([elvtune],
7fa4f112 871 AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
271d98e0 872 [], enable_elvtune=no
48d7b13a 873)
49ccbae6 874AM_CONDITIONAL(BUILD_ELVTUNE, test "x$enable_elvtune" = xyes)
48d7b13a
KZ
875
876
877AC_ARG_ENABLE([init],
7fa4f112 878 AS_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
271d98e0 879 [], enable_init=no
48d7b13a 880)
49ccbae6 881AM_CONDITIONAL(BUILD_INIT, test "x$enable_init" = xyes)
48d7b13a
KZ
882
883
884AC_ARG_ENABLE([kill],
7fa4f112 885 AS_HELP_STRING([--enable-kill], [build kill]),
271d98e0 886 [], enable_kill=no
48d7b13a 887)
49ccbae6 888AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
48d7b13a
KZ
889
890
891AC_ARG_ENABLE([last],
7fa4f112 892 AS_HELP_STRING([--enable-last], [build last]),
271d98e0 893 [], enable_last=no
48d7b13a 894)
49ccbae6 895AM_CONDITIONAL(BUILD_LAST, test "x$enable_last" = xyes)
48d7b13a
KZ
896
897
898AC_ARG_ENABLE([mesg],
7fa4f112 899 AS_HELP_STRING([--enable-mesg], [build mesg]),
271d98e0 900 [], enable_mesg=no
48d7b13a 901)
49ccbae6 902AM_CONDITIONAL(BUILD_MESG, test "x$enable_mesg" = xyes)
48d7b13a
KZ
903
904
905AC_ARG_ENABLE([partx],
7fa4f112 906 AS_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
271d98e0 907 [], enable_partx=no
48d7b13a 908)
49ccbae6 909AM_CONDITIONAL(BUILD_PARTX, test "x$enable_partx" = xyes)
48d7b13a
KZ
910
911
912AC_ARG_ENABLE([raw],
7fa4f112 913 AS_HELP_STRING([--enable-raw], [build raw]),
271d98e0 914 [], enable_raw=no
48d7b13a 915)
49ccbae6 916AM_CONDITIONAL(BUILD_RAW, test "x$enable_raw" = xyes)
48d7b13a
KZ
917
918
48d7b13a 919AC_ARG_ENABLE([rename],
7fa4f112 920 AS_HELP_STRING([--disable-rename], [do not build rename]),
271d98e0 921 [], enable_rename=yes
48d7b13a 922)
49ccbae6 923AM_CONDITIONAL(BUILD_RENAME, test "x$enable_rename" = xyes)
48d7b13a
KZ
924
925
926AC_ARG_ENABLE([reset],
7fa4f112 927 AS_HELP_STRING([--enable-reset], [build reset]),
271d98e0 928 [], enable_reset=no
48d7b13a 929)
49ccbae6 930AM_CONDITIONAL(BUILD_RESET, test "x$enable_reset" = xyes)
48d7b13a
KZ
931
932
933AC_ARG_ENABLE([login-utils],
7fa4f112 934 AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
271d98e0 935 [], enable_login_utils=no
48d7b13a 936)
49ccbae6 937AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$enable_login_utils" = xyes)
48d7b13a 938
9cb68977 939AC_ARG_WITH([pam],
7fa4f112 940 [AS_HELP_STRING([--without-pam], [compile login-utils without PAM support])])
9cb68977 941
fd67be31 942AM_CONDITIONAL(HAVE_PAM, false)
49ccbae6 943if test "x$enable_login_utils" = xyes && test "x$with_pam" != xno; then
fd67be31
SK
944 AC_CHECK_HEADERS([security/pam_misc.h],
945 [AM_CONDITIONAL(HAVE_PAM, true)],
49ccbae6 946 [if test "x$with_pam" = xyes; then
fd67be31
SK
947 AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
948 fi
949 ])
9cb68977 950fi
9cb68977
KZ
951
952AC_ARG_WITH([selinux],
7fa4f112 953 AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
271d98e0 954 [], with_selinux=no
9cb68977
KZ
955)
956
49ccbae6 957if test "x$with_selinux" = xno; then
fd67be31
SK
958 AM_CONDITIONAL(HAVE_SELINUX, false)
959else
960 UTIL_CHECK_LIB(selinux, getprevcon)
49ccbae6 961 case "$with_selinux:$have_selinux" in
fd67be31
SK
962 yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
963 esac
9cb68977 964fi
9cb68977 965
49ccbae6 966if test "x$have_selinux" = xyes; then
8569410c
SK
967 SELINUX_LIBS="-lselinux -lsepol"
968 SELINUX_LIBS_STATIC="-lselinux -lsepol"
28d39b6d
KZ
969 old_LDFLAGS="$LDFLAGS"
970 LDFLAGS="$LDFLAGS $SELINUX_LIBS"
971 # This function is missing in old libselinux 1.xx versions
972 AC_CHECK_FUNCS([security_get_initial_context])
973 LDFLAGS="$old_LDFLAGS"
8569410c
SK
974fi
975AC_SUBST([SELINUX_LIBS])
976AC_SUBST([SELINUX_LIBS_STATIC])
9cb68977 977
bbae9cb0 978AC_ARG_WITH([audit],
7fa4f112 979 AS_HELP_STRING([--with-audit], [compile with audit support]),
271d98e0 980 [], with_audit=no
bbae9cb0
KZ
981)
982
49ccbae6 983if test "x$with_audit" = xno; then
fd67be31
SK
984 AM_CONDITIONAL(HAVE_AUDIT, false)
985else
986 UTIL_CHECK_LIB(audit, audit_log_user_message)
49ccbae6 987 case "$with_audit:$have_audit" in
fd67be31
SK
988 yes:no)
989 AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
990 ;;
991 esac
bbae9cb0 992fi
bbae9cb0 993
48d7b13a 994AC_ARG_ENABLE([schedutils],
7fa4f112 995 AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
271d98e0 996 [], enable_schedutils=yes
48d7b13a 997)
49ccbae6 998AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$enable_schedutils" = xyes)
48d7b13a
KZ
999
1000
1001AC_ARG_ENABLE([wall],
7fa4f112 1002 AS_HELP_STRING([--disable-wall], [do not build wall]),
271d98e0 1003 [], enable_wall=yes
48d7b13a 1004)
49ccbae6 1005AM_CONDITIONAL(BUILD_WALL, test "x$enable_wall" = xyes)
48d7b13a
KZ
1006
1007
1008AC_ARG_ENABLE([write],
7fa4f112 1009 AS_HELP_STRING([--enable-write], [build write]),
271d98e0 1010 [], enable_write=no
48d7b13a 1011)
49ccbae6 1012AM_CONDITIONAL(BUILD_WRITE, test "x$enable_write" = xyes)
48d7b13a
KZ
1013
1014
1015AC_ARG_ENABLE([chsh-only-listed],
7fa4f112 1016 AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
271d98e0 1017 [], enable_chsh_only_listed=yes
48d7b13a
KZ
1018)
1019
49ccbae6 1020if test "x$enable_chsh_only_listed" = xyes; then
48d7b13a
KZ
1021 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
1022fi
1023
1024
1025AC_ARG_ENABLE([login-chown-vcs],
7fa4f112 1026 AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
271d98e0 1027 [], enable_login_chown_vcs=no
48d7b13a
KZ
1028)
1029
49ccbae6 1030if test "x$enable_login_chown_vcs" = xyes; then
48d7b13a
KZ
1031 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
1032fi
1033
1034
1035AC_ARG_ENABLE([login-stat-mail],
7fa4f112 1036 AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
271d98e0 1037 [], enable_login_stat_mail=no
48d7b13a
KZ
1038)
1039
49ccbae6 1040if test "x$enable_login_stat_mail" = xyes; then
48d7b13a
KZ
1041 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
1042fi
1043
1044
1045AC_ARG_ENABLE([pg-bell],
7fa4f112 1046 AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
271d98e0 1047 [], enable_pg_bell=yes
48d7b13a
KZ
1048)
1049
49ccbae6 1050if test "x$enable_pg_bell" = xyes; then
48d7b13a
KZ
1051 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
1052fi
1053
1054
1055AC_ARG_ENABLE([require-password],
7fa4f112 1056 AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
271d98e0 1057 [], enable_require_password=yes
48d7b13a
KZ
1058)
1059
49ccbae6 1060if test "x$enable_require_password" = xyes; then
48d7b13a
KZ
1061 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
1062fi
1063
1064
bb4cb69d
MF
1065AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs])
1066AC_ARG_ENABLE([fs-paths-default],
1067 AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]),
1068 [case "$enableval" in
1069 yes) fs_paths_defaults="FS_PATHS_DEFAULT" ;;
1070 no) fs_paths_defaults="" ;;
1071 *) fs_paths_defaults="$enableval" ;;
1072 esac],
1073 [fs_paths_defaults="FS_PATHS_DEFAULT"]
1074)
1075AC_ARG_ENABLE([fs-paths-extra],
1076 AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]),
1077 [case "$enableval" in
1078 yes|no) fs_paths_extra="" ;;
1079 *) fs_paths_extra="$enableval" ;;
1080 esac],
1081 [fs_paths_extra=""]
1082)
1083fs_paths="$fs_paths_defaults"
1084if test "x$fs_paths_extra" != "x"; then
1085 if test "x$fs_paths" != "x"; then
1086 fs_paths="${fs_paths}:"
1087 fi
1088 fs_paths="${fs_paths}${fs_paths_extra}"
1089fi
1090AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers])
1091
1092
48d7b13a 1093AC_ARG_ENABLE([use-tty-group],
7fa4f112 1094 AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
271d98e0 1095 [], enable_use_tty_group=yes
48d7b13a 1096)
49ccbae6 1097AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes)
48d7b13a 1098
49ccbae6 1099if test "x$enable_use_tty_group" = xyes; then
48d7b13a
KZ
1100 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
1101fi
1102
f3831bbd
KZ
1103AC_ARG_ENABLE([makeinstall-chown],
1104 AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
1105 [], enable_makeinstall_chown=yes
1106)
49ccbae6 1107AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes)
f3831bbd 1108
4c24a7ae
KZ
1109AC_ARG_ENABLE([makeinstall-setuid],
1110 AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
1111 [], enable_makeinstall_setuid=yes
1112)
1113AM_CONDITIONAL(MAKEINSTALL_DO_SETUID, test "x$enable_makeinstall_setuid" = xyes)
1114
06bcee19 1115
1f10890f
SK
1116AC_ARG_VAR([SUID_CFLAGS],
1117 [CFLAGS used for binaries which are usually with the suid bit])
1118AC_ARG_VAR([SUID_LDFLAGS],
1119 [LDFLAGS used for binaries which are usually with the suid bit])
06bcee19 1120
9cb68977 1121LIBS=""
48d7b13a 1122
48d7b13a
KZ
1123
1124AC_CONFIG_HEADERS(config.h)
1125
8eeb575c 1126AC_CONFIG_FILES([
8eeb575c 1127disk-utils/Makefile
562218e6 1128fdisk/Makefile
607c2a72 1129fsck/Makefile
8eeb575c
KZ
1130getopt/Makefile
1131hwclock/Makefile
562218e6 1132include/Makefile
d00ed891 1133lib/Makefile
8eeb575c 1134login-utils/Makefile
20ad4963
KZ
1135Makefile
1136misc-utils/chkdupexe:misc-utils/chkdupexe.pl
8eeb575c
KZ
1137misc-utils/Makefile
1138mount/Makefile
1139partx/Makefile
1140po/Makefile.in
1141schedutils/Makefile
20ad4963
KZ
1142shlibs/blkid/blkid.pc
1143shlibs/blkid/Makefile
1e018c15
KZ
1144shlibs/blkid/docs/Makefile
1145shlibs/blkid/docs/version.xml
20ad4963 1146shlibs/blkid/src/Makefile
033cf439 1147shlibs/blkid/src/blkid.h
219227c2 1148shlibs/blkid/src/superblocks/Makefile
cc33d693 1149shlibs/blkid/src/topology/Makefile
e4799a35 1150shlibs/blkid/src/partitions/Makefile
e21677fe 1151shlibs/blkid/samples/Makefile
f1cde479
KZ
1152shlibs/mount/mount.pc
1153shlibs/mount/Makefile
1154shlibs/mount/src/Makefile
1155shlibs/mount/src/mount.h
3d735589
KZ
1156shlibs/mount/docs/Makefile
1157shlibs/mount/docs/version.xml
754fed0c
KZ
1158shlibs/uuid/uuid.pc
1159shlibs/uuid/Makefile
1160shlibs/uuid/man/Makefile
1161shlibs/uuid/src/Makefile
20ad4963 1162shlibs/Makefile
8eeb575c 1163sys-utils/Makefile
e83446da 1164tests/commands.sh
20ad4963
KZ
1165tests/helpers/Makefile
1166tests/Makefile
1167text-utils/Makefile
8eeb575c 1168])
48d7b13a 1169
996fb358 1170
48d7b13a 1171AC_OUTPUT