]> git.ipfire.org Git - thirdparty/util-linux.git/blame - configure.ac
Imported from util-linux-2.13-pre1 tarball.
[thirdparty/util-linux.git] / configure.ac
CommitLineData
48d7b13a
KZ
1AC_INIT(util-linux, 2.13-pre1, bunk@stusta.de)
2
3AC_CONFIG_AUX_DIR(config)
4
5AM_INIT_AUTOMAKE([check-news std-options -Wall foreign])
6
7AC_CONFIG_SRCDIR(mount/mount.c)
8
9AC_PREFIX_DEFAULT(/)
10
11AC_PROG_CC_STDC
12
13AC_DISABLE_SHARED
14AC_PROG_LIBTOOL
15
16AC_PATH_PROG(PERL, perl)
17
18AC_SYS_LARGEFILE
19
20AC_CHECK_HEADERS(scsi/scsi.h)
21AC_CHECK_HEADERS(linux/compiler.h)
22AC_CHECK_HEADERS(linux/blkpg.h,,,[
23#ifdef HAVE_LINUX_COMPILER_H
24#include <linux/compiler.h>
25#endif
26])
27AC_CHECK_HEADERS(langinfo.h)
28AC_CHECK_HEADERS(sys/user.h)
29AC_CHECK_HEADERS(asm/page.h)
30AC_CHECK_HEADERS(rpcsvc/nfs_prot.h)
31AC_CHECK_HEADERS(sys/io.h)
32AC_CHECK_HEADERS(pty.h)
33
34AC_CHECK_HEADERS(linux/raw.h)
35AM_CONDITIONAL(HAVE_RAW, test x$ac_cv_header_linux_raw_h = xyes)
36
37AC_CHECK_HEADERS(security/pam_misc.h)
38AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes)
39
40
41
42AC_CHECK_FUNCS(inet_aton)
43AC_CHECK_FUNCS(fsync)
44AC_CHECK_FUNCS(getdomainname)
45AC_CHECK_FUNCS(nanosleep)
46AC_CHECK_FUNCS(personality)
47AC_CHECK_FUNCS(updwtmp)
48AC_FUNC_FSEEKO
49AC_CHECK_FUNCS(lchown)
50AC_CHECK_FUNCS(rpmatch)
51
52
53AC_CHECK_LIB(uuid, uuid_is_null)
54AM_CONDITIONAL(HAVE_UUID, test x$ac_cv_lib_uuid_uuid_is_null = xyes)
55
56AC_CHECK_LIB(util, openpty)
57AM_CONDITIONAL(HAVE_LIBUTIL, test x$ac_cv_lib_util_openpty = xyes)
58
59AC_CHECK_LIB(termcap, tgetnum)
60AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes)
61
62AC_CHECK_LIB(z, crc32)
63AM_CONDITIONAL(HAVE_ZLIB, test x$ac_cv_lib_z_crc32 = xyes)
64
65AC_CHECK_LIB(blkid, blkid_known_fstype)
66AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
67
68AC_CHECK_LIB(selinux, getprevcon)
69AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes)
70
71LIBS=""
72
73
74AM_GNU_GETTEXT([external])
75
76
77AC_CHECK_HEADERS(ncurses.h)
78AC_CHECK_HEADERS(ncurses/ncurses.h)
79
80
81if test x$ac_cv_header_ncurses_h = xyes -o x$ac_cv_header_ncurses_ncurses_h = xyes; then
82 have_ncurses=yes
83 AC_MSG_NOTICE([you have ncurses])
84else
85 AC_MSG_NOTICE([you do not have ncurses])
86fi
87
88AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
89
90
91AC_ARG_WITH([slang],
92 AC_HELP_STRING([--with-slang], [compile cfdisk with slang]),
93 with_slang=$withval, with_slang=no
94)
95
96if test x$with_slang = xyes; then
97 AC_CHECK_HEADERS(slcurses.h)
98 AC_CHECK_HEADERS(slang/slcurses.h)
99 if test x$ac_cv_header_slcurses_h = xyes -o x$ac_cv_header_slang_slcurses_h = xyes; then
100 use_slang=yes
101 else
102 AC_MSG_ERROR([slang selected but slcurses.h not found])
103 fi
104fi
105
106AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes)
107
108
109AC_TRY_LINK([
110#define _XOPEN_SOURCE
111#include <unistd.h>
112],[
113char *c = crypt("abc","pw");
114],,[
115 my_LIBS="$LIBS"
116 LIBS="$LIBS -lcrypt"
117 AC_TRY_COMPILE([
118 #define _XOPEN_SOURCE
119 #include <unistd.h>
120 ],[
121 char *c = crypt("abc","pw");
122 ],[
123 AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
124 need_libcrypt=yes
125 ],[
126 AC_MSG_ERROR([crypt() is not available])
127 ])
128 LIBS="$my_LIBS"
129])
130
131AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes)
132
133AC_TRY_COMPILE([
134#include <stdio.h>
135],[
136printf(__progname);
137],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?])
138)
139
140
141AC_TRY_COMPILE([
142#include <wchar.h>
143#include <wctype.h>
144#include <stdio.h>
145],[
146 wchar_t wc;
147 wint_t w;
148 w = fgetwc(stdin);
149 if (w == WEOF) exit(1);
150 wc = w;
151 fputwc(wc,stdout);
152],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?]))
153
154
155AC_TRY_COMPILE([
156#include <sys/syscall.h>
157#include <unistd.h>
158],[
159int test = SYS_pivot_root;
160],have_pivot_root=true)
161
162AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue)
163
164
165AC_TRY_COMPILE([
166#include <time.h>
167#include <unistd.h>
168],[
169 int a = 0;
170 struct tm *tm = localtime(0);
171 if (a == -1) /* false */
172 sleep(tm->tm_gmtoff);
173],[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])])
174
175
176case "$host" in
177 i?86-*) intel=true ;;
178 sparc*) sparc=true ;;
179esac
180
181AM_CONDITIONAL(INTEL, test x$intel = xtrue)
182AM_CONDITIONAL(SPARC, test x$sparc = xtrue)
183
184
185AC_ARG_ENABLE([agetty],
186 AC_HELP_STRING([--disable-agetty], [do not build agetty]),
187 with_agetty=$withval, with_agetty=yes
188)
189AM_CONDITIONAL(BUILD_AGETTY, test x$with_agetty = xyes)
190
191
192AC_ARG_ENABLE([elvtune],
193 AC_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
194 with_elvtune=$withval, with_elvtune=no
195)
196AM_CONDITIONAL(BUILD_ELVTUNE, test x$with_elvtune = xyes)
197
198
199AC_ARG_ENABLE([init],
200 AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
201 with_init=$withval, with_init=no
202)
203AM_CONDITIONAL(BUILD_INIT, test x$with_init = xyes)
204
205
206AC_ARG_ENABLE([kill],
207 AC_HELP_STRING([--enable-kill], [build kill]),
208 with_kill=$withval, with_kill=no
209)
210AM_CONDITIONAL(BUILD_KILL, test x$with_kill = xyes)
211
212
213AC_ARG_ENABLE([last],
214 AC_HELP_STRING([--enable-last], [build last]),
215 with_last=$withval, with_last=no
216)
217AM_CONDITIONAL(BUILD_LAST, test x$with_last = xyes)
218
219
220AC_ARG_ENABLE([mesg],
221 AC_HELP_STRING([--enable-mesg], [build mesg]),
222 with_mesg=$withval, with_mesg=no
223)
224AM_CONDITIONAL(BUILD_MESG, test x$with_mesg = xyes)
225
226
227AC_ARG_ENABLE([partx],
228 AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
229 with_partx=$withval, with_partx=no
230)
231AM_CONDITIONAL(BUILD_PARTX, test x$with_partx = xyes)
232
233
234AC_ARG_ENABLE([raw],
235 AC_HELP_STRING([--enable-raw], [build raw]),
236 with_raw=$withval, with_raw=no
237)
238AM_CONDITIONAL(BUILD_RAW, test x$with_raw = xyes)
239
240
241AC_ARG_ENABLE([rdev],
242 AC_HELP_STRING([--enable-rdev], [build rdev on i386]),
243 with_rdev=$withval, with_rdev=no
244)
245AM_CONDITIONAL(BUILD_RDEV, test x$with_rdev = xyes)
246
247
248AC_ARG_ENABLE([rename],
249 AC_HELP_STRING([--disable-rename], [do not build rename]),
250 with_agetty=$withval, with_rename=yes
251)
252AM_CONDITIONAL(BUILD_RENAME, test x$with_rename = xyes)
253
254
255AC_ARG_ENABLE([reset],
256 AC_HELP_STRING([--enable-reset], [build reset]),
257 with_reset=$withval, with_reset=no
258)
259AM_CONDITIONAL(BUILD_RESET, test x$with_reset = xyes)
260
261
262AC_ARG_ENABLE([login-utils],
263 AC_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
264 with_login_utils=$withval, with_login_utils=no
265)
266AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$with_login_utils = xyes)
267
268
269AC_ARG_ENABLE([schedutils],
270 AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
271 with_schedutils=$withval, with_schedutils=yes
272)
273AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$with_schedutils = xyes)
274
275
276AC_ARG_ENABLE([wall],
277 AC_HELP_STRING([--disable-wall], [do not build wall]),
278 with_wall=$withval, with_wall=yes
279)
280AM_CONDITIONAL(BUILD_WALL, test x$with_wall = xyes)
281
282
283AC_ARG_ENABLE([write],
284 AC_HELP_STRING([--enable-write], [build write]),
285 with_write=$withval, with_write=no
286)
287AM_CONDITIONAL(BUILD_WRITE, test x$with_write = xyes)
288
289
290AC_ARG_ENABLE([chsh-only-listed],
291 AC_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
292 with_login_chsh_only_listed=$withval, with_chsh_only_listed=yes
293)
294
295if test x$with_chsh_only_listed = xyes; then
296 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
297fi
298
299
300AC_ARG_ENABLE([login-chown-vcs],
301 AC_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
302 with_login_chown_vcs=$withval, with_login_chown_vcs=no
303)
304
305if test x$with_login_chown_vcs = xyes; then
306 AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
307fi
308
309
310AC_ARG_ENABLE([login-stat-mail],
311 AC_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
312 with_login_stat_mail=$withval, with_login_stat_mail=no
313)
314
315if test x$with_login_stat_mail = xyes; then
316 AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
317fi
318
319
320AC_ARG_ENABLE([pg-bell],
321 AC_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
322 with_pg_bell=$withval, with_pg_bell=yes
323)
324
325if test x$with_pg_bell = xyes; then
326 AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
327fi
328
329
330AC_ARG_ENABLE([require-password],
331 AC_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
332 with_require_password=$withval, with_require_password=yes
333)
334
335if test x$with_require_password = xyes; then
336 AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
337fi
338
339
340AC_ARG_ENABLE([use-tty-group],
341 AC_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
342 with_use_tty_group=$withval, with_use_tty_group=yes
343)
344AM_CONDITIONAL(USE_TTY_GROUP, test x$with_use_tty_group = xyes)
345
346if test x$with_use_tty_group = xyes; then
347 AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
348fi
349
350
351
352CPPFLAGS="-fsigned-char -Wall -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration $CPPFLAGS"
353
354
355AC_CONFIG_HEADERS(config.h)
356
357AC_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])
358
359AC_OUTPUT