]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
build-sys: merge adjacent AC_CONFIG_HEADERS and AC_CONFIG_FUNCS calls
[thirdparty/util-linux.git] / configure.ac
CommitLineData
5bbc26de 1AC_INIT(util-linux-ng, 2.13devel, kzak@redhat.com)
baf39af1
KZ
2
3AC_PREREQ(2.59)
48d7b13a
KZ
4
5AC_CONFIG_AUX_DIR(config)
6
baf39af1 7AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9])
48d7b13a
KZ
8
9AC_CONFIG_SRCDIR(mount/mount.c)
10
11AC_PREFIX_DEFAULT(/)
12
13AC_PROG_CC_STDC
82640b11 14AC_PROG_LIBTOOL
48d7b13a
KZ
15
16AC_PATH_PROG(PERL, perl)
17
18AC_SYS_LARGEFILE
19
bf962c0a 20AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h], [], [], [
48d7b13a
KZ
21#ifdef HAVE_LINUX_COMPILER_H
22#include <linux/compiler.h>
23#endif
24])
bf962c0a
SK
25AC_CHECK_HEADERS(
26 [scsi/scsi.h \
27 langinfo.h \
28 sys/user.h \
29 rpcsvc/nfs_prot.h \
30 sys/io.h \
31 pty.h \
32 linux/raw.h])
48d7b13a
KZ
33AM_CONDITIONAL(HAVE_RAW, test x$ac_cv_header_linux_raw_h = xyes)
34
48d7b13a 35
bf962c0a
SK
36AC_CHECK_FUNCS(
37 [inet_aton \
38 fsync \
39 getdomainname \
40 nanosleep \
41 personality \
42 updwtmp \
43 lchown \
44 rpmatch])
48d7b13a 45AC_FUNC_FSEEKO
48d7b13a
KZ
46
47
48AC_CHECK_LIB(uuid, uuid_is_null)
49AM_CONDITIONAL(HAVE_UUID, test x$ac_cv_lib_uuid_uuid_is_null = xyes)
50
51AC_CHECK_LIB(util, openpty)
52AM_CONDITIONAL(HAVE_LIBUTIL, test x$ac_cv_lib_util_openpty = xyes)
53
54AC_CHECK_LIB(termcap, tgetnum)
55AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes)
56
48d7b13a
KZ
57AC_CHECK_LIB(blkid, blkid_known_fstype)
58AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
59
48d7b13a 60
8eeb575c 61AM_GNU_GETTEXT_VERSION([0.14.1])
48d7b13a 62AM_GNU_GETTEXT([external])
8eeb575c
KZ
63if test -d po
64then
65 ALL_LINGUAS=`(cd po > /dev/null && ls *.po) | sed 's+\.po$++'`
66else
67 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"
68fi
48d7b13a 69
bf962c0a 70AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h])
48d7b13a
KZ
71
72
19922f22 73if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes; then
48d7b13a
KZ
74 have_ncurses=yes
75 AC_MSG_NOTICE([you have ncurses])
76else
77 AC_MSG_NOTICE([you do not have ncurses])
78fi
79
80AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
81
82
83AC_ARG_WITH([slang],
84 AC_HELP_STRING([--with-slang], [compile cfdisk with slang]),
271d98e0 85 [], with_slang=no
48d7b13a
KZ
86)
87
88if test x$with_slang = xyes; then
bf962c0a 89 AC_CHECK_HEADERS([slcurses.h slang/slcurses.h])
19922f22 90 if test x$ac_cv_header_slcurses_h = xyes || test x$ac_cv_header_slang_slcurses_h = xyes; then
48d7b13a
KZ
91 use_slang=yes
92 else
93 AC_MSG_ERROR([slang selected but slcurses.h not found])
94 fi
95fi
96
97AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes)
98
99
100AC_TRY_LINK([
101#define _XOPEN_SOURCE
102#include <unistd.h>
103],[
104char *c = crypt("abc","pw");
105],,[
48d7b13a
KZ
106 LIBS="$LIBS -lcrypt"
107 AC_TRY_COMPILE([
108 #define _XOPEN_SOURCE
109 #include <unistd.h>
110 ],[
111 char *c = crypt("abc","pw");
112 ],[
113 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
114 need_libcrypt=yes
115 ],[
116 AC_MSG_ERROR([crypt() is not available])
117 ])
48d7b13a
KZ
118])
119
120AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
121
122AC_TRY_COMPILE([
123#include <stdio.h>
124],[
125printf(__progname);
126],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?])
127)
128
129
130AC_TRY_COMPILE([
131#include <wchar.h>
132#include <wctype.h>
133#include <stdio.h>
134],[
135 wchar_t wc;
136 wint_t w;
137 w = fgetwc(stdin);
138 if (w == WEOF) exit(1);
139 wc = w;
140 fputwc(wc,stdout);
141],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?]))
142
143
144AC_TRY_COMPILE([
145#include <sys/syscall.h>
146#include <unistd.h>
147],[
148int test = SYS_pivot_root;
149],have_pivot_root=true)
150
151AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue)
152
153
154AC_TRY_COMPILE([
155#include <time.h>
156#include <unistd.h>
157],[
158 int a = 0;
159 struct tm *tm = localtime(0);
160 if (a == -1) /* false */
161 sleep(tm->tm_gmtoff);
162],[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])])
163
164
165case "$host" in
ca3ea756
KZ
166 i?86-*) intel=true ;;
167 m68*) m68k=true ;;
48d7b13a
KZ
168 sparc*) sparc=true ;;
169esac
170
171AM_CONDITIONAL(INTEL, test x$intel = xtrue)
ca3ea756 172AM_CONDITIONAL(M68K, test x$m68k = xtrue)
48d7b13a
KZ
173AM_CONDITIONAL(SPARC, test x$sparc = xtrue)
174
175
176AC_ARG_ENABLE([agetty],
177 AC_HELP_STRING([--disable-agetty], [do not build agetty]),
271d98e0 178 [], enable_agetty=yes
48d7b13a 179)
baf39af1 180AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes)
48d7b13a
KZ
181
182
9cb68977
KZ
183AC_ARG_ENABLE([cramfs],
184 AC_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
271d98e0 185 [], enable_cramfs=check
9cb68977
KZ
186)
187
188if test x$enable_cramfs != xno; then
189 AC_CHECK_LIB(z, crc32)
190 build_cramfs=$ac_cv_lib_z_crc32
191 if test x$enable_cramfs = xyes && test x$ac_cv_lib_z_crc32 = xno; then
192 AC_MSG_ERROR([cramfs selected but libz not found])
193 fi
194fi
195
196AM_CONDITIONAL(BUILD_CRAMFS, test x$build_cramfs = xyes)
197
198
48d7b13a
KZ
199AC_ARG_ENABLE([elvtune],
200 AC_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
271d98e0 201 [], enable_elvtune=no
48d7b13a 202)
baf39af1 203AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes)
48d7b13a
KZ
204
205
206AC_ARG_ENABLE([init],
207 AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
271d98e0 208 [], enable_init=no
48d7b13a 209)
baf39af1 210AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes)
48d7b13a
KZ
211
212
213AC_ARG_ENABLE([kill],
214 AC_HELP_STRING([--enable-kill], [build kill]),
271d98e0 215 [], enable_kill=no
48d7b13a 216)
baf39af1 217AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes)
48d7b13a
KZ
218
219
220AC_ARG_ENABLE([last],
221 AC_HELP_STRING([--enable-last], [build last]),
271d98e0 222 [], enable_last=no
48d7b13a 223)
baf39af1 224AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes)
48d7b13a
KZ
225
226
227AC_ARG_ENABLE([mesg],
228 AC_HELP_STRING([--enable-mesg], [build mesg]),
271d98e0 229 [], enable_mesg=no
48d7b13a 230)
baf39af1 231AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes)
48d7b13a
KZ
232
233
234AC_ARG_ENABLE([partx],
235 AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
271d98e0 236 [], enable_partx=no
48d7b13a 237)
baf39af1 238AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes)
48d7b13a
KZ
239
240
241AC_ARG_ENABLE([raw],
242 AC_HELP_STRING([--enable-raw], [build raw]),
271d98e0 243 [], enable_raw=no
48d7b13a 244)
baf39af1 245AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes)
48d7b13a
KZ
246
247
248AC_ARG_ENABLE([rdev],
249 AC_HELP_STRING([--enable-rdev], [build rdev on i386]),
271d98e0 250 [], enable_rdev=no
48d7b13a 251)
baf39af1 252AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes)
48d7b13a
KZ
253
254
255AC_ARG_ENABLE([rename],
256 AC_HELP_STRING([--disable-rename], [do not build rename]),
271d98e0 257 [], enable_rename=yes
48d7b13a 258)
baf39af1 259AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes)
48d7b13a
KZ
260
261
262AC_ARG_ENABLE([reset],
263 AC_HELP_STRING([--enable-reset], [build reset]),
271d98e0 264 [], enable_reset=no
48d7b13a 265)
baf39af1 266AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes)
48d7b13a
KZ
267
268
269AC_ARG_ENABLE([login-utils],
270 AC_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
271d98e0 271 [], enable_login_utils=no
48d7b13a 272)
baf39af1 273AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes)
48d7b13a 274
9cb68977
KZ
275AC_ARG_WITH([pam],
276 AC_HELP_STRING([--without-pam], [compile login-utils without PAM support]),
271d98e0 277 [], with_pam=yes
9cb68977
KZ
278)
279
280if test x$enable_login_utils = xyes && test x$with_pam != xno; then
281 AC_CHECK_HEADERS(security/pam_misc.h)
282 if test x$with_pam = xyes && test x$ac_cv_header_security_pam_misc_h = xno; then
283 AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
284 fi
285fi
286AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes)
287
288AC_ARG_WITH([selinux],
deef0ba5 289 AC_HELP_STRING([--with-selinux], [compile with SELinux support]),
271d98e0 290 [], with_selinux=no
9cb68977
KZ
291)
292
deef0ba5 293if test x$with_selinux != xno; then
9cb68977
KZ
294 AC_CHECK_LIB(selinux, getprevcon)
295 if test x$with_selinux = xyes && test x$ac_cv_lib_selinux_getprevcon = xno; then
296 AC_MSG_ERROR([SELinux selected but libselinux not found])
297 fi
298fi
299AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes)
300
301
bbae9cb0
KZ
302AC_ARG_WITH([audit],
303 AC_HELP_STRING([--with-audit], [compile with audit support]),
271d98e0 304 [], with_audit=no
bbae9cb0
KZ
305)
306
307if test x$with_audit != xno; then
308 AC_CHECK_LIB(audit, audit_log_user_message)
309 if test x$with_audit = xyes && test x$ac_cv_lib_audit_audit_log_user_message = xno; then
310 AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
311 fi
312fi
313AM_CONDITIONAL(HAVE_AUDIT, test x$ac_cv_lib_audit_audit_log_user_message = xyes)
314
48d7b13a
KZ
315
316AC_ARG_ENABLE([schedutils],
317 AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
271d98e0 318 [], enable_schedutils=yes
48d7b13a 319)
baf39af1 320AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes)
48d7b13a
KZ
321
322
323AC_ARG_ENABLE([wall],
324 AC_HELP_STRING([--disable-wall], [do not build wall]),
271d98e0 325 [], enable_wall=yes
48d7b13a 326)
baf39af1 327AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes)
48d7b13a
KZ
328
329
330AC_ARG_ENABLE([write],
331 AC_HELP_STRING([--enable-write], [build write]),
271d98e0 332 [], enable_write=no
48d7b13a 333)
baf39af1 334AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes)
48d7b13a
KZ
335
336
337AC_ARG_ENABLE([chsh-only-listed],
338 AC_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
271d98e0 339 [], enable_chsh_only_listed=yes
48d7b13a
KZ
340)
341
baf39af1 342if test x$enable_chsh_only_listed = xyes; then
48d7b13a
KZ
343 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
344fi
345
346
347AC_ARG_ENABLE([login-chown-vcs],
348 AC_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
271d98e0 349 [], enable_login_chown_vcs=no
48d7b13a
KZ
350)
351
baf39af1 352if test x$enable_login_chown_vcs = xyes; then
48d7b13a
KZ
353 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
354fi
355
356
357AC_ARG_ENABLE([login-stat-mail],
358 AC_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
271d98e0 359 [], enable_login_stat_mail=no
48d7b13a
KZ
360)
361
baf39af1 362if test x$enable_login_stat_mail = xyes; then
48d7b13a
KZ
363 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
364fi
365
366
367AC_ARG_ENABLE([pg-bell],
368 AC_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
271d98e0 369 [], enable_pg_bell=yes
48d7b13a
KZ
370)
371
baf39af1 372if test x$enable_pg_bell = xyes; then
48d7b13a
KZ
373 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
374fi
375
376
377AC_ARG_ENABLE([require-password],
378 AC_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
271d98e0 379 [], enable_require_password=yes
48d7b13a
KZ
380)
381
baf39af1 382if test x$enable_require_password = xyes; then
48d7b13a
KZ
383 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
384fi
385
386
387AC_ARG_ENABLE([use-tty-group],
388 AC_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
271d98e0 389 [], enable_use_tty_group=yes
48d7b13a 390)
baf39af1 391AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes)
48d7b13a 392
baf39af1 393if test x$enable_use_tty_group = xyes; then
48d7b13a
KZ
394 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
395fi
396
06bcee19 397
1f10890f
SK
398AC_ARG_VAR([SUID_CFLAGS],
399 [CFLAGS used for binaries which are usually with the suid bit])
400AC_ARG_VAR([SUID_LDFLAGS],
401 [LDFLAGS used for binaries which are usually with the suid bit])
06bcee19 402
9cb68977 403LIBS=""
48d7b13a 404
48d7b13a
KZ
405
406AC_CONFIG_HEADERS(config.h)
407
8eeb575c
KZ
408AC_CONFIG_FILES([
409Makefile
410disk-utils/Makefile
562218e6 411fdisk/Makefile
8eeb575c
KZ
412getopt/Makefile
413hwclock/Makefile
562218e6 414include/Makefile
8eeb575c
KZ
415login-utils/Makefile
416misc-utils/Makefile
417mount/Makefile
418partx/Makefile
419po/Makefile.in
420schedutils/Makefile
421sys-utils/Makefile
422text-utils/Makefile
e83446da 423tests/Makefile
0f0584ad 424tests/helpers/Makefile
e83446da 425tests/commands.sh
8eeb575c 426])
48d7b13a
KZ
427
428AC_OUTPUT