1 AC_INIT(util-linux, 2.13-pre4, bunk@stusta.de)
5 AC_CONFIG_AUX_DIR(config)
7 AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9])
9 AC_CONFIG_SRCDIR(mount/mount.c)
16 AC_PATH_PROG(PERL, perl)
20 AC_CHECK_HEADERS(scsi/scsi.h)
21 AC_CHECK_HEADERS(linux/compiler.h)
22 AC_CHECK_HEADERS(linux/blkpg.h,,,[
23 #ifdef HAVE_LINUX_COMPILER_H
24 #include <linux/compiler.h>
27 AC_CHECK_HEADERS(langinfo.h)
28 AC_CHECK_HEADERS(sys/user.h)
29 AC_CHECK_HEADERS(asm/page.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([external])
66 AC_CHECK_HEADERS(ncurses.h)
67 AC_CHECK_HEADERS(ncurses/ncurses.h)
70 if test x$ac_cv_header_ncurses_h = xyes || x$ac_cv_header_ncurses_ncurses_h = xyes; then
72 AC_MSG_NOTICE([you have ncurses])
74 AC_MSG_NOTICE([you do not have ncurses])
77 AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
81 AC_HELP_STRING([--with-slang], [compile cfdisk with slang]),
82 with_slang=$withval, with_slang=no
85 if test x$with_slang = xyes; then
86 AC_CHECK_HEADERS(slcurses.h)
87 AC_CHECK_HEADERS(slang/slcurses.h)
88 if test x$ac_cv_header_slcurses_h = xyes || x$ac_cv_header_slang_slcurses_h = xyes; then
91 AC_MSG_ERROR([slang selected but slcurses.h not found])
95 AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes)
102 char *c = crypt("abc","pw");
106 #define _XOPEN_SOURCE
109 char *c = crypt("abc","pw");
111 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
114 AC_MSG_ERROR([crypt() is not available])
118 AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
124 ],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?])
136 if (w == WEOF) exit(1);
139 ],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?]))
143 #include <sys/syscall.h>
146 int test = SYS_pivot_root;
147 ],have_pivot_root=true)
149 AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue)
157 struct tm *tm = localtime(0);
158 if (a == -1) /* false */
159 sleep(tm->tm_gmtoff);
160 ],[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])])
164 i?86-*) intel=true ;;
166 sparc*) sparc=true ;;
169 AM_CONDITIONAL(INTEL, test x$intel = xtrue)
170 AM_CONDITIONAL(M68K, test x$m68k = xtrue)
171 AM_CONDITIONAL(SPARC, test x$sparc = xtrue)
174 AC_ARG_ENABLE([agetty],
175 AC_HELP_STRING([--disable-agetty], [do not build agetty]),
176 enable_agetty=$enableval, enable_agetty=yes
178 AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes)
181 AC_ARG_ENABLE([cramfs],
182 AC_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
183 enable_cramfs=$enableval, enable_cramfs=check
186 if test x$enable_cramfs != xno; then
187 AC_CHECK_LIB(z, crc32)
188 build_cramfs=$ac_cv_lib_z_crc32
189 if test x$enable_cramfs = xyes && test x$ac_cv_lib_z_crc32 = xno; then
190 AC_MSG_ERROR([cramfs selected but libz not found])
194 AM_CONDITIONAL(BUILD_CRAMFS, test x$build_cramfs = xyes)
197 AC_ARG_ENABLE([elvtune],
198 AC_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
199 enable_elvtune=$enableval, enable_elvtune=no
201 AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes)
204 AC_ARG_ENABLE([init],
205 AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
206 enable_init=$enableval, enable_init=no
208 AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes)
211 AC_ARG_ENABLE([kill],
212 AC_HELP_STRING([--enable-kill], [build kill]),
213 enable_kill=$enableval, enable_kill=no
215 AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes)
218 AC_ARG_ENABLE([last],
219 AC_HELP_STRING([--enable-last], [build last]),
220 enable_last=$enableval, enable_last=no
222 AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes)
225 AC_ARG_ENABLE([mesg],
226 AC_HELP_STRING([--enable-mesg], [build mesg]),
227 enable_mesg=$enableval, enable_mesg=no
229 AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes)
232 AC_ARG_ENABLE([partx],
233 AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
234 enable_partx=$enableval, enable_partx=no
236 AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes)
240 AC_HELP_STRING([--enable-raw], [build raw]),
241 enable_raw=$enableval, enable_raw=no
243 AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes)
246 AC_ARG_ENABLE([rdev],
247 AC_HELP_STRING([--enable-rdev], [build rdev on i386]),
248 enable_rdev=$enableval, enable_rdev=no
250 AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes)
253 AC_ARG_ENABLE([rename],
254 AC_HELP_STRING([--disable-rename], [do not build rename]),
255 enable_agetty=$enableval, enable_rename=yes
257 AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes)
260 AC_ARG_ENABLE([reset],
261 AC_HELP_STRING([--enable-reset], [build reset]),
262 enable_reset=$enableval, enable_reset=no
264 AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes)
267 AC_ARG_ENABLE([login-utils],
268 AC_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
269 enable_login_utils=$enableval, enable_login_utils=no
271 AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes)
274 AC_HELP_STRING([--without-pam], [compile login-utils without PAM support]),
275 with_pam=$withval, with_pam=not_checked
278 if test x$enable_login_utils = xyes && test x$with_pam != xno; then
279 AC_CHECK_HEADERS(security/pam_misc.h)
280 if test x$with_pam = xyes && test x$ac_cv_header_security_pam_misc_h = xno; then
281 AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
284 AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes)
286 AC_ARG_WITH([selinux],
287 AC_HELP_STRING([--without-selinux], [compile login-utils without SELinux support]),
288 with_selinux=$withval, with_selinux=not_checked
291 if test x$enable_login_utils = xyes && test x$with_selinux != xno; then
292 AC_CHECK_LIB(selinux, getprevcon)
293 if test x$with_selinux = xyes && test x$ac_cv_lib_selinux_getprevcon = xno; then
294 AC_MSG_ERROR([SELinux selected but libselinux not found])
297 AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes)
301 AC_ARG_ENABLE([schedutils],
302 AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
303 enable_schedutils=$enableval, enable_schedutils=yes
305 AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes)
308 AC_ARG_ENABLE([wall],
309 AC_HELP_STRING([--disable-wall], [do not build wall]),
310 enable_wall=$enableval, enable_wall=yes
312 AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes)
315 AC_ARG_ENABLE([write],
316 AC_HELP_STRING([--enable-write], [build write]),
317 enable_write=$enableval, enable_write=no
319 AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes)
322 AC_ARG_ENABLE([chsh-only-listed],
323 AC_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
324 enable_login_chsh_only_listed=$enableval, enable_chsh_only_listed=yes
327 if test x$enable_chsh_only_listed = xyes; then
328 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
332 AC_ARG_ENABLE([login-chown-vcs],
333 AC_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
334 enable_login_chown_vcs=$enableval, enable_login_chown_vcs=no
337 if test x$enable_login_chown_vcs = xyes; then
338 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
342 AC_ARG_ENABLE([login-stat-mail],
343 AC_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
344 enable_login_stat_mail=$enableval, enable_login_stat_mail=no
347 if test x$enable_login_stat_mail = xyes; then
348 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
352 AC_ARG_ENABLE([pg-bell],
353 AC_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
354 enable_pg_bell=$enableval, enable_pg_bell=yes
357 if test x$enable_pg_bell = xyes; then
358 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
362 AC_ARG_ENABLE([require-password],
363 AC_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
364 enable_require_password=$enableval, enable_require_password=yes
367 if test x$enable_require_password = xyes; then
368 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
372 AC_ARG_ENABLE([use-tty-group],
373 AC_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
374 enable_use_tty_group=$enableval, enable_use_tty_group=yes
376 AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes)
378 if test x$enable_use_tty_group = xyes; then
379 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
385 CPPFLAGS="-fsigned-char -Wall -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -fomit-frame-pointer $CPPFLAGS"
388 AC_CONFIG_HEADERS(config.h)
390 AC_CONFIG_FILES([Makefile disk-utils/Makefile fdisk/Makefile getopt/Makefile hwclock/Makefile lib/Makefile login-utils/Makefile misc-utils/Makefile mount/Makefile partx/Makefile po/Makefile.in schedutils/Makefile sys-utils/Makefile text-utils/Makefile])