]> git.ipfire.org Git - thirdparty/util-linux.git/blob - configure.ac
build-sys: call automake after autoconf
[thirdparty/util-linux.git] / configure.ac
1 AC_INIT(util-linux-ng, 2.13devel, kzak@redhat.com)
2
3 AC_PREREQ(2.59)
4
5 AC_CONFIG_AUX_DIR(config)
6
7 AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9])
8
9 AC_CONFIG_SRCDIR(mount/mount.c)
10
11 AC_PREFIX_DEFAULT(/)
12
13 AC_PROG_CC_STDC
14 AC_PROG_RANLIB
15 AC_PROG_LIBTOOL
16
17 AC_PATH_PROG(PERL, perl)
18
19 AC_SYS_LARGEFILE
20
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>
26 #endif
27 ])
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)
33
34 AC_CHECK_HEADERS(linux/raw.h)
35 AM_CONDITIONAL(HAVE_RAW, test x$ac_cv_header_linux_raw_h = xyes)
36
37
38
39 AC_CHECK_FUNCS(inet_aton)
40 AC_CHECK_FUNCS(fsync)
41 AC_CHECK_FUNCS(getdomainname)
42 AC_CHECK_FUNCS(nanosleep)
43 AC_CHECK_FUNCS(personality)
44 AC_CHECK_FUNCS(updwtmp)
45 AC_FUNC_FSEEKO
46 AC_CHECK_FUNCS(lchown)
47 AC_CHECK_FUNCS(rpmatch)
48
49
50 AC_CHECK_LIB(uuid, uuid_is_null)
51 AM_CONDITIONAL(HAVE_UUID, test x$ac_cv_lib_uuid_uuid_is_null = xyes)
52
53 AC_CHECK_LIB(util, openpty)
54 AM_CONDITIONAL(HAVE_LIBUTIL, test x$ac_cv_lib_util_openpty = xyes)
55
56 AC_CHECK_LIB(termcap, tgetnum)
57 AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes)
58
59 AC_CHECK_LIB(blkid, blkid_known_fstype)
60 AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
61
62
63 AM_GNU_GETTEXT_VERSION([0.14.1])
64 AM_GNU_GETTEXT([external])
65 if test -d po
66 then
67 ALL_LINGUAS=`(cd po > /dev/null && ls *.po) | sed 's+\.po$++'`
68 else
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"
70 fi
71
72 AC_CHECK_HEADERS(ncurses.h)
73 AC_CHECK_HEADERS(ncurses/ncurses.h)
74
75
76 if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes; then
77 have_ncurses=yes
78 AC_MSG_NOTICE([you have ncurses])
79 else
80 AC_MSG_NOTICE([you do not have ncurses])
81 fi
82
83 AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
84
85
86 AC_ARG_WITH([slang],
87 AC_HELP_STRING([--with-slang], [compile cfdisk with slang]),
88 with_slang=$withval, with_slang=no
89 )
90
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
95 use_slang=yes
96 else
97 AC_MSG_ERROR([slang selected but slcurses.h not found])
98 fi
99 fi
100
101 AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes)
102
103
104 AC_TRY_LINK([
105 #define _XOPEN_SOURCE
106 #include <unistd.h>
107 ],[
108 char *c = crypt("abc","pw");
109 ],,[
110 LIBS="$LIBS -lcrypt"
111 AC_TRY_COMPILE([
112 #define _XOPEN_SOURCE
113 #include <unistd.h>
114 ],[
115 char *c = crypt("abc","pw");
116 ],[
117 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
118 need_libcrypt=yes
119 ],[
120 AC_MSG_ERROR([crypt() is not available])
121 ])
122 ])
123
124 AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
125
126 AC_TRY_COMPILE([
127 #include <stdio.h>
128 ],[
129 printf(__progname);
130 ],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?])
131 )
132
133
134 AC_TRY_COMPILE([
135 #include <wchar.h>
136 #include <wctype.h>
137 #include <stdio.h>
138 ],[
139 wchar_t wc;
140 wint_t w;
141 w = fgetwc(stdin);
142 if (w == WEOF) exit(1);
143 wc = w;
144 fputwc(wc,stdout);
145 ],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?]))
146
147
148 AC_TRY_COMPILE([
149 #include <sys/syscall.h>
150 #include <unistd.h>
151 ],[
152 int test = SYS_pivot_root;
153 ],have_pivot_root=true)
154
155 AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue)
156
157
158 AC_TRY_COMPILE([
159 #include <time.h>
160 #include <unistd.h>
161 ],[
162 int a = 0;
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?])])
167
168
169 case "$host" in
170 i?86-*) intel=true ;;
171 m68*) m68k=true ;;
172 sparc*) sparc=true ;;
173 esac
174
175 AM_CONDITIONAL(INTEL, test x$intel = xtrue)
176 AM_CONDITIONAL(M68K, test x$m68k = xtrue)
177 AM_CONDITIONAL(SPARC, test x$sparc = xtrue)
178
179
180 AC_ARG_ENABLE([agetty],
181 AC_HELP_STRING([--disable-agetty], [do not build agetty]),
182 enable_agetty=$enableval, enable_agetty=yes
183 )
184 AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes)
185
186
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
190 )
191
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])
197 fi
198 fi
199
200 AM_CONDITIONAL(BUILD_CRAMFS, test x$build_cramfs = xyes)
201
202
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
206 )
207 AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes)
208
209
210 AC_ARG_ENABLE([init],
211 AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
212 enable_init=$enableval, enable_init=no
213 )
214 AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes)
215
216
217 AC_ARG_ENABLE([kill],
218 AC_HELP_STRING([--enable-kill], [build kill]),
219 enable_kill=$enableval, enable_kill=no
220 )
221 AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes)
222
223
224 AC_ARG_ENABLE([last],
225 AC_HELP_STRING([--enable-last], [build last]),
226 enable_last=$enableval, enable_last=no
227 )
228 AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes)
229
230
231 AC_ARG_ENABLE([mesg],
232 AC_HELP_STRING([--enable-mesg], [build mesg]),
233 enable_mesg=$enableval, enable_mesg=no
234 )
235 AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes)
236
237
238 AC_ARG_ENABLE([partx],
239 AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
240 enable_partx=$enableval, enable_partx=no
241 )
242 AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes)
243
244
245 AC_ARG_ENABLE([raw],
246 AC_HELP_STRING([--enable-raw], [build raw]),
247 enable_raw=$enableval, enable_raw=no
248 )
249 AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes)
250
251
252 AC_ARG_ENABLE([rdev],
253 AC_HELP_STRING([--enable-rdev], [build rdev on i386]),
254 enable_rdev=$enableval, enable_rdev=no
255 )
256 AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes)
257
258
259 AC_ARG_ENABLE([rename],
260 AC_HELP_STRING([--disable-rename], [do not build rename]),
261 enable_agetty=$enableval, enable_rename=yes
262 )
263 AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes)
264
265
266 AC_ARG_ENABLE([reset],
267 AC_HELP_STRING([--enable-reset], [build reset]),
268 enable_reset=$enableval, enable_reset=no
269 )
270 AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes)
271
272
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
276 )
277 AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes)
278
279 AC_ARG_WITH([pam],
280 AC_HELP_STRING([--without-pam], [compile login-utils without PAM support]),
281 with_pam=$withval, with_pam=yes
282 )
283
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])
288 fi
289 fi
290 AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes)
291
292 AC_ARG_WITH([selinux],
293 AC_HELP_STRING([--with-selinux], [compile with SELinux support]),
294 with_selinux=$withval, with_selinux=no
295 )
296
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])
301 fi
302 fi
303 AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes)
304
305
306 AC_ARG_WITH([audit],
307 AC_HELP_STRING([--with-audit], [compile with audit support]),
308 with_audit=$withval, with_audit=no
309 )
310
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())])
315 fi
316 fi
317 AM_CONDITIONAL(HAVE_AUDIT, test x$ac_cv_lib_audit_audit_log_user_message = xyes)
318
319
320 AC_ARG_ENABLE([schedutils],
321 AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
322 enable_schedutils=$enableval, enable_schedutils=yes
323 )
324 AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes)
325
326
327 AC_ARG_ENABLE([wall],
328 AC_HELP_STRING([--disable-wall], [do not build wall]),
329 enable_wall=$enableval, enable_wall=yes
330 )
331 AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes)
332
333
334 AC_ARG_ENABLE([write],
335 AC_HELP_STRING([--enable-write], [build write]),
336 enable_write=$enableval, enable_write=no
337 )
338 AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes)
339
340
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
344 )
345
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?])
348 fi
349
350
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
354 )
355
356 if test x$enable_login_chown_vcs = xyes; then
357 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
358 fi
359
360
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
364 )
365
366 if test x$enable_login_stat_mail = xyes; then
367 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
368 fi
369
370
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
374 )
375
376 if test x$enable_pg_bell = xyes; then
377 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
378 fi
379
380
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
384 )
385
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?])
388 fi
389
390
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
394 )
395 AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes)
396
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?])
399 fi
400
401
402 AC_SUBST([SUID_CFLAGS])
403
404 CPPFLAGS="-fsigned-char -fomit-frame-pointer $CPPFLAGS"
405
406 LIBS=""
407
408
409 AC_CONFIG_HEADERS(config.h)
410
411 AC_CONFIG_FILES([
412 Makefile
413 disk-utils/Makefile
414 fdisk/Makefile
415 getopt/Makefile
416 hwclock/Makefile
417 include/Makefile
418 lib/Makefile
419 login-utils/Makefile
420 misc-utils/Makefile
421 mount/Makefile
422 partx/Makefile
423 po/Makefile.in
424 schedutils/Makefile
425 sys-utils/Makefile
426 text-utils/Makefile
427 tests/Makefile
428 tests/helpers/Makefile
429 tests/commands.sh
430 ])
431
432 AC_OUTPUT