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