]>
Commit | Line | Data |
---|---|---|
034d378b | 1 | AC_INIT([util-linux], |
38c75b59 | 2 | m4_esyscmd([tools/git-version-gen .tarball-version]), |
4230b2d4 | 3 | [kzak@redhat.com], [], |
033b5a52 | 4 | [https://www.kernel.org/pub/linux/utils/util-linux/]) |
baf39af1 | 5 | |
b0e6b25e | 6 | |
4230b2d4 | 7 | AC_PREREQ([2.64]) |
48d7b13a | 8 | |
034d378b | 9 | AC_CONFIG_AUX_DIR([config]) |
b12991dd | 10 | AC_CONFIG_MACRO_DIR([m4]) |
eaf70198 | 11 | dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run |
4230b2d4 | 12 | dnl the compiler (like LT_INIT) to avoid autoconf errors. |
eaf70198 | 13 | AC_USE_SYSTEM_EXTENSIONS |
a527a360 | 14 | AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) |
48d7b13a | 15 | |
eb35c251 | 16 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], |
f06b4328 | 17 | [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) |
316795fc | 18 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
eb35c251 | 19 | |
034d378b | 20 | AC_CONFIG_SRCDIR([sys-utils/mount.c]) |
15a9b48c SK |
21 | AC_PREFIX_DEFAULT([/usr]) |
22 | ||
33b0be6d KZ |
23 | dnl version details from <major>.<minor>[-<suffix>] |
24 | PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}') | |
0f0972ac | 25 | PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{ |
c25b7d8a | 26 | sub("-.*","",$2); print $2}') |
c42a6d4d | 27 | PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{ |
c25b7d8a | 28 | sub("-.*","",$3); print $3 ~ /^@<:@0-9@:>@+$/ ? $3 : 0}') |
a0948ffe | 29 | |
33b0be6d KZ |
30 | dnl libblkid version |
31 | LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
2dccaae4 | 32 | LIBBLKID_DATE="17-May-2023" |
dc2b8d87 KZ |
33 | LIBBLKID_LT_MAJOR=1 |
34 | LIBBLKID_LT_MINOR=1 | |
35 | LIBBLKID_LT_MICRO=0 | |
36 | LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR | |
a0948ffe | 37 | |
f6076f55 KZ |
38 | dnl libuuid version |
39 | LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
dc2b8d87 KZ |
40 | LIBUUID_LT_MAJOR=1 |
41 | LIBUUID_LT_MINOR=3 | |
42 | LIBUUID_LT_MICRO=0 | |
43 | LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR | |
f6076f55 | 44 | |
c2e299d0 SS |
45 | dnl liblastlog2 version |
46 | LIBLASTLOG2_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
47 | LIBLASTLOG2_LT_MAJOR=1 | |
48 | LIBLASTLOG2_LT_MINOR=3 | |
49 | LIBLASTLOG2_LT_MICRO=0 | |
50 | LIBLASTLOG2_VERSION_INFO=`expr $LIBLASTLOG2_LT_MAJOR + $LIBLASTLOG2_LT_MINOR`:$LIBLASTLOG2_LT_MICRO:$LIBLASTLOG2_LT_MINOR | |
51 | ||
f1cde479 KZ |
52 | dnl libmount version |
53 | LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
54 | LIBMOUNT_LT_MAJOR=1 | |
55 | LIBMOUNT_LT_MINOR=1 | |
56 | LIBMOUNT_LT_MICRO=0 | |
57 | LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR | |
58 | ||
1a4d989e OO |
59 | dnl libsmartcols version |
60 | LIBSMARTCOLS_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
61 | LIBSMARTCOLS_LT_MAJOR=1 | |
62 | LIBSMARTCOLS_LT_MINOR=1 | |
63 | LIBSMARTCOLS_LT_MICRO=0 | |
64 | LIBSMARTCOLS_VERSION_INFO=`expr $LIBSMARTCOLS_LT_MAJOR + $LIBSMARTCOLS_LT_MINOR`:$LIBSMARTCOLS_LT_MICRO:$LIBSMARTCOLS_LT_MINOR | |
65 | ||
0bb4c979 KZ |
66 | dnl libfdisk version |
67 | LIBFDISK_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
68 | LIBFDISK_LT_MAJOR=1 | |
69 | LIBFDISK_LT_MINOR=1 | |
70 | LIBFDISK_LT_MICRO=0 | |
71 | LIBFDISK_VERSION_INFO=`expr $LIBFDISK_LT_MAJOR + $LIBFDISK_LT_MINOR`:$LIBFDISK_LT_MICRO:$LIBFDISK_LT_MINOR | |
72 | ||
15a9b48c | 73 | # Check whether exec_prefix=/usr: |
9f57e6e8 SK |
74 | AS_CASE([$exec_prefix:$prefix], |
75 | [NONE:NONE | NONE:/usr | /usr:*], | |
76 | [AC_MSG_NOTICE([Default --exec-prefix detected.]) | |
17794746 KZ |
77 | AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ]) |
78 | AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])]) | |
79 | AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ]) | |
f40e316f | 80 | AS_CASE([$libdir], ['${exec_prefix}/lib64'],[libdir=/lib64; AC_MSG_NOTICE([ --libdir defaults to /lib64]) ]) |
9f57e6e8 SK |
81 | ] |
82 | ) | |
83 | ||
3d289965 KZ |
84 | # Check whether prefix=/usr |
85 | AS_CASE([$prefix], | |
86 | [NONE | /usr], | |
87 | [AC_MSG_NOTICE([Default --prefix detected.]) | |
88 | AS_CASE([$localstatedir], [NONE | '${prefix}/var' | "${prefix}"/var ], | |
89 | [localstatedir=/var; AC_MSG_NOTICE([ --localstatedir defaults to /var])]) | |
90 | AS_CASE([$sysconfdir], [NONE | '${prefix}/etc' | "${prefix}"/etc ], | |
91 | [sysconfdir=/etc; AC_MSG_NOTICE([ --sysconfdir defaults to /etc])]) | |
92 | ||
93 | ] | |
94 | ) | |
8df54559 AH |
95 | |
96 | # default for old versions without $runstatedir | |
97 | AS_IF([test x"$runstatedir" = x], [runstatedir='${localstatedir}/run']) | |
98 | ||
99 | # our default if $localstatedir unchanged | |
100 | AS_CASE([$localstatedir:$runstatedir], | |
101 | [NONE:'${localstatedir}/run' | /var:'${localstatedir}/run' | NONE:'/run' ], | |
102 | [runstatedir=/run; AC_MSG_NOTICE([ --runstatedir defaults to /run])] | |
9f57e6e8 | 103 | ) |
8df54559 AH |
104 | |
105 | AC_SUBST([runstatedir]) | |
07a16b9d | 106 | |
b0a0d7d5 | 107 | |
996fb358 | 108 | # The original default values of {bin,sbin,lib}dir |
aaf3e8f5 | 109 | usrbin_execdir='${exec_prefix}/bin' |
30688dde | 110 | AC_SUBST([usrbin_execdir]) |
996fb358 | 111 | |
aaf3e8f5 | 112 | usrsbin_execdir='${exec_prefix}/sbin' |
30688dde | 113 | AC_SUBST([usrsbin_execdir]) |
996fb358 | 114 | |
9f57e6e8 | 115 | AS_CASE([$libdir], |
b2b61efc | 116 | ['${exec_prefix}/'* | '${prefix}/'* | /usr/* | "${prefix}"/* ], |
9f57e6e8 SK |
117 | [usrlib_execdir=$libdir], |
118 | [usrlib_execdir='${exec_prefix}'$libdir] | |
119 | ) | |
30688dde | 120 | AC_SUBST([usrlib_execdir]) |
996fb358 | 121 | |
c2409b55 KZ |
122 | # static configuration maintaned by packages (e.g. /usr/lib) |
123 | AC_ARG_VAR([SYSCONFSTATICDIR], | |
124 | [Path to static system configuration, default ${prefix}/lib]) | |
125 | AS_IF([test "x$SYSCONFSTATICDIR" = x], | |
126 | [sysconfstaticdir='${prefix}/lib'], | |
127 | [sysconfstaticdir=$SYSCONFSTATICDIR]) | |
128 | AC_SUBST([sysconfstaticdir]) | |
129 | ||
4230b2d4 | 130 | AC_PROG_CC |
31c9c1c4 | 131 | AM_PROG_CC_C_O |
18336d16 | 132 | AC_PROG_MKDIR_P |
30d7f61f | 133 | AC_PROG_YACC |
cf4f9ec8 KZ |
134 | |
135 | # Don't use autotools integrated LEX/YACC support for libsmartcols | |
136 | AC_PATH_PROG([FLEX], [flex]) | |
137 | AC_PATH_PROG([BISON], [bison]) | |
138 | ||
a6996860 | 139 | AC_CANONICAL_HOST |
85b4c147 | 140 | AC_C_CONST |
e79829db | 141 | AC_C_VOLATILE |
b12991dd | 142 | |
0e60bc9b | 143 | dnl Compiler warnings |
b1b54edf | 144 | UL_WARN_ADD([-fno-common]) |
9dc72d0b | 145 | UL_WARN_ADD([-Wall]) |
0e60bc9b | 146 | UL_WARN_ADD([-Wextra]) |
c25b7d8a SK |
147 | |
148 | UL_WARN_ADD([-Waddress-of-packed-member]) | |
149 | UL_WARN_ADD([-Wdiscarded-qualifiers]) | |
4230d576 | 150 | UL_WARN_ADD([-Wembedded-directive]) |
c25b7d8a SK |
151 | UL_WARN_ADD([-Wextra-semi]) |
152 | UL_WARN_ADD([-Wformat-security]) | |
153 | UL_WARN_ADD([-Wimplicit-function-declaration]) | |
b1b54edf KZ |
154 | UL_WARN_ADD([-Wmissing-declarations]) |
155 | UL_WARN_ADD([-Wmissing-parameter-type]) | |
156 | UL_WARN_ADD([-Wmissing-prototypes]) | |
c25b7d8a | 157 | UL_WARN_ADD([-Wnested-externs]) |
0e60bc9b | 158 | UL_WARN_ADD([-Wno-missing-field-initializers]) |
9df5ac34 | 159 | UL_WARN_ADD([-Wold-style-definition]) |
c25b7d8a | 160 | UL_WARN_ADD([-Wpointer-arith]) |
b1b54edf | 161 | UL_WARN_ADD([-Wredundant-decls]) |
0e60bc9b | 162 | UL_WARN_ADD([-Wsign-compare]) |
c25b7d8a | 163 | UL_WARN_ADD([-Wstrict-prototypes]) |
0e60bc9b KZ |
164 | UL_WARN_ADD([-Wtype-limits]) |
165 | UL_WARN_ADD([-Wuninitialized]) | |
b1b54edf KZ |
166 | UL_WARN_ADD([-Wunused-but-set-parameter]) |
167 | UL_WARN_ADD([-Wunused-but-set-variable]) | |
0e60bc9b | 168 | UL_WARN_ADD([-Wunused-parameter]) |
0e60bc9b | 169 | UL_WARN_ADD([-Wunused-result]) |
bec5c9db | 170 | UL_WARN_ADD([-Wunused-variable]) |
a52f9bdd | 171 | UL_WARN_ADD([-Wvla]) |
2a91b213 | 172 | UL_WARN_ADD([-Walloca]) |
63c80c4c KZ |
173 | |
174 | AC_ARG_ENABLE([werror], | |
175 | AS_HELP_STRING([--enable-werror], [make all compiler warnings into errors]), | |
176 | [], [enable_werror=no] | |
177 | ) | |
178 | AS_IF([test "x$enable_werror" = xyes], [ | |
179 | UL_WARN_ADD([-Werror]) | |
180 | ],[ | |
181 | UL_WARN_ADD([-Werror=sequence-point]) | |
182 | ]) | |
183 | ||
0e60bc9b KZ |
184 | AC_SUBST([WARN_CFLAGS]) |
185 | ||
63c80c4c | 186 | |
034d378b | 187 | UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS]) |
7697771d | 188 | AC_SUBST([BSD_WARN_CFLAGS]) |
4f9d999a KZ |
189 | |
190 | UL_WARN_ADD([-Wno-cast-function-type], [PYTHON_WARN_CFLAGS]) | |
191 | AC_SUBST([PYTHON_WARN_CFLAGS]) | |
192 | ||
b97cc9a8 KZ |
193 | |
194 | AC_ARG_ENABLE([asan], | |
195 | AS_HELP_STRING([--enable-asan], [compile with Address Sanitizer]), | |
196 | [], [enable_asan=no] | |
197 | ) | |
2afbcec5 | 198 | AS_IF([test "x$enable_asan" = xyes], [ |
b97cc9a8 | 199 | UL_WARN_ADD([-fsanitize=address]) |
ef61c093 | 200 | ASAN_LDFLAGS="-fsanitize=address" |
b97cc9a8 | 201 | ]) |
ef61c093 | 202 | AC_SUBST([ASAN_LDFLAGS]) |
b97cc9a8 | 203 | |
e6a4d8cc EV |
204 | AC_ARG_ENABLE([ubsan], |
205 | AS_HELP_STRING([--enable-ubsan], [compile with UBsan]), | |
206 | [], [enable_ubsan=no] | |
207 | ) | |
208 | AS_IF([test "x$enable_ubsan" = xyes], [ | |
209 | UL_WARN_ADD([-fsanitize=undefined]) | |
210 | UBSAN_LDFLAGS="-fsanitize=undefined" | |
211 | ]) | |
212 | AC_SUBST([UBSAN_LDFLAGS]) | |
213 | ||
ccdc47b7 EV |
214 | AC_ARG_ENABLE([fuzzing-engine], |
215 | AS_HELP_STRING([--enable-fuzzing-engine], [compile with fuzzing engine]), | |
216 | [], [enable_fuzzing_engine=no] | |
217 | ) | |
948182f4 | 218 | AS_IF([test "x$enable_fuzzing_engine" = xyes && test "x$LIB_FUZZING_ENGINE" = x], [ |
75196cd8 EV |
219 | UL_WARN_ADD([-fno-omit-frame-pointer]) |
220 | UL_WARN_ADD([-gline-tables-only]) | |
221 | UL_WARN_ADD([-fsanitize=fuzzer-no-link]) | |
222 | FUZZING_ENGINE_LDFLAGS="-fsanitize=fuzzer-no-link" | |
223 | ]) | |
224 | AC_SUBST([FUZZING_ENGINE_LDFLAGS]) | |
ccdc47b7 | 225 | AC_PROG_CXX |
75196cd8 EV |
226 | AM_CONDITIONAL([FUZZING_ENGINE], [test "x$enable_fuzzing_engine" = xyes]) |
227 | AM_CONDITIONAL([OSS_FUZZ], [test "x$LIB_FUZZING_ENGINE" != x]) | |
ccdc47b7 | 228 | |
b4b8f8c2 FS |
229 | AC_ARG_ENABLE([coverage], |
230 | AS_HELP_STRING([--enable-coverage], [compile with gcov]), | |
231 | [], [enable_coverage=no] | |
232 | ) | |
233 | AS_IF([test "x$enable_coverage" = xyes], [ | |
234 | UL_WARN_ADD([--coverage]) | |
235 | COVERAGE_LDFLAGS="--coverage" | |
236 | ]) | |
237 | AC_SUBST([COVERAGE_LDFLAGS]) | |
238 | AM_CONDITIONAL([WITH_COVERAGE], [test "x$enable_coverage" = xyes]) | |
239 | ||
b12991dd KZ |
240 | dnl libtool-2 |
241 | LT_INIT | |
48d7b13a | 242 | |
3719bf8d RM |
243 | dnl check supported linker flags |
244 | AX_CHECK_VSCRIPT | |
245 | ||
fd0f4132 SK |
246 | m4_ifndef([PKG_PROG_PKG_CONFIG], |
247 | [m4_fatal([Could not locate the pkg-config autoconf | |
248 | macros. These are usually located in /usr/share/aclocal/pkg.m4. | |
249 | If your macros are in a different location, try setting the | |
250 | environment variable AL_OPTS="-I/other/macro/dir" before running | |
bf2603c7 | 251 | ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])]) |
d06d028a | 252 | PKG_PROG_PKG_CONFIG |
99f95a1e | 253 | PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig']) |
d06d028a | 254 | |
22aa5166 KZ |
255 | GTK_DOC_CHECK([1.10]) |
256 | AC_PATH_PROG([XSLTPROC], [xsltproc]) | |
236421a4 KZ |
257 | |
258 | ||
8c182554 | 259 | linux_os=no |
8026fa9b KZ |
260 | bsd_os=no |
261 | AS_CASE([${host_os}], | |
262 | [*linux*], | |
263 | [linux_os=yes], | |
40733239 RM |
264 | [*darwin*], |
265 | [darwin_os=yes], | |
8026fa9b KZ |
266 | [*bsd*], |
267 | [bsd_os=yes]) | |
034d378b | 268 | AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes]) |
40733239 | 269 | AM_CONDITIONAL([DARWIN], [test "x$darwin_os" = xyes]) |
8026fa9b KZ |
270 | AM_CONDITIONAL([BSD], [test "x$bsd_os" = xyes]) |
271 | ||
40733239 RM |
272 | AS_IF([test "x$darwin_os" = xyes], [ |
273 | AC_DEFINE([_DARWIN_C_SOURCE], [1], [Enable MAP_ANON in sys/mman.h on Mac OS X]) | |
274 | ]) | |
8c182554 | 275 | |
3c6e292c | 276 | dnl define ARCH_<NAME> conditionals |
034d378b SK |
277 | UL_SET_ARCH([I86], [i?86-*]) |
278 | UL_SET_ARCH([86_64], [x86_64*]) | |
279 | UL_SET_ARCH([IA64], [ia64*]) | |
280 | UL_SET_ARCH([S390], [s390*]) | |
281 | UL_SET_ARCH([SPARC], [sparc*]) | |
282 | UL_SET_ARCH([PPC], [ppc*|powerpc*]) | |
283 | UL_SET_ARCH([M68K], [m68*]) | |
284 | UL_SET_ARCH([MIPS], [mips*]) | |
f319e301 | 285 | UL_SET_ARCH([HPPA], [hppa*|parisc*]) |
3c6e292c | 286 | |
48d7b13a | 287 | AC_SYS_LARGEFILE |
2c656779 | 288 | AC_HEADER_ASSERT |
f69eba17 | 289 | AC_STRUCT_TIMEZONE |
f6e7a21c TW |
290 | UL_YEAR2038_INIT |
291 | AC_SYS_YEAR2038_RECOMMENDED | |
48d7b13a | 292 | |
f8d75a66 | 293 | dnl Don't forget to maintain alternatively allowed versions in autogen.sh! |
91c520bc | 294 | AM_GNU_GETTEXT_VERSION([0.18.3]) |
09734b00 | 295 | AM_GNU_GETTEXT([external]) |
3013eb9d SK |
296 | |
297 | AS_IF([test -d "$srcdir/po"], [ | |
298 | ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'` | |
c25b7d8a SK |
299 | ], [dnl echo $ALL_LINGUAS | sed 's/ /\n/g' | sort -u | column -xc 72 -o ' ' | sed 's/^/\t/' |
300 | ALL_LINGUAS=" | |
301 | af am ar as be bg bn bn_IN ca | |
302 | cs cy da de el en_GB es et eu_ES | |
303 | fa fi fr gl gu he hi hr hu | |
304 | hy id is it ja ka kn ko ku | |
305 | lo lt lv mk ml mr ms my nb | |
306 | nl nn no nso or pa pl pt pt_BR | |
307 | ro ru si sk sl sq sr sr@Latn sv | |
308 | ta te th tr uk ur vi zh_CN zh_TW | |
309 | zu | |
310 | "]) | |
09734b00 | 311 | |
e460a5bf | 312 | AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [ |
48d7b13a KZ |
313 | #ifdef HAVE_LINUX_COMPILER_H |
314 | #include <linux/compiler.h> | |
315 | #endif | |
316 | ]) | |
f06b4328 | 317 | AC_CHECK_HEADERS([ \ |
908ac36f MY |
318 | asm-generic/fcntl.h \ |
319 | asm/fcntl.h \ | |
f06b4328 | 320 | asm/io.h \ |
c25b7d8a SK |
321 | byteswap.h \ |
322 | endian.h \ | |
f06b4328 | 323 | err.h \ |
a0948ffe | 324 | errno.h \ |
f06b4328 | 325 | fcntl.h \ |
a0948ffe | 326 | getopt.h \ |
f06b4328 | 327 | inttypes.h \ |
6578ced7 | 328 | lastlog.h \ |
77835be2 | 329 | libutil.h \ |
647f80e4 | 330 | linux/blkzoned.h \ |
5a971329 | 331 | linux/btrfs.h \ |
c25b7d8a | 332 | linux/capability.h \ |
f06b4328 SK |
333 | linux/cdrom.h \ |
334 | linux/falloc.h \ | |
a0948ffe | 335 | linux/fd.h \ |
c25b7d8a | 336 | linux/fiemap.h \ |
ae015d71 | 337 | linux/landlock.h \ |
f4d700d7 | 338 | linux/kcmp.h \ |
c25b7d8a | 339 | linux/net_namespace.h \ |
d652d4c6 | 340 | linux/nsfs.h \ |
627428a9 | 341 | linux/pr.h \ |
f06b4328 | 342 | linux/raw.h \ |
c25b7d8a | 343 | linux/securebits.h \ |
a0948ffe KZ |
344 | linux/tiocl.h \ |
345 | linux/version.h \ | |
c25b7d8a | 346 | linux/watchdog.h \ |
259bed15 | 347 | linux/if_alg.h \ |
8b7f16fc | 348 | locale.h \ |
607c2a72 | 349 | mntent.h \ |
754fed0c | 350 | net/if_dl.h \ |
c25b7d8a | 351 | net/if.h \ |
f06b4328 SK |
352 | netinet/in.h \ |
353 | paths.h \ | |
354 | pty.h \ | |
fe2c9909 | 355 | security/pam_appl.h \ |
c25b7d8a | 356 | shadow.h \ |
f06b4328 | 357 | stdint.h \ |
78288764 | 358 | stdio_ext.h \ |
a0948ffe KZ |
359 | stdlib.h \ |
360 | sys/disk.h \ | |
361 | sys/disklabel.h \ | |
c25b7d8a | 362 | sys/endian.h \ |
f06b4328 | 363 | sys/file.h \ |
f06b4328 SK |
364 | sys/ioccom.h \ |
365 | sys/ioctl.h \ | |
c25b7d8a | 366 | sys/io.h \ |
a0948ffe | 367 | sys/mkdev.h \ |
ac1c53e4 | 368 | sys/mount.h \ |
4ebac79f | 369 | sys/param.h \ |
84732a88 | 370 | sys/pidfd.h \ |
a0948ffe | 371 | sys/prctl.h \ |
f06b4328 | 372 | sys/resource.h \ |
c25b7d8a | 373 | sys/sendfile.h \ |
651b25cd | 374 | sys/signalfd.h \ |
2a7c1f70 | 375 | sys/socket.h \ |
f06b4328 | 376 | sys/sockio.h \ |
a0948ffe | 377 | sys/stat.h \ |
3671d4a8 | 378 | sys/statfs.h \ |
f06b4328 SK |
379 | sys/swap.h \ |
380 | sys/syscall.h \ | |
c25b7d8a | 381 | sys/sysmacros.h \ |
f06b4328 | 382 | sys/time.h \ |
87ee2658 | 383 | sys/timex.h \ |
00c505d9 | 384 | sys/ttydefaults.h \ |
a0948ffe | 385 | sys/types.h \ |
ac1c53e4 | 386 | sys/ucred.h \ |
754fed0c | 387 | sys/un.h \ |
3671d4a8 | 388 | sys/vfs.h \ |
40b119b9 | 389 | sys/xattr.h \ |
f06b4328 | 390 | unistd.h \ |
77835be2 | 391 | utmp.h \ |
b4b919fe | 392 | utmpx.h \ |
c2e299d0 | 393 | sqlite3.h \ |
f06b4328 | 394 | ]) |
dc61d398 | 395 | |
a0357292 KZ |
396 | # There is a collision in old kernel-headers. The both files mount.h and fs.h |
397 | # define MS_* macros. Fixed by kernel commit e462ec50cb5fad19f6003a3d8087f4a0945dd2b1. | |
398 | # | |
399 | AC_CHECK_HEADERS([linux/fs.h ], [], [], | |
400 | [#ifdef HAVE_SYS_MOUNT_H | |
401 | # include <linux/fs.h> | |
402 | # include <sys/mount.h> | |
403 | #endif | |
404 | ]) | |
405 | ||
5502e73d MM |
406 | AC_CHECK_HEADERS([linux/mount.h ], [], [], |
407 | [#ifdef HAVE_LINUX_MOUNT_H | |
408 | # include <linux/mount.h> | |
409 | #endif | |
410 | ]) | |
411 | ||
db4e2645 KZ |
412 | AC_CHECK_HEADERS([linux/gsmmux.h ], [], [], |
413 | [#ifdef LINUX_GSMMUX_H | |
414 | # include <linux/gsmmux.h> | |
415 | #endif | |
416 | ]) | |
417 | ||
fe2c9909 WJ |
418 | AC_CHECK_HEADERS([security/pam_misc.h], |
419 | [AM_CONDITIONAL([HAVE_LINUXPAM], [true])], | |
420 | [AM_CONDITIONAL([HAVE_LINUXPAM], [false])], [ | |
421 | #ifdef HAVE_SECURITY_PAM_APPL_H | |
422 | #include <security/pam_appl.h> | |
423 | #endif | |
424 | ]) | |
425 | ||
e5ad3a6a SK |
426 | AC_CHECK_DECLS([BLK_ZONE_REP_CAPACITY], [], [], [ |
427 | #include <linux/blkzoned.h> | |
428 | ]) | |
429 | ||
627428a9 | 430 | AC_CHECK_DECLS([PR_REP_CAPACITY], [], [], [ |
431 | #include <linux/pr.h> | |
432 | ]) | |
433 | ||
fe2c9909 WJ |
434 | AC_CHECK_HEADERS([security/openpam.h], [], [], [ |
435 | #ifdef HAVE_SECURITY_PAM_APPL_H | |
436 | #include <security/pam_appl.h> | |
437 | #endif | |
438 | ]) | |
439 | ||
a67387b7 | 440 | AC_CHECK_HEADERS([langinfo.h], |
ac660b80 ZJS |
441 | [AM_CONDITIONAL([HAVE_LANGINFO_H], [true])], |
442 | [AM_CONDITIONAL([HAVE_LANGINFO_H], [false])]) | |
a67387b7 | 443 | |
4e12a62e RL |
444 | AC_MSG_CHECKING([whether langinfo.h defines ALTMON_x constants]) |
445 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
446 | #include <langinfo.h> | |
447 | ]], [[ | |
448 | char *str; | |
449 | str = nl_langinfo (ALTMON_1); | |
450 | str = nl_langinfo (ALTMON_2); | |
451 | str = nl_langinfo (ALTMON_3); | |
452 | str = nl_langinfo (ALTMON_4); | |
453 | str = nl_langinfo (ALTMON_5); | |
454 | str = nl_langinfo (ALTMON_6); | |
455 | str = nl_langinfo (ALTMON_7); | |
456 | str = nl_langinfo (ALTMON_8); | |
457 | str = nl_langinfo (ALTMON_9); | |
458 | str = nl_langinfo (ALTMON_10); | |
459 | str = nl_langinfo (ALTMON_11); | |
460 | str = nl_langinfo (ALTMON_12); | |
461 | ]])], [ | |
462 | AC_MSG_RESULT([yes]) | |
463 | AC_DEFINE([HAVE_LANGINFO_ALTMON], [1], | |
464 | [Define if langinfo.h defines ALTMON_x constants]) | |
465 | ], [ | |
466 | AC_MSG_RESULT([no]) | |
467 | ]) | |
468 | ||
469 | ||
470 | AC_MSG_CHECKING([whether langinfo.h defines _NL_ABALTMON_x constants]) | |
471 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
472 | #include <langinfo.h> | |
473 | ]], [[ | |
474 | char *str; | |
475 | str = nl_langinfo (_NL_ABALTMON_1); | |
476 | str = nl_langinfo (_NL_ABALTMON_2); | |
477 | str = nl_langinfo (_NL_ABALTMON_3); | |
478 | str = nl_langinfo (_NL_ABALTMON_4); | |
479 | str = nl_langinfo (_NL_ABALTMON_5); | |
480 | str = nl_langinfo (_NL_ABALTMON_6); | |
481 | str = nl_langinfo (_NL_ABALTMON_7); | |
482 | str = nl_langinfo (_NL_ABALTMON_8); | |
483 | str = nl_langinfo (_NL_ABALTMON_9); | |
484 | str = nl_langinfo (_NL_ABALTMON_10); | |
485 | str = nl_langinfo (_NL_ABALTMON_11); | |
486 | str = nl_langinfo (_NL_ABALTMON_12); | |
487 | ]])], [ | |
488 | AC_MSG_RESULT([yes]) | |
489 | AC_DEFINE([HAVE_LANGINFO_NL_ABALTMON], [1], | |
490 | [Define if langinfo.h defines _NL_ABALTMON_x constants]) | |
491 | ], [ | |
492 | AC_MSG_RESULT([no]) | |
493 | ]) | |
494 | ||
495 | ||
16ba8d58 KZ |
496 | dnl Convert some ac_cv_header_* variables to have_* |
497 | dnl | |
70bb5345 | 498 | have_linux_blkzoned_h=$ac_cv_header_linux_blkzoned_h |
5a971329 | 499 | have_linux_btrfs_h=$ac_cv_header_linux_btrfs_h |
c25b7d8a | 500 | have_linux_capability_h=$ac_cv_header_linux_capability_h |
f4d700d7 | 501 | have_linux_kcmp_h=$ac_cv_header_linux_kcmp_h |
5502e73d | 502 | have_linux_mount_h=$ac_cv_header_linux_mount_h |
627428a9 | 503 | have_linux_pr_h=$ac_cv_header_linux_pr_h |
16ba8d58 | 504 | have_linux_raw_h=$ac_cv_header_linux_raw_h |
48469f90 | 505 | have_linux_securebits_h=$ac_cv_header_linux_securebits_h |
c25b7d8a | 506 | have_linux_version_h=$ac_cv_header_linux_version_h |
5b0289b9 | 507 | have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h |
c25b7d8a SK |
508 | have_pty_h=$ac_cv_header_pty_h |
509 | have_security_openpam_h=$ac_cv_header_security_openpam_h | |
fe2c9909 | 510 | have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h |
ff0cb84d | 511 | have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h |
d00c10ed | 512 | have_shadow_h=$ac_cv_header_shadow_h |
651b25cd | 513 | have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h |
b4b919fe | 514 | have_utmpx_h=$ac_cv_header_utmpx_h |
94c8821b | 515 | have_mntent_h=$ac_cv_header_mntent_h |
c2e299d0 | 516 | have_sqlite3_h=$ac_cv_header_sqlite3_h |
a67387b7 | 517 | |
8a931412 KZ |
518 | AS_CASE([$linux_os:$have_linux_version_h], |
519 | [yes:no], | |
520 | [AC_MSG_ERROR([kernel headers required on Linux])] | |
521 | ) | |
522 | ||
a67387b7 KZ |
523 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
524 | #include <time.h> | |
525 | #include <unistd.h> | |
526 | ]], [[ | |
527 | int a = 0; | |
528 | struct tm *tm = localtime(0); | |
529 | if (a == -1) /* false */ | |
f06b4328 | 530 | sleep(tm->tm_gmtoff); |
a67387b7 | 531 | ]])], |
034d378b | 532 | [AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?]) |
a67387b7 KZ |
533 | ]) |
534 | ||
10efb9ea | 535 | AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]]) |
0120be6f | 536 | AC_CHECK_TYPES([enum fsconfig_command], [], [], [[#include <linux/mount.h>]]) |
013e0db4 | 537 | |
a67387b7 KZ |
538 | AC_CHECK_MEMBERS([struct termios.c_line],,, |
539 | [[#include <termios.h>]]) | |
540 | ||
541 | AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, | |
c0136ac0 KZ |
542 | [[#include <sys/stat.h>]]) |
543 | ||
7d679f29 | 544 | AC_CHECK_TYPES([struct statx], [], [], [[#include <sys/stat.h>]]) |
c0136ac0 | 545 | AC_CHECK_MEMBERS([struct statx.stx_mnt_id],,, |
7d679f29 | 546 | [[#include <sys/stat.h>]]) |
a67387b7 | 547 | |
a88057d9 TP |
548 | AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]]) |
549 | ||
0e9b73d3 | 550 | AC_CHECK_DECL([environ], |
034d378b | 551 | [AC_DEFINE([HAVE_ENVIRON_DECL], [1], |
0e9b73d3 SK |
552 | [Define to 1 if have **environ prototype])], |
553 | ) | |
554 | ||
555 | AC_CHECK_DECL([strsignal], | |
034d378b | 556 | [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1], |
0e9b73d3 SK |
557 | [Define to 1 if have strsignal function prototype])], |
558 | ) | |
559 | ||
1eb16fd7 KZ |
560 | AC_CHECK_DECL([TIOCGLCKTRMIOS], |
561 | [have_tiocglcktrmios=yes], [have_tiocglcktrmios=no], | |
c25b7d8a | 562 | [#include <sys/ioctl.h>]) |
1eb16fd7 KZ |
563 | AC_CHECK_DECL([SOCK_CLOEXEC], |
564 | [have_sock_cloexec=yes], [have_sock_cloexec=no], | |
565 | [#include <sys/types.h> | |
c25b7d8a | 566 | #include <sys/socket.h>]) |
1eb16fd7 KZ |
567 | AC_CHECK_DECL([SOCK_NONBLOCK], |
568 | [have_sock_nonblock=yes], [have_sock_nonblock=no], | |
569 | [#include <sys/types.h> | |
c25b7d8a | 570 | #include <sys/socket.h>]) |
1eb16fd7 KZ |
571 | AC_CHECK_DECL([SO_PASSCRED], |
572 | [have_so_passcred=yes], [have_so_passcred=no], | |
573 | [#include <sys/types.h> | |
c25b7d8a | 574 | #include <sys/socket.h>]) |
1eb16fd7 | 575 | |
f06b4328 | 576 | AC_CHECK_FUNCS([ \ |
c214cbeb | 577 | cachestat \ |
75efef98 | 578 | clearenv \ |
f0649c0d | 579 | close_range \ |
c08396c7 | 580 | eaccess \ |
eb76ca98 FG |
581 | err \ |
582 | errx \ | |
87583438 | 583 | explicit_bzero \ |
c25b7d8a SK |
584 | __fpending \ |
585 | __fpurge \ | |
586 | fpurge \ | |
d9b022bd | 587 | fnmatch \ |
0120be6f KZ |
588 | fsconfig \ |
589 | fsmount \ | |
590 | fsopen \ | |
591 | fspick \ | |
bf962c0a SK |
592 | fsync \ |
593 | getdomainname \ | |
f06b4328 SK |
594 | getdtablesize \ |
595 | getexecname \ | |
596 | getmntinfo \ | |
cc01c2dc | 597 | getrandom \ |
f06b4328 | 598 | getrlimit \ |
c829aebc | 599 | getsgnam \ |
1cf6e936 | 600 | getttynam \ |
f06b4328 | 601 | inotify_init \ |
3ac22f7a | 602 | jrand48 \ |
ae015d71 TW |
603 | landlock_create_ruleset \ |
604 | landlock_add_rule \ | |
605 | landlock_restrict_self \ | |
bf962c0a | 606 | lchown \ |
3854515c KZ |
607 | lgetxattr \ |
608 | llistxattr \ | |
a0948ffe | 609 | llseek \ |
670b10ae | 610 | newlocale \ |
02887b73 | 611 | mempcpy \ |
4d751c00 | 612 | mkostemp \ |
013e0db4 CB |
613 | move_mount \ |
614 | mount_setattr \ | |
f06b4328 | 615 | nanosleep \ |
7d3a07d8 | 616 | ntp_gettime \ |
013e0db4 | 617 | open_tree \ |
f06b4328 | 618 | personality \ |
6e6b9a1d SK |
619 | pidfd_open \ |
620 | pidfd_send_signal \ | |
f06b4328 SK |
621 | posix_fadvise \ |
622 | prctl \ | |
9c7955da | 623 | qsort_r \ |
0322c9cd | 624 | reallocarray \ |
cd094a05 | 625 | renameat2 \ |
f06b4328 | 626 | rpmatch \ |
485a8bfa | 627 | scandirat \ |
c25b7d8a SK |
628 | sched_setattr \ |
629 | sched_setscheduler \ | |
630 | __secure_getenv \ | |
631 | secure_getenv \ | |
360cdaa6 | 632 | sendfile \ |
30fbf2f6 | 633 | setprogname \ |
69045d3d KZ |
634 | setresgid \ |
635 | setresuid \ | |
f06b4328 SK |
636 | sigqueue \ |
637 | srandom \ | |
30c59d67 | 638 | statx \ |
f06b4328 | 639 | strnchr \ |
69b7e41e KZ |
640 | strndup \ |
641 | strnlen \ | |
670b10ae | 642 | strtod_l \ |
f06b4328 | 643 | sysconf \ |
88e0f3df | 644 | sysinfo \ |
b72a75e9 | 645 | timegm \ |
f06b4328 | 646 | usleep \ |
670b10ae | 647 | uselocale \ |
c25b7d8a | 648 | utimensat \ |
31f85fce | 649 | vwarnx \ |
eb76ca98 FG |
650 | warn \ |
651 | warnx \ | |
f06b4328 | 652 | ]) |
48d7b13a | 653 | AC_FUNC_FSEEKO |
48d7b13a | 654 | |
90d5285d | 655 | AC_CHECK_FUNCS([futimens], [have_futimens=yes]) |
c25b7d8a | 656 | AC_CHECK_FUNCS([getusershell], [have_getusershell=yes],[have_getusershell=no]) |
90d5285d | 657 | AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes]) |
c25b7d8a SK |
658 | AC_CHECK_FUNCS([ioperm iopl], [have_io=yes]) |
659 | AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no]) | |
f9c4d138 | 660 | AC_CHECK_FUNCS([open_memstream], [have_open_memstream=yes],[have_open_memstream=no]) |
e52b58e6 | 661 | AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no]) |
227ebea7 | 662 | AC_CHECK_FUNCS([updwtmpx updwtmpx], [have_gnu_utmpx=yes], [have_gnu_utmpx=no]) |
465e9973 | 663 | |
dc049516 | 664 | AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes]) |
ae015d71 | 665 | AM_CONDITIONAL([HAVE_LINUX_LANDLOCK_H], [test "x$ac_cv_header_linux_landlock_h" = xyes]) |
dc049516 | 666 | |
7a3b35b9 KZ |
667 | have_setns_syscall="yes" |
668 | UL_CHECK_SYSCALL([setns]) | |
669 | AS_IF([test "x$ul_cv_syscall_setns" = xno], [ | |
670 | have_setns_syscall="no" | |
671 | ]) | |
feda4342 | 672 | |
6e6b9a1d SK |
673 | UL_CHECK_SYSCALL([pidfd_open]) |
674 | UL_CHECK_SYSCALL([pidfd_send_signal]) | |
f0649c0d | 675 | UL_CHECK_SYSCALL([close_range]) |
0120be6f KZ |
676 | UL_CHECK_SYSCALL([fsconfig]) |
677 | UL_CHECK_SYSCALL([fsmount]) | |
678 | UL_CHECK_SYSCALL([fsopen]) | |
679 | UL_CHECK_SYSCALL([fspick]) | |
e087a188 | 680 | UL_CHECK_SYSCALL([mount_setattr]) |
0120be6f KZ |
681 | UL_CHECK_SYSCALL([move_mount]) |
682 | UL_CHECK_SYSCALL([open_tree]) | |
683 | ||
9040c090 KZ |
684 | AS_IF([test "x$ul_cv_syscall_fsconfig" = xno || |
685 | test "x$ul_cv_syscall_fsmount" = xno || | |
686 | test "x$ul_cv_syscall_fsopen" = xno || | |
687 | test "x$ul_cv_syscall_fspick" = xno || | |
688 | test "x$ul_cv_syscall_mount_setattr" = xno || | |
689 | test "x$ul_cv_syscall_move_mount" = xno || | |
690 | test "x$ul_cv_syscall_open_tree" = xno], | |
691 | [ | |
692 | have_mountfd_api="no" | |
693 | ],[ | |
694 | have_mountfd_api="yes" | |
695 | AC_DEFINE([HAVE_MOUNTFD_API], [1], [Define to 1 if you want mount API based on FDs.]) | |
696 | ]) | |
697 | ||
e087a188 | 698 | |
feda4342 KZ |
699 | AC_CHECK_FUNCS([isnan], [], |
700 | [AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])] | |
4953018e | 701 | [AC_CHECK_LIB([m], [__isnan], [MATH_LIBS="-lm"])] |
feda4342 KZ |
702 | ) |
703 | AC_SUBST([MATH_LIBS]) | |
704 | ||
705 | ||
378543e1 | 706 | dnl lib/mononotic.c may require -lrt |
254743e4 KZ |
707 | AC_CHECK_FUNCS([clock_gettime], [], |
708 | [AC_CHECK_LIB([rt], [clock_gettime], [REALTIME_LIBS="-lrt"])] | |
709 | ) | |
bd9b94d1 | 710 | |
254743e4 | 711 | have_timer="no" |
f07a82c9 | 712 | AC_CHECK_FUNCS([timer_create], |
7944a03c | 713 | [have_timer="yes"], |
254743e4 KZ |
714 | [AC_CHECK_LIB([rt], [timer_create], [ |
715 | have_timer="yes" | |
716 | REALTIME_LIBS="-lrt" | |
f2458cf9 | 717 | AC_DEFINE([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt]) |
bf6be9f5 LT |
718 | ],[ |
719 | AC_SEARCH_LIBS([timer_create], [rt], [ | |
720 | AC_MSG_RESULT(yes) | |
721 | have_timer="yes" | |
722 | REALTIME_LIBS="-lrt -lpthread" | |
f2458cf9 | 723 | AC_DEFINE([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt -lpthread]) |
bf6be9f5 LT |
724 | ],[], [-lpthread] |
725 | ) | |
9a558f9c | 726 | ])] |
254743e4 | 727 | ) |
8fc4a886 | 728 | |
f07a82c9 KZ |
729 | AC_SUBST([REALTIME_LIBS]) |
730 | ||
6df5acf9 KZ |
731 | AS_IF([test x"$have_timer" = xno], [ |
732 | AC_CHECK_FUNCS([setitimer], [have_timer="yes"], [have_timer="no"]) | |
733 | ]) | |
734 | ||
f07a82c9 KZ |
735 | |
736 | AC_CHECK_LIB([rtas], [rtas_get_sysparm], [ | |
737 | RTAS_LIBS="-lrtas" | |
f2458cf9 | 738 | AC_DEFINE([HAVE_LIBRTAS], [1], [Define if librtas exists]) |
f07a82c9 KZ |
739 | ]) |
740 | AC_SUBST([RTAS_LIBS]) | |
741 | ||
8fc4a886 | 742 | |
034d378b | 743 | AC_CHECK_MEMBER([struct sockaddr.sa_len], |
f2458cf9 | 744 | AC_DEFINE([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [], |
754fed0c KZ |
745 | [#include <sys/types.h> |
746 | #include <sys/socket.h>]) | |
747 | ||
60cc9f94 | 748 | SOCKET_LIBS= |
60cc9f94 | 749 | AC_SEARCH_LIBS([socket], [socket], |
3013eb9d SK |
750 | [AS_IF([test x"$ac_cv_search_socket" != x"none required"], |
751 | [SOCKET_LIBS="$SOCKET_LIBS -lsocket"]) | |
752 | ]) | |
60cc9f94 FG |
753 | AC_SUBST([SOCKET_LIBS]) |
754 | ||
d58c47d9 FG |
755 | |
756 | have_dirfd=no | |
757 | AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no]) | |
3013eb9d | 758 | AS_IF([test x"$have_dirfd" = xno], [ |
d58c47d9 FG |
759 | AC_CHECK_DECLS([dirfd], |
760 | [have_dirfd=yes], [have_dirfd=no], | |
761 | [#include <sys/types.h> | |
762 | #include <dirent.h>]) | |
3013eb9d | 763 | ]) |
d58c47d9 FG |
764 | |
765 | have_ddfd=no | |
3013eb9d | 766 | AS_IF([test x"$have_dirfd" = xno], [ |
d58c47d9 FG |
767 | AC_CHECK_MEMBERS([DIR.dd_fd], |
768 | [have_ddfd=yes], [have_ddfd=no], | |
769 | [#include <sys/types.h> | |
770 | #include <dirent.h>]) | |
3013eb9d | 771 | ]) |
d58c47d9 | 772 | |
948182f4 | 773 | AM_CONDITIONAL([HAVE_DIRFD], [test "x$have_dirfd" = xyes || test "x$have_ddfd" = xyes]) |
d58c47d9 | 774 | |
330555c4 MY |
775 | MQ_LIBS= |
776 | AC_CHECK_LIB([rt], [mq_open], [MQ_LIBS="-lrt"]) | |
777 | AC_SUBST([MQ_LIBS]) | |
d58c47d9 | 778 | |
d6abf168 SK |
779 | AC_MSG_CHECKING([whether program_invocation_short_name is defined]) |
780 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
37edac9a | 781 | #include <errno.h> |
d6abf168 SK |
782 | ]], [[ |
783 | program_invocation_short_name = "test"; | |
784 | ]])], [ | |
785 | AC_MSG_RESULT([yes]) | |
786 | AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], | |
787 | [Define if program_invocation_short_name is defined]) | |
788 | ], [ | |
789 | AC_MSG_RESULT([no]) | |
790 | ]) | |
791 | ||
a804f444 FG |
792 | |
793 | AC_MSG_CHECKING([whether __progname is defined]) | |
794 | AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;], | |
cf582a2e | 795 | [if (*__progname == 0) return 1;])], |
034d378b SK |
796 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined]) |
797 | AC_MSG_RESULT([yes]), | |
798 | AC_MSG_RESULT([no])) | |
a804f444 | 799 | |
a0cf9105 LB |
800 | AC_CHECK_DECL([IOC_OPAL_GET_STATUS], |
801 | [AC_DEFINE([HAVE_OPAL_GET_STATUS], [1], | |
802 | [Define to 1 if OPAL status ioctl is defined])],, | |
803 | [#include <linux/sed-opal.h>]) | |
804 | ||
8569410c | 805 | dnl Static compilation |
c25b7d8a | 806 | m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, sfdisk, umount, unshare]) |
8569410c SK |
807 | |
808 | AC_ARG_ENABLE([static-programs], | |
809 | [AS_HELP_STRING([--enable-static-programs=LIST], | |
810 | [link static the programs in LIST (comma-separated, | |
132ea941 | 811 | supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])]) |
8569410c | 812 | |
9f57e6e8 SK |
813 | AS_CASE([$enable_static_programs], |
814 | [yes], | |
d924b10b | 815 | [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)], |
9f57e6e8 SK |
816 | [no], |
817 | [enable_static_programs=] | |
818 | ) | |
8569410c | 819 | |
8569410c | 820 | dnl Set all the individual AM_CONDITIONALs |
132ea941 | 821 | m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [ |
9f57e6e8 SK |
822 | AS_CASE([,$enable_static_programs,], |
823 | [*,UL_PRG,*], [static_[]UL_PRG=yes] | |
824 | ) | |
d924b10b | 825 | AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])]) |
132ea941 KZ |
826 | AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG), |
827 | [test "x$static_[]UL_PRG" = xyes]) | |
8569410c SK |
828 | ]) |
829 | ||
08b1c219 KZ |
830 | |
831 | AC_ARG_ENABLE([all-programs], | |
832 | AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]), | |
833 | [], [enable_all_programs=undefined] | |
834 | ) | |
835 | ||
836 | AS_CASE([$enable_all_programs], | |
7477f356 | 837 | [yes], [AC_MSG_WARN([force to build all programs by default]) |
c25b7d8a | 838 | ul_default_estate=check], |
22a900a9 | 839 | [no], [AC_MSG_WARN([disable all programs and man pages by default]) |
c25b7d8a | 840 | ul_default_estate=no] |
08b1c219 KZ |
841 | ) |
842 | ||
843 | ||
22a900a9 KZ |
844 | AC_ARG_ENABLE([asciidoc], |
845 | AS_HELP_STRING([--disable-asciidoc], [do not generate man pages from asciidoc]), | |
846 | [], [UL_DEFAULT_ENABLE([asciidoc], [check])] | |
847 | ) | |
848 | UL_BUILD_INIT([asciidoc]) | |
849 | UL_REQUIRES_PROGRAM([asciidoc], [ASCIIDOCTOR], [asciidoctor], [man pages]) | |
850 | AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$build_asciidoc" = xyes]) | |
a5b09369 | 851 | have_asciidoctor_failure_level=no |
25a70dcb TW |
852 | AS_IF([test "x$build_asciidoc" = xyes], [ |
853 | AC_MSG_CHECKING([whether ${ASCIIDOCTOR} supports --failure-level]) | |
854 | AS_IF([${ASCIIDOCTOR} --help | grep failure-level >/dev/null 2>&1 ], [ | |
855 | AC_MSG_RESULT([yes]) | |
a5b09369 | 856 | have_asciidoctor_failure_level=yes |
25a70dcb TW |
857 | ], [ |
858 | AC_MSG_RESULT([no]) | |
25a70dcb TW |
859 | ]) |
860 | ]) | |
a5b09369 | 861 | AM_CONDITIONAL([HAVE_ASCIIDOCTOR_FAILURE_LEVEL], [test "x$have_asciidoctor_failure_level" = xyes]) |
22a900a9 | 862 | |
1a30b2bd KZ |
863 | have_manpages=no |
864 | AS_IF([test -f "$srcdir/sys-utils/mount.8"], [ | |
865 | AC_MSG_NOTICE([re-use already generated man-pages.]) | |
866 | have_manpages=yes] | |
867 | ) | |
868 | AM_CONDITIONAL([HAVE_MANPAGES], [test "x$have_manpages" = xyes]) | |
869 | ||
22a900a9 | 870 | |
8f5fff53 | 871 | AC_ARG_ENABLE([poman], |
9acfc349 KZ |
872 | AS_HELP_STRING([--disable-poman], [generate translated man pages]), |
873 | [], [UL_DEFAULT_ENABLE([poman], [check])] | |
8f5fff53 KZ |
874 | ) |
875 | UL_BUILD_INIT([poman]) | |
876 | UL_REQUIRES_PROGRAM([poman], [PO4A], [po4a], [translated man pages]) | |
5e42ec32 | 877 | AM_CONDITIONAL([ENABLE_POMAN], [test "x$build_poman" = xyes]) |
8f5fff53 KZ |
878 | |
879 | ||
d7a01582 | 880 | AX_CHECK_TLS |
3ac22f7a | 881 | |
37a11e1a | 882 | have_pty=no |
17d71034 KZ |
883 | AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]), |
884 | [], [with_util=auto] | |
885 | ) | |
886 | AS_IF([test "x$with_util" = xno], [ | |
887 | AM_CONDITIONAL([HAVE_UTIL], [false]) | |
888 | have_util=no | |
889 | ], [ | |
890 | UL_CHECK_LIB([util], [openpty]) | |
891 | ]) | |
892 | ||
948182f4 | 893 | AS_IF([test "x$have_pty_h" = xyes && test "x$have_sys_signalfd_h" = xyes && test "x$have_util" = xyes], [ |
6954895c KZ |
894 | AM_CONDITIONAL([HAVE_PTY], [true]) |
895 | AC_DEFINE([HAVE_PTY], [1], [have PTY support]) | |
37a11e1a | 896 | have_pty=yes |
6954895c KZ |
897 | ], [ |
898 | AM_CONDITIONAL([HAVE_PTY], [false]) | |
899 | ]) | |
17d71034 | 900 | |
3aecf79d KZ |
901 | AC_CHECK_TYPES([union semun], [], [], [[ |
902 | #include <sys/sem.h> | |
903 | ]]) | |
034d378b | 904 | AC_CHECK_TYPES([loff_t]) |
3aecf79d | 905 | |
4cb6fea5 KZ |
906 | |
907 | AC_ARG_ENABLE([widechar], | |
908 | AS_HELP_STRING([--disable-widechar], [do not compile wide character support]), | |
909 | [], [enable_widechar=check] | |
910 | ) | |
911 | UL_BUILD_INIT([widechar]) | |
912 | UL_REQUIRES_COMPILE([widechar], [[ | |
913 | #include <wchar.h> | |
914 | #include <wctype.h> | |
915 | #include <stdio.h> | |
1632856e | 916 | #include <stdlib.h> |
4cb6fea5 KZ |
917 | ]], [[ |
918 | wchar_t wc; | |
919 | wint_t w; | |
920 | w = fgetwc(stdin); | |
921 | if (w == WEOF) exit(1); | |
922 | wc = w; | |
923 | fputwc(wc,stdout); | |
924 | ]], | |
925 | [wchar_t support]) | |
926 | ||
927 | AS_IF([test "x$build_widechar" = xyes ], [ | |
928 | AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?]) | |
3aecf79d KZ |
929 | ]) |
930 | ||
4cb6fea5 | 931 | |
3aecf79d KZ |
932 | AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[ |
933 | #include <sched.h> | |
934 | ]]) | |
935 | ||
034d378b | 936 | AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes]) |
3aecf79d | 937 | |
b09bc508 MF |
938 | AC_CHECK_TYPES([sighandler_t], [], [], [[ |
939 | #include <signal.h> | |
940 | ]]) | |
941 | ||
3aecf79d KZ |
942 | AC_CHECK_DECLS([CPU_ALLOC], [], [], [[ |
943 | #include <sched.h> | |
944 | ]]) | |
945 | ||
8d35bdc9 | 946 | # on Solaris, you can't mix and match standards, since we use c99 |
218b1dd6 | 947 | # apparently at this stage, XOPEN_SOURCE will conflict. As workaround, |
8d35bdc9 | 948 | # check for crypt.h and use that without XOPEN_SOURCE. |
8229ed2f | 949 | have_crypt=no |
8d35bdc9 KZ |
950 | AC_CHECK_HEADERS([crypt.h]) |
951 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
952 | #ifdef HAVE_CRYPT_H | |
953 | #include <crypt.h> | |
954 | #else | |
955 | #define _XOPEN_SOURCE | |
956 | #include <unistd.h> | |
957 | #endif | |
958 | ]], [[ | |
959 | char *c = crypt("abc","pw"); | |
70c364b4 JN |
960 | ]])],[ |
961 | have_libcrypt=no | |
962 | have_crypt=yes | |
963 | ],[ | |
75cba8d5 | 964 | UL_SET_LIBS([-lcrypt]) |
637cc045 | 965 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
8d35bdc9 KZ |
966 | #ifdef HAVE_CRYPT_H |
967 | #include <crypt.h> | |
968 | #else | |
969 | #define _XOPEN_SOURCE | |
970 | #include <unistd.h> | |
971 | #endif | |
972 | ]], [[ | |
973 | char *c = crypt("abc","pw"); | |
974 | ]])],[ | |
8d35bdc9 | 975 | have_libcrypt=yes |
8229ed2f | 976 | have_crypt=yes |
8d35bdc9 | 977 | ],[ |
8229ed2f | 978 | AC_MSG_WARN([crypt() is not available]) |
8d35bdc9 | 979 | ]) |
75cba8d5 | 980 | UL_RESTORE_LIBS |
8d35bdc9 | 981 | ]) |
034d378b | 982 | AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes]) |
8d35bdc9 | 983 | |
13f5473e | 984 | |
75ad4910 KZ |
985 | AC_ARG_WITH([selinux], |
986 | AS_HELP_STRING([--with-selinux], [compile with SELinux support]), | |
034d378b | 987 | [], [with_selinux=no] |
75ad4910 KZ |
988 | ) |
989 | ||
3013eb9d | 990 | AS_IF([test "x$with_selinux" = xno], [ |
034d378b | 991 | AM_CONDITIONAL([HAVE_SELINUX], [false]) |
3013eb9d | 992 | ], [ |
ca27216a | 993 | PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.5], [have_selinux=yes], [have_selinux=no]) |
9f57e6e8 SK |
994 | AS_CASE([$with_selinux:$have_selinux], |
995 | [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])] | |
996 | ) | |
3013eb9d | 997 | AS_IF([test "x$have_selinux" = xyes], [ |
1468eda6 KZ |
998 | AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available]) |
999 | UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux]) | |
1000 | AM_CONDITIONAL([HAVE_SELINUX], [true]) | |
1001 | ||
75cba8d5 | 1002 | UL_SET_LIBS([$SELINUX_LIBS]) |
312f04f4 KZ |
1003 | # This function is missing in old libselinux 1.xx versions |
1004 | AC_CHECK_FUNCS([security_get_initial_context]) | |
75cba8d5 | 1005 | UL_RESTORE_LIBS |
3013eb9d SK |
1006 | ]) |
1007 | ]) | |
75ad4910 KZ |
1008 | AC_SUBST([SELINUX_LIBS]) |
1009 | AC_SUBST([SELINUX_LIBS_STATIC]) | |
1010 | ||
0273afda | 1011 | |
75ad4910 KZ |
1012 | AC_ARG_WITH([audit], |
1013 | AS_HELP_STRING([--with-audit], [compile with audit support]), | |
034d378b | 1014 | [], [with_audit=no] |
75ad4910 KZ |
1015 | ) |
1016 | ||
3013eb9d | 1017 | AS_IF([test "x$with_audit" = xno], [ |
034d378b | 1018 | AM_CONDITIONAL([HAVE_AUDIT], [false]) |
3013eb9d | 1019 | ], [ |
034d378b | 1020 | UL_CHECK_LIB([audit], [audit_log_user_message]) |
9f57e6e8 SK |
1021 | AS_CASE([$with_audit:$have_audit], |
1022 | [yes:no], | |
1023 | [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])] | |
1024 | ) | |
3013eb9d | 1025 | ]) |
75ad4910 KZ |
1026 | |
1027 | AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]), | |
034d378b | 1028 | [], [with_udev=auto] |
75ad4910 KZ |
1029 | ) |
1030 | ||
3013eb9d | 1031 | AS_IF([test "x$with_udev" = xno], [ |
034d378b | 1032 | AM_CONDITIONAL([HAVE_UDEV], [false]) |
3013eb9d | 1033 | ], [ |
034d378b | 1034 | UL_CHECK_LIB([udev], [udev_new]) |
9f57e6e8 SK |
1035 | AS_CASE([$with_udev:$have_udev], |
1036 | [yes:no], | |
1037 | [AC_MSG_ERROR([udev selected but libudev not found])] | |
1038 | ) | |
3013eb9d | 1039 | ]) |
75ad4910 | 1040 | |
2b8f22bd | 1041 | |
4ffcc7a9 KZ |
1042 | dnl wide-char ncurses |
1043 | AC_ARG_WITH([ncursesw], | |
95a89bd3 | 1044 | AS_HELP_STRING([--without-ncursesw], [do not build with wide-char ncurses]), |
4ffcc7a9 KZ |
1045 | [], [with_ncursesw=auto] |
1046 | ) | |
1047 | have_ncursesw=no | |
3cc8a9f4 | 1048 | have_ncursesw_header=no |
4ffcc7a9 | 1049 | AS_IF([test "x$with_ncursesw" != xno], [ |
e5cc93b5 KZ |
1050 | UL_NCURSES_CHECK([ncursesw]) |
1051 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
3947ca4c KZ |
1052 | AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes]) |
1053 | AC_CHECK_HEADERS([ncursesw/term.h]) | |
87c26ce5 KZ |
1054 | |
1055 | # Define HAVE_NCURSES_H only if check for HAVE_NCURSESW_NCURSES_H is | |
1056 | # unsuccessful to avoid too many *_H permitations in config.h | |
1057 | AS_IF([test "x$have_ncursesw_header" = xno], [ | |
1058 | AC_CHECK_HEADERS([ncurses.h], [have_ncursesw_header=yes]) | |
1059 | AC_CHECK_HEADERS([term.h]) | |
1060 | ]) | |
3cc8a9f4 KZ |
1061 | AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no]) |
1062 | ]) | |
1063 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
f1512be8 | 1064 | CURSES_LIB_NAME="ncursesw" |
3cc8a9f4 | 1065 | AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available]) |
e5cc93b5 | 1066 | ]) |
4ffcc7a9 KZ |
1067 | ]) |
1068 | AS_CASE([$with_ncursesw:$have_ncursesw], | |
1069 | [yes:no], [AC_MSG_ERROR([ncursesw selected, but library not found])]) | |
2b8f22bd | 1070 | |
43cc76e2 | 1071 | |
4ffcc7a9 KZ |
1072 | dnl non-wide ncurses |
1073 | AC_ARG_WITH([ncurses], | |
95a89bd3 | 1074 | AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses]), |
4ffcc7a9 KZ |
1075 | [], [with_ncurses=auto] |
1076 | ) | |
1077 | have_ncurses=no | |
3cc8a9f4 | 1078 | have_ncurses_header=no |
18dae5d8 KZ |
1079 | AS_CASE([$with_ncurses:$build_widechar], |
1080 | [yes:yes], [AC_MSG_ERROR([wide-char support enabled, but non-wide ncurses selects])]) | |
1081 | ||
948182f4 | 1082 | AS_IF([test "x$have_ncursesw" = xno && test "x$with_ncurses" != xno ], [ |
e5cc93b5 KZ |
1083 | UL_NCURSES_CHECK([ncurses]) |
1084 | AS_IF([test "x$have_ncurses" = xyes], [ | |
87c26ce5 KZ |
1085 | AC_CHECK_HEADERS([ncurses/ncurses.h], [have_ncurses_header=yes]) |
1086 | AC_CHECK_HEADERS([ncurses/term.h]) | |
1087 | ||
1088 | # Define HAVE_NCURSES_H only if check for HAVE_NCURSES_NCURSES_H is | |
1089 | # unsuccessful to avoid too many *_H permitations in config.h | |
1090 | AS_IF([test "x$have_ncurses_header" = xno], [ | |
1091 | AC_CHECK_HEADERS([ncurses.h], [have_ncurses_header=yes]) | |
1092 | AC_CHECK_HEADERS([term.h]) | |
1093 | ]) | |
3cc8a9f4 KZ |
1094 | AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no]) |
1095 | ]) | |
1096 | AS_IF([test "x$have_ncurses" = xyes], [ | |
4ffcc7a9 | 1097 | CURSES_LIB_NAME="ncurses" |
3cc8a9f4 | 1098 | AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available]) |
e5cc93b5 | 1099 | ]) |
3013eb9d | 1100 | ]) |
4ffcc7a9 KZ |
1101 | AS_CASE([$with_ncurses:$have_ncurses], |
1102 | [yes:no], [AC_MSG_ERROR([ncurses selected, but library not found])]) | |
1103 | ||
2b8f22bd | 1104 | AC_SUBST([NCURSES_CFLAGS]) |
75ad4910 | 1105 | AC_SUBST([NCURSES_LIBS]) |
948182f4 | 1106 | AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes]) |
75ad4910 KZ |
1107 | |
1108 | ||
1109 | AC_ARG_WITH([slang], | |
4ffcc7a9 | 1110 | AS_HELP_STRING([--with-slang], [compile cfdisk with slang rather than ncurses]), |
034d378b | 1111 | [], [with_slang=no] |
75ad4910 | 1112 | ) |
50ea6795 | 1113 | have_slang=no |
3013eb9d | 1114 | AS_IF([test "x$with_slang" = xyes], [ |
75ad4910 KZ |
1115 | AC_CHECK_HEADERS([slang.h slang/slang.h]) |
1116 | AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], | |
50ea6795 | 1117 | [have_slang=yes], [], [ |
75ad4910 KZ |
1118 | #ifdef HAVE_SLANG_H |
1119 | #include <slang.h> | |
1120 | #elif defined(HAVE_SLANG_SLANG_H) | |
1121 | #include <slang/slang.h> | |
1122 | #endif | |
1123 | ]) | |
3013eb9d | 1124 | AS_IF([test "x$have_slang" = xno], [ |
f1512be8 KZ |
1125 | AC_MSG_ERROR([slang selected but slcurses.h not found])], |
1126 | [CURSES_LIB_NAME=slang | |
3013eb9d SK |
1127 | ]) |
1128 | ]) | |
034d378b | 1129 | AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes]) |
50ea6795 | 1130 | |
50ea6795 | 1131 | |
948182f4 | 1132 | AS_IF([test "x$have_slang" = xyes || test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes], [ |
f1512be8 KZ |
1133 | AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [ |
1134 | AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, | |
7556c944 KZ |
1135 | [Define if curses library has the use_default_colors().]) |
1136 | ]) | |
1137 | AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [ | |
1138 | AC_DEFINE(HAVE_RESIZETERM, 1, | |
1139 | [Define if curses library has the resizeterm().]) | |
f1512be8 KZ |
1140 | ]) |
1141 | ]) | |
1142 | ||
50ea6795 | 1143 | |
17d71034 KZ |
1144 | AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]), |
1145 | [], [with_tinfo=auto] | |
1146 | ) | |
1147 | have_tinfo=no | |
ad442a81 | 1148 | have_tinfow=no |
17d71034 | 1149 | AS_IF([test "x$with_tinfo" != xno], [ |
ad442a81 KZ |
1150 | AS_IF([test "x$have_ncursesw" = xyes], [ |
1151 | UL_TINFO_CHECK([tinfow]) | |
1152 | ]) | |
1153 | AS_IF([test "x$have_tinfow" = xno], [ | |
1154 | UL_TINFO_CHECK([tinfo]) | |
17d71034 | 1155 | ]) |
2b8f22bd MF |
1156 | ]) |
1157 | AC_SUBST([TINFO_LIBS]) | |
0b28c2ec | 1158 | AC_SUBST([TINFO_LIBS_STATIC]) |
ccf92e6d | 1159 | AC_SUBST([TINFO_CFLAGS]) |
948182f4 IM |
1160 | AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes]) |
1161 | AS_IF([test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes], [ | |
ad442a81 | 1162 | AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo or libtinfow available.]) |
4310faf9 | 1163 | ]) |
75ad4910 KZ |
1164 | |
1165 | ||
0b28c2ec | 1166 | AC_ARG_WITH([readline], |
95a89bd3 | 1167 | AS_HELP_STRING([--without-readline], [do not build with GNU Readline support]), |
0b28c2ec KZ |
1168 | [], [with_readline=auto] |
1169 | ) | |
1170 | ||
1171 | AS_IF([test "x$with_readline" = xno], [ | |
1172 | AM_CONDITIONAL([HAVE_READLINE], [false]) | |
1173 | ], [ | |
1174 | UL_CHECK_LIB([readline], [readline]) | |
1175 | AS_CASE([$with_readline:$have_readline], | |
1176 | [yes:no], | |
1177 | [AC_MSG_ERROR([readline selected but libreadline not found ])], | |
1178 | [*:yes], | |
1179 | [READLINE_LIBS="-lreadline" | |
1180 | READLINE_LIBS_STATIC="-lreadline $TINFO_LIBS_STATIC"] | |
1181 | ) | |
1182 | ]) | |
1183 | AC_SUBST([READLINE_LIBS]) | |
1184 | AC_SUBST([READLINE_LIBS_STATIC]) | |
1185 | ||
1186 | ||
75ad4910 KZ |
1187 | AC_ARG_WITH([utempter], |
1188 | AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]), | |
034d378b | 1189 | [], [with_utempter=no] |
75ad4910 KZ |
1190 | ) |
1191 | ||
3013eb9d | 1192 | AS_IF([test "x$with_utempter" = xyes], [ |
034d378b | 1193 | UL_CHECK_LIB([utempter], [utempter_add_record]) |
3013eb9d | 1194 | AS_IF([test "x$have_utempter" = xno], [ |
75ad4910 | 1195 | AC_MSG_ERROR([utempter selected but libutempter not found]) |
3013eb9d SK |
1196 | ]) |
1197 | ], [ | |
034d378b | 1198 | AM_CONDITIONAL([HAVE_UTEMPTER], [false]) |
3013eb9d | 1199 | ]) |
75ad4910 KZ |
1200 | |
1201 | ||
1dbbde66 KZ |
1202 | dnl |
1203 | dnl libuuid | |
1204 | dnl | |
17afb032 KZ |
1205 | AC_ARG_ENABLE([libuuid], |
1206 | AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]), | |
08b1c219 | 1207 | [], [UL_DEFAULT_ENABLE([libuuid], [yes])] |
17afb032 | 1208 | ) |
fa7be20e | 1209 | UL_BUILD_INIT([libuuid]) |
dc2b8d87 KZ |
1210 | AC_SUBST([LIBUUID_VERSION]) |
1211 | AC_SUBST([LIBUUID_VERSION_INFO]) | |
fa7be20e | 1212 | AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes) |
9dc801d2 | 1213 | |
3e584e85 RM |
1214 | AC_ARG_ENABLE([libuuid-force-uuidd], |
1215 | AS_HELP_STRING([--enable-libuuid-force-uuidd], [support uuidd even though the daemon is not built]), | |
1216 | [], [enable_libuuid_force_uuidd=no] | |
1217 | ) | |
1218 | ||
13985252 | 1219 | AS_IF([test "x$build_libuuid" = xyes], [ |
17afb032 | 1220 | AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.]) |
3013eb9d | 1221 | ]) |
48d7b13a | 1222 | |
c2e299d0 SS |
1223 | dnl |
1224 | dnl liblastlog2 | |
1225 | dnl | |
1226 | AC_ARG_ENABLE([liblastlog2], | |
1227 | AS_HELP_STRING([--disable-liblastlog2], [do not build liblastlog2 and lastlog2 utilities]), | |
1228 | [enable_liblastlog2=no], [enable_liblastlog2=check] | |
1229 | ) | |
1230 | AC_SUBST([LIBLASTLOG2_VERSION]) | |
1231 | AC_SUBST([LIBLASTLOG2_VERSION_INFO]) | |
1232 | AC_DEFINE_UNQUOTED([LIBLASTLOG2_VERSION], ["$LIBLASTLOG2_VERSION"], [liblastlog2 version string]) | |
1233 | ||
1234 | have_lastlog2=no | |
1235 | AS_IF([test "x$enable_liblastlog2" != xno], [ | |
1236 | AS_CASE([$enable_liblastlog2:$have_sqlite3_h], | |
1237 | [yes:no], | |
1238 | [AC_MSG_ERROR([lastlog2 selected but sqlite3.h not found])], | |
1239 | [check:no], | |
1240 | [AC_MSG_WARN([sqlite3.h not found, do not build with lastlog2 support])], | |
1241 | [*:yes], | |
1242 | [have_lastlog2=yes | |
1243 | AC_DEFINE(HAVE_LIBLASTLOG2, 1, [Define to 1 if you have the -llastlog2.])] | |
1244 | ) | |
1245 | ]) | |
1246 | AM_CONDITIONAL([BUILD_LIBLASTLOG2], [test "x$have_lastlog2" = xyes]) | |
1247 | AM_CONDITIONAL([BUILD_LIBLASTLOG2_TESTS], [test "x$have_lastlog2" = xyes && test "x$enable_static" = xyes]) | |
1248 | ||
1dbbde66 KZ |
1249 | dnl |
1250 | dnl libblkid | |
1251 | dnl | |
f910b559 | 1252 | AC_ARG_ENABLE([libblkid], |
1d12ed57 | 1253 | AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]), |
dc049516 | 1254 | [], [UL_DEFAULT_ENABLE([libblkid], [check])] |
40f07ff7 | 1255 | ) |
61a074f7 | 1256 | UL_BUILD_INIT([libblkid]) |
dc049516 | 1257 | UL_REQUIRES_HAVE([libblkid], [openat], [openat functions]) |
a68ed87f | 1258 | UL_REQUIRES_HAVE([libblkid], [dirfd,ddfd], [dirfd or ddfd function]) |
033cf439 | 1259 | AC_SUBST([LIBBLKID_DATE]) |
dc2b8d87 KZ |
1260 | AC_SUBST([LIBBLKID_VERSION]) |
1261 | AC_SUBST([LIBBLKID_VERSION_INFO]) | |
034d378b SK |
1262 | AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string]) |
1263 | AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string]) | |
3013eb9d | 1264 | AS_IF([test "x$build_libblkid" = xyes], [ |
034d378b | 1265 | AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.]) |
3013eb9d | 1266 | ]) |
034d378b | 1267 | AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes]) |
948182f4 | 1268 | AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes && test "x$enable_static" = xyes]) |
f910b559 | 1269 | |
1dbbde66 KZ |
1270 | dnl |
1271 | dnl libmount | |
1272 | dnl | |
f1cde479 KZ |
1273 | AC_ARG_ENABLE([libmount], |
1274 | AS_HELP_STRING([--disable-libmount], [do not build libmount]), | |
08b1c219 | 1275 | [], [UL_DEFAULT_ENABLE([libmount], [check])] |
f1cde479 | 1276 | ) |
61a074f7 | 1277 | UL_BUILD_INIT([libmount]) |
13f5473e | 1278 | UL_REQUIRES_BUILD([libmount], [libblkid]) |
a68ed87f | 1279 | UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function]) |
94c8821b | 1280 | UL_REQUIRES_HAVE([libmount], [mntent_h], [mntent.h header file]) |
034d378b | 1281 | AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes]) |
948182f4 | 1282 | AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes && test "x$enable_static" = xyes]) |
30c34afb | 1283 | AS_IF([test "x$build_libmount" = xyes], [ |
7a3b35b9 KZ |
1284 | AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount available.]) |
1285 | AS_IF([test "x$have_setns_syscall" = "xyes"], [ | |
1286 | AC_DEFINE([USE_LIBMOUNT_SUPPORT_NAMESPACES], [1], [Define to 1 if want to support namepaces.]) | |
1287 | ],[ | |
1288 | AC_MSG_WARN([libmount will be compiled without namespaces support]) | |
1289 | ]) | |
30c34afb | 1290 | ]) |
8e368761 | 1291 | |
f1cde479 | 1292 | AC_SUBST([LIBMOUNT_VERSION]) |
10e1d2e5 SH |
1293 | AC_SUBST([LIBMOUNT_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR) |
1294 | AC_SUBST([LIBMOUNT_MINOR_VERSION], $PACKAGE_VERSION_MINOR) | |
1295 | AC_SUBST([LIBMOUNT_PATCH_VERSION], $PACKAGE_VERSION_RELEASE) | |
f1cde479 | 1296 | AC_SUBST([LIBMOUNT_VERSION_INFO]) |
034d378b | 1297 | AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string]) |
13f5473e | 1298 | |
9040c090 KZ |
1299 | AC_ARG_ENABLE([libmount-mountfd-support], |
1300 | AS_HELP_STRING([--disable-libmount-mountfd-support], [do not use new mount API based on FDs]), | |
1301 | [], [enable_libmount_mountfd_support=check] | |
1302 | ) | |
1303 | UL_BUILD_INIT([libmount_mountfd_support]) | |
1304 | UL_REQUIRES_BUILD([libmount_mountfd_support], [libmount]) | |
1305 | UL_REQUIRES_LINUX([libmount_mountfd_support]) | |
1306 | UL_REQUIRES_HAVE([libmount_mountfd_support], [mountfd_api], [mount FDs based API]) | |
5502e73d | 1307 | UL_REQUIRES_HAVE([libmount_mountfd_support], [linux_mount_h], [linux/mount.h]) |
9040c090 KZ |
1308 | AS_IF([test "x$build_libmount_mountfd_support" = xyes ], [ |
1309 | AC_DEFINE([USE_LIBMOUNT_MOUNTFD_SUPPORT], [1], [Enable support for new mount FD based kernel API]) | |
1310 | ]) | |
1311 | ||
1312 | ||
1a4d989e OO |
1313 | dnl |
1314 | dnl libsmartcols | |
1315 | dnl | |
1316 | AC_ARG_ENABLE([libsmartcols], | |
1317 | AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]), | |
08b1c219 | 1318 | [], [UL_DEFAULT_ENABLE([libsmartcols], [yes])] |
1a4d989e OO |
1319 | ) |
1320 | UL_BUILD_INIT([libsmartcols]) | |
1a4d989e | 1321 | AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes]) |
1a4d989e OO |
1322 | |
1323 | AC_SUBST([LIBSMARTCOLS_VERSION]) | |
1324 | AC_SUBST([LIBSMARTCOLS_VERSION_INFO]) | |
1325 | AC_DEFINE_UNQUOTED([LIBSMARTCOLS_VERSION], ["$LIBSMARTCOLS_VERSION"], [libsmartcols version string]) | |
1326 | ||
1327 | ||
eb6a03f3 | 1328 | dnl |
0bb4c979 | 1329 | dnl libfdisk |
eb6a03f3 | 1330 | dnl |
0bb4c979 KZ |
1331 | AC_ARG_ENABLE([libfdisk], |
1332 | AS_HELP_STRING([--disable-libfdisk], [do not build libfdisk]), | |
1333 | [], [UL_DEFAULT_ENABLE([libfdisk], [check])] | |
1334 | ) | |
1335 | UL_BUILD_INIT([libfdisk]) | |
eb6a03f3 | 1336 | UL_REQUIRES_BUILD([libfdisk], [libuuid]) |
034d378b | 1337 | AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes]) |
948182f4 | 1338 | AM_CONDITIONAL([BUILD_LIBFDISK_TESTS], [test "x$build_libfdisk" = xyes && test "x$enable_static" = xyes]) |
0bb4c979 | 1339 | |
ed79557e KZ |
1340 | AS_IF([test "x$build_libblkid" = xyes], |
1341 | [LIBFDISK_PC_REQUIRES="uuid blkid"],[LIBFDISK_PC_REQUIRES="uuid"]) | |
1342 | AC_SUBST([LIBFDISK_PC_REQUIRES]) | |
1343 | ||
0bb4c979 | 1344 | AC_SUBST([LIBFDISK_VERSION]) |
791da22d KZ |
1345 | AC_SUBST([LIBFDISK_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR) |
1346 | AC_SUBST([LIBFDISK_MINOR_VERSION], $PACKAGE_VERSION_MINOR) | |
1347 | AC_SUBST([LIBFDISK_PATCH_VERSION], $PACKAGE_VERSION_RELEASE) | |
0bb4c979 KZ |
1348 | AC_SUBST([LIBFDISK_VERSION_INFO]) |
1349 | AC_DEFINE_UNQUOTED([LIBFDISK_VERSION], ["$LIBFDISK_VERSION"], [libfdisk version string]) | |
1350 | ||
eb6a03f3 | 1351 | |
9c7431fd CS |
1352 | AC_ARG_ENABLE([fdisks], |
1353 | AS_HELP_STRING([--disable-fdisks], [do not build fdisk(8), sfdisk(8) and cfdisk(8)]), | |
1354 | [], [UL_DEFAULT_ENABLE([fdisks], [check])] | |
1355 | ) | |
1356 | enable_fdisk=$enable_fdisks | |
1357 | enable_sfdisk=$enable_fdisks | |
1358 | enable_cfdisk=$enable_fdisks | |
1359 | ||
1360 | UL_BUILD_INIT([fdisk]) | |
dc049516 | 1361 | UL_REQUIRES_HAVE([fdisk], [openat], [openat functions]) |
a68ed87f | 1362 | UL_REQUIRES_HAVE([fdisk], [dirfd,ddfd], [dirfd or ddfd function]) |
eb6a03f3 | 1363 | UL_REQUIRES_BUILD([fdisk], [libfdisk]) |
d44115f3 | 1364 | UL_REQUIRES_BUILD([fdisk], [libsmartcols]) |
034d378b | 1365 | AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes]) |
eb6a03f3 KZ |
1366 | |
1367 | ||
9c7431fd | 1368 | UL_BUILD_INIT([sfdisk]) |
dc049516 | 1369 | UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions]) |
a68ed87f | 1370 | UL_REQUIRES_HAVE([sfdisk], [dirfd,ddfd], [dirfd or ddfd function]) |
9c1f9dd3 KZ |
1371 | UL_REQUIRES_BUILD([sfdisk], [libfdisk]) |
1372 | UL_REQUIRES_BUILD([sfdisk], [libsmartcols]) | |
ecc6047e KZ |
1373 | AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes]) |
1374 | ||
1375 | ||
9c7431fd | 1376 | UL_BUILD_INIT([cfdisk]) |
08b1c219 KZ |
1377 | UL_REQUIRES_BUILD([cfdisk], [libfdisk]) |
1378 | UL_REQUIRES_BUILD([cfdisk], [libsmartcols]) | |
9dd55a04 | 1379 | UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function]) |
4ffcc7a9 | 1380 | UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) |
08b1c219 KZ |
1381 | AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes]) |
1382 | ||
1383 | ||
434b07a0 KZ |
1384 | AC_ARG_ENABLE([mount], |
1385 | AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]), | |
08b1c219 | 1386 | [], [UL_DEFAULT_ENABLE([mount], [check])] |
ecdba5dd | 1387 | ) |
434b07a0 | 1388 | UL_BUILD_INIT([mount]) |
53e8c16e | 1389 | UL_REQUIRES_LINUX([mount]) |
434b07a0 | 1390 | UL_REQUIRES_BUILD([mount], [libmount]) |
034d378b | 1391 | AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes]) |
ecdba5dd KZ |
1392 | |
1393 | ||
bafe1a75 KZ |
1394 | AC_ARG_ENABLE([losetup], |
1395 | AS_HELP_STRING([--disable-losetup], [do not build losetup]), | |
08b1c219 | 1396 | [], [UL_DEFAULT_ENABLE([losetup], [check])] |
bafe1a75 KZ |
1397 | ) |
1398 | UL_BUILD_INIT([losetup]) | |
1399 | UL_REQUIRES_LINUX([losetup]) | |
7477f356 | 1400 | UL_REQUIRES_BUILD([losetup], [libsmartcols]) |
034d378b | 1401 | AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes]) |
bafe1a75 | 1402 | |
0624d840 KZ |
1403 | AC_ARG_ENABLE([zramctl], |
1404 | AS_HELP_STRING([--disable-zramctl], [do not build zramctl]), | |
1405 | [], [UL_DEFAULT_ENABLE([zramctl], [check])] | |
1406 | ) | |
1407 | UL_BUILD_INIT([zramctl]) | |
1408 | UL_REQUIRES_LINUX([zramctl]) | |
1409 | UL_REQUIRES_BUILD([zramctl], [libsmartcols]) | |
1410 | AM_CONDITIONAL([BUILD_ZRAMCTL], [test "x$build_zramctl" = xyes]) | |
bafe1a75 | 1411 | |
1dbbde66 KZ |
1412 | AC_ARG_ENABLE([fsck], |
1413 | AS_HELP_STRING([--disable-fsck], [do not build fsck]), | |
08b1c219 | 1414 | [], [UL_DEFAULT_ENABLE([fsck], [check])] |
1dbbde66 | 1415 | ) |
61a074f7 | 1416 | UL_BUILD_INIT([fsck]) |
a7b585ea | 1417 | UL_REQUIRES_BUILD([fsck], [libmount]) |
034d378b | 1418 | AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes]) |
1dbbde66 KZ |
1419 | |
1420 | ||
1421 | AC_ARG_ENABLE([partx], | |
1422 | AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]), | |
08b1c219 | 1423 | [], [UL_DEFAULT_ENABLE([partx], [check])] |
1dbbde66 | 1424 | ) |
61a074f7 | 1425 | UL_BUILD_INIT([partx]) |
ecde2536 KZ |
1426 | UL_REQUIRES_LINUX([partx]) |
1427 | UL_REQUIRES_BUILD([partx], [libblkid]) | |
08b1c219 | 1428 | UL_REQUIRES_BUILD([partx], [libsmartcols]) |
034d378b | 1429 | AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes]) |
1dbbde66 KZ |
1430 | |
1431 | ||
1dbbde66 KZ |
1432 | AC_ARG_ENABLE([uuidd], |
1433 | AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]), | |
08b1c219 | 1434 | [], [UL_DEFAULT_ENABLE([uuidd], [check])] |
1dbbde66 | 1435 | ) |
61a074f7 | 1436 | UL_BUILD_INIT([uuidd]) |
bcdab497 | 1437 | UL_REQUIRES_BUILD([uuidd], [libuuid]) |
651b25cd RM |
1438 | UL_REQUIRES_HAVE([uuidd], [timer], [timer_create function]) |
1439 | UL_REQUIRES_HAVE([uuidd], [sys_signalfd_h], [sys/signalfd.h header]) | |
2afbcec5 | 1440 | AS_IF([test "x$build_uuidd" = xyes || test "x$enable_libuuid_force_uuidd" = xyes], [ |
034d378b | 1441 | AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.]) |
3013eb9d | 1442 | ]) |
034d378b | 1443 | AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes]) |
1dbbde66 KZ |
1444 | |
1445 | ||
5ec1108c | 1446 | AC_ARG_ENABLE([uuidgen], |
1447 | AS_HELP_STRING([--disable-uuidgen], [do not build uuidgen]), | |
1448 | [], [UL_DEFAULT_ENABLE([uuidgen], [check])] | |
1449 | ) | |
1450 | UL_BUILD_INIT([uuidgen]) | |
1b15cbd1 KZ |
1451 | UL_REQUIRES_BUILD([uuidgen], [libuuid]) |
1452 | AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes]) | |
1453 | ||
83893f26 SK |
1454 | UL_BUILD_INIT([uuidparse], [check]) |
1455 | UL_REQUIRES_BUILD([uuidparse], [libuuid]) | |
1456 | UL_REQUIRES_BUILD([uuidparse], [libsmartcols]) | |
1457 | AM_CONDITIONAL([BUILD_UUIDPARSE], [test "x$build_uuidparse" = xyes]) | |
1458 | ||
5ec1108c | 1459 | AC_ARG_ENABLE([blkid], |
1460 | AS_HELP_STRING([--disable-blkid], [do not build blkid(8)]), | |
1461 | [], [UL_DEFAULT_ENABLE([blkid], [check])] | |
1462 | ) | |
1463 | UL_BUILD_INIT([blkid]) | |
15a2c741 KZ |
1464 | UL_REQUIRES_BUILD([blkid], [libblkid]) |
1465 | AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes]) | |
1466 | ||
1467 | UL_BUILD_INIT([findfs], [check]) | |
1468 | UL_REQUIRES_BUILD([findfs], [libblkid]) | |
1469 | AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes]) | |
1470 | ||
a76cd5f6 SV |
1471 | AC_ARG_ENABLE([wipefs], |
1472 | AS_HELP_STRING([--disable-wipefs], [do not build wipefs]), | |
1473 | [], [UL_DEFAULT_ENABLE([wipefs], [check])] | |
1474 | ) | |
1475 | UL_BUILD_INIT([wipefs]) | |
15a2c741 | 1476 | UL_REQUIRES_BUILD([wipefs], [libblkid]) |
d9921b2a | 1477 | UL_REQUIRES_BUILD([wipefs], [libsmartcols]) |
15a2c741 KZ |
1478 | AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes]) |
1479 | ||
1480 | UL_BUILD_INIT([findmnt], [check]) | |
1481 | UL_REQUIRES_BUILD([findmnt], [libmount]) | |
169b4a8c | 1482 | UL_REQUIRES_BUILD([findmnt], [libblkid]) |
15a2c741 KZ |
1483 | UL_REQUIRES_BUILD([findmnt], [libsmartcols]) |
1484 | AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes]) | |
1485 | ||
1b15cbd1 | 1486 | |
0164c245 | 1487 | AC_ARG_ENABLE([mountpoint], |
2023ccc4 | 1488 | AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]), |
08b1c219 | 1489 | [], [UL_DEFAULT_ENABLE([mountpoint], [check])] |
0164c245 | 1490 | ) |
61a074f7 | 1491 | UL_BUILD_INIT([mountpoint]) |
a9127bc1 | 1492 | UL_REQUIRES_BUILD([mountpoint], [libmount]) |
034d378b | 1493 | AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes]) |
0164c245 KZ |
1494 | |
1495 | ||
10e56b49 KZ |
1496 | AC_ARG_ENABLE([fallocate], |
1497 | AS_HELP_STRING([--disable-fallocate], [do not build fallocate]), | |
08b1c219 | 1498 | [], [UL_DEFAULT_ENABLE([fallocate], [check])] |
10e56b49 | 1499 | ) |
61a074f7 | 1500 | UL_BUILD_INIT([fallocate]) |
10e56b49 KZ |
1501 | UL_REQUIRES_LINUX([fallocate]) |
1502 | UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])]) | |
034d378b | 1503 | AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes]) |
10e56b49 | 1504 | |
3013eb9d | 1505 | AS_IF([test "x$build_fallocate" = xyes], [ |
10e56b49 KZ |
1506 | dnl check for valid fallocate() function |
1507 | dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64() | |
1508 | dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64() | |
1509 | dnl and program can't be linked. | |
1510 | dnl AC_CHECK_FUNC can't catch such errors since it's redefining | |
1511 | dnl function prototype. | |
1512 | AC_MSG_CHECKING([for valid fallocate() function]) | |
1513 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
b832c2fe YD |
1514 | #ifdef HAVE_UNISTD_H |
1515 | # include <unistd.h> | |
1516 | #endif | |
1517 | #ifdef HAVE_SYS_TYPES_H | |
1518 | # include <sys/types.h> | |
1519 | #endif | |
1520 | #ifdef HAVE_LINUX_FALLOC_H | |
1521 | # include <linux/falloc.h> | |
1522 | #endif | |
1523 | #ifdef HAVE_FCNTL_H | |
1524 | # include <fcntl.h> | |
1525 | #endif | |
1526 | ]],[[ | |
1527 | long ret; | |
b832c2fe | 1528 | ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful); |
b832c2fe YD |
1529 | if (ret != 0) { |
1530 | return 1; | |
1531 | } | |
1532 | ]])],[ | |
10e56b49 | 1533 | AC_MSG_RESULT([yes]) |
034d378b | 1534 | AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[ |
10e56b49 | 1535 | AC_MSG_RESULT([no])]) |
3013eb9d | 1536 | ]) |
10e56b49 | 1537 | |
833f9a7a DC |
1538 | AS_IF([test "x$build_fallocate" = xyes], [ |
1539 | dnl check for valid posix_fallocate() function | |
1540 | AC_MSG_CHECKING([for valid posix_fallocate() function]) | |
1541 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1542 | #ifdef HAVE_UNISTD_H | |
1543 | # include <unistd.h> | |
1544 | #endif | |
1545 | #ifdef HAVE_SYS_TYPES_H | |
1546 | # include <sys/types.h> | |
1547 | #endif | |
1548 | #ifdef HAVE_LINUX_FALLOC_H | |
1549 | # include <linux/falloc.h> | |
1550 | #endif | |
1551 | #ifdef HAVE_FCNTL_H | |
1552 | # include <fcntl.h> | |
1553 | #endif | |
1554 | ]],[[ | |
1555 | long ret; | |
1556 | ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful); | |
1557 | if (ret != 0) { | |
1558 | return 1; | |
1559 | } | |
1560 | ]])],[ | |
1561 | AC_MSG_RESULT([yes]) | |
1562 | AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Have valid posix_fallocate() function])],[ | |
1563 | AC_MSG_RESULT([no])]) | |
1564 | ]) | |
1565 | ||
19a224ad | 1566 | |
a2ea6670 KZ |
1567 | AC_ARG_ENABLE([unshare], |
1568 | AS_HELP_STRING([--disable-unshare], [do not build unshare]), | |
08b1c219 | 1569 | [], [UL_DEFAULT_ENABLE([unshare], [check])] |
a2ea6670 | 1570 | ) |
61a074f7 | 1571 | UL_BUILD_INIT([unshare]) |
a2ea6670 KZ |
1572 | UL_REQUIRES_LINUX([unshare]) |
1573 | UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])]) | |
2c2ff2ed | 1574 | UL_REQUIRES_HAVE([unshare], [linux_capability_h], [linux/capability.h header file]) |
034d378b | 1575 | AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes]) |
01e94325 KZ |
1576 | |
1577 | AC_MSG_CHECKING([for valid unshare() function]) | |
1578 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1579 | #include <sched.h> | |
1580 | ]],[[ | |
1581 | int ret; | |
1582 | ret = unshare(0); | |
1583 | if (ret != 0) { | |
1584 | return 1; | |
1585 | } | |
1586 | ]])],[ | |
1587 | AC_MSG_RESULT([yes]) | |
1588 | AC_DEFINE([HAVE_UNSHARE], [1], [Have valid unshare() function])], | |
1589 | [ | |
1590 | AC_MSG_RESULT([no]) | |
1591 | ]) | |
1592 | ||
b3425806 | 1593 | |
f8aa8e94 EB |
1594 | AC_ARG_ENABLE([nsenter], |
1595 | AS_HELP_STRING([--disable-nsenter], [do not build nsenter]), | |
08b1c219 | 1596 | [], [UL_DEFAULT_ENABLE([nsenter], [check])] |
f8aa8e94 EB |
1597 | ) |
1598 | UL_BUILD_INIT([nsenter]) | |
1599 | UL_REQUIRES_LINUX([nsenter]) | |
7a3b35b9 | 1600 | UL_REQUIRES_HAVE([nsenter], [setns_syscall], [setns syscall]) |
034d378b | 1601 | AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes]) |
01e94325 KZ |
1602 | |
1603 | AC_MSG_CHECKING([for valid setns() function]) | |
1604 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1605 | #include <sched.h> | |
1606 | #include <errno.h> | |
1607 | ]],[[ | |
1608 | int ret; | |
1609 | ret = setns(0, 0); | |
1610 | if (ret != EINVAL && ret != EBADF && ret != EPERM) { | |
1611 | return 1; | |
1612 | } | |
1613 | ]])],[ | |
1614 | AC_MSG_RESULT([yes]) | |
1615 | AC_DEFINE([HAVE_SETNS], [1], [Have valid setns() function])], | |
1616 | [ | |
1617 | AC_MSG_RESULT([no]) | |
1618 | ]) | |
b3425806 | 1619 | |
17d71034 KZ |
1620 | |
1621 | AC_ARG_WITH([cap_ng], | |
801afcb0 | 1622 | AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]), |
17d71034 KZ |
1623 | [], [with_cap_ng=auto] |
1624 | ) | |
801afcb0 MF |
1625 | AS_IF([test "x$with_cap_ng" = xno], [ |
1626 | AM_CONDITIONAL([HAVE_CAP_NG], [false]) | |
1627 | have_cap_ng=no | |
1628 | ],[ | |
17d71034 KZ |
1629 | UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng]) |
1630 | ]) | |
1631 | ||
1632 | ||
5600c405 AL |
1633 | AC_ARG_ENABLE([setpriv], |
1634 | AS_HELP_STRING([--disable-setpriv], [do not build setpriv]), | |
08b1c219 | 1635 | [], [UL_DEFAULT_ENABLE([setpriv], [check])] |
5600c405 AL |
1636 | ) |
1637 | UL_BUILD_INIT([setpriv]) | |
1638 | UL_REQUIRES_LINUX([setpriv]) | |
2c2ff2ed KZ |
1639 | UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [linux/securebits.h header file]) |
1640 | UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header file]) | |
e1b8ba20 | 1641 | UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library]) |
034d378b | 1642 | AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes]) |
5600c405 | 1643 | |
04ae85a7 RM |
1644 | AC_ARG_ENABLE([hardlink], |
1645 | AS_HELP_STRING([--disable-hardlink], [do not build hardlink]), | |
1646 | [], [UL_DEFAULT_ENABLE([hardlink], [check])] | |
1647 | ) | |
1648 | UL_BUILD_INIT([hardlink]) | |
1649 | AM_CONDITIONAL([BUILD_HARDLINK], [test "x$build_hardlink" = xyes]) | |
5600c405 | 1650 | |
43989bad | 1651 | |
539feec1 ML |
1652 | AC_ARG_ENABLE([eject], |
1653 | AS_HELP_STRING([--disable-eject], [do not build eject]), | |
08b1c219 | 1654 | [], [UL_DEFAULT_ENABLE([eject], [check])] |
539feec1 ML |
1655 | ) |
1656 | UL_BUILD_INIT([eject]) | |
1657 | UL_REQUIRES_LINUX([eject]) | |
7770e7df | 1658 | UL_REQUIRES_BUILD([eject], [libmount]) |
034d378b | 1659 | AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes]) |
539feec1 ML |
1660 | |
1661 | ||
48d7b13a | 1662 | AC_ARG_ENABLE([agetty], |
7fa4f112 | 1663 | AS_HELP_STRING([--disable-agetty], [do not build agetty]), |
d00c10ed | 1664 | [], [UL_DEFAULT_ENABLE([agetty], [check])] |
48d7b13a | 1665 | ) |
61a074f7 | 1666 | UL_BUILD_INIT([agetty]) |
b4b919fe | 1667 | UL_REQUIRES_HAVE([agetty], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 1668 | UL_REQUIRES_HAVE([agetty], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 1669 | AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes]) |
948182f4 | 1670 | AS_IF([test "x$have_futimens" = xyes && test "x$have_inotify_init1" = xyes ], [ |
90d5285d KZ |
1671 | AC_DEFINE([AGETTY_RELOAD], [1], [Enable agetty --reload feature]) |
1672 | ],[ | |
1673 | AC_MSG_WARN([futimens or inotify_init1 not found; agetty(8) will not provide ---reload functionality]) | |
1674 | ]) | |
0fc74be1 | 1675 | |
48d7b13a | 1676 | |
1eb16fd7 | 1677 | AC_ARG_ENABLE([plymouth_support], |
c89edac5 | 1678 | AS_HELP_STRING([--disable-plymouth_support], [do not care about plymouth in sulogin(8) and agetty(8)]), |
d67f61c0 | 1679 | [], [enable_plymouth_support=check] |
1eb16fd7 KZ |
1680 | ) |
1681 | UL_BUILD_INIT([plymouth_support]) | |
1682 | UL_REQUIRES_HAVE([plymouth_support], [tiocglcktrmios], [TIOCGLCKTRMIOS flag]) | |
1683 | UL_REQUIRES_HAVE([plymouth_support], [sock_cloexec], [SOCK_CLOEXEC flag]) | |
1684 | UL_REQUIRES_HAVE([plymouth_support], [sock_nonblock], [SOCK_NONBLOCK flag]) | |
1685 | UL_REQUIRES_HAVE([plymouth_support], [so_passcred], [SO_PASSCRED flag]) | |
1686 | AM_CONDITIONAL([USE_PLYMOUTH_SUPPORT], [test "x$build_plymouth_support" = xyes]) | |
1687 | AS_IF([test "x$build_plymouth_support" = xyes ], [ | |
c89edac5 | 1688 | AC_DEFINE([USE_PLYMOUTH_SUPPORT], [1], [Enable plymouth support feature for sulogin and agetty]) |
1eb16fd7 KZ |
1689 | ]) |
1690 | ||
1691 | ||
17d71034 KZ |
1692 | AC_ARG_WITH([libz], |
1693 | AS_HELP_STRING([--without-libz], [compile without libz]), | |
1694 | [], [with_libz=auto] | |
1695 | ) | |
1696 | AS_IF([test "x$with_libz" = xno], [have_z=no], [ | |
1697 | AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no]) | |
1698 | ]) | |
1699 | ||
09070e1a SK |
1700 | AC_ARG_WITH([libmagic], |
1701 | AS_HELP_STRING([--without-libmagic], [compile without libmagic]), | |
1702 | [], [with_libmagic=auto] | |
1703 | ) | |
1704 | AS_IF([test "x$with_libmagic" = xno], [have_magic=no], [ | |
1705 | AC_CHECK_LIB([magic], [magic_open], [ | |
263381dd MM |
1706 | AC_CHECK_HEADER(magic.h, [ |
1707 | AC_DEFINE([HAVE_MAGIC], [1], [Define to 1 if you have the libmagic present.]) | |
1708 | MAGIC_LIBS="-lmagic" | |
1709 | ]) | |
09070e1a SK |
1710 | ]) |
1711 | ]) | |
1712 | AC_SUBST([MAGIC_LIBS]) | |
1713 | ||
17d71034 | 1714 | |
9cb68977 | 1715 | AC_ARG_ENABLE([cramfs], |
7fa4f112 | 1716 | AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]), |
08b1c219 | 1717 | [], [UL_DEFAULT_ENABLE([cramfs], [check])] |
9cb68977 | 1718 | ) |
61a074f7 | 1719 | UL_BUILD_INIT([cramfs]) |
d81b5a52 | 1720 | UL_REQUIRES_HAVE([cramfs], [z], [z library]) |
034d378b | 1721 | AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes]) |
9cb68977 | 1722 | |
a13cdb7a | 1723 | |
8d6f0bae | 1724 | AC_ARG_ENABLE([bfs], |
834fc88c | 1725 | AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]), |
08b1c219 | 1726 | [], [UL_DEFAULT_ENABLE([bfs], [yes])] |
834fc88c KZ |
1727 | ) |
1728 | UL_BUILD_INIT([bfs]) | |
034d378b | 1729 | AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes]) |
834fc88c KZ |
1730 | |
1731 | ||
3d9fdac5 KZ |
1732 | AC_ARG_ENABLE([minix], |
1733 | AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]), | |
08b1c219 | 1734 | [], [UL_DEFAULT_ENABLE([minix], [yes])] |
3d9fdac5 KZ |
1735 | ) |
1736 | UL_BUILD_INIT([minix]) | |
1737 | AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes]) | |
1738 | ||
1739 | ||
8d6f0bae | 1740 | AC_ARG_ENABLE([fdformat], |
13b26e3c SK |
1741 | AS_HELP_STRING([--enable-fdformat], [build fdformat]), |
1742 | [], [UL_DEFAULT_ENABLE([fdformat], [no])] | |
8d6f0bae KZ |
1743 | ) |
1744 | UL_BUILD_INIT([fdformat]) | |
1745 | UL_REQUIRES_LINUX([fdformat]) | |
034d378b | 1746 | AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes]) |
8d6f0bae KZ |
1747 | |
1748 | ||
6acf31ac KZ |
1749 | AC_ARG_ENABLE([hwclock], |
1750 | AS_HELP_STRING([--disable-hwclock], [do not build hwclock]), | |
08b1c219 | 1751 | [], [UL_DEFAULT_ENABLE([hwclock], [check])] |
6acf31ac KZ |
1752 | ) |
1753 | have_linuxdummy=$linux_os | |
1754 | ||
1755 | UL_BUILD_INIT([hwclock]) | |
1756 | UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux]) | |
034d378b | 1757 | AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes]) |
e09ebf22 | 1758 | |
b1062292 | 1759 | AC_ARG_ENABLE([hwclock_cmos], |
88bc304b | 1760 | AS_HELP_STRING([--disable-hwclock-cmos], [do not use CMOS clock]), |
b1062292 | 1761 | [], [enable_hwclock_cmos=check] |
88bc304b | 1762 | ) |
b1062292 KZ |
1763 | UL_BUILD_INIT([hwclock_cmos]) |
1764 | UL_REQUIRES_BUILD([hwclock_cmos], [hwclock]) | |
1765 | UL_REQUIRES_ARCH([hwclock_cmos], [i?86-*,x86_64*]) | |
1766 | AM_CONDITIONAL([USE_HWCLOCK_CMOS], [test "x$build_hwclock_cmos" = xyes]) | |
1767 | AS_IF([test "x$build_hwclock_cmos" = xyes ], [ | |
1768 | AC_DEFINE([USE_HWCLOCK_CMOS], [1], [Define to 1 if want to use CMOS clock.]) | |
88bc304b CS |
1769 | ]) |
1770 | ||
e8c21c89 KZ |
1771 | AC_ARG_ENABLE([hwclock_gplv3], |
1772 | AS_HELP_STRING([--disable-hwclock-gplv3], [do not use datetime parsing GPLv3 code]), | |
1773 | [], [enable_hwclock_gplv3=yes] | |
1774 | ) | |
1775 | AM_CONDITIONAL([USE_HWCLOCK_GPLv3_DATETIME], [test "x$enable_hwclock_gplv3" = xyes]) | |
1776 | AS_IF([test "x$enable_hwclock_gplv3" = xyes ], [ | |
1777 | AC_DEFINE([USE_HWCLOCK_GPLv3_DATETIME], [1], [use datetime parsing GPLv3 code to hwclock]) | |
1778 | ]) | |
1779 | ||
88bc304b | 1780 | |
5ec1108c | 1781 | AC_ARG_ENABLE([mkfs], |
1782 | AS_HELP_STRING([--disable-mkfs], [do not build mkfs(8)]), | |
1783 | [], [UL_DEFAULT_ENABLE([mkfs], [check])] | |
1784 | ) | |
1785 | UL_BUILD_INIT([mkfs]) | |
ecc6047e KZ |
1786 | AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes]) |
1787 | ||
1788 | UL_BUILD_INIT([isosize], [yes]) | |
1789 | AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes]) | |
1790 | ||
3d9fdac5 | 1791 | |
5ec1108c | 1792 | AC_ARG_ENABLE([fstrim], |
1793 | AS_HELP_STRING([--disable-fstrim], [do not build fstrim(8)]), | |
1794 | [], [UL_DEFAULT_ENABLE([fstrim], [check])] | |
1795 | ) | |
1796 | UL_BUILD_INIT([fstrim]) | |
7b040214 KZ |
1797 | UL_REQUIRES_LINUX([fstrim]) |
1798 | UL_REQUIRES_BUILD([fstrim], [libmount]) | |
1799 | AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes]) | |
1800 | ||
1801 | ||
5ec1108c | 1802 | AC_ARG_ENABLE([swapon], |
1803 | AS_HELP_STRING([--disable-swapon], [do not build swapon(8) and swapoff(8)]), | |
1804 | [], [UL_DEFAULT_ENABLE([swapon], [check])] | |
1805 | ) | |
1806 | UL_BUILD_INIT([swapon]) | |
143635c9 | 1807 | UL_REQUIRES_LINUX([swapon]) |
cf9b16f1 KZ |
1808 | UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapon])], [swapon]) |
1809 | UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapoff])], [swapoff]) | |
143635c9 | 1810 | UL_REQUIRES_BUILD([swapon], [libblkid]) |
7770e7df | 1811 | UL_REQUIRES_BUILD([swapon], [libmount]) |
7477f356 | 1812 | UL_REQUIRES_BUILD([swapon], [libsmartcols]) |
034d378b | 1813 | AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes]) |
cf9b16f1 KZ |
1814 | AC_CHECK_FUNCS([swapon]) |
1815 | AC_CHECK_FUNCS([swapoff]) | |
143635c9 KZ |
1816 | |
1817 | ||
61a074f7 | 1818 | UL_BUILD_INIT([lsblk], [check]) |
a13cdb7a KZ |
1819 | UL_REQUIRES_LINUX([lsblk]) |
1820 | UL_REQUIRES_BUILD([lsblk], [libblkid]) | |
9554f7ab | 1821 | UL_REQUIRES_BUILD([lsblk], [libmount]) |
7477f356 | 1822 | UL_REQUIRES_BUILD([lsblk], [libsmartcols]) |
034d378b | 1823 | AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes]) |
9cb68977 | 1824 | |
a3d3b770 | 1825 | |
5ec1108c | 1826 | AC_ARG_ENABLE([lscpu], |
1827 | AS_HELP_STRING([--disable-lscpu], [do not build lscpu]), | |
1828 | [], [UL_DEFAULT_ENABLE([lscpu], [check])] | |
1829 | ) | |
1830 | UL_BUILD_INIT([lscpu]) | |
da396d88 | 1831 | UL_REQUIRES_LINUX([lscpu]) |
7477f356 | 1832 | UL_REQUIRES_BUILD([lscpu], [libsmartcols]) |
da396d88 | 1833 | UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type]) |
034d378b | 1834 | AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes]) |
da396d88 | 1835 | |
f2c3f2c7 AP |
1836 | AC_ARG_ENABLE([lsfd], |
1837 | AS_HELP_STRING([--disable-lsfd], [do not build lsfd]), | |
1838 | [], [UL_DEFAULT_ENABLE([lsfd], [check])] | |
1839 | ) | |
1840 | UL_BUILD_INIT([lsfd]) | |
128beb71 MY |
1841 | UL_REQUIRES_LINUX([lsfd]) |
1842 | UL_REQUIRES_BUILD([lsfd], [libsmartcols]) | |
f4d700d7 | 1843 | UL_REQUIRES_HAVE([lsfd], [linux_kcmp_h], [linux/kcmp.h header file]) |
128beb71 | 1844 | AM_CONDITIONAL([BUILD_LSFD], [test "x$build_lsfd" = xyes]) |
a3d3b770 | 1845 | |
50e6f15b RM |
1846 | AC_ARG_ENABLE([lslogins], |
1847 | AS_HELP_STRING([--disable-lslogins], [do not build lslogins]), | |
1848 | [], [UL_DEFAULT_ENABLE([lslogins], [check])] | |
1849 | ) | |
1850 | UL_BUILD_INIT([lslogins]) | |
ab1cfad5 | 1851 | UL_REQUIRES_BUILD([lslogins], [libsmartcols]) |
d00c10ed | 1852 | UL_REQUIRES_HAVE([lslogins], [shadow_h], [shadow.h header]) |
b4b919fe | 1853 | UL_REQUIRES_HAVE([lslogins], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 1854 | UL_REQUIRES_HAVE([lslogins], [gnu_utmpx], [GNU utmpx functions]) |
ab1cfad5 OO |
1855 | AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes]) |
1856 | ||
1857 | ||
61a074f7 | 1858 | UL_BUILD_INIT([chcpu], [check]) |
da396d88 KZ |
1859 | UL_REQUIRES_LINUX([chcpu]) |
1860 | UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type]) | |
034d378b | 1861 | AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes]) |
da396d88 | 1862 | |
a13cdb7a | 1863 | |
7fcccbdf KZ |
1864 | AC_ARG_ENABLE([wdctl], |
1865 | AS_HELP_STRING([--disable-wdctl], [do not build wdctl]), | |
08b1c219 | 1866 | [], [UL_DEFAULT_ENABLE([wdctl], [check])] |
7fcccbdf KZ |
1867 | ) |
1868 | UL_BUILD_INIT([wdctl]) | |
5b0289b9 | 1869 | UL_REQUIRES_LINUX([wdctl]) |
7477f356 | 1870 | UL_REQUIRES_BUILD([wdctl], [libsmartcols]) |
5b0289b9 | 1871 | UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file]) |
034d378b | 1872 | AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes]) |
5b0289b9 KZ |
1873 | |
1874 | ||
54dbc8cf KZ |
1875 | UL_BUILD_INIT([swaplabel], [check]) |
1876 | UL_REQUIRES_BUILD([swaplabel], [libblkid]) | |
034d378b | 1877 | AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes]) |
54dbc8cf KZ |
1878 | |
1879 | ||
ecc6047e KZ |
1880 | UL_BUILD_INIT([mkswap], [yes]) |
1881 | AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes]) | |
948182f4 | 1882 | AS_IF([test "x$build_mkswap" = xyes && test "x$build_libuuid" != xyes], [ |
08b1c219 KZ |
1883 | AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs]) |
1884 | ]) | |
ecc6047e | 1885 | |
328eb445 KZ |
1886 | |
1887 | AC_ARG_ENABLE([cal], | |
1888 | AS_HELP_STRING([--disable-cal], [do not build cal]), | |
1889 | [], [UL_DEFAULT_ENABLE([cal], [check])] | |
1890 | ) | |
1891 | UL_BUILD_INIT([cal]) | |
1b15cbd1 KZ |
1892 | AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes]) |
1893 | ||
50e6f15b RM |
1894 | AC_ARG_ENABLE([logger], |
1895 | AS_HELP_STRING([--disable-logger], [do not build logger]), | |
1896 | [], [UL_DEFAULT_ENABLE([logger], [check])] | |
1897 | ) | |
1898 | UL_BUILD_INIT([logger]) | |
1b15cbd1 KZ |
1899 | AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes]) |
1900 | ||
4c838e6c | 1901 | UL_BUILD_INIT([look], [yes]) |
1b15cbd1 KZ |
1902 | AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes]) |
1903 | ||
1904 | UL_BUILD_INIT([mcookie], [yes]) | |
1905 | AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes]) | |
1906 | ||
1907 | UL_BUILD_INIT([namei], [yes]) | |
1908 | AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes]) | |
1909 | ||
c9ab7387 AH |
1910 | matriplet="$($CC -print-multiarch 2>/dev/null || true)" |
1911 | if test "x$matriplet" != "x"; then | |
1912 | AC_DEFINE_UNQUOTED([MULTIARCHTRIPLET], ["$matriplet"], | |
1913 | ["Multi-arch triplet for whereis library search path"]) | |
1914 | fi | |
b7fc158a SN |
1915 | AC_ARG_ENABLE([whereis], |
1916 | AS_HELP_STRING([--disable-whereis], [do not build whereis]), | |
1917 | [], [UL_DEFAULT_ENABLE([whereis], [check])] | |
1918 | ) | |
1919 | UL_BUILD_INIT([whereis]) | |
1b15cbd1 KZ |
1920 | AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes]) |
1921 | ||
c221578e NS |
1922 | AC_ARG_ENABLE([pipesz], |
1923 | AS_HELP_STRING([--disable-pipesz], [do not build pipesz]), | |
62604365 | 1924 | [], [UL_DEFAULT_ENABLE([pipesz], [check])] |
c221578e NS |
1925 | ) |
1926 | UL_BUILD_INIT([pipesz]) | |
1927 | UL_REQUIRES_LINUX([pipesz]) | |
1928 | AM_CONDITIONAL([BUILD_PIPESZ], [test "x$build_pipesz" = xyes]) | |
1929 | ||
642e1c69 MY |
1930 | UL_BUILD_INIT([fadvise], [check]) |
1931 | UL_REQUIRES_LINUX([fadvise]) | |
1932 | AM_CONDITIONAL([BUILD_FADVISE], [test "x$build_fadvise" = xyes]) | |
1933 | ||
c0d75916 FS |
1934 | AC_ARG_ENABLE([waitpid], |
1935 | AS_HELP_STRING([--disable-waitpid], [do not build waitpid]), | |
58c16c84 | 1936 | [], [UL_DEFAULT_ENABLE([waitpid], [check])] |
c0d75916 FS |
1937 | ) |
1938 | UL_BUILD_INIT([waitpid]) | |
550d32c4 | 1939 | UL_REQUIRES_LINUX([waitpid]) |
ffdd75cc | 1940 | UL_REQUIRES_SYSCALL_CHECK([waitpid], [UL_CHECK_SYSCALL([pidfd_open])], [pidfd_open]) |
550d32c4 TW |
1941 | AM_CONDITIONAL([BUILD_WAITPID], [test "x$build_waitpid" = xyes]) |
1942 | ||
cba52cc1 TW |
1943 | UL_BUILD_INIT([enosys], [check]) |
1944 | UL_REQUIRES_LINUX([enosys]) | |
3e0bbb12 TW |
1945 | AS_IF([test "x$build_enosys" = xyes], [ |
1946 | AC_MSG_CHECKING([for valid audit arch]) | |
1947 | AC_COMPILE_IFELSE( | |
1948 | [AC_LANG_PROGRAM([[#include "${srcdir}/include/audit-arch.h"]])], | |
1949 | [AC_MSG_RESULT([yes])], | |
1950 | [AC_MSG_RESULT([no]) | |
1951 | build_enosys=no | |
1952 | ]) | |
1953 | ]) | |
cba52cc1 TW |
1954 | AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes]) |
1955 | ||
22c41e99 KZ |
1956 | UL_BUILD_INIT([lsclocks], [check]) |
1957 | UL_REQUIRES_LINUX([lsclocks]) | |
e9ddea79 TW |
1958 | AM_CONDITIONAL([BUILD_LSCLOCKS], [test "x$build_lsclocks" = xyes]) |
1959 | ||
3adaaa15 KZ |
1960 | UL_BUILD_INIT([getopt], [yes]) |
1961 | AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes]) | |
1962 | ||
ecc6047e KZ |
1963 | |
1964 | UL_BUILD_INIT([blockdev], [check]) | |
1965 | UL_REQUIRES_LINUX([blockdev]) | |
1966 | AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes]) | |
1967 | ||
1968 | ||
945ac250 KZ |
1969 | UL_BUILD_INIT([prlimit], [check]) |
1970 | UL_REQUIRES_LINUX([prlimit]) | |
7477f356 | 1971 | UL_REQUIRES_BUILD([prlimit], [libsmartcols]) |
945ac250 | 1972 | UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64]) |
034d378b | 1973 | AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes]) |
3013eb9d | 1974 | AS_IF([test "x$build_prlimit" = xyes], [ |
01e94325 KZ |
1975 | dnl check for valid prlimit() function |
1976 | AC_MSG_CHECKING([for valid prlimit() function]) | |
1977 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1978 | #include <sys/types.h> | |
1979 | #include <sys/time.h> | |
1980 | #include <sys/resource.h> | |
1981 | #include <stddef.h> | |
1982 | ]],[[ | |
1983 | int ret; | |
1984 | ret = prlimit(0, RLIMIT_AS, NULL, NULL); | |
1985 | if (ret != 0) { | |
1986 | return 1; | |
1987 | } | |
1988 | ]])],[ | |
1989 | AC_MSG_RESULT([yes]) | |
1990 | AC_DEFINE([HAVE_PRLIMIT], [1], [Have valid prlimit() function])],[ | |
1991 | AC_MSG_RESULT([no])]) | |
3013eb9d | 1992 | ]) |
945ac250 KZ |
1993 | |
1994 | ||
01e94325 | 1995 | |
3dc02ef4 DB |
1996 | UL_BUILD_INIT([lslocks], [check]) |
1997 | UL_REQUIRES_LINUX([lslocks]) | |
ec1204dc | 1998 | UL_REQUIRES_BUILD([lslocks], [libmount]) |
7477f356 | 1999 | UL_REQUIRES_BUILD([lslocks], [libsmartcols]) |
034d378b | 2000 | AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes]) |
3dc02ef4 DB |
2001 | |
2002 | ||
bd671347 KZ |
2003 | AC_ARG_ENABLE([switch_root], |
2004 | AS_HELP_STRING([--disable-switch_root], [do not build switch_root]), | |
08b1c219 | 2005 | [], [UL_DEFAULT_ENABLE([switch_root], [check])] |
bd671347 | 2006 | ) |
61a074f7 | 2007 | UL_BUILD_INIT([switch_root]) |
a3d3b770 KZ |
2008 | UL_REQUIRES_LINUX([switch_root]) |
2009 | UL_REQUIRES_HAVE([switch_root], [openat], [openat function]) | |
a68ed87f | 2010 | UL_REQUIRES_HAVE([switch_root], [dirfd,ddfd], [dirfd or ddfd function]) |
034d378b | 2011 | AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes]) |
bd671347 KZ |
2012 | |
2013 | ||
11125e7a KZ |
2014 | AC_ARG_ENABLE([pivot_root], |
2015 | AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]), | |
08b1c219 | 2016 | [], [UL_DEFAULT_ENABLE([pivot_root], [check])] |
11125e7a | 2017 | ) |
61a074f7 | 2018 | UL_BUILD_INIT([pivot_root]) |
5cbbdfbf | 2019 | UL_REQUIRES_LINUX([pivot_root]) |
9f632667 | 2020 | UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])]) |
034d378b | 2021 | AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes]) |
11125e7a KZ |
2022 | |
2023 | ||
c12fc5e1 | 2024 | UL_BUILD_INIT([flock], [check]) |
3001923b | 2025 | UL_REQUIRES_HAVE([flock], [timer], [timer_create/setitimer function]) |
205dbb7a KZ |
2026 | AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes]) |
2027 | ||
bdfe4601 | 2028 | |
cad2d1ac HC |
2029 | AC_ARG_ENABLE([lsmem], |
2030 | AS_HELP_STRING([--disable-lsmem], [do not build lsmem]), | |
bdfe4601 | 2031 | [], [UL_DEFAULT_ENABLE([lsmem], [check])] |
cad2d1ac HC |
2032 | ) |
2033 | UL_BUILD_INIT([lsmem]) | |
bdfe4601 | 2034 | UL_REQUIRES_LINUX([lsmem]) |
8b7f00a8 | 2035 | UL_REQUIRES_BUILD([lsmem], [libsmartcols]) |
cad2d1ac HC |
2036 | AM_CONDITIONAL([BUILD_LSMEM], [test "x$build_lsmem" = xyes]) |
2037 | ||
bdfe4601 | 2038 | |
30e1ea8b HC |
2039 | AC_ARG_ENABLE([chmem], |
2040 | AS_HELP_STRING([--disable-chmem], [do not build chmem]), | |
bdfe4601 | 2041 | [], [UL_DEFAULT_ENABLE([chmem], [check])] |
30e1ea8b HC |
2042 | ) |
2043 | UL_BUILD_INIT([chmem]) | |
bdfe4601 | 2044 | UL_REQUIRES_LINUX([chmem]) |
30e1ea8b HC |
2045 | AM_CONDITIONAL([BUILD_CHMEM], [test "x$build_chmem" = xyes]) |
2046 | ||
205dbb7a | 2047 | |
45020b67 KZ |
2048 | AC_ARG_ENABLE([ipcmk], |
2049 | AS_HELP_STRING([--disable-ipcmk], [do not build ipcmk]), | |
2050 | [], [UL_DEFAULT_ENABLE([ipcmk], [check])] | |
2051 | ) | |
2052 | UL_BUILD_INIT([ipcmk]) | |
2053 | UL_EXCLUDE_ARCH([ipcmk], [*darwin*]) | |
2054 | AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes]) | |
bdfe4601 | 2055 | |
42a4a152 RM |
2056 | AC_ARG_ENABLE([ipcrm], |
2057 | AS_HELP_STRING([--disable-ipcrm], [do not build ipcrm]), | |
45020b67 | 2058 | [], [UL_DEFAULT_ENABLE([ipcrm], [check])] |
42a4a152 RM |
2059 | ) |
2060 | UL_BUILD_INIT([ipcrm]) | |
45020b67 | 2061 | UL_EXCLUDE_ARCH([ipcrm], [*darwin*]) |
205dbb7a KZ |
2062 | AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes]) |
2063 | ||
42a4a152 RM |
2064 | AC_ARG_ENABLE([ipcs], |
2065 | AS_HELP_STRING([--disable-ipcs], [do not build ipcs]), | |
45020b67 | 2066 | [], [UL_DEFAULT_ENABLE([ipcs], [check])] |
42a4a152 RM |
2067 | ) |
2068 | UL_BUILD_INIT([ipcs]) | |
45020b67 | 2069 | UL_EXCLUDE_ARCH([ipcs], [*darwin*]) |
205dbb7a KZ |
2070 | AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes]) |
2071 | ||
a0f62b0b | 2072 | |
4f6610f5 SK |
2073 | AC_ARG_ENABLE([irqtop], |
2074 | AS_HELP_STRING([--disable-irqtop], [do not build irqtop]), | |
c61470c7 | 2075 | [], [UL_DEFAULT_ENABLE([irqtop], [check])] |
4f6610f5 SK |
2076 | ) |
2077 | UL_BUILD_INIT([irqtop]) | |
fa8c5cd5 | 2078 | UL_REQUIRES_LINUX([irqtop]) |
a0f62b0b KZ |
2079 | UL_REQUIRES_BUILD([irqtop], [libsmartcols]) |
2080 | UL_REQUIRES_HAVE([irqtop], [open_memstream], [open_memstream function]) | |
2081 | UL_REQUIRES_HAVE([irqtop], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) | |
4f6610f5 SK |
2082 | AM_CONDITIONAL([BUILD_IRQTOP], [test "x$build_irqtop" = xyes]) |
2083 | ||
a0f62b0b KZ |
2084 | AC_ARG_ENABLE([lsirq], |
2085 | AS_HELP_STRING([--disable-lsirq], [do not build lsirq]), | |
c61470c7 | 2086 | [], [UL_DEFAULT_ENABLE([lsirq], [check])] |
a0f62b0b KZ |
2087 | ) |
2088 | UL_BUILD_INIT([lsirq]) | |
2089 | UL_REQUIRES_LINUX([lsirq]) | |
2090 | UL_REQUIRES_BUILD([lsirq], [libsmartcols]) | |
2091 | AM_CONDITIONAL([BUILD_LSIRQ], [test "x$build_lsirq" = xyes]) | |
2092 | ||
2093 | ||
8fa223da KZ |
2094 | UL_BUILD_INIT([choom], [check]) |
2095 | UL_REQUIRES_LINUX([choom]) | |
2096 | AM_CONDITIONAL([BUILD_CHOOM], [test "x$build_choom" = xyes]) | |
2097 | ||
9d20ffda KZ |
2098 | UL_BUILD_INIT([lsipc], [check]) |
2099 | UL_REQUIRES_LINUX([lsipc]) | |
2100 | UL_REQUIRES_BUILD([lsipc], [libsmartcols]) | |
2101 | AM_CONDITIONAL([BUILD_LSIPC], [test "x$build_lsipc" = xyes]) | |
2102 | ||
dcf8f3b4 FF |
2103 | AC_ARG_ENABLE([lsns], |
2104 | AS_HELP_STRING([--disable-lsns], [do not build lsns]), | |
2105 | [], [UL_DEFAULT_ENABLE([lsns], [check])] | |
2106 | ) | |
2107 | UL_BUILD_INIT([lsns]) | |
8a204562 KZ |
2108 | UL_REQUIRES_LINUX([lsns]) |
2109 | UL_REQUIRES_BUILD([lsns], [libsmartcols]) | |
4b328279 | 2110 | UL_REQUIRES_BUILD([lsns], [libmount]) |
8a204562 KZ |
2111 | AM_CONDITIONAL([BUILD_LSNS], [test "x$build_lsns" = xyes]) |
2112 | ||
205dbb7a KZ |
2113 | UL_BUILD_INIT([renice], [yes]) |
2114 | AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes]) | |
2115 | ||
3d47ab05 KZ |
2116 | |
2117 | AC_ARG_ENABLE([rfkill], | |
2118 | AS_HELP_STRING([--disable-rfkill], [do not build rfkill]), | |
271552c7 | 2119 | [], [UL_DEFAULT_ENABLE([rfkill], [check])] |
3d47ab05 KZ |
2120 | ) |
2121 | UL_BUILD_INIT([rfkill]) | |
367f4080 | 2122 | UL_REQUIRES_LINUX([rfkill]) |
b3849c66 | 2123 | UL_REQUIRES_BUILD([rfkill], [libsmartcols]) |
c0d78c90 SK |
2124 | AM_CONDITIONAL([BUILD_RFKILL], [test "x$build_rfkill" = xyes]) |
2125 | ||
3d47ab05 | 2126 | |
f092076f DDM |
2127 | UL_BUILD_INIT([setpgid], [yes]) |
2128 | AM_CONDITIONAL([BUILD_SETPGID], [test "x$build_setpgid" = xyes]) | |
2129 | ||
205dbb7a KZ |
2130 | UL_BUILD_INIT([setsid], [yes]) |
2131 | AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes]) | |
2132 | ||
2133 | UL_BUILD_INIT([readprofile], [check]) | |
2134 | UL_REQUIRES_LINUX([readprofile]) | |
2135 | AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes]) | |
2136 | ||
2137 | UL_BUILD_INIT([dmesg], [check]) | |
2138 | UL_REQUIRES_LINUX([dmesg]) | |
2139 | AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes]) | |
2140 | ||
2141 | UL_BUILD_INIT([ctrlaltdel], [check]) | |
2142 | UL_REQUIRES_LINUX([ctrlaltdel]) | |
e52b58e6 CTV |
2143 | dnl we assume reboot() to be the 1-argument variant, because even considering |
2144 | dnl widely used alternative C libraries like uclibc, dietlibc and musl, | |
2145 | dnl reboot() with multiple arguments is yet only found in glibc versions | |
2146 | dnl earlier than 2.x. | |
9dd55a04 | 2147 | UL_REQUIRES_HAVE([ctrlaltdel], [reboot], [reboot function]) |
205dbb7a KZ |
2148 | AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes]) |
2149 | ||
b6252de2 KZ |
2150 | AC_ARG_ENABLE([exch], |
2151 | AS_HELP_STRING([--disable-exch], [do not build exch]), | |
2152 | [], [UL_DEFAULT_ENABLE([exch], [check])] | |
2153 | ) | |
cd094a05 MY |
2154 | UL_BUILD_INIT([exch]) |
2155 | UL_REQUIRES_LINUX([exch]) | |
b6252de2 | 2156 | UL_REQUIRES_SYSCALL_CHECK([exch], [UL_CHECK_SYSCALL([renameat2])]) |
cd094a05 MY |
2157 | AM_CONDITIONAL([BUILD_EXCH], [test "x$build_exch" = xyes]) |
2158 | ||
a921a7de MY |
2159 | UL_BUILD_INIT([fincore], [check]) |
2160 | UL_REQUIRES_LINUX([fincore]) | |
3e37d7b7 | 2161 | UL_REQUIRES_BUILD([fincore], [libsmartcols]) |
a921a7de MY |
2162 | AM_CONDITIONAL([BUILD_FINCORE], [test "x$build_fincore" = xyes]) |
2163 | ||
205dbb7a KZ |
2164 | UL_BUILD_INIT([fsfreeze], [check]) |
2165 | UL_REQUIRES_LINUX([fsfreeze]) | |
2166 | AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes]) | |
2167 | ||
2168 | UL_BUILD_INIT([blkdiscard], [check]) | |
2169 | UL_REQUIRES_LINUX([blkdiscard]) | |
2170 | AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes]) | |
2171 | ||
1ad8ef91 KZ |
2172 | UL_BUILD_INIT([blkzone], [check]) |
2173 | UL_REQUIRES_LINUX([blkzone]) | |
2174 | UL_REQUIRES_HAVE([blkzone], [linux_blkzoned_h], [linux/blkzoned.h header]) | |
2175 | AM_CONDITIONAL([BUILD_BLKZONE], [test "x$build_blkzone" = xyes]) | |
2176 | ||
627428a9 | 2177 | UL_BUILD_INIT([blkpr], [check]) |
2178 | UL_REQUIRES_LINUX([blkpr]) | |
2179 | UL_REQUIRES_HAVE([blkpr], [linux_pr_h], [linux/pr.h header]) | |
2180 | AM_CONDITIONAL([BUILD_BLKPR], [test "x$build_blkpr" = xyes]) | |
2181 | ||
205dbb7a KZ |
2182 | UL_BUILD_INIT([ldattach], [check]) |
2183 | UL_REQUIRES_LINUX([ldattach]) | |
2184 | AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes]) | |
2185 | ||
2186 | UL_BUILD_INIT([rtcwake], [check]) | |
2187 | UL_REQUIRES_LINUX([rtcwake]) | |
2188 | AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes]) | |
2189 | ||
2190 | UL_BUILD_INIT([setarch], [check]) | |
2191 | UL_REQUIRES_LINUX([setarch]) | |
2192 | AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes]) | |
2193 | ||
d4b58873 KZ |
2194 | |
2195 | # build_scriptutils= is just configure-only variable to control | |
2196 | # script, scriptreplay and scriptlive | |
2197 | AC_ARG_ENABLE([scriptutils], | |
2198 | AS_HELP_STRING([--disable-scriptutils], [do not build script, scriptreplay and scriptlive]), | |
2199 | [], [UL_DEFAULT_ENABLE([scriptutils], [check])] | |
2200 | ) | |
2201 | ||
2202 | UL_ENABLE_ALIAS([script], [scriptutils]) | |
2203 | UL_BUILD_INIT([script]) | |
870235d0 | 2204 | UL_REQUIRES_HAVE([script], [pty], [openpty function (libutil)]) |
3f91b990 KZ |
2205 | AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes]) |
2206 | ||
d4b58873 KZ |
2207 | UL_ENABLE_ALIAS([scriptreplay], [scriptutils]) |
2208 | UL_BUILD_INIT([scriptreplay]) | |
3f91b990 KZ |
2209 | AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes]) |
2210 | ||
d4b58873 KZ |
2211 | UL_ENABLE_ALIAS([scriptlive], [scriptutils]) |
2212 | UL_BUILD_INIT([scriptlive]) | |
870235d0 | 2213 | UL_REQUIRES_HAVE([scriptlive], [pty], [openpty function (libutil)]) |
33869e5a KZ |
2214 | AM_CONDITIONAL([BUILD_SCRIPTLIVE], [test "x$build_scriptlive" = xyes]) |
2215 | ||
d4b58873 | 2216 | |
8886d84e TW |
2217 | UL_BUILD_INIT([col], [check]) |
2218 | UL_REQUIRES_COMPILE([col], [#include <limits.h>], [__GLIBC__], [building for glibc]) | |
cb45354e KZ |
2219 | AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes]) |
2220 | ||
2221 | UL_BUILD_INIT([colcrt], [yes]) | |
2222 | AM_CONDITIONAL([BUILD_COLCRT], [test "x$build_colcrt" = xyes]) | |
2223 | ||
2224 | UL_BUILD_INIT([colrm], [yes]) | |
2225 | AM_CONDITIONAL([BUILD_COLRM], [test "x$build_colrm" = xyes]) | |
2226 | ||
38d69192 KZ |
2227 | UL_BUILD_INIT([column], [check]) |
2228 | UL_REQUIRES_BUILD([column], [libsmartcols]) | |
cb45354e KZ |
2229 | AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes]) |
2230 | ||
2231 | UL_BUILD_INIT([hexdump], [yes]) | |
2232 | AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes]) | |
2233 | ||
2234 | UL_BUILD_INIT([rev], [yes]) | |
2235 | AM_CONDITIONAL([BUILD_REV], [test "x$build_rev" = xyes]) | |
2236 | ||
3f91b990 | 2237 | |
1342ffcb SK |
2238 | AC_ARG_ENABLE([tunelp], |
2239 | AS_HELP_STRING([--enable-tunelp], [build tunelp]), | |
08b1c219 | 2240 | [], [UL_DEFAULT_ENABLE([tunelp], [no])] |
1342ffcb SK |
2241 | ) |
2242 | UL_BUILD_INIT([tunelp]) | |
2243 | UL_REQUIRES_LINUX([tunelp]) | |
034d378b | 2244 | AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes]) |
1342ffcb SK |
2245 | |
2246 | ||
48d7b13a | 2247 | AC_ARG_ENABLE([kill], |
4be753aa | 2248 | AS_HELP_STRING([--disable-kill], [do not build kill]), |
08b1c219 | 2249 | [], [UL_DEFAULT_ENABLE([kill], [check])] |
48d7b13a | 2250 | ) |
61a074f7 | 2251 | UL_BUILD_INIT([kill]) |
4be753aa | 2252 | UL_REQUIRES_LINUX([kill]) |
034d378b | 2253 | AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes]) |
48d7b13a | 2254 | |
ce602720 | 2255 | |
48d7b13a | 2256 | AC_ARG_ENABLE([last], |
ce602720 | 2257 | AS_HELP_STRING([--disable-last], [do not build last]), |
08b1c219 | 2258 | [], [UL_DEFAULT_ENABLE([last], [check])] |
48d7b13a | 2259 | ) |
61a074f7 | 2260 | UL_BUILD_INIT([last]) |
b4b919fe | 2261 | UL_REQUIRES_HAVE([last], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2262 | UL_REQUIRES_HAVE([last], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2263 | AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes]) |
2dc68529 | 2264 | |
48d7b13a | 2265 | |
78d5ceac | 2266 | AC_ARG_ENABLE([utmpdump], |
c9b53461 | 2267 | AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]), |
d00c10ed | 2268 | [], [UL_DEFAULT_ENABLE([utmpdump], [check])] |
78d5ceac KZ |
2269 | ) |
2270 | UL_BUILD_INIT([utmpdump]) | |
b4b919fe | 2271 | UL_REQUIRES_HAVE([utmpdump], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2272 | UL_REQUIRES_HAVE([utmpdump], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2273 | AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes]) |
78d5ceac KZ |
2274 | |
2275 | ||
c135a8bd SK |
2276 | AC_ARG_ENABLE([line], |
2277 | AS_HELP_STRING([--enable-line], [build line]), | |
08b1c219 | 2278 | [], [UL_DEFAULT_ENABLE([line], [no])] |
c135a8bd | 2279 | ) |
61a074f7 | 2280 | UL_BUILD_INIT([line]) |
034d378b | 2281 | AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes]) |
2dc68529 | 2282 | |
48d7b13a KZ |
2283 | |
2284 | AC_ARG_ENABLE([mesg], | |
5c0b406d | 2285 | AS_HELP_STRING([--disable-mesg], [do not build mesg]), |
08b1c219 | 2286 | [], [UL_DEFAULT_ENABLE([mesg], [yes])] |
48d7b13a | 2287 | ) |
61a074f7 | 2288 | UL_BUILD_INIT([mesg]) |
034d378b | 2289 | AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes]) |
48d7b13a KZ |
2290 | |
2291 | ||
48d7b13a | 2292 | AC_ARG_ENABLE([raw], |
5c0b406d | 2293 | AS_HELP_STRING([--disable-raw], [do not build raw]), |
08b1c219 | 2294 | [], [UL_DEFAULT_ENABLE([raw], [check])] |
48d7b13a | 2295 | ) |
61a074f7 | 2296 | UL_BUILD_INIT([raw]) |
16ba8d58 KZ |
2297 | UL_REQUIRES_LINUX([raw]) |
2298 | UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file]) | |
034d378b | 2299 | AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes]) |
48d7b13a KZ |
2300 | |
2301 | ||
48d7b13a | 2302 | AC_ARG_ENABLE([rename], |
7fa4f112 | 2303 | AS_HELP_STRING([--disable-rename], [do not build rename]), |
08b1c219 | 2304 | [], [UL_DEFAULT_ENABLE([rename], [yes])] |
48d7b13a | 2305 | ) |
61a074f7 | 2306 | UL_BUILD_INIT([rename]) |
034d378b | 2307 | AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes]) |
48d7b13a KZ |
2308 | |
2309 | ||
cc76731e KZ |
2310 | AC_ARG_ENABLE([vipw], |
2311 | AS_HELP_STRING([--enable-vipw], [build vipw]), | |
08b1c219 | 2312 | [], [UL_DEFAULT_ENABLE([vipw], [no])] |
48d7b13a | 2313 | ) |
cc76731e | 2314 | UL_BUILD_INIT([vipw]) |
d00c10ed | 2315 | UL_REQUIRES_HAVE([vipw], [shadow_h], [shadow.h header]) |
034d378b | 2316 | AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes]) |
9cb68977 | 2317 | |
c94b3604 | 2318 | |
aec9ecbd KZ |
2319 | AC_ARG_ENABLE([newgrp], |
2320 | AS_HELP_STRING([--enable-newgrp], [build newgrp]), | |
08b1c219 | 2321 | [], [UL_DEFAULT_ENABLE([newgrp], [no])] |
aec9ecbd KZ |
2322 | ) |
2323 | UL_BUILD_INIT([newgrp]) | |
8229ed2f | 2324 | UL_REQUIRES_HAVE([newgrp], [crypt], [crypt function]) |
034d378b | 2325 | AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes]) |
aec9ecbd KZ |
2326 | |
2327 | ||
d86918b6 | 2328 | AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]), |
034d378b | 2329 | [], [with_user=check] |
7e4714f2 | 2330 | ) |
6e93c52f | 2331 | have_user=no |
3013eb9d | 2332 | AS_IF([test "x$with_user" != xno], [ |
2771954b | 2333 | PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no]) |
9f57e6e8 SK |
2334 | AS_CASE([$with_user:$have_user], |
2335 | [yes:no], | |
2336 | [AC_MSG_ERROR([user selected but libuser not found])], | |
2337 | [*:yes], | |
2338 | [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])] | |
2339 | ) | |
1f6ec24c KZ |
2340 | # temporary solution, libuser has stupid .pc where are exported all |
2341 | # private dependencies to Requires: instead of Requires.private: | |
3013eb9d | 2342 | AS_IF([test "x$have_user" = xyes], [ |
1f6ec24c | 2343 | LIBUSER_LIBS=-luser |
3013eb9d SK |
2344 | ]) |
2345 | ]) | |
034d378b | 2346 | AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes]) |
7e4714f2 | 2347 | |
d86918b6 KZ |
2348 | AC_ARG_ENABLE([chfn-chsh-password], |
2349 | AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]), | |
034d378b | 2350 | [], [enable_chfn_chsh_password=yes] |
d86918b6 KZ |
2351 | ) |
2352 | ||
2353 | AC_ARG_ENABLE([chfn-chsh], | |
f205a073 | 2354 | AS_HELP_STRING([--disable-chfn-chsh], [do not build chfn and chsh]), |
9a4e9c9d | 2355 | [], [UL_DEFAULT_ENABLE([chfn_chsh], [check])] |
d86918b6 KZ |
2356 | ) |
2357 | UL_BUILD_INIT([chfn_chsh]) | |
d00c10ed | 2358 | UL_REQUIRES_HAVE([chfn_chsh], [shadow_h], [shadow.h header]) |
49a3d609 | 2359 | UL_REQUIRES_HAVE([chfn_chsh], [getusershell], [getusershell function]) |
d86918b6 | 2360 | |
948182f4 | 2361 | AS_IF([test "x$enable_chfn_chsh_password" = xyes || test "x$have_user" = xyes], [ |
fe2c9909 | 2362 | UL_REQUIRES_HAVE([chfn_chsh], [security_pam_appl_h], [PAM header file]) |
034d378b | 2363 | AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?]) |
3013eb9d | 2364 | ]) |
034d378b SK |
2365 | AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes]) |
2366 | AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes]) | |
d86918b6 KZ |
2367 | |
2368 | AC_ARG_ENABLE([chsh-only-listed], | |
5c0b406d BS |
2369 | AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]), |
2370 | [], enable_chsh_only_listed=yes | |
d86918b6 | 2371 | ) |
7e4714f2 | 2372 | |
3013eb9d SK |
2373 | AS_IF([test "x$enable_chsh_only_listed" = xyes], [ |
2374 | AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?]) | |
2375 | ]) | |
71681ee5 | 2376 | |
2c8a3e16 | 2377 | |
e7614a07 KZ |
2378 | AC_ARG_ENABLE([login], |
2379 | AS_HELP_STRING([--disable-login], [do not build login]), | |
08b1c219 | 2380 | [], [UL_DEFAULT_ENABLE([login], [check])] |
e7614a07 KZ |
2381 | ) |
2382 | UL_BUILD_INIT([login]) | |
fe2c9909 WJ |
2383 | UL_REQUIRES_HAVE([login], [security_pam_appl_h], [PAM header file]) |
2384 | UL_REQUIRES_HAVE([login], [security_pam_misc_h, security_openpam_h], [PAM conversation functions]) | |
b4b919fe | 2385 | UL_REQUIRES_HAVE([login], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2386 | UL_REQUIRES_HAVE([login], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2387 | AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes]) |
e7614a07 | 2388 | |
71681ee5 KZ |
2389 | AC_ARG_ENABLE([login-chown-vcs], |
2390 | AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]), | |
034d378b | 2391 | [], [enable_login_chown_vcs=no] |
71681ee5 KZ |
2392 | ) |
2393 | ||
3013eb9d | 2394 | AS_IF([test "x$enable_login_chown_vcs" = xyes], [ |
034d378b | 2395 | AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?]) |
3013eb9d | 2396 | ]) |
71681ee5 KZ |
2397 | |
2398 | AC_ARG_ENABLE([login-stat-mail], | |
2399 | AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]), | |
034d378b | 2400 | [], [enable_login_stat_mail=no] |
71681ee5 KZ |
2401 | ) |
2402 | ||
3013eb9d | 2403 | AS_IF([test "x$enable_login_stat_mail" = xyes], [ |
034d378b | 2404 | AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?]) |
3013eb9d | 2405 | ]) |
71681ee5 | 2406 | |
e7614a07 | 2407 | |
88407b93 KZ |
2408 | AC_ARG_ENABLE([nologin], |
2409 | AS_HELP_STRING([--disable-nologin], [do not build nologin]), | |
08b1c219 | 2410 | [], [UL_DEFAULT_ENABLE([nologin], [yes])] |
88407b93 KZ |
2411 | ) |
2412 | UL_BUILD_INIT([nologin]) | |
2413 | AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes]) | |
2414 | ||
2415 | ||
e7614a07 KZ |
2416 | AC_ARG_ENABLE([sulogin], |
2417 | AS_HELP_STRING([--disable-sulogin], [do not build sulogin]), | |
d00c10ed | 2418 | [], [UL_DEFAULT_ENABLE([sulogin], [check])] |
e7614a07 KZ |
2419 | ) |
2420 | UL_BUILD_INIT([sulogin]) | |
8229ed2f | 2421 | UL_REQUIRES_HAVE([sulogin], [crypt], [crypt function]) |
d00c10ed | 2422 | UL_REQUIRES_HAVE([sulogin], [shadow_h], [shadow.h header]) |
034d378b | 2423 | AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes]) |
e7614a07 | 2424 | |
f17f5f48 | 2425 | |
ff4c5555 KZ |
2426 | AC_ARG_ENABLE([su], |
2427 | AS_HELP_STRING([--disable-su], [do not build su]), | |
08b1c219 | 2428 | [], [UL_DEFAULT_ENABLE([su], [check])] |
ff4c5555 KZ |
2429 | ) |
2430 | UL_BUILD_INIT([su]) | |
fe2c9909 | 2431 | UL_REQUIRES_HAVE([su], [security_pam_appl_h], [PAM header file]) |
b4b919fe | 2432 | UL_REQUIRES_HAVE([su], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2433 | UL_REQUIRES_HAVE([su], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2434 | AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes]) |
ff4c5555 KZ |
2435 | |
2436 | ||
7ec6adb1 KZ |
2437 | AC_ARG_ENABLE([runuser], |
2438 | AS_HELP_STRING([--disable-runuser], [do not build runuser]), | |
08b1c219 | 2439 | [], [UL_DEFAULT_ENABLE([runuser], [check])] |
7ec6adb1 KZ |
2440 | ) |
2441 | UL_BUILD_INIT([runuser]) | |
fe2c9909 | 2442 | UL_REQUIRES_HAVE([runuser], [security_pam_appl_h], [PAM header file]) |
b4b919fe | 2443 | UL_REQUIRES_HAVE([runuser], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2444 | UL_REQUIRES_HAVE([runuser], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2445 | AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes]) |
7ec6adb1 KZ |
2446 | |
2447 | ||
53b22add KZ |
2448 | AC_ARG_ENABLE([ul], |
2449 | AS_HELP_STRING([--disable-ul], [do not build ul]), | |
08b1c219 | 2450 | [], [UL_DEFAULT_ENABLE([ul], [check])] |
53b22add KZ |
2451 | ) |
2452 | UL_BUILD_INIT([ul]) | |
3cc8a9f4 | 2453 | UL_REQUIRES_HAVE([ul], [ncursesw, ncurses], [ncursesw or ncurses libraries]) |
034d378b | 2454 | AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes]) |
53b22add KZ |
2455 | |
2456 | ||
2457 | AC_ARG_ENABLE([more], | |
2458 | AS_HELP_STRING([--disable-more], [do not build more]), | |
08b1c219 | 2459 | [], [UL_DEFAULT_ENABLE([more], [check])] |
53b22add KZ |
2460 | ) |
2461 | UL_BUILD_INIT([more]) | |
3cc8a9f4 | 2462 | UL_REQUIRES_HAVE([more], [ncursesw, ncurses], [ncursesw or ncurses libraries]) |
823ef319 | 2463 | UL_REQUIRES_LINUX([more]) |
034d378b | 2464 | AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes]) |
53b22add KZ |
2465 | |
2466 | ||
2467 | AC_ARG_ENABLE([pg], | |
00971cca SK |
2468 | AS_HELP_STRING([--enable-pg], [build pg]), |
2469 | [], [UL_DEFAULT_ENABLE([pg], [no])] | |
53b22add KZ |
2470 | ) |
2471 | UL_BUILD_INIT([pg]) | |
4b439e2d | 2472 | UL_REQUIRES_HAVE([pg], [ncursesw, ncurses], [ncursesw or ncurses library]) |
034d378b | 2473 | AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes]) |
53b22add KZ |
2474 | |
2475 | ||
d78d0409 KZ |
2476 | AC_ARG_ENABLE([setterm], |
2477 | AS_HELP_STRING([--disable-setterm], [do not build setterm]), | |
08b1c219 | 2478 | [], [UL_DEFAULT_ENABLE([setterm], [check])] |
d78d0409 KZ |
2479 | ) |
2480 | UL_BUILD_INIT([setterm]) | |
2481 | UL_REQUIRES_LINUX([setterm]) | |
4b439e2d | 2482 | UL_REQUIRES_HAVE([setterm], [ncursesw, ncurses], [ncursesw or ncurses library]) |
034d378b | 2483 | AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes]) |
d78d0409 | 2484 | |
d6ace0b8 KZ |
2485 | # build_schedutils= is just configure-only variable to control |
2486 | # ionice, taskset and chrt | |
48d7b13a | 2487 | AC_ARG_ENABLE([schedutils], |
34228e69 | 2488 | AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]), |
fc72f51e | 2489 | [], [UL_DEFAULT_ENABLE([schedutils], [check])] |
48d7b13a | 2490 | ) |
17d5e11b | 2491 | |
6f2eb034 KZ |
2492 | |
2493 | UL_ENABLE_ALIAS([ionice], [schedutils]) | |
2494 | UL_BUILD_INIT([ionice]) | |
17d5e11b KZ |
2495 | UL_REQUIRES_SYSCALL_CHECK([ionice], |
2496 | [UL_CHECK_SYSCALL([ioprio_set], | |
f06b4328 SK |
2497 | [alpha], [442], |
2498 | [i*86], [289], | |
2499 | [ia64*], [1274], | |
2500 | [powerpc*], [273], | |
2501 | [s390*], [282], | |
2502 | [sparc*], [196], | |
2503 | [sh*], [288], | |
2504 | [x86_64*], [251])], | |
17d5e11b KZ |
2505 | [ioprio_set]) |
2506 | ||
2507 | UL_REQUIRES_SYSCALL_CHECK([ionice], | |
2508 | [UL_CHECK_SYSCALL([ioprio_get], | |
f06b4328 SK |
2509 | [alpha], [443], |
2510 | [i*86], [290], | |
2511 | [ia64*], [1275], | |
2512 | [powerpc*], [274], | |
2513 | [s390*], [283], | |
2514 | [sparc*], [218], | |
2515 | [sh*], [289], | |
2516 | [x86_64*], [252])], | |
17d5e11b KZ |
2517 | [ioprio_get]) |
2518 | ||
034d378b | 2519 | AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes]) |
17d5e11b | 2520 | |
6f2eb034 KZ |
2521 | |
2522 | UL_ENABLE_ALIAS([taskset], [schedutils]) | |
2523 | UL_BUILD_INIT([taskset]) | |
e21e6d26 | 2524 | UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type]) |
17d5e11b KZ |
2525 | UL_REQUIRES_SYSCALL_CHECK([taskset], |
2526 | [UL_CHECK_SYSCALL([sched_getaffinity])], | |
2527 | [sched_getaffinity]) | |
034d378b | 2528 | AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes]) |
48d7b13a | 2529 | |
ee20c303 RM |
2530 | |
2531 | have_schedsetter=no | |
2532 | AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes], | |
2533 | [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes]) | |
2534 | ||
6f2eb034 KZ |
2535 | UL_ENABLE_ALIAS([chrt], [schedutils]) |
2536 | UL_BUILD_INIT([chrt]) | |
ee20c303 | 2537 | UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions]) |
d6ace0b8 KZ |
2538 | AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes]) |
2539 | ||
15167589 KZ |
2540 | AS_IF([test "x$build_chrt" = xyes], [ |
2541 | UL_CHECK_SYSCALL([sched_setattr]) | |
2542 | ]) | |
2543 | ||
f59654bb QY |
2544 | UL_ENABLE_ALIAS([uclampset], [schedutils]) |
2545 | UL_BUILD_INIT([uclampset]) | |
82643a9b KZ |
2546 | UL_REQUIRES_SYSCALL_CHECK([uclampset], |
2547 | [UL_CHECK_SYSCALL([sched_setattr])], [sched_setattr]) | |
f59654bb QY |
2548 | AM_CONDITIONAL([BUILD_UCLAMPSET], [test "x$build_uclampset" = xyes]) |
2549 | ||
48d7b13a KZ |
2550 | |
2551 | AC_ARG_ENABLE([wall], | |
7fa4f112 | 2552 | AS_HELP_STRING([--disable-wall], [do not build wall]), |
d00c10ed | 2553 | [], [UL_DEFAULT_ENABLE([wall], [check])] |
48d7b13a | 2554 | ) |
8fc8888b | 2555 | UL_BUILD_INIT([wall]) |
b4b919fe | 2556 | UL_REQUIRES_HAVE([wall], [utmpx_h], [utmpx.h header]) |
034d378b | 2557 | AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes]) |
48d7b13a KZ |
2558 | |
2559 | ||
2560 | AC_ARG_ENABLE([write], | |
7fa4f112 | 2561 | AS_HELP_STRING([--enable-write], [build write]), |
08b1c219 | 2562 | [], [UL_DEFAULT_ENABLE([write], [no])] |
48d7b13a | 2563 | ) |
61a074f7 | 2564 | UL_BUILD_INIT([write]) |
b4b919fe | 2565 | UL_REQUIRES_HAVE([write], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2566 | UL_REQUIRES_HAVE([write], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2567 | AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes]) |
48d7b13a KZ |
2568 | |
2569 | ||
5a971329 | 2570 | AC_ARG_WITH([btrfs], |
95a89bd3 | 2571 | AS_HELP_STRING([--without-btrfs], [do not build with btrfs support]), |
5a971329 KZ |
2572 | [], [with_btrfs=check] |
2573 | ) | |
2574 | have_btrfs=no | |
2575 | AS_IF([test "x$with_btrfs" != xno], [ | |
2576 | AS_CASE([$with_btrfs:$have_linux_btrfs_h], | |
2577 | [yes:no], | |
2578 | [AC_MSG_ERROR([btrfs selected but linux/btrfs.h not found])], | |
2579 | [check:no], | |
2580 | [AC_MSG_WARN([linux/btrfs.h not found, do not build with btrfs support])], | |
2581 | [*:yes], | |
2582 | [have_btrfs=yes | |
2583 | AC_DEFINE([HAVE_BTRFS_SUPPORT], [1], [Define if btrfs stuff is available])] | |
2584 | ) | |
2585 | ]) | |
2586 | AM_CONDITIONAL([HAVE_BTRFS], [test "x$have_btrfs" = xyes]) | |
2587 | ||
2588 | ||
ebff016a | 2589 | AC_ARG_WITH([systemd], |
95a89bd3 | 2590 | AS_HELP_STRING([--without-systemd], [do not build with systemd support]), |
ebff016a KZ |
2591 | [], [with_systemd=check] |
2592 | ) | |
2593 | ||
2594 | have_systemd=no | |
2595 | AS_IF([test "x$with_systemd" != xno], [ | |
2596 | # new version -- all libsystemd-* libs merged into libsystemd | |
2597 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no]) | |
2598 | # old versions | |
2599 | AS_IF([test "x$have_systemd" != "xyes"], [ | |
2600 | PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], | |
2601 | [have_systemd_daemon=yes], [have_systemd_daemon=no]) | |
2602 | PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal], | |
2603 | [have_systemd_journal=yes], [have_systemd_journal=no]) | |
948182f4 | 2604 | AS_IF([test "x$have_systemd_daemon" = "xyes" && test "x$have_systemd_journal" = "xyes" ],[ |
ebff016a | 2605 | have_systemd=yes]) |
ea45d34c | 2606 | ]) |
ebff016a KZ |
2607 | AS_CASE([$with_systemd:$have_systemd], |
2608 | [yes:no], | |
2609 | [AC_MSG_ERROR([systemd expected but libsystemd not found])], | |
2610 | [*:yes], | |
2611 | AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available]) | |
b66b5b97 | 2612 | AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ]) |
87fcd95a | 2613 | AC_CHECK_DECLS([sd_session_get_username], [], [], [#include <systemd/sd-login.h>]) |
ebff016a | 2614 | ) |
3013eb9d | 2615 | ]) |
ebff016a KZ |
2616 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes]) |
2617 | ||
bbe289c4 | 2618 | |
1b68c379 | 2619 | AC_ARG_WITH([systemdsystemunitdir], |
95a89bd3 | 2620 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd unit files (requires systemd support)]), |
f6d3f34a | 2621 | [], [ |
7a95313c | 2622 | AS_IF([test "x$have_systemd" = xyes], [ |
f6d3f34a KZ |
2623 | PKG_CHECK_VAR([with_systemdsystemunitdir], [systemd], [systemdsystemunitdir], |
2624 | [], | |
2625 | [with_systemdsystemunitdir=no]) | |
7a95313c KZ |
2626 | ]) |
2627 | ]) | |
3013eb9d | 2628 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ |
1b68c379 | 2629 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) |
3013eb9d | 2630 | ]) |
1b68c379 | 2631 | |
c2e299d0 SS |
2632 | AC_ARG_WITH([tmpfilesdir], |
2633 | AS_HELP_STRING([--with-tmpfilesdir=DIR], [directory for tmpfiles. See tmpfiles.d(5) for details]), | |
2634 | [], [ | |
2635 | AS_IF([test "x$have_systemd" = xyes], [ | |
2636 | PKG_CHECK_VAR([with_tmpfilesdir], [systemd], [tmpfilesdir], | |
2637 | [], | |
2638 | [with_tmpfilesdir=no]) | |
2639 | ]) | |
2640 | ]) | |
2641 | AS_IF([test "x$with_tmpfilesdir" != "xno"], [ | |
2642 | AC_SUBST([tmpfilesdir], [$with_tmpfilesdir]) | |
2643 | ]) | |
bbe289c4 | 2644 | |
b8095d25 KZ |
2645 | AC_ARG_WITH([smack], |
2646 | AS_HELP_STRING([--with-smack], [build with SMACK support]), | |
2647 | [], [with_smack=no] | |
2648 | ) | |
2649 | AS_IF([test "x$with_smack" = xyes], [ | |
2650 | AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support]) | |
2651 | ]) | |
2652 | ||
9e584ff3 TK |
2653 | AC_ARG_WITH([econf], |
2654 | AS_HELP_STRING([--without-econf], [do not use libeconf]), | |
2655 | [], [with_econf=check] | |
2656 | ) | |
2657 | ||
2658 | have_econf=no | |
2659 | AS_IF([test "x$with_econf" != xno], [ | |
9e584ff3 TK |
2660 | PKG_CHECK_MODULES([ECONF], [libeconf], [have_econf=yes], [have_econf=no]) |
2661 | AS_CASE([$with_econf:$have_econf], | |
2662 | [yes:no], | |
2663 | [AC_MSG_ERROR([libeconf expected but libeconf not found])], | |
2664 | [*:yes], | |
2665 | AC_DEFINE([HAVE_LIBECONF], [1], [Define if libeconf is available]) | |
2666 | ) | |
2667 | ]) | |
2668 | AM_CONDITIONAL([HAVE_ECONF], [test "x$have_econf" = xyes]) | |
2669 | ||
fee99106 | 2670 | AC_ARG_WITH([vendordir], |
cb776288 | 2671 | AS_HELP_STRING([--with-vendordir=DIR], [Directory for distribution provided configuration files]), |
fee99106 | 2672 | [], [] |
9e584ff3 | 2673 | ) |
fee99106 KZ |
2674 | AC_SUBST([vendordir], [$with_vendordir]) |
2675 | AM_CONDITIONAL([USE_VENDORDIR], [test "x$with_vendordir" != x]) | |
2676 | AS_IF([test "x$with_vendordir" != x], [ | |
2677 | AC_DEFINE([USE_VENDORDIR], [1], [Define to 1 to use vendordir]) | |
2678 | ]) | |
9e584ff3 | 2679 | |
b8095d25 | 2680 | |
ece777e9 KZ |
2681 | AC_ARG_ENABLE([bash-completion], |
2682 | AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]), | |
034d378b | 2683 | [], [enable_bash_completion=yes] |
ece777e9 KZ |
2684 | ) |
2685 | ||
034d378b | 2686 | AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes]) |
ece777e9 | 2687 | |
f6d3f34a KZ |
2688 | AC_ARG_WITH([bashcompletiondir], |
2689 | AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), | |
2690 | [], [ | |
2691 | AS_IF([test "x$enable_bash_completion" = xyes], [ | |
2692 | PKG_CHECK_VAR([with_bashcompletiondir], [bash-completion], [completionsdir], | |
2693 | [], | |
2694 | [with_bashcompletiondir=${datadir}/bash-completion/completions]) | |
2695 | ]) | |
2696 | ]) | |
140e4c7b KZ |
2697 | AS_IF([test "x$enable_bash_completion" = xyes], [ |
2698 | AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) | |
2699 | ]) | |
f6d3f34a | 2700 | |
9cc36e9f | 2701 | |
d78df0ac | 2702 | AC_ARG_WITH([python], |
4c54effb KZ |
2703 | AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]), |
2704 | [], [with_python=check withval=check] | |
d78df0ac | 2705 | ) |
8e5c4675 | 2706 | |
d78df0ac | 2707 | have_python=no |
b2ae8c57 | 2708 | have_libpython=no |
8e5c4675 KZ |
2709 | AS_IF([test "x$with_python" != xno], [ |
2710 | # We follow distributions default and look for PKG module name "python" | |
2711 | # (minimal version is 2) but if major version is explicitly specified by | |
2712 | # --with-python=2 or --with-python=3 then we look for PKG module "python2" or | |
2713 | # "python3". | |
948182f4 | 2714 | AS_IF([test "x$withval" != xno && test "x$withval" != xyes && test "x$withval" != xcheck], |
0b567ae5 | 2715 | [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"]) |
b2ae8c57 KZ |
2716 | |
2717 | # check for python interpreter | |
0b567ae5 | 2718 | AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no]) |
8e5c4675 KZ |
2719 | AS_CASE([$with_python:$have_python], |
2720 | [yes:no], | |
b2ae8c57 | 2721 | [AC_MSG_ERROR([python selected but python interpreter not found])], |
4c54effb | 2722 | [check:no], |
b2ae8c57 | 2723 | [AC_MSG_WARN([python interpreter not found, do not build python bindings])], |
4c54effb | 2724 | [*:yes], |
b2ae8c57 | 2725 | # check for python development stuff |
c6cdefd7 TW |
2726 | [ |
2727 | PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_libpython=yes], [have_libpython=no]) | |
2728 | ||
2729 | # https://github.com/util-linux/util-linux/issues/2366 | |
2730 | AX_COMPARE_VERSION([$PYTHON_VERSION], [ge], [3.12], [ | |
2731 | UL_WARN_ADD([-Wno-error=redundant-decls], [PYTHON_CFLAGS]) | |
2732 | ]) | |
2733 | ] | |
8e5c4675 | 2734 | ) |
d78df0ac KZ |
2735 | ]) |
2736 | ||
da0ec90b KZ |
2737 | |
2738 | AC_ARG_ENABLE([pylibmount], | |
2739 | AS_HELP_STRING([--disable-pylibmount], [do not build pylibmount]), | |
2740 | [], [UL_DEFAULT_ENABLE([pylibmount], [check])] | |
2741 | ) | |
2742 | UL_BUILD_INIT([pylibmount]) | |
b2ae8c57 | 2743 | UL_REQUIRES_HAVE([pylibmount], [libpython], [libpython]) |
da0ec90b | 2744 | UL_REQUIRES_BUILD([pylibmount], [libmount]) |
d78df0ac KZ |
2745 | AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"]) |
2746 | ||
324330ac FB |
2747 | # We need to introduce a verbatim dependency into the Makefile, without automake |
2748 | # trying to interpret it, so push it as a AM_SUBST_NOTMAKE variable. | |
2749 | verbatim_pylibmount_dependency=' | |
2750 | ||
2751 | # pylibmountexec module must be installed after usrlib_exec libraries, | |
2752 | # otherwise the libtool relink step will fail to find libmount.la and | |
2753 | # will try -lmount which is possibly not available. | |
2754 | install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES | |
2755 | ||
2756 | ' | |
2757 | AC_SUBST([verbatim_pylibmount_dependency]) | |
2758 | AM_SUBST_NOTMAKE([verbatim_pylibmount_dependency]) | |
d78df0ac | 2759 | |
48d7b13a | 2760 | AC_ARG_ENABLE([pg-bell], |
7fa4f112 | 2761 | AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]), |
034d378b | 2762 | [], [enable_pg_bell=yes] |
48d7b13a KZ |
2763 | ) |
2764 | ||
3013eb9d | 2765 | AS_IF([test "x$enable_pg_bell" = xyes], [ |
034d378b | 2766 | AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?]) |
3013eb9d | 2767 | ]) |
48d7b13a KZ |
2768 | |
2769 | ||
bb4cb69d MF |
2770 | AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs]) |
2771 | AC_ARG_ENABLE([fs-paths-default], | |
2772 | AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]), | |
9f57e6e8 SK |
2773 | [AS_CASE([$enableval], |
2774 | [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"], | |
2775 | [no], [fs_paths_defaults=""], | |
2776 | [fs_paths_defaults="$enableval"] | |
2777 | )], | |
bb4cb69d MF |
2778 | [fs_paths_defaults="FS_PATHS_DEFAULT"] |
2779 | ) | |
2780 | AC_ARG_ENABLE([fs-paths-extra], | |
2781 | AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]), | |
9f57e6e8 SK |
2782 | [AS_CASE([$enableval], |
2783 | [yes|no], [fs_paths_extra=""], | |
2784 | [fs_paths_extra="$enableval"] | |
2785 | )], | |
bb4cb69d MF |
2786 | [fs_paths_extra=""] |
2787 | ) | |
2788 | fs_paths="$fs_paths_defaults" | |
3013eb9d SK |
2789 | AS_IF([test "x$fs_paths_extra" != "x"], [ |
2790 | AS_IF([test "x$fs_paths" != "x"], [ | |
bb4cb69d | 2791 | fs_paths="${fs_paths}:" |
3013eb9d | 2792 | ]) |
bb4cb69d | 2793 | fs_paths="${fs_paths}${fs_paths_extra}" |
3013eb9d | 2794 | ]) |
bb4cb69d MF |
2795 | AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers]) |
2796 | ||
2797 | ||
48d7b13a | 2798 | AC_ARG_ENABLE([use-tty-group], |
7fa4f112 | 2799 | AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]), |
034d378b | 2800 | [], [enable_use_tty_group=yes] |
48d7b13a | 2801 | ) |
034d378b | 2802 | AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes]) |
48d7b13a | 2803 | |
3013eb9d | 2804 | AS_IF([test "x$enable_use_tty_group" = xyes], [ |
034d378b | 2805 | AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?]) |
3013eb9d | 2806 | ]) |
48d7b13a | 2807 | |
ab6478ef WF |
2808 | |
2809 | AC_ARG_ENABLE([sulogin-emergency-mount], | |
479d50bd DR |
2810 | AS_HELP_STRING([--enable-sulogin-emergency-mount], |
2811 | [use emergency mount of /dev and /proc for sulogin]), | |
034d378b | 2812 | [], [enable_sulogin_emergency_mount=no] |
ab6478ef WF |
2813 | ) |
2814 | ||
3013eb9d | 2815 | AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [ |
89c7c6ea KZ |
2816 | AS_IF([test "x$linux_os" = xyes], [ ], |
2817 | [AC_MSG_ERROR([--enable-sulogin-emergency-mount selected for non-linux system])]) | |
034d378b | 2818 | AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1], |
3c560686 | 2819 | [Should sulogin use an emergency mount of /dev and /proc?]) |
3013eb9d | 2820 | ]) |
ab6478ef WF |
2821 | |
2822 | ||
f71d1104 KZ |
2823 | AC_ARG_ENABLE([usrdir-path], |
2824 | AS_HELP_STRING([--enable-usrdir-path], [use only /usr paths in PATH env. variable (recommended on systems with /bin -> /usr/bin symlinks)]), | |
2825 | [], [enable_usrdir_path=no] | |
2826 | ) | |
2827 | ||
2afbcec5 | 2828 | AS_IF([test "x$enable_usrdir_path" = xyes], [ |
f71d1104 KZ |
2829 | AC_DEFINE([USE_USRDIR_PATHS_ONLY], [1], [Define to 1 to remove /bin and /sbin from PATH env.variable]) |
2830 | ]) | |
2831 | ||
2832 | ||
f3831bbd KZ |
2833 | AC_ARG_ENABLE([makeinstall-chown], |
2834 | AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]), | |
034d378b | 2835 | [], [enable_makeinstall_chown=yes] |
f3831bbd | 2836 | ) |
034d378b | 2837 | AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes]) |
f3831bbd | 2838 | |
81f55ab9 | 2839 | |
4c24a7ae KZ |
2840 | AC_ARG_ENABLE([makeinstall-setuid], |
2841 | AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]), | |
034d378b | 2842 | [], [enable_makeinstall_setuid=yes] |
4c24a7ae | 2843 | ) |
034d378b | 2844 | AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes]) |
4c24a7ae | 2845 | |
06bcee19 | 2846 | |
81f55ab9 KZ |
2847 | AC_ARG_ENABLE([colors-default], |
2848 | AS_HELP_STRING([--disable-colors-default], [do not colorize output from utils by default]), | |
2849 | [], [enable_colors_default=yes] | |
2850 | ) | |
2851 | AS_IF([test "x$enable_colors_default" = xyes], [ | |
2852 | AC_DEFINE([USE_COLORS_BY_DEFAULT], [1], [Enables colorized output from utils by default]) | |
2853 | ]) | |
2854 | ||
2855 | ||
e6a49887 LB |
2856 | AC_ARG_WITH([cryptsetup], |
2857 | AS_HELP_STRING([--with-cryptsetup], [compile with cryptsetup support]), | |
2858 | [], [with_cryptsetup=no] | |
2859 | ) | |
2860 | ||
2861 | AS_IF([test "x$with_cryptsetup" = xno], [ | |
2862 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [false]) | |
488fd4c3 | 2863 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) |
e6a49887 LB |
2864 | ], [ |
2865 | PKG_CHECK_MODULES([CRYPTSETUP], [libcryptsetup], | |
2866 | [AC_DEFINE([HAVE_CRYPTSETUP], [1], [Define if cryptsetup is available]) | |
2867 | UL_PKG_STATIC([CRYPTSETUP_LIBS_STATIC], [libcryptsetup]) | |
2868 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [true]) | |
123b1a67 LB |
2869 | SAVE_CFLAGS="$CFLAGS" |
2870 | CFLAGS="$CRYPTSETUP_CFLAGS $CFLAGS" | |
2871 | SAVE_LIBS="$LIBS" | |
2872 | LIBS="$CRYPTSETUP_LIBS $LIBS" | |
2873 | AC_CHECK_LIB([cryptsetup], [crypt_activate_by_signed_key], [ | |
f2458cf9 | 2874 | AC_DEFINE([HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY], [1], [Define if crypt_activate_by_signed_key exist in -lcryptsetup]) |
123b1a67 | 2875 | ]) |
488fd4c3 LB |
2876 | AS_IF([test "x$with_cryptsetup" = xdlopen], [ |
2877 | LIBS="-ldl $LIBS" | |
2878 | AC_CHECK_LIB([dl], [dlsym], [ | |
2879 | AC_DEFINE([CRYPTSETUP_VIA_DLOPEN], [1], [Define if cryptsetup is to be loaded via dlopen]) | |
2880 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [true]) | |
2881 | ], [AC_MSG_ERROR([libdl required to build with cryptsetup support])]) | |
2882 | ], [ | |
2883 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
2884 | ]) | |
123b1a67 LB |
2885 | CFLAGS="$SAVE_CFLAGS" |
2886 | LIBS="$SAVE_LIBS" | |
e6a49887 LB |
2887 | have_cryptsetup=yes], |
2888 | [have_cryptsetup=no | |
488fd4c3 LB |
2889 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [false]) |
2890 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
2891 | ]) | |
e6a49887 LB |
2892 | |
2893 | AS_CASE([$with_cryptsetup:$have_cryptsetup], | |
2894 | [yes:no], [AC_MSG_WARN([cryptsetup selected but libcryptsetup not found])] | |
2895 | ) | |
2896 | ]) | |
2897 | AC_SUBST([CRYPTSETUP_LIBS]) | |
2898 | AC_SUBST([CRYPTSETUP_LIBS_STATIC]) | |
2899 | ||
2900 | ||
1f10890f SK |
2901 | AC_ARG_VAR([SUID_CFLAGS], |
2902 | [CFLAGS used for binaries which are usually with the suid bit]) | |
2903 | AC_ARG_VAR([SUID_LDFLAGS], | |
2904 | [LDFLAGS used for binaries which are usually with the suid bit]) | |
06bcee19 | 2905 | |
03d00d49 KZ |
2906 | AC_ARG_VAR([DAEMON_CFLAGS], |
2907 | [CFLAGS used for binaries which are usually executed as daemons]) | |
2908 | AC_ARG_VAR([DAEMON_LDFLAGS], | |
2909 | [LDFLAGS used for binaries which are usually executed as daemons]) | |
2910 | ||
2911 | AC_ARG_VAR([SOLIB_CFLAGS], | |
2912 | [CFLAGS used for shared libraries]) | |
2913 | AC_ARG_VAR([SOLIB_LDFLAGS], | |
2914 | [LDFLAGS used for shared libraries]) | |
2915 | ||
2ad21963 KZ |
2916 | AC_ARG_VAR([ADJTIME_PATH], |
2917 | [Path to hwclock adjtime file, default /etc/adjtime]) | |
2918 | AS_IF([test "x$ADJTIME_PATH" = x], [ADJTIME_PATH="/etc/adjtime"]) | |
2919 | AC_DEFINE_UNQUOTED([CONFIG_ADJTIME_PATH], "$ADJTIME_PATH", [Path to hwclock adjtime file]) | |
2920 | ||
0cc63f0b TW |
2921 | if test "x${build_alias}" != "x${host_alias}"; then |
2922 | AC_MSG_NOTICE([setting link_all_deplibs=unknown for libtool]) | |
2923 | # work around Debian patch to libtool breaking cross-compiles | |
2924 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702737 | |
2925 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297726 | |
2926 | link_all_deplibs=unknown | |
2927 | fi | |
2928 | ||
2ad21963 | 2929 | |
9cb68977 | 2930 | LIBS="" |
48d7b13a | 2931 | |
48d7b13a | 2932 | |
034d378b | 2933 | AC_CONFIG_HEADERS([config.h]) |
48d7b13a | 2934 | |
d4baf92e KZ |
2935 | # |
2936 | # Don't use configure.ac to replace install paths! See Makefile PATHFILES for | |
2937 | # more details. | |
2938 | # | |
8eeb575c | 2939 | AC_CONFIG_FILES([ |
f06b4328 | 2940 | Makefile |
31a938ac | 2941 | libblkid/docs/Makefile |
8fb4efae | 2942 | libblkid/docs/version.xml |
8fb4efae | 2943 | libblkid/src/blkid.h |
705854f3 KZ |
2944 | libfdisk/docs/Makefile |
2945 | libfdisk/docs/version.xml | |
2946 | libfdisk/src/libfdisk.h | |
31a938ac | 2947 | libmount/docs/Makefile |
2aefc0a8 | 2948 | libmount/docs/version.xml |
f06b4328 | 2949 | libmount/src/libmount.h |
1d90bcb1 OO |
2950 | libsmartcols/docs/Makefile |
2951 | libsmartcols/docs/version.xml | |
1a4d989e | 2952 | libsmartcols/src/libsmartcols.h |
f06b4328 | 2953 | po/Makefile.in |
8f5fff53 | 2954 | po-man/Makefile |
8eeb575c | 2955 | ]) |
48d7b13a KZ |
2956 | |
2957 | AC_OUTPUT | |
4e1073c2 KZ |
2958 | |
2959 | AC_MSG_RESULT([ | |
a73035dc | 2960 | ${PACKAGE} ${VERSION} |
4e1073c2 | 2961 | |
a73035dc KZ |
2962 | prefix: ${prefix} |
2963 | exec prefix: ${exec_prefix} | |
4e1073c2 | 2964 | |
a73035dc KZ |
2965 | bindir: ${bindir} |
2966 | sbindir: ${sbindir} | |
2967 | libdir: ${libdir} | |
2968 | usrbin_execdir: ${usrbin_execdir} | |
2969 | usrsbin_execdir: ${usrsbin_execdir} | |
2970 | usrlib_execdir: ${usrlib_execdir} | |
3d289965 | 2971 | |
a73035dc KZ |
2972 | localstatedir: ${localstatedir} |
2973 | runstatedir: ${runstatedir} | |
2974 | includedir: ${includedir} | |
2975 | sysconfdir: ${sysconfdir} | |
2976 | sysconfstaticdir: ${sysconfstaticdir} | |
3d289965 | 2977 | |
a73035dc | 2978 | vendordir: ${with_vendordir} |
4e1073c2 | 2979 | |
a73035dc KZ |
2980 | Python: ${PYTHON} |
2981 | Python version: ${PYTHON_VERSION} | |
2982 | Python libs: ${pyexecdir} | |
8e5c4675 | 2983 | |
a73035dc KZ |
2984 | Bash completions: ${with_bashcompletiondir} |
2985 | Systemd support: ${have_systemd} | |
2986 | Systemd unitdir: ${with_systemdsystemunitdir} | |
c2e299d0 | 2987 | tmpfilesdir: ${with_tmpfilesdir} |
a73035dc KZ |
2988 | libeconf support: ${have_econf} |
2989 | Btrfs support: ${have_btrfs} | |
c2e299d0 | 2990 | lastlog2 support: ${have_lastlog2} |
a73035dc | 2991 | Wide-char support: ${build_widechar} |
034ca748 | 2992 | libcryptsetup support: ${have_cryptsetup} |
3745d4a9 | 2993 | |
a73035dc KZ |
2994 | Manual pages: ${build_asciidoc} |
2995 | Manual pages translated: ${build_poman} | |
4e1073c2 | 2996 | |
8519f4dd | 2997 | compiler: ${CC} / ${CXX} |
a73035dc KZ |
2998 | suid cflags: ${SUID_CFLAGS} |
2999 | ldflags: ${LDFLAGS} | |
3000 | suid ldflags: ${SUID_LDFLAGS} | |
3001 | ASAN enabled: ${enable_asan} | |
b4b8f8c2 FS |
3002 | Fuzzing enabled: ${enable_fuzzing_engine} |
3003 | Coverage enabled ${enable_coverage} | |
22a900a9 | 3004 | |
a73035dc KZ |
3005 | cflags: ${CFLAGS} |
3006 | ||
3007 | warnings: | |
4e1073c2 KZ |
3008 | |
3009 | ${WARN_CFLAGS} | |
b4b84389 | 3010 | |
a73035dc | 3011 | Type 'make' or 'make <utilname>' to compile. |
4e1073c2 | 3012 | ]) |