1 AC_INIT(util-linux-ng, 2.13devel, kzak@redhat.com)
5 AC_CONFIG_AUX_DIR(config)
7 AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9])
9 AC_CONFIG_SRCDIR(mount/mount.c)
17 AC_PATH_PROG(PERL, perl)
21 AC_CHECK_HEADERS(scsi/scsi.h)
22 AC_CHECK_HEADERS(linux/compiler.h)
23 AC_CHECK_HEADERS(linux/blkpg.h,,,[
24 #ifdef HAVE_LINUX_COMPILER_H
25 #include <linux/compiler.h>
28 AC_CHECK_HEADERS(langinfo.h)
29 AC_CHECK_HEADERS(sys/user.h)
30 AC_CHECK_HEADERS(rpcsvc/nfs_prot.h)
31 AC_CHECK_HEADERS(sys/io.h)
32 AC_CHECK_HEADERS(pty.h)
34 AC_CHECK_HEADERS(linux/raw.h)
35 AM_CONDITIONAL(HAVE_RAW, test x$ac_cv_header_linux_raw_h = xyes)
39 AC_CHECK_FUNCS(inet_aton)
41 AC_CHECK_FUNCS(getdomainname)
42 AC_CHECK_FUNCS(nanosleep)
43 AC_CHECK_FUNCS(personality)
44 AC_CHECK_FUNCS(updwtmp)
46 AC_CHECK_FUNCS(lchown)
47 AC_CHECK_FUNCS(rpmatch)
50 AC_CHECK_LIB(uuid, uuid_is_null)
51 AM_CONDITIONAL(HAVE_UUID, test x$ac_cv_lib_uuid_uuid_is_null = xyes)
53 AC_CHECK_LIB(util, openpty)
54 AM_CONDITIONAL(HAVE_LIBUTIL, test x$ac_cv_lib_util_openpty = xyes)
56 AC_CHECK_LIB(termcap, tgetnum)
57 AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes)
59 AC_CHECK_LIB(blkid, blkid_known_fstype)
60 AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
63 AM_GNU_GETTEXT_VERSION([0.14.1])
64 AM_GNU_GETTEXT([external])
67 ALL_LINGUAS=`(cd po > /dev/null && ls *.po) | sed 's+\.po$++'`
69 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"
72 AC_CHECK_HEADERS(ncurses.h)
73 AC_CHECK_HEADERS(ncurses/ncurses.h)
76 if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes; then
78 AC_MSG_NOTICE([you have ncurses])
80 AC_MSG_NOTICE([you do not have ncurses])
83 AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
87 AC_HELP_STRING([--with-slang], [compile cfdisk with slang]),
88 with_slang=$withval, with_slang=no
91 if test x$with_slang = xyes; then
92 AC_CHECK_HEADERS(slcurses.h)
93 AC_CHECK_HEADERS(slang/slcurses.h)
94 if test x$ac_cv_header_slcurses_h = xyes || test x$ac_cv_header_slang_slcurses_h = xyes; then
97 AC_MSG_ERROR([slang selected but slcurses.h not found])
101 AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes)
105 #define _XOPEN_SOURCE
108 char *c = crypt("abc","pw");
112 #define _XOPEN_SOURCE
115 char *c = crypt("abc","pw");
117 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
120 AC_MSG_ERROR([crypt() is not available])
124 AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
130 ],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?])
142 if (w == WEOF) exit(1);
145 ],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?]))
149 #include <sys/syscall.h>
152 int test = SYS_pivot_root;
153 ],have_pivot_root=true)
155 AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue)
163 struct tm *tm = localtime(0);
164 if (a == -1) /* false */
165 sleep(tm->tm_gmtoff);
166 ],[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])])
170 i?86-*) intel=true ;;
172 sparc*) sparc=true ;;
175 AM_CONDITIONAL(INTEL, test x$intel = xtrue)
176 AM_CONDITIONAL(M68K, test x$m68k = xtrue)
177 AM_CONDITIONAL(SPARC, test x$sparc = xtrue)
180 AC_ARG_ENABLE([agetty],
181 AC_HELP_STRING([--disable-agetty], [do not build agetty]),
182 enable_agetty=$enableval, enable_agetty=yes
184 AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes)
187 AC_ARG_ENABLE([cramfs],
188 AC_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
189 enable_cramfs=$enableval, enable_cramfs=check
192 if test x$enable_cramfs != xno; then
193 AC_CHECK_LIB(z, crc32)
194 build_cramfs=$ac_cv_lib_z_crc32
195 if test x$enable_cramfs = xyes && test x$ac_cv_lib_z_crc32 = xno; then
196 AC_MSG_ERROR([cramfs selected but libz not found])
200 AM_CONDITIONAL(BUILD_CRAMFS, test x$build_cramfs = xyes)
203 AC_ARG_ENABLE([elvtune],
204 AC_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
205 enable_elvtune=$enableval, enable_elvtune=no
207 AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes)
210 AC_ARG_ENABLE([init],
211 AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
212 enable_init=$enableval, enable_init=no
214 AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes)
217 AC_ARG_ENABLE([kill],
218 AC_HELP_STRING([--enable-kill], [build kill]),
219 enable_kill=$enableval, enable_kill=no
221 AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes)
224 AC_ARG_ENABLE([last],
225 AC_HELP_STRING([--enable-last], [build last]),
226 enable_last=$enableval, enable_last=no
228 AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes)
231 AC_ARG_ENABLE([mesg],
232 AC_HELP_STRING([--enable-mesg], [build mesg]),
233 enable_mesg=$enableval, enable_mesg=no
235 AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes)
238 AC_ARG_ENABLE([partx],
239 AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
240 enable_partx=$enableval, enable_partx=no
242 AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes)
246 AC_HELP_STRING([--enable-raw], [build raw]),
247 enable_raw=$enableval, enable_raw=no
249 AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes)
252 AC_ARG_ENABLE([rdev],
253 AC_HELP_STRING([--enable-rdev], [build rdev on i386]),
254 enable_rdev=$enableval, enable_rdev=no
256 AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes)
259 AC_ARG_ENABLE([rename],
260 AC_HELP_STRING([--disable-rename], [do not build rename]),
261 enable_agetty=$enableval, enable_rename=yes
263 AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes)
266 AC_ARG_ENABLE([reset],
267 AC_HELP_STRING([--enable-reset], [build reset]),
268 enable_reset=$enableval, enable_reset=no
270 AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes)
273 AC_ARG_ENABLE([login-utils],
274 AC_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
275 enable_login_utils=$enableval, enable_login_utils=no
277 AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes)
280 AC_HELP_STRING([--without-pam], [compile login-utils without PAM support]),
281 with_pam=$withval, with_pam=yes
284 if test x$enable_login_utils = xyes && test x$with_pam != xno; then
285 AC_CHECK_HEADERS(security/pam_misc.h)
286 if test x$with_pam = xyes && test x$ac_cv_header_security_pam_misc_h = xno; then
287 AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
290 AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes)
292 AC_ARG_WITH([selinux],
293 AC_HELP_STRING([--with-selinux], [compile with SELinux support]),
294 with_selinux=$withval, with_selinux=no
297 if test x$with_selinux != xno; then
298 AC_CHECK_LIB(selinux, getprevcon)
299 if test x$with_selinux = xyes && test x$ac_cv_lib_selinux_getprevcon = xno; then
300 AC_MSG_ERROR([SELinux selected but libselinux not found])
303 AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes)
307 AC_HELP_STRING([--with-audit], [compile with audit support]),
308 with_audit=$withval, with_audit=no
311 if test x$with_audit != xno; then
312 AC_CHECK_LIB(audit, audit_log_user_message)
313 if test x$with_audit = xyes && test x$ac_cv_lib_audit_audit_log_user_message = xno; then
314 AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
317 AM_CONDITIONAL(HAVE_AUDIT, test x$ac_cv_lib_audit_audit_log_user_message = xyes)
320 AC_ARG_ENABLE([schedutils],
321 AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
322 enable_schedutils=$enableval, enable_schedutils=yes
324 AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes)
327 AC_ARG_ENABLE([wall],
328 AC_HELP_STRING([--disable-wall], [do not build wall]),
329 enable_wall=$enableval, enable_wall=yes
331 AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes)
334 AC_ARG_ENABLE([write],
335 AC_HELP_STRING([--enable-write], [build write]),
336 enable_write=$enableval, enable_write=no
338 AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes)
341 AC_ARG_ENABLE([chsh-only-listed],
342 AC_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
343 enable_login_chsh_only_listed=$enableval, enable_chsh_only_listed=yes
346 if test x$enable_chsh_only_listed = xyes; then
347 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
351 AC_ARG_ENABLE([login-chown-vcs],
352 AC_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
353 enable_login_chown_vcs=$enableval, enable_login_chown_vcs=no
356 if test x$enable_login_chown_vcs = xyes; then
357 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
361 AC_ARG_ENABLE([login-stat-mail],
362 AC_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
363 enable_login_stat_mail=$enableval, enable_login_stat_mail=no
366 if test x$enable_login_stat_mail = xyes; then
367 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
371 AC_ARG_ENABLE([pg-bell],
372 AC_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
373 enable_pg_bell=$enableval, enable_pg_bell=yes
376 if test x$enable_pg_bell = xyes; then
377 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
381 AC_ARG_ENABLE([require-password],
382 AC_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
383 enable_require_password=$enableval, enable_require_password=yes
386 if test x$enable_require_password = xyes; then
387 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
391 AC_ARG_ENABLE([use-tty-group],
392 AC_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
393 enable_use_tty_group=$enableval, enable_use_tty_group=yes
395 AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes)
397 if test x$enable_use_tty_group = xyes; then
398 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
402 AC_SUBST([SUID_CFLAGS])
404 CPPFLAGS="-fsigned-char -fomit-frame-pointer $CPPFLAGS"
409 AC_CONFIG_HEADERS(config.h)
428 tests/helpers/Makefile