]> git.ipfire.org Git - thirdparty/util-linux.git/blob - configure.ac
269e6310c0e5a74b308740c9904d03c2b1dc943c
[thirdparty/util-linux.git] / configure.ac
1 AC_INIT(util-linux, 2.13-pre4, bunk@stusta.de)
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
16 AC_PATH_PROG(PERL, perl)
17
18 AC_SYS_LARGEFILE
19
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>
25 #endif
26 ])
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)
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([external])
64
65
66 AC_CHECK_HEADERS(ncurses.h)
67 AC_CHECK_HEADERS(ncurses/ncurses.h)
68
69
70 if test x$ac_cv_header_ncurses_h = xyes || x$ac_cv_header_ncurses_ncurses_h = xyes; then
71 have_ncurses=yes
72 AC_MSG_NOTICE([you have ncurses])
73 else
74 AC_MSG_NOTICE([you do not have ncurses])
75 fi
76
77 AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
78
79
80 AC_ARG_WITH([slang],
81 AC_HELP_STRING([--with-slang], [compile cfdisk with slang]),
82 with_slang=$withval, with_slang=no
83 )
84
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
89 use_slang=yes
90 else
91 AC_MSG_ERROR([slang selected but slcurses.h not found])
92 fi
93 fi
94
95 AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes)
96
97
98 AC_TRY_LINK([
99 #define _XOPEN_SOURCE
100 #include <unistd.h>
101 ],[
102 char *c = crypt("abc","pw");
103 ],,[
104 LIBS="$LIBS -lcrypt"
105 AC_TRY_COMPILE([
106 #define _XOPEN_SOURCE
107 #include <unistd.h>
108 ],[
109 char *c = crypt("abc","pw");
110 ],[
111 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
112 need_libcrypt=yes
113 ],[
114 AC_MSG_ERROR([crypt() is not available])
115 ])
116 ])
117
118 AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
119
120 AC_TRY_COMPILE([
121 #include <stdio.h>
122 ],[
123 printf(__progname);
124 ],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?])
125 )
126
127
128 AC_TRY_COMPILE([
129 #include <wchar.h>
130 #include <wctype.h>
131 #include <stdio.h>
132 ],[
133 wchar_t wc;
134 wint_t w;
135 w = fgetwc(stdin);
136 if (w == WEOF) exit(1);
137 wc = w;
138 fputwc(wc,stdout);
139 ],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?]))
140
141
142 AC_TRY_COMPILE([
143 #include <sys/syscall.h>
144 #include <unistd.h>
145 ],[
146 int test = SYS_pivot_root;
147 ],have_pivot_root=true)
148
149 AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue)
150
151
152 AC_TRY_COMPILE([
153 #include <time.h>
154 #include <unistd.h>
155 ],[
156 int a = 0;
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?])])
161
162
163 case "$host" in
164 i?86-*) intel=true ;;
165 m68*) m68k=true ;;
166 sparc*) sparc=true ;;
167 esac
168
169 AM_CONDITIONAL(INTEL, test x$intel = xtrue)
170 AM_CONDITIONAL(M68K, test x$m68k = xtrue)
171 AM_CONDITIONAL(SPARC, test x$sparc = xtrue)
172
173
174 AC_ARG_ENABLE([agetty],
175 AC_HELP_STRING([--disable-agetty], [do not build agetty]),
176 enable_agetty=$enableval, enable_agetty=yes
177 )
178 AM_CONDITIONAL(BUILD_AGETTY, test x$enable_agetty = xyes)
179
180
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
184 )
185
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])
191 fi
192 fi
193
194 AM_CONDITIONAL(BUILD_CRAMFS, test x$build_cramfs = xyes)
195
196
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
200 )
201 AM_CONDITIONAL(BUILD_ELVTUNE, test x$enable_elvtune = xyes)
202
203
204 AC_ARG_ENABLE([init],
205 AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
206 enable_init=$enableval, enable_init=no
207 )
208 AM_CONDITIONAL(BUILD_INIT, test x$enable_init = xyes)
209
210
211 AC_ARG_ENABLE([kill],
212 AC_HELP_STRING([--enable-kill], [build kill]),
213 enable_kill=$enableval, enable_kill=no
214 )
215 AM_CONDITIONAL(BUILD_KILL, test x$enable_kill = xyes)
216
217
218 AC_ARG_ENABLE([last],
219 AC_HELP_STRING([--enable-last], [build last]),
220 enable_last=$enableval, enable_last=no
221 )
222 AM_CONDITIONAL(BUILD_LAST, test x$enable_last = xyes)
223
224
225 AC_ARG_ENABLE([mesg],
226 AC_HELP_STRING([--enable-mesg], [build mesg]),
227 enable_mesg=$enableval, enable_mesg=no
228 )
229 AM_CONDITIONAL(BUILD_MESG, test x$enable_mesg = xyes)
230
231
232 AC_ARG_ENABLE([partx],
233 AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
234 enable_partx=$enableval, enable_partx=no
235 )
236 AM_CONDITIONAL(BUILD_PARTX, test x$enable_partx = xyes)
237
238
239 AC_ARG_ENABLE([raw],
240 AC_HELP_STRING([--enable-raw], [build raw]),
241 enable_raw=$enableval, enable_raw=no
242 )
243 AM_CONDITIONAL(BUILD_RAW, test x$enable_raw = xyes)
244
245
246 AC_ARG_ENABLE([rdev],
247 AC_HELP_STRING([--enable-rdev], [build rdev on i386]),
248 enable_rdev=$enableval, enable_rdev=no
249 )
250 AM_CONDITIONAL(BUILD_RDEV, test x$enable_rdev = xyes)
251
252
253 AC_ARG_ENABLE([rename],
254 AC_HELP_STRING([--disable-rename], [do not build rename]),
255 enable_agetty=$enableval, enable_rename=yes
256 )
257 AM_CONDITIONAL(BUILD_RENAME, test x$enable_rename = xyes)
258
259
260 AC_ARG_ENABLE([reset],
261 AC_HELP_STRING([--enable-reset], [build reset]),
262 enable_reset=$enableval, enable_reset=no
263 )
264 AM_CONDITIONAL(BUILD_RESET, test x$enable_reset = xyes)
265
266
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
270 )
271 AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$enable_login_utils = xyes)
272
273 AC_ARG_WITH([pam],
274 AC_HELP_STRING([--without-pam], [compile login-utils without PAM support]),
275 with_pam=$withval, with_pam=not_checked
276 )
277
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])
282 fi
283 fi
284 AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes)
285
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
289 )
290
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])
295 fi
296 fi
297 AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes)
298
299
300
301 AC_ARG_ENABLE([schedutils],
302 AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
303 enable_schedutils=$enableval, enable_schedutils=yes
304 )
305 AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$enable_schedutils = xyes)
306
307
308 AC_ARG_ENABLE([wall],
309 AC_HELP_STRING([--disable-wall], [do not build wall]),
310 enable_wall=$enableval, enable_wall=yes
311 )
312 AM_CONDITIONAL(BUILD_WALL, test x$enable_wall = xyes)
313
314
315 AC_ARG_ENABLE([write],
316 AC_HELP_STRING([--enable-write], [build write]),
317 enable_write=$enableval, enable_write=no
318 )
319 AM_CONDITIONAL(BUILD_WRITE, test x$enable_write = xyes)
320
321
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
325 )
326
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?])
329 fi
330
331
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
335 )
336
337 if test x$enable_login_chown_vcs = xyes; then
338 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
339 fi
340
341
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
345 )
346
347 if test x$enable_login_stat_mail = xyes; then
348 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
349 fi
350
351
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
355 )
356
357 if test x$enable_pg_bell = xyes; then
358 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
359 fi
360
361
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
365 )
366
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?])
369 fi
370
371
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
375 )
376 AM_CONDITIONAL(USE_TTY_GROUP, test x$enable_use_tty_group = xyes)
377
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?])
380 fi
381
382
383 LIBS=""
384
385 CPPFLAGS="-fsigned-char -Wall -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -fomit-frame-pointer $CPPFLAGS"
386
387
388 AC_CONFIG_HEADERS(config.h)
389
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])
391
392 AC_OUTPUT