]>
Commit | Line | Data |
---|---|---|
38c75b59 SK |
1 | AC_INIT(util-linux, |
2 | m4_esyscmd([tools/git-version-gen .tarball-version]), | |
3 | kzak@redhat.com) | |
baf39af1 | 4 | |
7fc9786b | 5 | AC_PREREQ(2.60) |
48d7b13a KZ |
6 | |
7 | AC_CONFIG_AUX_DIR(config) | |
b12991dd | 8 | AC_CONFIG_MACRO_DIR([m4]) |
df5f3c54 | 9 | AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability]) |
48d7b13a | 10 | |
eb35c251 GJ |
11 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], |
12 | [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) | |
13 | ||
48d7b13a | 14 | AC_CONFIG_SRCDIR(mount/mount.c) |
15a9b48c SK |
15 | AC_PREFIX_DEFAULT([/usr]) |
16 | ||
33b0be6d KZ |
17 | dnl version details from <major>.<minor>[-<suffix>] |
18 | PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}') | |
19 | PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \ | |
20 | | awk -F- '{print $1}') | |
21 | PACKAGE_VERSION_RELEASE=0 | |
a0948ffe | 22 | |
33b0be6d KZ |
23 | dnl libblkid version |
24 | LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
6b7113bc | 25 | LIBBLKID_DATE="24-Feb-2012" |
dc2b8d87 KZ |
26 | LIBBLKID_LT_MAJOR=1 |
27 | LIBBLKID_LT_MINOR=1 | |
28 | LIBBLKID_LT_MICRO=0 | |
29 | LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR | |
a0948ffe | 30 | |
f6076f55 KZ |
31 | dnl libuuid version |
32 | LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
dc2b8d87 KZ |
33 | LIBUUID_LT_MAJOR=1 |
34 | LIBUUID_LT_MINOR=3 | |
35 | LIBUUID_LT_MICRO=0 | |
36 | LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR | |
f6076f55 | 37 | |
f1cde479 KZ |
38 | dnl libmount version |
39 | LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
40 | LIBMOUNT_LT_MAJOR=1 | |
41 | LIBMOUNT_LT_MINOR=1 | |
42 | LIBMOUNT_LT_MICRO=0 | |
43 | LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR | |
44 | ||
15a9b48c SK |
45 | # Check whether exec_prefix=/usr: |
46 | case $exec_prefix:$prefix in | |
47 | NONE:NONE | NONE:/usr | /usr:*) | |
48 | AC_MSG_NOTICE([Default --exec-prefix detected.]) | |
49 | case $bindir in | |
50 | '${exec_prefix}/bin') bindir=/bin | |
51 | AC_MSG_NOTICE([ --bindir defaults to /bin]) ;; | |
52 | esac | |
53 | case $sbindir in | |
54 | '${exec_prefix}/sbin') sbindir=/sbin | |
55 | AC_MSG_NOTICE([ --sbindir defaults to /sbin]) ;; | |
971f57f6 KZ |
56 | esac |
57 | case $libdir in | |
58 | '${exec_prefix}/lib') libdir=/lib | |
59 | AC_MSG_NOTICE([ --libdir defaults to /lib]) ;; | |
15a9b48c SK |
60 | esac ;; |
61 | esac | |
48d7b13a | 62 | |
cb5212e2 | 63 | libdirname=`basename "$libdir"` |
b0a0d7d5 KZ |
64 | AC_SUBST([libdirname]) |
65 | ||
996fb358 | 66 | # The original default values of {bin,sbin,lib}dir |
aaf3e8f5 | 67 | usrbin_execdir='${exec_prefix}/bin' |
30688dde | 68 | AC_SUBST([usrbin_execdir]) |
996fb358 | 69 | |
aaf3e8f5 | 70 | usrsbin_execdir='${exec_prefix}/sbin' |
30688dde | 71 | AC_SUBST([usrsbin_execdir]) |
996fb358 | 72 | |
aaf3e8f5 | 73 | usrlib_execdir='${exec_prefix}/'$libdirname |
30688dde | 74 | AC_SUBST([usrlib_execdir]) |
996fb358 | 75 | |
31c9c1c4 | 76 | AM_PROG_CC_C_O |
48d7b13a | 77 | AC_PROG_CC_STDC |
240f7101 | 78 | AC_GNU_SOURCE |
a6996860 | 79 | AC_CANONICAL_HOST |
85b4c147 | 80 | AC_C_CONST |
e79829db | 81 | AC_C_VOLATILE |
fbaec83b | 82 | AC_C_BIGENDIAN |
b12991dd KZ |
83 | |
84 | dnl libtool-2 | |
85 | LT_INIT | |
48d7b13a | 86 | |
fd0f4132 SK |
87 | m4_ifndef([PKG_PROG_PKG_CONFIG], |
88 | [m4_fatal([Could not locate the pkg-config autoconf | |
89 | macros. These are usually located in /usr/share/aclocal/pkg.m4. | |
90 | If your macros are in a different location, try setting the | |
91 | environment variable AL_OPTS="-I/other/macro/dir" before running | |
92 | ./autogen.sh or autoreconf again.])]) | |
d06d028a KZ |
93 | PKG_PROG_PKG_CONFIG |
94 | ||
22aa5166 KZ |
95 | GTK_DOC_CHECK([1.10]) |
96 | AC_PATH_PROG([XSLTPROC], [xsltproc]) | |
97 | ||
8c182554 KZ |
98 | linux_os=no |
99 | case ${host_os} in | |
100 | *linux*) | |
101 | linux_os=yes | |
102 | ;; | |
103 | esac | |
49ccbae6 | 104 | AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes) |
8c182554 | 105 | |
3c6e292c KZ |
106 | dnl define ARCH_<NAME> conditionals |
107 | UL_SET_ARCH(I86, i?86-*) | |
108 | UL_SET_ARCH(86_64, x86_64*) | |
109 | UL_SET_ARCH(IA64, ia64*) | |
110 | UL_SET_ARCH(S390, s390*) | |
111 | UL_SET_ARCH(SPARC, sparc*) | |
112 | UL_SET_ARCH(PPC, ppc*|powerpc*) | |
113 | UL_SET_ARCH(M68K, m68*) | |
114 | UL_SET_ARCH(MIPS, mips*) | |
115 | UL_SET_ARCH(HPPA, hppa*) | |
116 | ||
48d7b13a KZ |
117 | AC_SYS_LARGEFILE |
118 | ||
09734b00 KZ |
119 | AM_GNU_GETTEXT_VERSION([0.14.1]) |
120 | AM_GNU_GETTEXT([external]) | |
121 | if test -d "$srcdir/po" | |
122 | then | |
123 | ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'` | |
124 | else | |
125 | 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" | |
126 | fi | |
127 | ||
e460a5bf | 128 | AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [ |
48d7b13a KZ |
129 | #ifdef HAVE_LINUX_COMPILER_H |
130 | #include <linux/compiler.h> | |
131 | #endif | |
132 | ]) | |
bf962c0a | 133 | AC_CHECK_HEADERS( |
a0948ffe KZ |
134 | [err.h \ |
135 | errno.h \ | |
136 | getopt.h \ | |
a0948ffe KZ |
137 | linux/fd.h \ |
138 | linux/tiocl.h \ | |
139 | linux/version.h \ | |
b832c2fe | 140 | linux/falloc.h \ |
55113b15 | 141 | linux/cdrom.h \ |
b832c2fe | 142 | fcntl.h \ |
8b7f16fc | 143 | locale.h \ |
754fed0c KZ |
144 | stdint.h \ |
145 | inttypes.h \ | |
0bf9d41d | 146 | paths.h \ |
a0948ffe | 147 | pty.h \ |
607c2a72 | 148 | mntent.h \ |
754fed0c KZ |
149 | net/if.h \ |
150 | net/if_dl.h \ | |
151 | netinet/in.h \ | |
bf962c0a | 152 | rpcsvc/nfs_prot.h \ |
a0948ffe | 153 | stdlib.h \ |
363ce071 | 154 | asm/io.h \ |
a0948ffe KZ |
155 | sys/disk.h \ |
156 | sys/disklabel.h \ | |
157 | sys/ioctl.h \ | |
3edaa201 | 158 | sys/ioccom.h \ |
bf962c0a | 159 | sys/io.h \ |
754fed0c | 160 | sys/time.h \ |
a0948ffe KZ |
161 | sys/mkdev.h \ |
162 | sys/prctl.h \ | |
163 | sys/queue.h \ | |
754fed0c | 164 | sys/sockio.h \ |
2a7c1f70 KZ |
165 | sys/socket.h \ |
166 | sys/syscall.h \ | |
754fed0c KZ |
167 | sys/file.h \ |
168 | sys/ioctl.h \ | |
a0948ffe KZ |
169 | sys/stat.h \ |
170 | sys/types.h \ | |
754fed0c | 171 | sys/un.h \ |
a0948ffe | 172 | sys/user.h \ |
a67387b7 | 173 | sys/swap.h \ |
754fed0c | 174 | sys/resource.h \ |
ff0cb84d | 175 | security/pam_misc.h \ |
16ba8d58 | 176 | linux/raw.h \ |
a0948ffe | 177 | unistd.h ]) |
dc61d398 | 178 | |
a67387b7 KZ |
179 | AC_CHECK_HEADERS([langinfo.h], |
180 | [AM_CONDITIONAL([HAVE_LANGINFO], [true])], | |
181 | [AM_CONDITIONAL([HAVE_LANGINFO], [false])]) | |
182 | ||
16ba8d58 KZ |
183 | dnl Convert some ac_cv_header_* variables to have_* |
184 | dnl | |
185 | have_linux_raw_h=$ac_cv_header_linux_raw_h | |
ff0cb84d | 186 | have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h |
48d7b13a | 187 | |
a67387b7 KZ |
188 | |
189 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
190 | #include <time.h> | |
191 | #include <unistd.h> | |
192 | ]], [[ | |
193 | int a = 0; | |
194 | struct tm *tm = localtime(0); | |
195 | if (a == -1) /* false */ | |
196 | sleep(tm->tm_gmtoff); | |
197 | ]])], | |
198 | [AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?]) | |
199 | ]) | |
200 | ||
201 | AC_CHECK_MEMBERS([struct termios.c_line],,, | |
202 | [[#include <termios.h>]]) | |
203 | ||
204 | AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, | |
205 | [#include <sys/stat.h>]) | |
206 | ||
207 | AC_CHECK_DECLS([ | |
208 | UNAME26, | |
209 | ADDR_NO_RANDOMIZE, | |
210 | FDPIC_FUNCPTRS, | |
211 | MMAP_PAGE_ZERO, | |
212 | ADDR_COMPAT_LAYOUT, | |
213 | READ_IMPLIES_EXEC, | |
214 | ADDR_LIMIT_32BIT, | |
215 | WHOLE_SECONDS, | |
216 | STICKY_TIMEOUTS, | |
217 | ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>]) | |
218 | ||
219 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | |
220 | [[ | |
221 | #ifdef HAVE_SYS_SWAP_H | |
222 | # include <sys/swap.h> | |
223 | #endif | |
224 | #include <unistd.h> | |
225 | ]], | |
226 | [[swapon("/dev/null", 0);]])], | |
227 | [AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?]) | |
228 | ], | |
229 | [AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.]) | |
230 | ]) | |
dc61d398 KZ |
231 | |
232 | ||
a88057d9 TP |
233 | AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]]) |
234 | ||
2a7c1f70 KZ |
235 | AC_CHECK_DECL([llseek], |
236 | [AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1, | |
237 | [Define to 1 if have llseek prototype])], | |
238 | [], | |
239 | [#include <unistd.h>]) | |
240 | ||
241 | AC_CHECK_DECL([lseek64], | |
242 | [AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1, | |
243 | [Define to 1 if have lseek64 prototype])], | |
244 | [], | |
245 | [#define _LARGEFILE_SOURCE | |
246 | #define _LARGEFILE64_SOURCE | |
247 | #include <unistd.h>]) | |
248 | ||
bf962c0a SK |
249 | AC_CHECK_FUNCS( |
250 | [inet_aton \ | |
eb76ca98 FG |
251 | err \ |
252 | errx \ | |
b7ce600d | 253 | futimens \ |
2a7c1f70 | 254 | fstat64 \ |
bf962c0a SK |
255 | fsync \ |
256 | getdomainname \ | |
e27a08ab | 257 | get_current_dir_name \ |
437fa54f | 258 | usleep \ |
bf962c0a SK |
259 | nanosleep \ |
260 | personality \ | |
132ea941 | 261 | updwtmp \ |
3ac22f7a | 262 | jrand48 \ |
bf962c0a | 263 | lchown \ |
a0948ffe KZ |
264 | llseek \ |
265 | lseek64 \ | |
485a8bfa | 266 | scandirat \ |
a0948ffe | 267 | strtoull \ |
754fed0c KZ |
268 | sysconf \ |
269 | getdtablesize \ | |
a804f444 | 270 | getexecname \ |
754fed0c | 271 | getrlimit \ |
a1504d8b | 272 | sigqueue \ |
754fed0c | 273 | srandom \ |
69045d3d KZ |
274 | setresgid \ |
275 | setresuid \ | |
69b7e41e KZ |
276 | strndup \ |
277 | strnlen \ | |
278 | strnchr \ | |
fc7aeb09 | 279 | inotify_init \ |
a0948ffe | 280 | prctl \ |
a67bb3bf | 281 | posix_fadvise \ |
acf6ab6f | 282 | getmntinfo \ |
a0948ffe | 283 | __secure_getenv \ |
eb76ca98 FG |
284 | warn \ |
285 | warnx \ | |
bf962c0a | 286 | rpmatch]) |
48d7b13a | 287 | AC_FUNC_FSEEKO |
48d7b13a | 288 | |
940fd28c | 289 | AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no]) |
465e9973 | 290 | AC_CHECK_FUNCS([ioperm iopl], [have_io=yes]) |
465e9973 | 291 | |
754fed0c KZ |
292 | AC_CHECK_MEMBER(struct sockaddr.sa_len, |
293 | AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),, | |
294 | [#include <sys/types.h> | |
295 | #include <sys/socket.h>]) | |
296 | ||
60cc9f94 FG |
297 | SOCKET_LIBS= |
298 | AC_SEARCH_LIBS([gethostbyname], [nsl], | |
299 | [if test x"$ac_cv_search_gethostbyname" != x"none required"; then | |
300 | SOCKET_LIBS="$SOCKET_LIBS -lnsl"; | |
301 | fi]) | |
302 | AC_SEARCH_LIBS([socket], [socket], | |
303 | [if test x"$ac_cv_search_socket" != x"none required"; then | |
304 | SOCKET_LIBS="$SOCKET_LIBS -lsocket"; | |
305 | fi]) | |
306 | AC_SUBST([SOCKET_LIBS]) | |
307 | ||
d58c47d9 FG |
308 | |
309 | have_dirfd=no | |
310 | AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no]) | |
311 | if test x"$have_dirfd" = xno ; then | |
312 | AC_CHECK_DECLS([dirfd], | |
313 | [have_dirfd=yes], [have_dirfd=no], | |
314 | [#include <sys/types.h> | |
315 | #include <dirent.h>]) | |
316 | fi | |
317 | ||
318 | have_ddfd=no | |
319 | if test x"$have_dirfd" = xno ; then | |
320 | AC_CHECK_MEMBERS([DIR.dd_fd], | |
321 | [have_ddfd=yes], [have_ddfd=no], | |
322 | [#include <sys/types.h> | |
323 | #include <dirent.h>]) | |
324 | fi | |
325 | ||
326 | case "$have_dirfd:$have_ddfd" in | |
327 | no:no) | |
328 | AC_MSG_ERROR([cannot find a method to get filedescriptor of directory]) ;; | |
329 | esac | |
330 | ||
331 | ||
a804f444 FG |
332 | AC_MSG_CHECKING(whether program_invocation_short_name is defined) |
333 | AC_TRY_COMPILE([#include <argp.h>], | |
334 | [program_invocation_short_name = "test";], | |
335 | AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1, | |
336 | [Define if program_invocation_short_name is defined]) | |
337 | AC_MSG_RESULT(yes), | |
338 | AC_MSG_RESULT(no)) | |
339 | ||
340 | AC_MSG_CHECKING([whether __progname is defined]) | |
341 | AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;], | |
342 | [if (*__progname == 0) return;])], | |
343 | AC_DEFINE(HAVE___PROGNAME, 1, [Define if __progname is defined]) | |
344 | AC_MSG_RESULT(yes), | |
345 | AC_MSG_RESULT(no)) | |
346 | ||
8569410c | 347 | dnl Static compilation |
132ea941 | 348 | m4_define([UL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid]) |
8569410c SK |
349 | |
350 | AC_ARG_ENABLE([static-programs], | |
351 | [AS_HELP_STRING([--enable-static-programs=LIST], | |
352 | [link static the programs in LIST (comma-separated, | |
132ea941 | 353 | supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])]) |
8569410c SK |
354 | |
355 | case $enable_static_programs in | |
132ea941 | 356 | yes) enable_static_programs=m4_quote(UL_STATIC_PROGRAMS) ;; |
8569410c SK |
357 | no) enable_static_programs= ;; |
358 | esac | |
359 | ||
8569410c | 360 | dnl Set all the individual AM_CONDITIONALs |
132ea941 | 361 | m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [ |
8569410c | 362 | case ,$enable_static_programs, in |
132ea941 | 363 | *,UL_PRG,*) static_[]UL_PRG=yes ;; |
8569410c | 364 | esac |
132ea941 KZ |
365 | AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG), |
366 | [test "x$static_[]UL_PRG" = xyes]) | |
8569410c SK |
367 | ]) |
368 | ||
d7a01582 | 369 | AX_CHECK_TLS |
3ac22f7a | 370 | |
13f5473e KZ |
371 | AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl |
372 | # include <stdio.h> | |
373 | int main() | |
374 | { | |
375 | int i; | |
376 | char *s; | |
377 | i = sscanf("x", $1, &s); | |
378 | if (i == 1) | |
379 | return 0; | |
380 | return 1; | |
381 | }]) | |
382 | ||
383 | AC_CACHE_VAL([scanf_cv_alloc_modifier], | |
384 | AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])], | |
385 | [scanf_cv_alloc_modifier=ms], | |
386 | AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%as"])])], | |
387 | [scanf_cv_alloc_modifier=as], | |
388 | [scanf_cv_alloc_modifier=no] | |
389 | ) | |
f46d1c96 | 390 | , |
9a0339e0 SAS |
391 | |
392 | [AC_COMPILE_IFELSE([AC_LANG_SOURCE([ | |
393 | #include <stdio.h> | |
394 | ||
395 | #ifdef __GLIBC__ | |
396 | ||
397 | #if !(__GLIBC_PREREQ(2, 7)) | |
398 | #error %m is not available | |
399 | #endif | |
400 | ||
401 | #else | |
402 | ||
403 | #error Your C-library is not supported. | |
404 | #endif | |
405 | ])], | |
406 | [scanf_cv_alloc_modifier=ms], | |
407 | [scanf_cv_alloc_modifier=no])] | |
13f5473e KZ |
408 | ) |
409 | ) | |
410 | ||
411 | AC_MSG_CHECKING([scanf string alloc modifiers]) | |
412 | case "$scanf_cv_alloc_modifier" in | |
413 | ms) | |
414 | AC_MSG_RESULT([(%ms) yes]) | |
415 | AC_DEFINE([HAVE_SCANF_MS_MODIFIER], [1], [scanf %ms modifier]) | |
416 | have_scanf_alloc_modifier=yes | |
417 | ;; | |
418 | as) | |
419 | AC_MSG_RESULT([(%as) yes]) | |
420 | have_scanf_alloc_modifier=yes | |
421 | AC_DEFINE([HAVE_SCANF_AS_MODIFIER], [1], [scanf %as modifier]) | |
422 | ;; | |
423 | *) | |
424 | AC_MSG_RESULT([no]) | |
425 | have_scanf_alloc_modifier=no | |
426 | ;; | |
427 | esac | |
428 | ||
3aecf79d KZ |
429 | UL_CHECK_LIB(util, openpty) |
430 | UL_CHECK_LIB(termcap, tgetnum) | |
431 | ||
432 | AC_CHECK_TYPES([union semun], [], [], [[ | |
433 | #include <sys/sem.h> | |
434 | ]]) | |
435 | AC_CHECK_TYPES(loff_t) | |
436 | ||
437 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
438 | #include <wchar.h> | |
439 | #include <wctype.h> | |
440 | #include <stdio.h> | |
441 | ]], [[ | |
442 | wchar_t wc; | |
443 | wint_t w; | |
444 | w = fgetwc(stdin); | |
445 | if (w == WEOF) exit(1); | |
446 | wc = w; | |
447 | fputwc(wc,stdout); | |
448 | ]])], | |
449 | [AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?) | |
450 | ]) | |
451 | ||
452 | AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[ | |
453 | #include <sched.h> | |
454 | ]]) | |
455 | ||
456 | AM_CONDITIONAL(HAVE_CPU_SET_T, [test "x$have_cpu_set_t" = xyes]) | |
457 | ||
458 | AC_CHECK_DECLS([CPU_ALLOC], [], [], [[ | |
459 | #include <sched.h> | |
460 | ]]) | |
461 | ||
8d35bdc9 KZ |
462 | # on Solaris, you can't mix and match standards, since we use c99 |
463 | # aparently at this stage, XOPEN_SOURCE will conflict. As workaround, | |
464 | # check for crypt.h and use that without XOPEN_SOURCE. | |
465 | AC_CHECK_HEADERS([crypt.h]) | |
466 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
467 | #ifdef HAVE_CRYPT_H | |
468 | #include <crypt.h> | |
469 | #else | |
470 | #define _XOPEN_SOURCE | |
471 | #include <unistd.h> | |
472 | #endif | |
473 | ]], [[ | |
474 | char *c = crypt("abc","pw"); | |
475 | ]])],[],[ | |
476 | LIBS="$LIBS -lcrypt" | |
477 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
478 | #ifdef HAVE_CRYPT_H | |
479 | #include <crypt.h> | |
480 | #else | |
481 | #define _XOPEN_SOURCE | |
482 | #include <unistd.h> | |
483 | #endif | |
484 | ]], [[ | |
485 | char *c = crypt("abc","pw"); | |
486 | ]])],[ | |
487 | AC_DEFINE(HAVE_LIBCRYPT, 1, [Do we need -lcrypt?]) | |
488 | have_libcrypt=yes | |
489 | ],[ | |
490 | AC_MSG_ERROR([crypt() is not available]) | |
491 | ]) | |
492 | ]) | |
493 | AM_CONDITIONAL(HAVE_LIBCRYPT, test "x$have_libcrypt" = xyes) | |
494 | ||
13f5473e | 495 | |
75ad4910 KZ |
496 | AC_ARG_WITH([selinux], |
497 | AS_HELP_STRING([--with-selinux], [compile with SELinux support]), | |
498 | [], with_selinux=no | |
499 | ) | |
500 | ||
501 | if test "x$with_selinux" = xno; then | |
502 | AM_CONDITIONAL(HAVE_SELINUX, false) | |
503 | else | |
504 | UL_CHECK_LIB(selinux, getprevcon) | |
505 | case "$with_selinux:$have_selinux" in | |
506 | yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);; | |
507 | esac | |
508 | fi | |
509 | ||
510 | if test "x$have_selinux" = xyes; then | |
511 | SELINUX_LIBS="-lselinux -lsepol" | |
512 | SELINUX_LIBS_STATIC="-lselinux -lsepol" | |
513 | old_LDFLAGS="$LDFLAGS" | |
514 | LDFLAGS="$LDFLAGS $SELINUX_LIBS" | |
515 | # This function is missing in old libselinux 1.xx versions | |
516 | AC_CHECK_FUNCS([security_get_initial_context]) | |
517 | LDFLAGS="$old_LDFLAGS" | |
518 | fi | |
519 | AC_SUBST([SELINUX_LIBS]) | |
520 | AC_SUBST([SELINUX_LIBS_STATIC]) | |
521 | ||
522 | AC_ARG_WITH([audit], | |
523 | AS_HELP_STRING([--with-audit], [compile with audit support]), | |
524 | [], with_audit=no | |
525 | ) | |
526 | ||
527 | if test "x$with_audit" = xno; then | |
528 | AM_CONDITIONAL(HAVE_AUDIT, false) | |
529 | else | |
530 | UL_CHECK_LIB(audit, audit_log_user_message) | |
531 | case "$with_audit:$have_audit" in | |
532 | yes:no) | |
533 | AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())]) | |
534 | ;; | |
535 | esac | |
536 | fi | |
537 | ||
538 | AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]), | |
539 | [], with_udev=auto | |
540 | ) | |
541 | ||
542 | if test "x$with_udev" = xno; then | |
543 | AM_CONDITIONAL(HAVE_UDEV, false) | |
544 | else | |
545 | UL_CHECK_LIB(udev, udev_new) | |
546 | case "$with_udev:$have_udev" in | |
547 | yes:no) | |
548 | AC_MSG_ERROR([udev selected but libudev not found]) | |
549 | ;; | |
550 | esac | |
551 | fi | |
552 | ||
553 | AC_ARG_WITH([ncurses], | |
554 | AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version | |
555 | (--without-ncurses disables all ncurses(w) support)]), | |
556 | [], with_ncurses=auto | |
557 | ) | |
558 | AM_CONDITIONAL(HAVE_NCURSES, false) | |
559 | ||
560 | if test "x$with_ncurses" != xno; then | |
561 | have_ncurses=no | |
562 | AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [ | |
563 | if test "x$with_ncurses" = xauto; then | |
564 | UL_CHECK_LIB(ncursesw, initscr, ncurses) | |
565 | if test "x$have_ncurses" = xyes; then | |
566 | AC_CHECK_HEADERS([ncursesw/ncurses.h]) | |
567 | NCURSES_LIBS="-lncursesw" | |
568 | fi | |
569 | fi | |
570 | if test "x$have_ncurses" = xno; then | |
571 | UL_CHECK_LIB(ncurses, initscr) | |
572 | if test "x$have_ncurses" = xyes; then | |
573 | NCURSES_LIBS="-lncurses" | |
574 | fi | |
575 | fi | |
576 | ]) | |
577 | if test "x$have_ncurses" = xno; then | |
578 | AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)]) | |
579 | fi | |
580 | fi | |
581 | AC_SUBST([NCURSES_LIBS]) | |
582 | ||
583 | ||
584 | AC_ARG_WITH([slang], | |
585 | AS_HELP_STRING([--with-slang], [compile cfdisk with slang]), | |
586 | [], with_slang=no | |
587 | ) | |
588 | ||
589 | have_tinfo=no | |
590 | AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes]) | |
591 | AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes) | |
592 | ||
593 | use_slang=no | |
594 | if test "x$with_slang" = xyes; then | |
595 | AC_CHECK_HEADERS([slang.h slang/slang.h]) | |
596 | AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], | |
597 | [use_slang=yes], [], [ | |
598 | #ifdef HAVE_SLANG_H | |
599 | #include <slang.h> | |
600 | #elif defined(HAVE_SLANG_SLANG_H) | |
601 | #include <slang/slang.h> | |
602 | #endif | |
603 | ]) | |
604 | if test "x$use_slang" = xno; then | |
605 | AC_MSG_ERROR([slang selected but slcurses.h not found]) | |
606 | fi | |
607 | fi | |
608 | AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes) | |
609 | ||
610 | ||
611 | AC_ARG_WITH([utempter], | |
612 | AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]), | |
613 | [], with_utempter=no | |
614 | ) | |
615 | ||
616 | if test "x$with_utempter" = xyes; then | |
617 | UL_CHECK_LIB(utempter, utempter_add_record) | |
618 | if test "x$have_utempter" = xno; then | |
619 | AC_MSG_ERROR([utempter selected but libutempter not found]) | |
620 | fi | |
621 | else | |
622 | AM_CONDITIONAL(HAVE_UTEMPTER, false) | |
623 | fi | |
624 | ||
625 | ||
d17584b6 SK |
626 | AC_ARG_ENABLE([most-builds], |
627 | AS_HELP_STRING([--enable-most-builds], [build everthing other than experimental code]), | |
628 | [], enable_most_builds=no | |
629 | ) | |
630 | if test "x$enable_most_builds" = xyes; then | |
631 | enable_arch=yes | |
632 | enable_ddate=yes | |
633 | enable_elvtune=yes | |
634 | enable_kill=yes | |
635 | enable_last=yes | |
636 | enable_line=yes | |
637 | enable_mesg=yes | |
638 | enable_raw=yes | |
639 | enable_rename=yes | |
640 | enable_reset=yes | |
641 | enable_login_utils=yes | |
642 | enable_write=yes | |
643 | fi | |
644 | ||
1dbbde66 KZ |
645 | dnl |
646 | dnl libuuid | |
647 | dnl | |
17afb032 KZ |
648 | AC_ARG_ENABLE([libuuid], |
649 | AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]), | |
650 | [], enable_libuuid=yes | |
651 | ) | |
fa7be20e | 652 | UL_BUILD_INIT([libuuid]) |
dc2b8d87 KZ |
653 | AC_SUBST([LIBUUID_VERSION]) |
654 | AC_SUBST([LIBUUID_VERSION_INFO]) | |
fa7be20e | 655 | AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes) |
9dc801d2 | 656 | |
403e2d0c | 657 | if test "x$enable_libuuid" = xyes; then |
17afb032 KZ |
658 | AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.]) |
659 | else | |
660 | AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs]) | |
661 | fi | |
48d7b13a | 662 | |
1dbbde66 KZ |
663 | dnl |
664 | dnl libblkid | |
665 | dnl | |
f910b559 | 666 | AC_ARG_ENABLE([libblkid], |
1d12ed57 | 667 | AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]), |
f910b559 | 668 | [], enable_libblkid=yes |
40f07ff7 | 669 | ) |
61a074f7 | 670 | UL_BUILD_INIT([libblkid]) |
033cf439 | 671 | AC_SUBST([LIBBLKID_DATE]) |
dc2b8d87 KZ |
672 | AC_SUBST([LIBBLKID_VERSION]) |
673 | AC_SUBST([LIBBLKID_VERSION_INFO]) | |
f910b559 KZ |
674 | AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string]) |
675 | AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string]) | |
4f3b364b | 676 | if test "x$build_libblkid" = xyes; then |
d06d028a | 677 | AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.]) |
64754af9 | 678 | fi |
4f3b364b | 679 | AM_CONDITIONAL(BUILD_LIBBLKID, test "x$build_libblkid" = xyes) |
f910b559 | 680 | |
1dbbde66 KZ |
681 | dnl |
682 | dnl libmount | |
683 | dnl | |
f1cde479 KZ |
684 | AC_ARG_ENABLE([libmount], |
685 | AS_HELP_STRING([--disable-libmount], [do not build libmount]), | |
a2b3d040 | 686 | [], enable_libmount=check |
f1cde479 | 687 | ) |
61a074f7 | 688 | UL_BUILD_INIT([libmount]) |
13f5473e KZ |
689 | UL_REQUIRES_LINUX([libmount]) |
690 | UL_REQUIRES_BUILD([libmount], [libblkid]) | |
691 | UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier]) | |
692 | AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$build_libmount" = xyes) | |
8e368761 | 693 | |
f1cde479 KZ |
694 | AC_SUBST([LIBMOUNT_VERSION]) |
695 | AC_SUBST([LIBMOUNT_VERSION_INFO]) | |
f4ab4ae8 | 696 | AC_DEFINE_UNQUOTED(LIBMOUNT_VERSION, "$LIBMOUNT_VERSION", [libmount version string]) |
13f5473e | 697 | |
f1cde479 | 698 | |
1dbbde66 KZ |
699 | AC_ARG_ENABLE([mount], |
700 | AS_HELP_STRING([--disable-mount], [do not build mount utilities]), | |
701 | [], enable_mount=check | |
702 | ) | |
61a074f7 | 703 | UL_BUILD_INIT([mount]) |
9ead6701 KZ |
704 | UL_REQUIRES_LINUX([mount]) |
705 | UL_REQUIRES_BUILD([mount], [libblkid]) | |
1dbbde66 KZ |
706 | AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes) |
707 | ||
708 | ||
bd6d0d03 KZ |
709 | AC_ARG_ENABLE([losetup], |
710 | AS_HELP_STRING([--disable-losetup], [do not build losetup]), | |
711 | [], enable_losetup=check | |
712 | ) | |
713 | UL_BUILD_INIT([losetup]) | |
714 | UL_REQUIRES_LINUX([losetup]) | |
715 | AM_CONDITIONAL(BUILD_LOSETUP, test "x$build_losetup" = xyes) | |
716 | ||
717 | ||
9ead6701 | 718 | AC_ARG_ENABLE([libmount-mount], |
ecdba5dd | 719 | AS_HELP_STRING([--enable-libmount-mount], [link old mount(8) with libmount]), |
9ead6701 KZ |
720 | [], enable_libmount_mount=no |
721 | ) | |
61a074f7 | 722 | UL_BUILD_INIT([libmount_mount]) |
9ead6701 KZ |
723 | UL_REQUIRES_BUILD([libmount_mount], [mount]) |
724 | UL_REQUIRES_BUILD([libmount_mount], [libmount]) | |
725 | if test "x$build_libmount_mount" = xyes; then | |
726 | AC_DEFINE(HAVE_LIBMOUNT_MOUNT, 1, [use libmount for mount(8)]) | |
727 | fi | |
728 | AM_CONDITIONAL(BUILD_LIBMOUNT_MOUNT, test "x$build_libmount_mount" = xyes) | |
729 | ||
730 | ||
ecdba5dd KZ |
731 | AC_ARG_ENABLE([new-mount], |
732 | AS_HELP_STRING([--enable-new-mount], [build new pure libmount based mount(8) (EXPERIMENTAL)]), | |
733 | [], enable_new_mount=no | |
734 | ) | |
735 | UL_BUILD_INIT([new_mount]) | |
736 | UL_REQUIRES_BUILD([new_mount], [libmount]) | |
737 | if test "x$build_new_mount" = xyes; then | |
738 | AM_CONDITIONAL(BUILD_MOUNT, [false]) | |
739 | fi | |
740 | AM_CONDITIONAL(BUILD_NEW_MOUNT, test "x$build_new_mount" = xyes) | |
741 | ||
742 | ||
1dbbde66 KZ |
743 | AC_ARG_ENABLE([fsck], |
744 | AS_HELP_STRING([--disable-fsck], [do not build fsck]), | |
1d12ed57 | 745 | [], enable_fsck=check |
1dbbde66 | 746 | ) |
61a074f7 | 747 | UL_BUILD_INIT([fsck]) |
1d12ed57 KZ |
748 | UL_REQUIRES_BUILD([fsck], [libblkid]) |
749 | AM_CONDITIONAL(BUILD_FSCK, test "x$build_fsck" = xyes) | |
1dbbde66 KZ |
750 | |
751 | ||
752 | AC_ARG_ENABLE([partx], | |
753 | AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]), | |
754 | [], enable_partx=check | |
755 | ) | |
61a074f7 | 756 | UL_BUILD_INIT([partx]) |
ecde2536 KZ |
757 | UL_REQUIRES_LINUX([partx]) |
758 | UL_REQUIRES_BUILD([partx], [libblkid]) | |
1dbbde66 KZ |
759 | AM_CONDITIONAL(BUILD_PARTX, test "x$build_partx" = xyes) |
760 | ||
761 | ||
1dbbde66 KZ |
762 | AC_ARG_ENABLE([uuidd], |
763 | AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]), | |
bcdab497 | 764 | [], enable_uuidd=check |
1dbbde66 | 765 | ) |
61a074f7 | 766 | UL_BUILD_INIT([uuidd]) |
bcdab497 KZ |
767 | UL_REQUIRES_BUILD([uuidd], [libuuid]) |
768 | if test "x$build_uuidd" = xyes; then | |
1dbbde66 KZ |
769 | AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.]) |
770 | fi | |
bcdab497 | 771 | AM_CONDITIONAL(BUILD_UUIDD, test "x$build_uuidd" = xyes) |
1dbbde66 KZ |
772 | |
773 | ||
0164c245 | 774 | AC_ARG_ENABLE([mountpoint], |
2023ccc4 | 775 | AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]), |
3d92ed40 | 776 | [], enable_mountpoint=check |
0164c245 | 777 | ) |
61a074f7 | 778 | UL_BUILD_INIT([mountpoint]) |
a9127bc1 | 779 | UL_REQUIRES_BUILD([mountpoint], [libmount]) |
3d92ed40 | 780 | AM_CONDITIONAL(BUILD_MOUNTPOINT, test "x$build_mountpoint" = xyes) |
0164c245 KZ |
781 | |
782 | ||
10e56b49 KZ |
783 | AC_ARG_ENABLE([fallocate], |
784 | AS_HELP_STRING([--disable-fallocate], [do not build fallocate]), | |
785 | [], enable_fallocate=check | |
786 | ) | |
61a074f7 | 787 | UL_BUILD_INIT([fallocate]) |
10e56b49 KZ |
788 | UL_REQUIRES_LINUX([fallocate]) |
789 | UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])]) | |
790 | AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = xyes) | |
791 | ||
792 | if test "x$build_fallocate" = xyes; then | |
793 | dnl check for valid fallocate() function | |
794 | dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64() | |
795 | dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64() | |
796 | dnl and program can't be linked. | |
797 | dnl AC_CHECK_FUNC can't catch such errors since it's redefining | |
798 | dnl function prototype. | |
799 | AC_MSG_CHECKING([for valid fallocate() function]) | |
800 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
b832c2fe YD |
801 | #ifdef HAVE_UNISTD_H |
802 | # include <unistd.h> | |
803 | #endif | |
804 | #ifdef HAVE_SYS_TYPES_H | |
805 | # include <sys/types.h> | |
806 | #endif | |
807 | #ifdef HAVE_LINUX_FALLOC_H | |
808 | # include <linux/falloc.h> | |
809 | #endif | |
810 | #ifdef HAVE_FCNTL_H | |
811 | # include <fcntl.h> | |
812 | #endif | |
813 | ]],[[ | |
814 | long ret; | |
b832c2fe | 815 | ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful); |
b832c2fe YD |
816 | if (ret != 0) { |
817 | return 1; | |
818 | } | |
819 | ]])],[ | |
10e56b49 KZ |
820 | AC_MSG_RESULT([yes]) |
821 | AC_DEFINE(HAVE_FALLOCATE,1,[Have valid fallocate() function])],[ | |
822 | AC_MSG_RESULT([no])]) | |
823 | fi | |
824 | ||
19a224ad | 825 | |
a2ea6670 KZ |
826 | AC_ARG_ENABLE([unshare], |
827 | AS_HELP_STRING([--disable-unshare], [do not build unshare]), | |
828 | [], enable_unshare=check | |
829 | ) | |
61a074f7 | 830 | UL_BUILD_INIT([unshare]) |
a2ea6670 KZ |
831 | UL_REQUIRES_LINUX([unshare]) |
832 | UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])]) | |
833 | AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes) | |
834 | if test "x$build_unshare" = xyes; then | |
835 | AC_CHECK_FUNCS([unshare]) | |
836 | fi | |
b3425806 SK |
837 | |
838 | ||
6a97809b KZ |
839 | AC_ARG_ENABLE([arch], |
840 | AS_HELP_STRING([--enable-arch], [do build arch]), | |
841 | [], enable_arch=no | |
842 | ) | |
61a074f7 | 843 | UL_BUILD_INIT([arch]) |
3c6e292c KZ |
844 | UL_REQUIRES_LINUX([arch]) |
845 | AM_CONDITIONAL(BUILD_ARCH, test "x$build_arch" = xyes) | |
846 | ||
48d7b13a | 847 | |
4a8962f3 KZ |
848 | AC_ARG_ENABLE([ddate], |
849 | AS_HELP_STRING([--enable-ddate], [do build ddate]), | |
564cea2b | 850 | [], enable_ddate=no |
4a8962f3 | 851 | ) |
61a074f7 | 852 | UL_BUILD_INIT([ddate]) |
0fc74be1 | 853 | AM_CONDITIONAL(BUILD_DDATE, test "x$build_ddate" = xyes) |
27c64071 KZ |
854 | ruman1dir='${mandir}/ru/man1' |
855 | AC_SUBST([ruman1dir]) | |
0fc74be1 | 856 | |
4a8962f3 | 857 | |
48d7b13a | 858 | AC_ARG_ENABLE([agetty], |
7fa4f112 | 859 | AS_HELP_STRING([--disable-agetty], [do not build agetty]), |
271d98e0 | 860 | [], enable_agetty=yes |
48d7b13a | 861 | ) |
61a074f7 | 862 | UL_BUILD_INIT([agetty]) |
0fc74be1 KZ |
863 | AM_CONDITIONAL(BUILD_AGETTY, test "x$build_agetty" = xyes) |
864 | ||
48d7b13a | 865 | |
9cb68977 | 866 | AC_ARG_ENABLE([cramfs], |
7fa4f112 | 867 | AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]), |
271d98e0 | 868 | [], enable_cramfs=check |
9cb68977 | 869 | ) |
61a074f7 | 870 | UL_BUILD_INIT([cramfs]) |
d81b5a52 KZ |
871 | AC_CHECK_LIB(z, crc32, [have_z=yes], [have_z=no]) |
872 | UL_REQUIRES_HAVE([cramfs], [z], [z library]) | |
49ccbae6 | 873 | AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes) |
9cb68977 | 874 | |
a13cdb7a | 875 | |
e09ebf22 KZ |
876 | if test "x$have_io" = xyes -o "x$linux_os" = xyes; then |
877 | build_hwclock=yes | |
878 | fi | |
879 | AM_CONDITIONAL(BUILD_HWCLOCK, test "x$build_hwclock" = xyes) | |
880 | ||
881 | ||
143635c9 KZ |
882 | UL_BUILD_INIT([swapon], [check]) |
883 | UL_REQUIRES_LINUX([swapon]) | |
884 | UL_REQUIRES_BUILD([swapon], [libblkid]) | |
885 | AM_CONDITIONAL(BUILD_SWAPON, test "x$build_swapon" = xyes) | |
886 | ||
887 | ||
61a074f7 | 888 | UL_BUILD_INIT([lsblk], [check]) |
a13cdb7a KZ |
889 | UL_REQUIRES_LINUX([lsblk]) |
890 | UL_REQUIRES_BUILD([lsblk], [libblkid]) | |
7f7126d7 | 891 | AM_CONDITIONAL(BUILD_LSBLK, test "x$build_lsblk" = xyes) |
9cb68977 | 892 | |
a3d3b770 | 893 | |
61a074f7 | 894 | UL_BUILD_INIT([lscpu], [check]) |
da396d88 KZ |
895 | UL_REQUIRES_LINUX([lscpu]) |
896 | UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type]) | |
897 | AM_CONDITIONAL(BUILD_LSCPU, test "x$build_lscpu" = xyes) | |
898 | ||
a3d3b770 | 899 | |
61a074f7 | 900 | UL_BUILD_INIT([chcpu], [check]) |
da396d88 KZ |
901 | UL_REQUIRES_LINUX([chcpu]) |
902 | UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type]) | |
903 | AM_CONDITIONAL(BUILD_CHCPU, test "x$build_chcpu" = xyes) | |
904 | ||
a13cdb7a | 905 | |
945ac250 KZ |
906 | UL_BUILD_INIT([prlimit], [check]) |
907 | UL_REQUIRES_LINUX([prlimit]) | |
908 | UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64]) | |
909 | AM_CONDITIONAL(BUILD_PRLIMIT, test "x$build_prlimit" = xyes) | |
910 | if test "x$build_prlimit" = xyes; then | |
911 | AC_CHECK_FUNCS([prlimit]) | |
912 | fi | |
913 | ||
914 | ||
bd671347 KZ |
915 | AC_ARG_ENABLE([switch_root], |
916 | AS_HELP_STRING([--disable-switch_root], [do not build switch_root]), | |
940fd28c | 917 | [], enable_switch_root=check |
bd671347 | 918 | ) |
61a074f7 | 919 | UL_BUILD_INIT([switch_root]) |
a3d3b770 KZ |
920 | UL_REQUIRES_LINUX([switch_root]) |
921 | UL_REQUIRES_HAVE([switch_root], [openat], [openat function]) | |
940fd28c | 922 | AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes) |
bd671347 KZ |
923 | |
924 | ||
11125e7a KZ |
925 | AC_ARG_ENABLE([pivot_root], |
926 | AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]), | |
927 | [], enable_pivot_root=check | |
928 | ) | |
61a074f7 | 929 | UL_BUILD_INIT([pivot_root]) |
9f632667 KZ |
930 | UL_REQUIRES_LINUX([switch_root]) |
931 | UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])]) | |
4a2ecf0a | 932 | AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes) |
11125e7a KZ |
933 | |
934 | ||
48d7b13a | 935 | AC_ARG_ENABLE([elvtune], |
7fa4f112 | 936 | AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]), |
271d98e0 | 937 | [], enable_elvtune=no |
48d7b13a | 938 | ) |
61a074f7 | 939 | UL_BUILD_INIT([elvtune]) |
b8d8c653 KZ |
940 | UL_REQUIRES_LINUX([elvtune]) |
941 | AM_CONDITIONAL(BUILD_ELVTUNE, test "x$build_elvtune" = xyes) | |
942 | ||
48d7b13a | 943 | |
48d7b13a | 944 | AC_ARG_ENABLE([kill], |
4be753aa KZ |
945 | AS_HELP_STRING([--disable-kill], [do not build kill]), |
946 | [], enable_kill=check | |
48d7b13a | 947 | ) |
61a074f7 | 948 | UL_BUILD_INIT([kill]) |
4be753aa | 949 | UL_REQUIRES_LINUX([kill]) |
49ccbae6 | 950 | AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes) |
48d7b13a KZ |
951 | |
952 | ||
953 | AC_ARG_ENABLE([last], | |
7fa4f112 | 954 | AS_HELP_STRING([--enable-last], [build last]), |
271d98e0 | 955 | [], enable_last=no |
48d7b13a | 956 | ) |
61a074f7 | 957 | UL_BUILD_INIT([last]) |
2dc68529 KZ |
958 | AM_CONDITIONAL(BUILD_LAST, test "x$build_last" = xyes) |
959 | ||
48d7b13a | 960 | |
c135a8bd SK |
961 | AC_ARG_ENABLE([line], |
962 | AS_HELP_STRING([--enable-line], [build line]), | |
963 | [], enable_line=no | |
964 | ) | |
61a074f7 | 965 | UL_BUILD_INIT([line]) |
2dc68529 KZ |
966 | AM_CONDITIONAL(BUILD_LINE, test "x$build_line" = xyes) |
967 | ||
48d7b13a KZ |
968 | |
969 | AC_ARG_ENABLE([mesg], | |
7fa4f112 | 970 | AS_HELP_STRING([--enable-mesg], [build mesg]), |
271d98e0 | 971 | [], enable_mesg=no |
48d7b13a | 972 | ) |
61a074f7 | 973 | UL_BUILD_INIT([mesg]) |
2dc68529 | 974 | AM_CONDITIONAL(BUILD_MESG, test "x$build_mesg" = xyes) |
48d7b13a KZ |
975 | |
976 | ||
48d7b13a | 977 | AC_ARG_ENABLE([raw], |
7fa4f112 | 978 | AS_HELP_STRING([--enable-raw], [build raw]), |
16ba8d58 | 979 | [], enable_raw=check |
48d7b13a | 980 | ) |
61a074f7 | 981 | UL_BUILD_INIT([raw]) |
16ba8d58 KZ |
982 | UL_REQUIRES_LINUX([raw]) |
983 | UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file]) | |
984 | AM_CONDITIONAL(BUILD_RAW, test "x$build_raw" = xyes) | |
48d7b13a KZ |
985 | |
986 | ||
48d7b13a | 987 | AC_ARG_ENABLE([rename], |
7fa4f112 | 988 | AS_HELP_STRING([--disable-rename], [do not build rename]), |
271d98e0 | 989 | [], enable_rename=yes |
48d7b13a | 990 | ) |
61a074f7 | 991 | UL_BUILD_INIT([rename]) |
d1171542 | 992 | AM_CONDITIONAL(BUILD_RENAME, test "x$build_rename" = xyes) |
48d7b13a KZ |
993 | |
994 | ||
995 | AC_ARG_ENABLE([reset], | |
7fa4f112 | 996 | AS_HELP_STRING([--enable-reset], [build reset]), |
271d98e0 | 997 | [], enable_reset=no |
48d7b13a | 998 | ) |
61a074f7 | 999 | UL_BUILD_INIT([reset]) |
d1171542 | 1000 | AM_CONDITIONAL(BUILD_RESET, test "x$build_reset" = xyes) |
48d7b13a KZ |
1001 | |
1002 | ||
1003 | AC_ARG_ENABLE([login-utils], | |
7fa4f112 | 1004 | AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]), |
271d98e0 | 1005 | [], enable_login_utils=no |
48d7b13a | 1006 | ) |
61a074f7 | 1007 | UL_BUILD_INIT([login_utils]) |
ff0cb84d KZ |
1008 | UL_REQUIRES_HAVE([login_utils], [security_pam_misc_h], [PAM header file]) |
1009 | AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$build_login_utils" = xyes) | |
9cb68977 | 1010 | |
c94b3604 | 1011 | |
f17f5f48 | 1012 | |
48d7b13a | 1013 | AC_ARG_ENABLE([schedutils], |
7fa4f112 | 1014 | AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]), |
271d98e0 | 1015 | [], enable_schedutils=yes |
48d7b13a | 1016 | ) |
61a074f7 | 1017 | UL_BUILD_INIT([schedutils]) |
17d5e11b KZ |
1018 | AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$build_schedutils" = xyes) |
1019 | ||
61a074f7 | 1020 | UL_BUILD_INIT([ionice], [check]) |
17d5e11b KZ |
1021 | UL_REQUIRES_BUILD([ionice], [schedutils]) |
1022 | UL_REQUIRES_SYSCALL_CHECK([ionice], | |
1023 | [UL_CHECK_SYSCALL([ioprio_set], | |
1024 | [alpha], [442], | |
1025 | [i*86], [289], | |
1026 | [ia64*], [1274], | |
1027 | [powerpc*], [273], | |
1028 | [s390*], [282], | |
1029 | [sparc*], [196], | |
1030 | [sh*], [288], | |
1031 | [x86_64*], [251])], | |
1032 | [ioprio_set]) | |
1033 | ||
1034 | UL_REQUIRES_SYSCALL_CHECK([ionice], | |
1035 | [UL_CHECK_SYSCALL([ioprio_get], | |
1036 | [alpha], [443], | |
1037 | [i*86], [290], | |
1038 | [ia64*], [1275], | |
1039 | [powerpc*], [274], | |
1040 | [s390*], [283], | |
1041 | [sparc*], [218], | |
1042 | [sh*], [289], | |
1043 | [x86_64*], [252])], | |
1044 | [ioprio_get]) | |
1045 | ||
1046 | AM_CONDITIONAL(BUILD_IONICE, test "x$build_ionice" = xyes) | |
1047 | ||
61a074f7 | 1048 | UL_BUILD_INIT([taskset], [check]) |
17d5e11b KZ |
1049 | UL_REQUIRES_BUILD([taskset], [schedutils]) |
1050 | UL_REQUIRES_SYSCALL_CHECK([taskset], | |
1051 | [UL_CHECK_SYSCALL([sched_getaffinity])], | |
1052 | [sched_getaffinity]) | |
1053 | AM_CONDITIONAL(BUILD_TASKSET, test "x$build_taskset" = xyes) | |
48d7b13a KZ |
1054 | |
1055 | ||
1056 | AC_ARG_ENABLE([wall], | |
7fa4f112 | 1057 | AS_HELP_STRING([--disable-wall], [do not build wall]), |
271d98e0 | 1058 | [], enable_wall=yes |
48d7b13a | 1059 | ) |
8fc8888b | 1060 | UL_BUILD_INIT([wall]) |
f0898116 | 1061 | AM_CONDITIONAL(BUILD_WALL, test "x$build_wall" = xyes) |
48d7b13a KZ |
1062 | |
1063 | ||
1064 | AC_ARG_ENABLE([write], | |
7fa4f112 | 1065 | AS_HELP_STRING([--enable-write], [build write]), |
271d98e0 | 1066 | [], enable_write=no |
48d7b13a | 1067 | ) |
61a074f7 | 1068 | UL_BUILD_INIT([write]) |
f0898116 | 1069 | AM_CONDITIONAL(BUILD_WRITE, test "x$build_write" = xyes) |
48d7b13a KZ |
1070 | |
1071 | ||
1072 | AC_ARG_ENABLE([chsh-only-listed], | |
7fa4f112 | 1073 | AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]), |
271d98e0 | 1074 | [], enable_chsh_only_listed=yes |
48d7b13a KZ |
1075 | ) |
1076 | ||
49ccbae6 | 1077 | if test "x$enable_chsh_only_listed" = xyes; then |
48d7b13a KZ |
1078 | AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?]) |
1079 | fi | |
1080 | ||
1081 | ||
1082 | AC_ARG_ENABLE([login-chown-vcs], | |
7fa4f112 | 1083 | AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]), |
271d98e0 | 1084 | [], enable_login_chown_vcs=no |
48d7b13a KZ |
1085 | ) |
1086 | ||
49ccbae6 | 1087 | if test "x$enable_login_chown_vcs" = xyes; then |
48d7b13a KZ |
1088 | AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?]) |
1089 | fi | |
1090 | ||
1091 | ||
1092 | AC_ARG_ENABLE([login-stat-mail], | |
7fa4f112 | 1093 | AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]), |
271d98e0 | 1094 | [], enable_login_stat_mail=no |
48d7b13a KZ |
1095 | ) |
1096 | ||
49ccbae6 | 1097 | if test "x$enable_login_stat_mail" = xyes; then |
48d7b13a KZ |
1098 | AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?]) |
1099 | fi | |
1100 | ||
1101 | ||
1102 | AC_ARG_ENABLE([pg-bell], | |
7fa4f112 | 1103 | AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]), |
271d98e0 | 1104 | [], enable_pg_bell=yes |
48d7b13a KZ |
1105 | ) |
1106 | ||
49ccbae6 | 1107 | if test "x$enable_pg_bell" = xyes; then |
48d7b13a KZ |
1108 | AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?]) |
1109 | fi | |
1110 | ||
1111 | ||
1112 | AC_ARG_ENABLE([require-password], | |
7fa4f112 | 1113 | AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]), |
271d98e0 | 1114 | [], enable_require_password=yes |
48d7b13a KZ |
1115 | ) |
1116 | ||
49ccbae6 | 1117 | if test "x$enable_require_password" = xyes; then |
48d7b13a KZ |
1118 | AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?]) |
1119 | fi | |
1120 | ||
1121 | ||
bb4cb69d MF |
1122 | AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs]) |
1123 | AC_ARG_ENABLE([fs-paths-default], | |
1124 | AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]), | |
1125 | [case "$enableval" in | |
1126 | yes) fs_paths_defaults="FS_PATHS_DEFAULT" ;; | |
1127 | no) fs_paths_defaults="" ;; | |
1128 | *) fs_paths_defaults="$enableval" ;; | |
1129 | esac], | |
1130 | [fs_paths_defaults="FS_PATHS_DEFAULT"] | |
1131 | ) | |
1132 | AC_ARG_ENABLE([fs-paths-extra], | |
1133 | AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]), | |
1134 | [case "$enableval" in | |
1135 | yes|no) fs_paths_extra="" ;; | |
1136 | *) fs_paths_extra="$enableval" ;; | |
1137 | esac], | |
1138 | [fs_paths_extra=""] | |
1139 | ) | |
1140 | fs_paths="$fs_paths_defaults" | |
1141 | if test "x$fs_paths_extra" != "x"; then | |
1142 | if test "x$fs_paths" != "x"; then | |
1143 | fs_paths="${fs_paths}:" | |
1144 | fi | |
1145 | fs_paths="${fs_paths}${fs_paths_extra}" | |
1146 | fi | |
1147 | AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers]) | |
1148 | ||
1149 | ||
48d7b13a | 1150 | AC_ARG_ENABLE([use-tty-group], |
7fa4f112 | 1151 | AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]), |
271d98e0 | 1152 | [], enable_use_tty_group=yes |
48d7b13a | 1153 | ) |
49ccbae6 | 1154 | AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes) |
48d7b13a | 1155 | |
49ccbae6 | 1156 | if test "x$enable_use_tty_group" = xyes; then |
48d7b13a KZ |
1157 | AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?]) |
1158 | fi | |
1159 | ||
f3831bbd KZ |
1160 | AC_ARG_ENABLE([makeinstall-chown], |
1161 | AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]), | |
1162 | [], enable_makeinstall_chown=yes | |
1163 | ) | |
49ccbae6 | 1164 | AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes) |
f3831bbd | 1165 | |
4c24a7ae KZ |
1166 | AC_ARG_ENABLE([makeinstall-setuid], |
1167 | AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]), | |
1168 | [], enable_makeinstall_setuid=yes | |
1169 | ) | |
1170 | AM_CONDITIONAL(MAKEINSTALL_DO_SETUID, test "x$enable_makeinstall_setuid" = xyes) | |
1171 | ||
06bcee19 | 1172 | |
1f10890f SK |
1173 | AC_ARG_VAR([SUID_CFLAGS], |
1174 | [CFLAGS used for binaries which are usually with the suid bit]) | |
1175 | AC_ARG_VAR([SUID_LDFLAGS], | |
1176 | [LDFLAGS used for binaries which are usually with the suid bit]) | |
06bcee19 | 1177 | |
9cb68977 | 1178 | LIBS="" |
48d7b13a | 1179 | |
48d7b13a KZ |
1180 | |
1181 | AC_CONFIG_HEADERS(config.h) | |
1182 | ||
8eeb575c | 1183 | AC_CONFIG_FILES([ |
8eeb575c | 1184 | disk-utils/Makefile |
562218e6 | 1185 | fdisk/Makefile |
607c2a72 | 1186 | fsck/Makefile |
8eeb575c KZ |
1187 | getopt/Makefile |
1188 | hwclock/Makefile | |
562218e6 | 1189 | include/Makefile |
d00ed891 | 1190 | lib/Makefile |
8eeb575c | 1191 | login-utils/Makefile |
20ad4963 | 1192 | Makefile |
f331598a | 1193 | man/ru/Makefile |
20ad4963 | 1194 | misc-utils/chkdupexe:misc-utils/chkdupexe.pl |
8eeb575c KZ |
1195 | misc-utils/Makefile |
1196 | mount/Makefile | |
1197 | partx/Makefile | |
1198 | po/Makefile.in | |
1199 | schedutils/Makefile | |
8fb4efae KZ |
1200 | libblkid/blkid.pc |
1201 | libblkid/Makefile | |
1202 | libblkid/docs/Makefile | |
1203 | libblkid/docs/version.xml | |
1204 | libblkid/src/Makefile | |
1205 | libblkid/src/blkid.h | |
1206 | libblkid/src/superblocks/Makefile | |
1207 | libblkid/src/topology/Makefile | |
1208 | libblkid/src/partitions/Makefile | |
1209 | libblkid/samples/Makefile | |
2aefc0a8 KZ |
1210 | libmount/mount.pc |
1211 | libmount/Makefile | |
1212 | libmount/src/Makefile | |
1213 | libmount/src/libmount.h | |
1214 | libmount/docs/Makefile | |
1215 | libmount/docs/version.xml | |
83d20837 KZ |
1216 | libuuid/uuid.pc |
1217 | libuuid/Makefile | |
1218 | libuuid/man/Makefile | |
1219 | libuuid/src/Makefile | |
8eeb575c | 1220 | sys-utils/Makefile |
c0f20acb | 1221 | term-utils/Makefile |
e83446da | 1222 | tests/commands.sh |
20ad4963 KZ |
1223 | tests/helpers/Makefile |
1224 | tests/Makefile | |
1225 | text-utils/Makefile | |
8eeb575c | 1226 | ]) |
48d7b13a | 1227 | |
996fb358 | 1228 | |
48d7b13a | 1229 | AC_OUTPUT |