]>
Commit | Line | Data |
---|---|---|
48d7b13a KZ |
1 | AC_INIT(util-linux, 2.13-pre1, bunk@stusta.de) |
2 | ||
3 | AC_CONFIG_AUX_DIR(config) | |
4 | ||
5 | AM_INIT_AUTOMAKE([check-news std-options -Wall foreign]) | |
6 | ||
7 | AC_CONFIG_SRCDIR(mount/mount.c) | |
8 | ||
9 | AC_PREFIX_DEFAULT(/) | |
10 | ||
11 | AC_PROG_CC_STDC | |
12 | ||
13 | AC_DISABLE_SHARED | |
14 | AC_PROG_LIBTOOL | |
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 | AC_CHECK_HEADERS(security/pam_misc.h) | |
38 | AM_CONDITIONAL(HAVE_PAM, test x$ac_cv_header_security_pam_misc_h = xyes) | |
39 | ||
40 | ||
41 | ||
42 | AC_CHECK_FUNCS(inet_aton) | |
43 | AC_CHECK_FUNCS(fsync) | |
44 | AC_CHECK_FUNCS(getdomainname) | |
45 | AC_CHECK_FUNCS(nanosleep) | |
46 | AC_CHECK_FUNCS(personality) | |
47 | AC_CHECK_FUNCS(updwtmp) | |
48 | AC_FUNC_FSEEKO | |
49 | AC_CHECK_FUNCS(lchown) | |
50 | AC_CHECK_FUNCS(rpmatch) | |
51 | ||
52 | ||
53 | AC_CHECK_LIB(uuid, uuid_is_null) | |
54 | AM_CONDITIONAL(HAVE_UUID, test x$ac_cv_lib_uuid_uuid_is_null = xyes) | |
55 | ||
56 | AC_CHECK_LIB(util, openpty) | |
57 | AM_CONDITIONAL(HAVE_LIBUTIL, test x$ac_cv_lib_util_openpty = xyes) | |
58 | ||
59 | AC_CHECK_LIB(termcap, tgetnum) | |
60 | AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes) | |
61 | ||
62 | AC_CHECK_LIB(z, crc32) | |
63 | AM_CONDITIONAL(HAVE_ZLIB, test x$ac_cv_lib_z_crc32 = xyes) | |
64 | ||
65 | AC_CHECK_LIB(blkid, blkid_known_fstype) | |
66 | AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes) | |
67 | ||
68 | AC_CHECK_LIB(selinux, getprevcon) | |
69 | AM_CONDITIONAL(HAVE_SELINUX, test x$ac_cv_lib_selinux_getprevcon = xyes) | |
70 | ||
71 | LIBS="" | |
72 | ||
73 | ||
74 | AM_GNU_GETTEXT([external]) | |
75 | ||
76 | ||
77 | AC_CHECK_HEADERS(ncurses.h) | |
78 | AC_CHECK_HEADERS(ncurses/ncurses.h) | |
79 | ||
80 | ||
81 | if 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]) | |
84 | else | |
85 | AC_MSG_NOTICE([you do not have ncurses]) | |
86 | fi | |
87 | ||
88 | AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes) | |
89 | ||
90 | ||
91 | AC_ARG_WITH([slang], | |
92 | AC_HELP_STRING([--with-slang], [compile cfdisk with slang]), | |
93 | with_slang=$withval, with_slang=no | |
94 | ) | |
95 | ||
96 | if 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 | |
104 | fi | |
105 | ||
106 | AM_CONDITIONAL(USE_SLANG, test x$use_slang = xyes) | |
107 | ||
108 | ||
109 | AC_TRY_LINK([ | |
110 | #define _XOPEN_SOURCE | |
111 | #include <unistd.h> | |
112 | ],[ | |
113 | char *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 | ||
131 | AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes) | |
132 | ||
133 | AC_TRY_COMPILE([ | |
134 | #include <stdio.h> | |
135 | ],[ | |
136 | printf(__progname); | |
137 | ],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?]) | |
138 | ) | |
139 | ||
140 | ||
141 | AC_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 | ||
155 | AC_TRY_COMPILE([ | |
156 | #include <sys/syscall.h> | |
157 | #include <unistd.h> | |
158 | ],[ | |
159 | int test = SYS_pivot_root; | |
160 | ],have_pivot_root=true) | |
161 | ||
162 | AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue) | |
163 | ||
164 | ||
165 | AC_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 | ||
176 | case "$host" in | |
177 | i?86-*) intel=true ;; | |
178 | sparc*) sparc=true ;; | |
179 | esac | |
180 | ||
181 | AM_CONDITIONAL(INTEL, test x$intel = xtrue) | |
182 | AM_CONDITIONAL(SPARC, test x$sparc = xtrue) | |
183 | ||
184 | ||
185 | AC_ARG_ENABLE([agetty], | |
186 | AC_HELP_STRING([--disable-agetty], [do not build agetty]), | |
187 | with_agetty=$withval, with_agetty=yes | |
188 | ) | |
189 | AM_CONDITIONAL(BUILD_AGETTY, test x$with_agetty = xyes) | |
190 | ||
191 | ||
192 | AC_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 | ) | |
196 | AM_CONDITIONAL(BUILD_ELVTUNE, test x$with_elvtune = xyes) | |
197 | ||
198 | ||
199 | AC_ARG_ENABLE([init], | |
200 | AC_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]), | |
201 | with_init=$withval, with_init=no | |
202 | ) | |
203 | AM_CONDITIONAL(BUILD_INIT, test x$with_init = xyes) | |
204 | ||
205 | ||
206 | AC_ARG_ENABLE([kill], | |
207 | AC_HELP_STRING([--enable-kill], [build kill]), | |
208 | with_kill=$withval, with_kill=no | |
209 | ) | |
210 | AM_CONDITIONAL(BUILD_KILL, test x$with_kill = xyes) | |
211 | ||
212 | ||
213 | AC_ARG_ENABLE([last], | |
214 | AC_HELP_STRING([--enable-last], [build last]), | |
215 | with_last=$withval, with_last=no | |
216 | ) | |
217 | AM_CONDITIONAL(BUILD_LAST, test x$with_last = xyes) | |
218 | ||
219 | ||
220 | AC_ARG_ENABLE([mesg], | |
221 | AC_HELP_STRING([--enable-mesg], [build mesg]), | |
222 | with_mesg=$withval, with_mesg=no | |
223 | ) | |
224 | AM_CONDITIONAL(BUILD_MESG, test x$with_mesg = xyes) | |
225 | ||
226 | ||
227 | AC_ARG_ENABLE([partx], | |
228 | AC_HELP_STRING([--enable-partx], [build addpart, delpart, partx]), | |
229 | with_partx=$withval, with_partx=no | |
230 | ) | |
231 | AM_CONDITIONAL(BUILD_PARTX, test x$with_partx = xyes) | |
232 | ||
233 | ||
234 | AC_ARG_ENABLE([raw], | |
235 | AC_HELP_STRING([--enable-raw], [build raw]), | |
236 | with_raw=$withval, with_raw=no | |
237 | ) | |
238 | AM_CONDITIONAL(BUILD_RAW, test x$with_raw = xyes) | |
239 | ||
240 | ||
241 | AC_ARG_ENABLE([rdev], | |
242 | AC_HELP_STRING([--enable-rdev], [build rdev on i386]), | |
243 | with_rdev=$withval, with_rdev=no | |
244 | ) | |
245 | AM_CONDITIONAL(BUILD_RDEV, test x$with_rdev = xyes) | |
246 | ||
247 | ||
248 | AC_ARG_ENABLE([rename], | |
249 | AC_HELP_STRING([--disable-rename], [do not build rename]), | |
250 | with_agetty=$withval, with_rename=yes | |
251 | ) | |
252 | AM_CONDITIONAL(BUILD_RENAME, test x$with_rename = xyes) | |
253 | ||
254 | ||
255 | AC_ARG_ENABLE([reset], | |
256 | AC_HELP_STRING([--enable-reset], [build reset]), | |
257 | with_reset=$withval, with_reset=no | |
258 | ) | |
259 | AM_CONDITIONAL(BUILD_RESET, test x$with_reset = xyes) | |
260 | ||
261 | ||
262 | AC_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 | ) | |
266 | AM_CONDITIONAL(BUILD_LOGIN_UTILS, test x$with_login_utils = xyes) | |
267 | ||
268 | ||
269 | AC_ARG_ENABLE([schedutils], | |
270 | AC_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]), | |
271 | with_schedutils=$withval, with_schedutils=yes | |
272 | ) | |
273 | AM_CONDITIONAL(BUILD_SCHEDUTILS, test x$with_schedutils = xyes) | |
274 | ||
275 | ||
276 | AC_ARG_ENABLE([wall], | |
277 | AC_HELP_STRING([--disable-wall], [do not build wall]), | |
278 | with_wall=$withval, with_wall=yes | |
279 | ) | |
280 | AM_CONDITIONAL(BUILD_WALL, test x$with_wall = xyes) | |
281 | ||
282 | ||
283 | AC_ARG_ENABLE([write], | |
284 | AC_HELP_STRING([--enable-write], [build write]), | |
285 | with_write=$withval, with_write=no | |
286 | ) | |
287 | AM_CONDITIONAL(BUILD_WRITE, test x$with_write = xyes) | |
288 | ||
289 | ||
290 | AC_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 | ||
295 | if test x$with_chsh_only_listed = xyes; then | |
296 | AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?]) | |
297 | fi | |
298 | ||
299 | ||
300 | AC_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 | ||
305 | if test x$with_login_chown_vcs = xyes; then | |
306 | AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?]) | |
307 | fi | |
308 | ||
309 | ||
310 | AC_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 | ||
315 | if test x$with_login_stat_mail = xyes; then | |
316 | AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?]) | |
317 | fi | |
318 | ||
319 | ||
320 | AC_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 | ||
325 | if test x$with_pg_bell = xyes; then | |
326 | AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?]) | |
327 | fi | |
328 | ||
329 | ||
330 | AC_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 | ||
335 | if test x$with_require_password = xyes; then | |
336 | AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?]) | |
337 | fi | |
338 | ||
339 | ||
340 | AC_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 | ) | |
344 | AM_CONDITIONAL(USE_TTY_GROUP, test x$with_use_tty_group = xyes) | |
345 | ||
346 | if test x$with_use_tty_group = xyes; then | |
347 | AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?]) | |
348 | fi | |
349 | ||
350 | ||
351 | ||
352 | CPPFLAGS="-fsigned-char -Wall -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration $CPPFLAGS" | |
353 | ||
354 | ||
355 | AC_CONFIG_HEADERS(config.h) | |
356 | ||
357 | 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]) | |
358 | ||
359 | AC_OUTPUT |