]>
Commit | Line | Data |
---|---|---|
5bbc26de | 1 | AC_INIT(util-linux-ng, 2.13devel, kzak@redhat.com) |
baf39af1 KZ |
2 | |
3 | AC_PREREQ(2.59) | |
48d7b13a KZ |
4 | |
5 | AC_CONFIG_AUX_DIR(config) | |
6 | ||
baf39af1 | 7 | AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9]) |
48d7b13a KZ |
8 | |
9 | AC_CONFIG_SRCDIR(mount/mount.c) | |
10 | ||
11 | AC_PREFIX_DEFAULT(/) | |
12 | ||
13 | AC_PROG_CC_STDC | |
82640b11 | 14 | AC_PROG_LIBTOOL |
48d7b13a KZ |
15 | |
16 | AC_PATH_PROG(PERL, perl) | |
17 | ||
18 | AC_SYS_LARGEFILE | |
19 | ||
bf962c0a | 20 | AC_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 |
25 | AC_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 |
33 | AM_CONDITIONAL(HAVE_RAW, test x$ac_cv_header_linux_raw_h = xyes) |
34 | ||
48d7b13a | 35 | |
bf962c0a SK |
36 | AC_CHECK_FUNCS( |
37 | [inet_aton \ | |
38 | fsync \ | |
39 | getdomainname \ | |
40 | nanosleep \ | |
41 | personality \ | |
42 | updwtmp \ | |
43 | lchown \ | |
44 | rpmatch]) | |
48d7b13a | 45 | AC_FUNC_FSEEKO |
48d7b13a KZ |
46 | |
47 | ||
48 | AC_CHECK_LIB(uuid, uuid_is_null) | |
49 | AM_CONDITIONAL(HAVE_UUID, test x$ac_cv_lib_uuid_uuid_is_null = xyes) | |
50 | ||
51 | AC_CHECK_LIB(util, openpty) | |
52 | AM_CONDITIONAL(HAVE_LIBUTIL, test x$ac_cv_lib_util_openpty = xyes) | |
53 | ||
54 | AC_CHECK_LIB(termcap, tgetnum) | |
55 | AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes) | |
56 | ||
48d7b13a KZ |
57 | AC_CHECK_LIB(blkid, blkid_known_fstype) |
58 | AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes) | |
59 | ||
48d7b13a | 60 | |
8eeb575c | 61 | AM_GNU_GETTEXT_VERSION([0.14.1]) |
48d7b13a | 62 | AM_GNU_GETTEXT([external]) |
8eeb575c KZ |
63 | if test -d po |
64 | then | |
65 | ALL_LINGUAS=`(cd po > /dev/null && ls *.po) | sed 's+\.po$++'` | |
66 | else | |
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" | |
68 | fi | |
48d7b13a | 69 | |
bf962c0a | 70 | AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h]) |
48d7b13a KZ |
71 | |
72 | ||
19922f22 | 73 | if 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]) | |
76 | else | |
77 | AC_MSG_NOTICE([you do not have ncurses]) | |
78 | fi | |
79 | ||
80 | AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes) | |
81 | ||
82 | ||
83 | AC_ARG_WITH([slang], | |
84 | AC_HELP_STRING([--with-slang], [compile cfdisk with slang]), | |
271d98e0 | 85 | [], with_slang=no |
48d7b13a KZ |
86 | ) |
87 | ||
88 | if 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 | |
95 | fi | |
96 | ||
97 | AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes) | |
98 | ||
99 | ||
100 | AC_TRY_LINK([ | |
101 | #define _XOPEN_SOURCE | |
102 | #include <unistd.h> | |
103 | ],[ | |
104 | char *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 | ||
120 | AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes) | |
121 | ||
122 | AC_TRY_COMPILE([ | |
123 | #include <stdio.h> | |
124 | ],[ | |
125 | printf(__progname); | |
126 | ],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?]) | |
127 | ) | |
128 | ||
129 | ||
130 | AC_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 | ||
144 | AC_TRY_COMPILE([ | |
145 | #include <sys/syscall.h> | |
146 | #include <unistd.h> | |
147 | ],[ | |
148 | int test = SYS_pivot_root; | |
149 | ],have_pivot_root=true) | |
150 | ||
151 | AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue) | |
152 | ||
153 | ||
154 | AC_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 | ||
165 | case "$host" in | |
ca3ea756 KZ |
166 | i?86-*) intel=true ;; |
167 | m68*) m68k=true ;; | |
48d7b13a KZ |
168 | sparc*) sparc=true ;; |
169 | esac | |
170 | ||
171 | AM_CONDITIONAL(INTEL, test x$intel = xtrue) | |
ca3ea756 | 172 | AM_CONDITIONAL(M68K, test x$m68k = xtrue) |
48d7b13a KZ |
173 | AM_CONDITIONAL(SPARC, test x$sparc = xtrue) |
174 | ||
175 | ||
176 | AC_ARG_ENABLE([agetty], | |
177 | AC_HELP_STRING([--disable-agetty], [do not build agetty]), | |
271d98e0 | 178 | [], enable_agetty=yes |
48d7b13a | 179 | ) |
baf39af1 | 180 | AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes) |
48d7b13a KZ |
181 | |
182 | ||
9cb68977 KZ |
183 | AC_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 | ||
188 | if 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 | |
194 | fi | |
195 | ||
196 | AM_CONDITIONAL(BUILD_CRAMFS, test x$build_cramfs = xyes) | |
197 | ||
198 | ||
48d7b13a KZ |
199 | AC_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 | 203 | AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes) |
48d7b13a KZ |
204 | |
205 | ||
206 | AC_ARG_ENABLE([init], | |
207 | AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]), | |
271d98e0 | 208 | [], enable_init=no |
48d7b13a | 209 | ) |
baf39af1 | 210 | AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes) |
48d7b13a KZ |
211 | |
212 | ||
213 | AC_ARG_ENABLE([kill], | |
214 | AC_HELP_STRING([--enable-kill], [build kill]), | |
271d98e0 | 215 | [], enable_kill=no |
48d7b13a | 216 | ) |
baf39af1 | 217 | AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes) |
48d7b13a KZ |
218 | |
219 | ||
220 | AC_ARG_ENABLE([last], | |
221 | AC_HELP_STRING([--enable-last], [build last]), | |
271d98e0 | 222 | [], enable_last=no |
48d7b13a | 223 | ) |
baf39af1 | 224 | AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes) |
48d7b13a KZ |
225 | |
226 | ||
227 | AC_ARG_ENABLE([mesg], | |
228 | AC_HELP_STRING([--enable-mesg], [build mesg]), | |
271d98e0 | 229 | [], enable_mesg=no |
48d7b13a | 230 | ) |
baf39af1 | 231 | AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes) |
48d7b13a KZ |
232 | |
233 | ||
234 | AC_ARG_ENABLE([partx], | |
235 | AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]), | |
271d98e0 | 236 | [], enable_partx=no |
48d7b13a | 237 | ) |
baf39af1 | 238 | AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes) |
48d7b13a KZ |
239 | |
240 | ||
241 | AC_ARG_ENABLE([raw], | |
242 | AC_HELP_STRING([--enable-raw], [build raw]), | |
271d98e0 | 243 | [], enable_raw=no |
48d7b13a | 244 | ) |
baf39af1 | 245 | AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes) |
48d7b13a KZ |
246 | |
247 | ||
248 | AC_ARG_ENABLE([rdev], | |
249 | AC_HELP_STRING([--enable-rdev], [build rdev on i386]), | |
271d98e0 | 250 | [], enable_rdev=no |
48d7b13a | 251 | ) |
baf39af1 | 252 | AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes) |
48d7b13a KZ |
253 | |
254 | ||
255 | AC_ARG_ENABLE([rename], | |
256 | AC_HELP_STRING([--disable-rename], [do not build rename]), | |
271d98e0 | 257 | [], enable_rename=yes |
48d7b13a | 258 | ) |
baf39af1 | 259 | AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes) |
48d7b13a KZ |
260 | |
261 | ||
262 | AC_ARG_ENABLE([reset], | |
263 | AC_HELP_STRING([--enable-reset], [build reset]), | |
271d98e0 | 264 | [], enable_reset=no |
48d7b13a | 265 | ) |
baf39af1 | 266 | AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes) |
48d7b13a KZ |
267 | |
268 | ||
269 | AC_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 | 273 | AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes) |
48d7b13a | 274 | |
9cb68977 KZ |
275 | AC_ARG_WITH([pam], |
276 | AC_HELP_STRING([--without-pam], [compile login-utils without PAM support]), | |
271d98e0 | 277 | [], with_pam=yes |
9cb68977 KZ |
278 | ) |
279 | ||
280 | if 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 | |
285 | fi | |
286 | AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes) | |
287 | ||
288 | AC_ARG_WITH([selinux], | |
deef0ba5 | 289 | AC_HELP_STRING([--with-selinux], [compile with SELinux support]), |
271d98e0 | 290 | [], with_selinux=no |
9cb68977 KZ |
291 | ) |
292 | ||
deef0ba5 | 293 | if 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 | |
298 | fi | |
299 | AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes) | |
300 | ||
301 | ||
bbae9cb0 KZ |
302 | AC_ARG_WITH([audit], |
303 | AC_HELP_STRING([--with-audit], [compile with audit support]), | |
271d98e0 | 304 | [], with_audit=no |
bbae9cb0 KZ |
305 | ) |
306 | ||
307 | if 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 | |
312 | fi | |
313 | AM_CONDITIONAL(HAVE_AUDIT, test x$ac_cv_lib_audit_audit_log_user_message = xyes) | |
314 | ||
48d7b13a KZ |
315 | |
316 | AC_ARG_ENABLE([schedutils], | |
317 | AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]), | |
271d98e0 | 318 | [], enable_schedutils=yes |
48d7b13a | 319 | ) |
baf39af1 | 320 | AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes) |
48d7b13a KZ |
321 | |
322 | ||
323 | AC_ARG_ENABLE([wall], | |
324 | AC_HELP_STRING([--disable-wall], [do not build wall]), | |
271d98e0 | 325 | [], enable_wall=yes |
48d7b13a | 326 | ) |
baf39af1 | 327 | AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes) |
48d7b13a KZ |
328 | |
329 | ||
330 | AC_ARG_ENABLE([write], | |
331 | AC_HELP_STRING([--enable-write], [build write]), | |
271d98e0 | 332 | [], enable_write=no |
48d7b13a | 333 | ) |
baf39af1 | 334 | AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes) |
48d7b13a KZ |
335 | |
336 | ||
337 | AC_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 | 342 | if 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?]) |
344 | fi | |
345 | ||
346 | ||
347 | AC_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 | 352 | if test x$enable_login_chown_vcs = xyes; then |
48d7b13a KZ |
353 | AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?]) |
354 | fi | |
355 | ||
356 | ||
357 | AC_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 | 362 | if test x$enable_login_stat_mail = xyes; then |
48d7b13a KZ |
363 | AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?]) |
364 | fi | |
365 | ||
366 | ||
367 | AC_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 | 372 | if test x$enable_pg_bell = xyes; then |
48d7b13a KZ |
373 | AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?]) |
374 | fi | |
375 | ||
376 | ||
377 | AC_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 | 382 | if 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?]) |
384 | fi | |
385 | ||
386 | ||
387 | AC_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 | 391 | AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes) |
48d7b13a | 392 | |
baf39af1 | 393 | if 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?]) |
395 | fi | |
396 | ||
06bcee19 | 397 | |
1f10890f SK |
398 | AC_ARG_VAR([SUID_CFLAGS], |
399 | [CFLAGS used for binaries which are usually with the suid bit]) | |
400 | AC_ARG_VAR([SUID_LDFLAGS], | |
401 | [LDFLAGS used for binaries which are usually with the suid bit]) | |
06bcee19 | 402 | |
9cb68977 | 403 | LIBS="" |
48d7b13a | 404 | |
48d7b13a KZ |
405 | |
406 | AC_CONFIG_HEADERS(config.h) | |
407 | ||
8eeb575c KZ |
408 | AC_CONFIG_FILES([ |
409 | Makefile | |
410 | disk-utils/Makefile | |
562218e6 | 411 | fdisk/Makefile |
8eeb575c KZ |
412 | getopt/Makefile |
413 | hwclock/Makefile | |
562218e6 | 414 | include/Makefile |
8eeb575c KZ |
415 | login-utils/Makefile |
416 | misc-utils/Makefile | |
417 | mount/Makefile | |
418 | partx/Makefile | |
419 | po/Makefile.in | |
420 | schedutils/Makefile | |
421 | sys-utils/Makefile | |
422 | text-utils/Makefile | |
e83446da | 423 | tests/Makefile |
0f0584ad | 424 | tests/helpers/Makefile |
e83446da | 425 | tests/commands.sh |
8eeb575c | 426 | ]) |
48d7b13a KZ |
427 | |
428 | AC_OUTPUT |