1
AC_INIT(util-linux-ng, 2.13.1, kzak@redhat.com)
5
AC_CONFIG_AUX_DIR(config)
7
AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9 dist-bzip2])
9
AC_CONFIG_SRCDIR(mount/mount.c)
11
AC_PREFIX_DEFAULT([/usr])
13
# Check whether exec_prefix=/usr:
14
case $exec_prefix:$prefix in
15
NONE:NONE | NONE:/usr | /usr:*)
16
AC_MSG_NOTICE([Default --exec-prefix detected.])
18
'${exec_prefix}/bin') bindir=/bin
19
AC_MSG_NOTICE([ --bindir defaults to /bin]) ;;
22
'${exec_prefix}/sbin') sbindir=/sbin
23
AC_MSG_NOTICE([ --sbindir defaults to /sbin]) ;;
30
AC_PATH_PROG(PERL, perl)
31
AC_PATH_PROG(BLKID, blkid, [], [$PATH:/sbin])
32
AC_PATH_PROG(VOLID, vol_id, [], [$PATH:/lib/udev])
36
AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h], [], [], [
37
#ifdef HAVE_LINUX_COMPILER_H
38
#include <linux/compiler.h>
49
AC_CHECK_HEADERS([linux/raw.h],
50
[AM_CONDITIONAL([HAVE_RAW], [true])],
51
[AM_CONDITIONAL([HAVE_RAW], [false])])
64
dnl UTIL_CHECK_LIB(LIBRARY, FUNCTION)
65
dnl ---------------------------------
66
AC_DEFUN([UTIL_CHECK_LIB], [
67
dnl The trick is to keep the third argument to AC_CHECK_LIB empty,
68
dnl and thus keep the default action.
70
AC_CHECK_LIB([$1], [$2], [], [have_$1=no])
71
AM_CONDITIONAL(AS_TR_CPP(HAVE_$1), [test $have_$1 = yes])
74
UTIL_CHECK_LIB(uuid, uuid_is_null)
75
if test $have_uuid = no; then
76
AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
79
UTIL_CHECK_LIB(util, openpty)
80
UTIL_CHECK_LIB(termcap, tgetnum)
82
AC_ARG_WITH([fsprobe],
83
[AS_HELP_STRING([--with-fsprobe], [library to guess filesystems (blkid|volume_id), default is blkid])],
84
[], [with_fsprobe=blkid]
87
AM_CONDITIONAL(HAVE_BLKID, false)
88
AM_CONDITIONAL(HAVE_VOLUME_ID, false)
92
if test x$with_fsprobe = xblkid; then
93
UTIL_CHECK_LIB(blkid, blkid_known_fstype)
94
elif test x$with_fsprobe = xvolume_id; then
95
UTIL_CHECK_LIB(volume_id, volume_id_encode_string)
98
if test $have_blkid = no && test $have_volume_id = no; then
99
AC_MSG_ERROR([blkid or volume_id is needed to build util-linux-ng.])
102
AM_GNU_GETTEXT_VERSION([0.14.1])
103
AM_GNU_GETTEXT([external])
104
if test -d $srcdir/po
106
ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
108
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"
112
AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [have_ncurses=yes])
113
case $have_ncurses in
115
AC_MSG_NOTICE([you have ncurses])
116
AC_DEFINE(HAVE_NCURSES, 1, [Do we have -lncurses?])
119
AC_MSG_NOTICE([you do not have ncurses])
122
AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
125
AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
130
AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
131
AM_CONDITIONAL(HAVE_TINFO, test x$have_tinfo = xyes)
134
if test x$with_slang = xyes; then
135
AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], [use_slang=yes])
136
if test $use_slang = no; then
137
AC_MSG_ERROR([slang selected but slcurses.h not found])
140
AM_CONDITIONAL(USE_SLANG, test $use_slang = yes)
143
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
144
#define _XOPEN_SOURCE
147
char *c = crypt("abc","pw");
150
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
151
#define _XOPEN_SOURCE
154
char *c = crypt("abc","pw");
156
AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
159
AC_MSG_ERROR([crypt() is not available])
163
AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
165
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
170
[AC_DEFINE(HAVE___PROGNAME, 1, Do we have __progname?)
174
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
182
if (w == WEOF) exit(1);
186
[AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?)
190
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
191
#include <sys/syscall.h>
194
int test = SYS_pivot_root;
196
[AM_CONDITIONAL(HAVE_PIVOT_ROOT, true)],
197
[AM_CONDITIONAL(HAVE_PIVOT_ROOT, false)])
200
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
201
#include <sys/syscall.h>
204
int test = SYS_sched_getaffinity;
206
[AM_CONDITIONAL(HAVE_SCHED_GETAFFINITY, true)],
207
[AM_CONDITIONAL(HAVE_SCHED_GETAFFINITY, false)])
210
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
215
struct tm *tm = localtime(0);
216
if (a == -1) /* false */
217
sleep(tm->tm_gmtoff);
219
[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
223
AC_CHECK_HEADERS([sys/swap.h])
225
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
227
#ifdef HAVE_SYS_SWAP_H
228
# include <sys/swap.h>
232
[[swapon("/dev/null", 0);]])],
233
[AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?])
235
[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
239
dnl UTIL_SET_ARCH(ARCHNAME, PATTERN)
240
dnl ---------------------------------
241
AC_DEFUN([UTIL_SET_ARCH], [
246
AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test x$cpu_$1 = xtrue])
249
UTIL_SET_ARCH(I86, i?86-*)
250
UTIL_SET_ARCH(86_64, x86_64*)
251
UTIL_SET_ARCH(IA64, ia64*)
252
UTIL_SET_ARCH(S390, s390*)
253
UTIL_SET_ARCH(SPARC, sparc*)
254
UTIL_SET_ARCH(PPC, ppc*|powerpc*)
255
UTIL_SET_ARCH(M68K, m68*)
256
UTIL_SET_ARCH(MIPS, mips*)
257
UTIL_SET_ARCH(HPPA, hppa*)
259
AC_ARG_ENABLE([arch],
260
AS_HELP_STRING([--enable-arch], [do build arch]),
263
AM_CONDITIONAL(BUILD_ARCH, test x$enable_arch = xyes)
265
AC_ARG_ENABLE([agetty],
266
AS_HELP_STRING([--disable-agetty], [do not build agetty]),
267
[], enable_agetty=yes
269
AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes)
271
AC_ARG_ENABLE([cramfs],
272
AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
273
[], enable_cramfs=check
276
if test $enable_cramfs = no; then
280
dnl Trick: leave the third parameter empty to get the default action.
281
AC_CHECK_LIB(z, crc32, [], build_cramfs=no)
282
case $enable_cramfs:$build_cramfs in
283
yes:no) AC_MSG_ERROR([cramfs selected but libz not found]);;
286
AM_CONDITIONAL(BUILD_CRAMFS, test $build_cramfs = yes)
289
AC_ARG_ENABLE([elvtune],
290
AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
291
[], enable_elvtune=no
293
AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes)
296
AC_ARG_ENABLE([init],
297
AS_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
300
AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes)
303
AC_ARG_ENABLE([kill],
304
AS_HELP_STRING([--enable-kill], [build kill]),
307
AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes)
310
AC_ARG_ENABLE([last],
311
AS_HELP_STRING([--enable-last], [build last]),
314
AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes)
317
AC_ARG_ENABLE([mesg],
318
AS_HELP_STRING([--enable-mesg], [build mesg]),
321
AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes)
324
AC_ARG_ENABLE([partx],
325
AS_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
328
AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes)
332
AS_HELP_STRING([--enable-raw], [build raw]),
335
AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes)
338
AC_ARG_ENABLE([rdev],
339
AS_HELP_STRING([--enable-rdev], [build rdev on i386]),
342
AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes)
345
AC_ARG_ENABLE([rename],
346
AS_HELP_STRING([--disable-rename], [do not build rename]),
347
[], enable_rename=yes
349
AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes)
352
AC_ARG_ENABLE([reset],
353
AS_HELP_STRING([--enable-reset], [build reset]),
356
AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes)
359
AC_ARG_ENABLE([login-utils],
360
AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
361
[], enable_login_utils=no
363
AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes)
366
[AS_HELP_STRING([--without-pam], [compile login-utils without PAM support])])
368
AM_CONDITIONAL(HAVE_PAM, false)
369
if test x$enable_login_utils = xyes && test x$with_pam != xno; then
370
AC_CHECK_HEADERS([security/pam_misc.h],
371
[AM_CONDITIONAL(HAVE_PAM, true)],
372
[if test x$with_pam = xyes; then
373
AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
378
AC_ARG_WITH([selinux],
379
AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
383
if test x$with_selinux = xno; then
384
AM_CONDITIONAL(HAVE_SELINUX, false)
386
UTIL_CHECK_LIB(selinux, getprevcon)
387
case $with_selinux:$have_selinux in
388
yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
394
AS_HELP_STRING([--with-audit], [compile with audit support]),
398
if test x$with_audit = xno; then
399
AM_CONDITIONAL(HAVE_AUDIT, false)
401
UTIL_CHECK_LIB(audit, audit_log_user_message)
402
case $with_audit:$have_audit in
404
AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
410
AC_ARG_ENABLE([schedutils],
411
AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
412
[], enable_schedutils=yes
414
AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes)
417
AC_ARG_ENABLE([wall],
418
AS_HELP_STRING([--disable-wall], [do not build wall]),
421
AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes)
424
AC_ARG_ENABLE([write],
425
AS_HELP_STRING([--enable-write], [build write]),
428
AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes)
431
AC_ARG_ENABLE([chsh-only-listed],
432
AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
433
[], enable_chsh_only_listed=yes
436
if test x$enable_chsh_only_listed = xyes; then
437
AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
441
AC_ARG_ENABLE([login-chown-vcs],
442
AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
443
[], enable_login_chown_vcs=no
446
if test x$enable_login_chown_vcs = xyes; then
447
AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
451
AC_ARG_ENABLE([login-stat-mail],
452
AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
453
[], enable_login_stat_mail=no
456
if test x$enable_login_stat_mail = xyes; then
457
AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
461
AC_ARG_ENABLE([pg-bell],
462
AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
463
[], enable_pg_bell=yes
466
if test x$enable_pg_bell = xyes; then
467
AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
471
AC_ARG_ENABLE([require-password],
472
AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
473
[], enable_require_password=yes
476
if test x$enable_require_password = xyes; then
477
AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
481
AC_ARG_ENABLE([use-tty-group],
482
AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
483
[], enable_use_tty_group=yes
485
AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes)
487
if test x$enable_use_tty_group = xyes; then
488
AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
491
AC_ARG_ENABLE([makeinstall-chown],
492
AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
493
[], enable_makeinstall_chown=yes
495
AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test x$enable_makeinstall_chown = xyes)
498
AC_ARG_VAR([SUID_CFLAGS],
499
[CFLAGS used for binaries which are usually with the suid bit])
500
AC_ARG_VAR([SUID_LDFLAGS],
501
[LDFLAGS used for binaries which are usually with the suid bit])
506
AC_CONFIG_HEADERS(config.h)
524
tests/helpers/Makefile
526
misc-utils/chkdupexe:misc-utils/chkdupexe.pl
527
misc-utils/scriptreplay:misc-utils/scriptreplay.pl